Magnetic Desklet v0.1 - Try it before it doesn't work anymore!

1 view
Skip to first unread message

Augusto Sellhorn

unread,
Apr 7, 2007, 10:28:05 PM4/7/07
to Desklets Development
Here's my first desklet, it's a window manager with a magnet theme ...
http://sellmic.com/download/MagneticDesklet.desklet

The description of what it does is in this post, however it doesn't
implement everything and there are changes (the screenshots in that
post are only mockups).
http://sellmic.com/blog/2007/03/21/magnetic-desklet-initial-thoughts/

Of course, this is going to break after Josh's latest changes. It
depends a lot on the JInternalFrames, and the fact that you can get a
handle to all other internal frames via them. It also needs handles to
other components and listeners for their movement.

I'm hoping with the new window manager and everything else there's a
way to do this, that's cleaner of course. Even if it requires asking
for some extra permissions, it'd be nice. So far what I need is:

1) A method to get all open/active desklets
2) A way to move the desklets, if I can do getLocation()/setLocation()
that should do it.
3) A method to get the dimensions (or Shape) of a desklet.
4) Listener for when a desklet is moved and closed (this is so you can
demagnetize a desklet, by dragging away).

What's currently implemented is:

1) Attract desklets (hit the up arrow button). All desklets go to the
magnet's location, and the magnetize (or on) button is turned on
automatically.
2) Repel desklets (down arrow). All desklets rerturn to their original
locations, magnetize button is turned off automatically.
3) Magnetize or turn on magnet. When on, you can drag and attach
desklets by touching them. Useful when you want to quickly move away a
set of desklets but not all.
4) Detach desklets by dragging away from magnet.

What I'd like to implement in the future:
1) Make it all work with the new container (of course!).
2) Better "attract" and "repel" animations, maybe desklets can shake a
bit before rapidly getting "stuck" to the magnet.
3) Animations for when dragging and magnetizing desklets (magnetize is
on).
4) Nicer icons. These are ok, but could be better.
5) Use JButtons instead of labels for circular buttons. I thought I
could just setOpaque(false) on the buttons, but it doesn't work!

Anyways, please give it a try before this desklet doesn't work anymore
and let me know any feedback! Thanks!!!

Augusto Sellhorn

unread,
Apr 7, 2007, 10:53:25 PM4/7/07
to Desklets Development
Also put a screenshot of the desklet in my blog, since I'm sure it's
not going to work pretty soon :-)

http://sellmic.com/blog/2007/04/07/60/

On Apr 7, 10:28 pm, "Augusto Sellhorn" <augusto.sellh...@gmail.com>
wrote:
> Here's my first desklet, it's a window manager with a magnet theme ...http://sellmic.com/download/MagneticDesklet.desklet


>
> The description of what it does is in this post, however it doesn't
> implement everything and there are changes (the screenshots in that

> post are only mockups).http://sellmic.com/blog/2007/03/21/magnetic-desklet-initial-thoughts/

Joshua Marinacci

unread,
Apr 7, 2007, 11:19:33 PM4/7/07
to desklets-c...@googlegroups.com
:) Don't worry. I'm not going to be updating the webstart version for a bit. I've got lots of bugs to fix first.  You'll have the new WindowManager api by then.
I just tried out your desklet. Works great!

- J
- Blasting forth in three part harmony!


Augusto Sellhorn

unread,
Apr 7, 2007, 11:57:52 PM4/7/07
to Desklets Development
Great to hear, looking forward to the new API. There's still a bunch
of other things I want to do, but might start work on a couple of
other ideas.

BTW, in the magnetic desklet, when I load the icons for the buttons I
just do a getClass().getResource(...) with a relative path to images
which is a relative path to the icons. Pretty standard stuff.

However the security dialog popups up for each image for some reason.
At the beginning I thought this was when running from Netbeans only,
but today when I tried it with the webstart version I got the same.
Any idea why this is happening? Other desklets do the same and I don't
see the dialog popping up for their images.

Thanks!

Joshua Marinacci

unread,
Apr 9, 2007, 10:28:24 AM4/9/07
to desklets-c...@googlegroups.com
Hmm. I thought we had fixed that.  Could you file a bug report on it.

- j
Reply all
Reply to author
Forward
0 new messages