Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » marquee selection tool
marquee selection tool [message #233663] Fri, 27 April 2007 21:54 Go to next message
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
Messages: 30
Registered: July 2009
Member
Right now when I want to select an object in the editor I need to
"paint" with marquee around the whole object. How can I, if possible
make selection of the object if any side of the marquee intersects with
object?

thanks,
Alex
Re: marquee selection tool [message #233680 is a reply to message #233663] Sat, 28 April 2007 20:37 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

Marquee selection tool behaviors, like the one you are asking about,
should be set up through #setMarqueeBehavior(int) method. You can chose
between 3 behavious defined as constants within the class. However, I
don't think that any of those behaviors would do for you. So, you'd have
to create your own marquee selection tool that would just be a copy-paste
of current MarqueeSelectionTool where you can define a new behavior and
add support for it most likely only in 2 methods:
#calculateNewSelection(Collection, Collection) and
#getAllChildren(EditPart, Set). Just look how other behaviors are defined
and supported.
Hope this helps.

Cheers,
Alex
Re: marquee selection tool [message #233695 is a reply to message #233680] Mon, 30 April 2007 13:25 Go to previous messageGo to next message
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
Messages: 30
Registered: July 2009
Member
Thanks Alex,

I have another related question. My figure is setup from a containing
layer that serves as a parent for image and label layers. When I want to
select the figure, I need to select the parent layer that is bigger than
other layers and without border (which is not visible by default) it's
hard to do it. Will implementing my own marquee tool help me in defining
selectable areas as well or do I need another approach?

Here are some reference images:

how figure is selected right now:
http://images22.fotki.com/v753/photos/6/66966/288150/fig1-vi .jpg

how figure should be selected:
http://images23.fotki.com/v765/photos/6/66966/288150/fig2-vi .jpg

thanks for your help,
Alex

Alex Boyko wrote:
> Hi,
>
> Marquee selection tool behaviors, like the one you are asking about,
> should be set up through #setMarqueeBehavior(int) method. You can chose
> between 3 behavious defined as constants within the class. However, I
> don't think that any of those behaviors would do for you. So, you'd have
> to create your own marquee selection tool that would just be a
> copy-paste of current MarqueeSelectionTool where you can define a new
> behavior and add support for it most likely only in 2 methods:
> #calculateNewSelection(Collection, Collection) and
> #getAllChildren(EditPart, Set). Just look how other behaviors are
> defined and supported.
> Hope this helps.
>
> Cheers,
> Alex
>
Re: marquee selection tool [message #233711 is a reply to message #233695] Mon, 30 April 2007 17:11 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi Alex,

I think you can use current MarqueeSelectionTool if you create an editpart
for your image figure. This is unless you already creating editpart for
the image...
The other approach could be: use 1 editpart, the figure for which will be
the wrapper figure for image and label. The wrapper figure implements
HandleBounds and returns the bounds of the image figure. However, based on
the screen shots, I have a feeling that this is your current approach, so
try creating the editpart for the image figure. In fact you can even try
the following: create 1 editpart the figure for which will be image figure
and attach the label figure to it with a help of
org.eclipse.draw2d.Locator (take a look at its subclasses to see how it's
used). In other words, this is a suggestion to get rid of the wrapper
figure.
Hope this helps.

Cheers,
Alex
Re: marquee selection tool [message #233719 is a reply to message #233711] Mon, 30 April 2007 17:33 Go to previous messageGo to next message
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
Messages: 30
Registered: July 2009
Member
Thanks a lot for your help!

Alex Boyko wrote:
> Hi Alex,
>
> I think you can use current MarqueeSelectionTool if you create an
> editpart for your image figure. This is unless you already creating
> editpart for the image...
> The other approach could be: use 1 editpart, the figure for which will
> be the wrapper figure for image and label. The wrapper figure implements
> HandleBounds and returns the bounds of the image figure. However, based
> on the screen shots, I have a feeling that this is your current
> approach, so try creating the editpart for the image figure. In fact you
> can even try the following: create 1 editpart the figure for which will
> be image figure and attach the label figure to it with a help of
> org.eclipse.draw2d.Locator (take a look at its subclasses to see how
> it's used). In other words, this is a suggestion to get rid of the
> wrapper figure.
> Hope this helps.
>
> Cheers,
> Alex
>
Re: marquee selection tool [message #239385 is a reply to message #233663] Wed, 24 October 2007 14:48 Go to previous message
Eclipse UserFriend
Originally posted by: swanbrook66.gmail.com

Aleksandr Krvavets wrote:
> Right now when I want to select an object in the editor I need to
> "paint" with marquee around the whole object. How can I, if possible
> make selection of the object if any side of the marquee intersects with
> object?
>
> thanks,
> Alex

Hi,
I have the exact same requirement as mentioned above (would have
thought this would be a standard mode but it isn't for some reason). I
have created my own selection tool based on the MarqueeSelectionTool
which uses intersects instead of contains to determine whether to select
an editpart or not. However, I am now stuck. How do I get my GMF
application to actually use this selection tool?

Help..please....

Thanks a lot.
Previous Topic:SWT widgets in Figures
Next Topic:Zoom query
Goto Forum:
  


Current Time: Mon Dec 22 15:02:34 GMT 2014

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

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