Skip to main content



      Home
Home » Eclipse Projects » GEF » How to select nearest figure when clicking on parent
How to select nearest figure when clicking on parent [message #185711] Tue, 28 June 2005 23:32 Go to next message
Eclipse UserFriend
I've created a root edit part that displays an image, and it has children
whose figures are just single red pixels that highlight certain features
in the root image.

Because they're only single pixels, it is difficult for the user to select
them. I'd like to implement a selection approach, where the user can
click on any point in the root figure, and the *nearest* child will be
selected. I'm not sure how to go about this - pointers appreciated.

Thanks,

Jason.
Re: How to select nearest figure when clicking on parent [message #185755 is a reply to message #185711] Wed, 29 June 2005 13:58 Go to previous messageGo to next message
Eclipse UserFriend
You could simply create a figure that would be say 25x25 pixels and
contain a 1x1 pixel red dot in the middle. The rest of the figure would be
transparent but this would allow you to select the dot even if you don't
click exactly on it.

(Such a strategy might not work if your dots are very close; bounding
boxes would overlap).
Re: How to select nearest figure when clicking on parent [message #185787 is a reply to message #185755] Thu, 30 June 2005 00:30 Go to previous message
Eclipse UserFriend
That's exactly what I did whilst awaiting responses! I also implemented
cross-hairs that appear on the feedback layer when the mouse moves/hovers
over the figure. The cross-hairs are animated for extra pizazz (used
GEF's SnapFeedbackPolicy.FadeIn figure for inspiration). This gives the
user a cue about which pixel will be selected should they click the mouse.

You're right; when the dots are close, it is still hard to select an 'in
between' pixel, however that would still be the case even if I used the
approach from my original query.

I'm going to settle on your approach for now, but I may try to provide an
alternative selection feedback, because the black box with anchors looks
awful when the figures are tiny.

Tips for doing the latter would be appreciated.
Previous Topic:Auto Layout on Subgraphs
Next Topic:Path of project!!!
Goto Forum:
  


Current Time: Thu Sep 25 06:20:12 EDT 2025

Powered by FUDForum. Page generated in 0.03638 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top