Magnetic Desklet - Initial Thoughts
Recently Joshua Marinacci and Robert Cooper announced their new AB5k project, a cross platform Java based widget system.
I’ve been pretty interested in the project and was wondering what desklet to develop. I’ve always been interested in window management issues, and in the AB5k forum there was a discussion about using the “magnet” name. That gave me a little idea for developing a”Magnetic Desklet”.
Goal
The main purpose of the Magnetic Desklet is to help users manage the layout of their desklets. Some of the functions are basic window management and could be implemented by the desklet container (ex: hide all my desklets, restore them), but the idea here is to complement the container and do it in a fun metaphor that makes sense usability wise.
Description
The best way to describe the window management features of this desklet is visually.

Figure 1
The Magnetic Desklet should be just another desklet that you can load into your system, since it will do window management, it will probably need to ask for special permissions. You can drag the magnet anywhere you want and access functions via a right click popup menu (there might be better ideas for this, as I don’t like hidden functions).

Figure 2
The main point of this desklet is to help you organize your desklet container. So for example, if I have a set of open desklets and I want to make some space, I should be able to click on the magnet (or access a “collapse” menu item in the popup menu) to group them all together.

Figure 3
All the existing desklets should collapse behind the magnet. The desklet will also remember all previous locations of the other desklets, so you can “restore” them easily from one of its commands.

Figure 4
There should be different options to arrange desklets, one of these is to use a horizontal or vertical (shown in figure 4) layout when rearranging desklets. Again, you should be able to easily restore their positions.

Figure 5
New desklets should be arranged normally by the container. In this case, the use case is that I want to move the existing ones to the side so I can make space for the Rome Reader desklet. I’m considering if another use case would be to always rearrange by default, meaning that while the magnet is activated all desklets are always attracted to it. Not sure about that last use case yet.

Figure 6
Another method for rearranging desklets would be to drag the magnet around the container area, and all intersecting desklets would attach themselves to the magnet. In this use case I want to move everything but the clock to the bottom right of the screen.

Figure 7
This last operation can result in some very flexible window management that is not too hard to learn since the metaphor fits the gesture very well.
Implementation
Sadly this desklet can’t be implemented without modifying the actual container source code. Features that are not present in the desklet “spec” that would be needed are:
- A handle to the container interface that is passed to the desklet in the init() method.
- A way to enumerate all currently opened desklets (should check for permission). The interface that is needed here is really the DeskletContainer because of the getSize() method, however the setContent() method might be dangerous in this context. Perhaps what you get are Desklet ids of some kind, and you can query the container for desklet attributes by their ID (get size, get name, get position, and some equivalent set methods).
- A container method (or desklet method) to move a desklet. Ideally, the container should already have methods that provide desklet animations for move operations, but initially it should be OK if this is not there. The animations can be implemented in the Magnetic Desklet.
- Maybe an interface to listen for container events. This with the enumerations, would also allow for other interesting desklets, maybe one that lists all opened ones in case a user is not happy with the container’s dock.
Conclusion
I hope this blog post helps illustrate the idea for this desklet, and I would love to hear any feedback. There might be some widget/gadgets that already do something like this in other systems, I’m not aware of any, but if you are please let me know.
Some of the API that is needed for this can be abused, however I believe some of this functionality will allow for other very interesting desklet usages. As long as the security infrastructure is well implemented (and not annoying, it currently pops up too many dialogs) these additions should be fine.
Filed under: Java, User Interface on March 21st, 2007

[...] have a post that describes the concept of what this is trying to do (not everything is implemented), and another [...]