So the outcome today was to implement a function that allows you to hover over any layer reference, and get a preview of that layer's contents, whether or not the layer is currently present in the stack (illustration here - the ink spiral is a layer that has been deleted from the stack, but still has a reference button - I've hovered over that button to see the contents of the original layer).
As so often, the simple concept was harder to implement than I thought. JavaScript apparently supports a 'hover' callback as a standard attribute of UI widgets, but Java components do not. Implementing hover within my mouse interaction model meant that I had to grapple with threads more seriously, to figure out what to do when the mouse isn't moving. On the positive - 'craft' reflection - side, it's an oddly pleasing feeling when you finally have some purpose for the spurious empty implementations of interface methods that Java makes you leave around all over the place. This was the first time that I've had anything I wanted to do with the mouseMoved (as opposed to mouseDragged) method of the MouseMotionListener.
No comments:
Post a Comment