Skip to main content

JPanel AffineTransform and DnD

2 replies [Last post]
tipper258
Offline
Joined: 2010-10-12

Folks, casting around trying to find if anyone has solved this already. We have a desktop app with various components in a JPanel, no layoutmanager, fully Drag and Drop enabled (need to share outside the VM too). Requirement now exists to zoom that view, which is really easy with AffineTransform. Problem is there doesn't seem to be a way to hook into the DnD classes to put the inverse transform in place so the mouse handlers know about the "zoomed" components.

Trying to avoid having to iterate the JPanel members and resize them one by one when the user say Zoom.

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tipper258
Offline
Joined: 2010-10-12

Update from research, as far as I can see, there is no ability anywhere in the Swing/AWT libraries to apply an inversetransform to mouse co-ordinates used in Java DnD. Also, there is no other support for scaling or "zooming" that can be used other than writing your own, easy enough to do for basic use, but doesn't support clipboard, inter-VM transfers etc without reinventing a large wheel. jXLayer and ZoomUI don't do it either, btw.

Are there any commercial desktop toolkits (with freely distributable runtime) for Java that are more complete?

aephyr
Offline
Joined: 2009-11-20

Try JXLayer.