Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selection Behavior like Marquee behavior
Selection Behavior like Marquee behavior [message #245399] Tue, 09 September 2008 11:23 Go to next message
Eclipse UserFriend
Originally posted by: ardiangunawan.yahoo.com

Hello,
for the shape editor,
for the ease of use, I am trying to
"eliminate" marquee tool, and trying to merge its functionalities with
selection tool.

Is it possible to have the similar "BEHAVIOR_NODES_AND_CONNECTIONS" of
the MarqueeSelectionTool applied to SelectionTool when dragging mouse,
so that both shape(s) and connection(s) are selected?

thank you for any help....

regards,
Ardian
Re: Selection Behavior like Marquee behavior [message #245405 is a reply to message #245399] Tue, 09 September 2008 13:04 Go to previous message
Eclipse UserFriend
Originally posted by: ardiangunawan.yahoo.com

Hello,
It works by extending SelectionTool:

public class ExtendedSelectionTool extends SelectionTool{

@Override
protected DragTracker getDragTracker() {
DragTracker dt = super.getDragTracker();
if(dt instanceof MarqueeDragTracker)
((MarqueeDragTracker)dt).setMarqueeBehavior(
MarqueeSelectionTool.BEHAVIOR_NODES_AND_CONNECTIONS);
return dt;
}
}


and to call the above class:
.....
PaletteToolbar toolbar = new PaletteToolbar("Tools");
ToolEntry tool = new SelectionToolEntry() ;
SelectionTool st = new ExtendedSelectionTool();
tool.setToolClass(st.getClass());
toolbar.add(tool);
palette.setDefaultEntry(tool);
....


regards,
Ardian

Ardian Eko schrieb:
> Hello,
> for the shape editor,
> for the ease of use, I am trying to
> "eliminate" marquee tool, and trying to merge its functionalities with
> selection tool.
>
> Is it possible to have the similar "BEHAVIOR_NODES_AND_CONNECTIONS" of
> the MarqueeSelectionTool applied to SelectionTool when dragging mouse,
> so that both shape(s) and connection(s) are selected?
>
> thank you for any help....
>
> regards,
> Ardian
Previous Topic:Setting SnapToGrid
Next Topic:XYLayout and FlowLayout
Goto Forum:
  


Current Time: Wed Apr 24 16:42:41 GMT 2024

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

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

Back to the top