Monday, May 13, 2013

Keyboard shortcuts and an enabled Event Tree

This week Adam has been working on items relating to an upcoming release. Among these was to re-enable the event tree-based enclosure solver as an option in the graphical user interface, and various improvements relating to keyboard-based interaction with Acumen. The File Browser now supports keyboard-based navigation of the tree. When a top-level folder is selected and the left arrow key is pressed, the parent of the current root folder becomes the new root of the tree. When an expanded folder is selected and the right arrow key is pressed, that folder becomes the new root of the file Browser. Keyboard shortcuts have also been aligned and improved throughout the application. Most notably, it is now possible to see the hotkeys associated with menu actions, as can be seen in the screenshot below. These hotkeys also adapt to the given platform that Acumen executes on.



As a lesson learned from implementing the file browser, Adam has concluded that Scala Swing is to be seen more as a complement to- rather than a replacement for using the raw Java Swing APIs. For instance, though a proposal for it exists, no component corresponding to Java Swing's JTree is currently available in Scala Swing. A side effect of dropping down to the raw Java APIs is that much of the code is spent on casting objects into the appropriate type and making sure that such casts are not applied to null references, i.e. far from the elegant code one can normally hope to produce using pure Scala APIs.