Search

Sunday, June 19, 2011

Geertjan's Blog: Synchronized Property Changes (Part 3)

Geertjan's Blog: Synchronized Property Changes (Part 3): "

This time, including a SaveCapability for the Node:

public class ShipNode extends BeanNode implements PropertyChangeListener { private final InstanceContent ic; private final ShipSaveCapability saveCookie; public ShipNode(Ship bean) throws IntrospectionException { this(bean, new InstanceContent()); } public ShipNode(Ship bean, InstanceContent ic) throws IntrospectionException { super(bean, Children.LEAF, new ProxyLookup(new AbstractLookup(ic),
Lookups.singleton(bean))); this.ic = ic; setDisplayName(bean.getType()); setShortDescription(String.valueOf(bean.getYear())); saveCookie = new ShipSaveCapability(bean); bean.addPropertyChangeListener(WeakListeners.propertyChange(this, bean)); } @Override public Action[] getActions(boolean context) { List<? extends Action> shipActions = Utilities.actionsForPath("Actions/Ship"); return shipActions.toArray(new Action[shipActions.size()]); } protected void fire(boolean modified) { if (modified)
{ ic.add(saveCookie); } else { ic.remove(saveCookie); } } private class ShipSaveCapability implements SaveCookie { private final Ship bean; public ShipSaveCapability(Ship bean) { this.bean = bean; } @Override public void save() throws IOException { StatusDisplayer.getDefault().setStatusText("Saving..."); fire(false); } } @Override public boolean canRename() { return true; } @Override public void setName(String s) { Ship c = getLookup().lookup(Ship.class); String oldDisplayName = c.getType();
c.setType(s); fireNameChange(oldDisplayName, s); fire(true); } @Override public String getDisplayName() { Ship c = getLookup().lookup(Ship.class); if (null != c.getType()) { return c.getType(); } return super.getDisplayName(); } @Override public String getShortDescription() { Ship c = getLookup().lookup(Ship.class); if (null != String.valueOf(c.getYear())) { return String.valueOf(c.getYear()); } return super.getShortDescription(); } @Override public void propertyChange(PropertyChangeEvent evt) { if
(evt.getPropertyName().equals("type")) { String oldDisplayName = evt.getOldValue().toString(); String newDisplayName = evt.getNewValue().toString(); fireDisplayNameChange(oldDisplayName, newDisplayName); } else if (evt.getPropertyName().equals("year")) { String oldToolTip = evt.getOldValue().toString(); String newToolTip = evt.getNewValue().toString(); fireShortDescriptionChange(oldToolTip, newToolTip); } fire(true); } }
"

NetBeans DZone: Developing Android Apps with NetBeans, Maven, and VirtualBox

NetBeans DZone: Developing Android Apps with NetBeans, Maven, and VirtualBox: "I am an experienced Java developer who has used various IDEs and prefer NetBeans IDE over all others by a long shot. I am also very fond of Maven as the tool to simplify and automate nearly every aspect of the development of my Java project throughout its lifecycle."

KDE Release 4.6.4

KDE Release 4.6.4: "

Packages for the release of the KDE Software Compilation 4.6.4 are available for Kubuntu 11.04 bringing you new versions of the KDE Platform, Plasma Workspaces and KDE Applications .


Bugs in packaging should be reported to kubuntu-ppa on Launchpad. Bugs in the software to KDE.


Users of 11.04 can install it from the Kubuntu Updates PPA.

"
"The Difference Between A Developer, A Programmer And A Computer Scientist http://dlvr.it/WSDF2"

Saturday, June 4, 2011

Week in tech: touching Windows 8 and stealing webcomics

Week in tech: touching Windows 8 and stealing webcomics: "




The Oatmeal vs. FunnyJunk: webcomic copyright fight gets personal: Matthew Inman, creator of webcomic The Oatmeal, tried to ignore the rampant online copying of his work—until he found that his entire output was mirrored on a user-generated content site called FunnyJunk.


Microsoft gives the first official look of Windows 8 touch interface: Microsoft today unveiled the new touch interface for Windows 8. Though still far from release, it looks like Redmond will finally have a truly worthy competitor to the iPad.


The crooks who created modern wiretapping law: During Prohibition, the government tapped telephones without warrants—after all, the lines left the home. It took 40 years, and the arrest of a bookie, for the Supreme Court to conclude that privacy wasn't a matter of physical location.


Read the rest of this article...






Read the comments on this post

"

KDE at LinuxTag

KDE at LinuxTag: "Sharing a nice, big booth at LinuxTag, the KDE, Kubuntu and Calligra teams are pulling together to promo all things KDE. As you can tell from the picture below, the booth is very well visited, with lots of people interested all 'round - showing off Plasma on the desktop in the middle there, and the brand, spanking new Plasma Active running on an openSuse powered tablet nearest the camera - already a real crowd puller, even in its experimental stage! Kudos to the Active team there, great stuff, very demoable :-)



The Busy KDE Booth at LinuxTag




Yesterday i did a talk about Calligra, standing in for Inge who couldn't attend, immediately following Michael Meeks' talk about LibreOffice - what an act to follow ;-) - and it was received very well indeed! The message of the Calligra Engine as a kind of WebKit for office applications is clear and easily understood, and the audience seemed very interested in this. Not only that, people seemed very interested in the fact that Calligra isn't just working on mobile versions, they're right around the corner. So, yes, it sounds like Calligra is, indeed, the future of office suites as hinted by Inge in a blog post a couple of days ago.



The day before, i gave a talk about the GamingFreedom network and the Gluon tool chain, and what it means for Free game development. While there was a fairly small number of attendees (about thirty people), those who were there were enthusiastic and positive about it. The question about JavaScript was brought up again, and it seems my answer that it is for reasons of easy distribution, and that the amount of code work when writing games is reasonably small as well, was acceptable. They also responded very well to the statements about how to monetize the effort - that is, that selling games is not encouraged, but that donations are being made extremely simple, thus removing all obstacles bar will and stinginess - in short, people liked to know that they would not have to compromise on their principles just because they wanted to make a bit of money with Gluon and GamingFreedom. Which is good to know ;-)



So, all in all, it seems to be going quite well! :-)
"

Wait...What?