Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Using Marquee Tool to select Connectors.(How to make marquee selection tool to select connectors also?)
Using Marquee Tool to select Connectors. [message #1708743] Sat, 19 September 2015 20:33 Go to next message
steve dobbs is currently offline steve dobbsFriend
Messages: 15
Registered: March 2014
Junior Member
This question may have been asked before.But I don't see an answer.When I use marquee tool to select some shapes , the connectors aren't getting selected.How can I make marquee tool select connectors also?
Re: Using Marquee Tool to select Connectors. [message #1708763 is a reply to message #1708743] Sun, 20 September 2015 19:09 Go to previous messageGo to next message
Christophe Grandpierre is currently offline Christophe GrandpierreFriend
Messages: 2
Registered: September 2015
Junior Member
Hi!

No answers ?
I'm very interested in a solution to do that too...


steve dobbs wrote on Sat, 19 September 2015 20:33
This question may have been asked before.But I don't see an answer.When I use marquee tool to select some shapes , the connectors aren't getting selected.How can I make marquee tool select connectors also?

Re: Using Marquee Tool to select Connectors. [message #1708767 is a reply to message #1708743] Sun, 20 September 2015 20:10 Go to previous messageGo to next message
Christophe Grandpierre is currently offline Christophe GrandpierreFriend
Messages: 2
Registered: September 2015
Junior Member
Hi!

I just find a way that could solve your problem.
The idea is to change the property 'marqueeBehavior' of the GFMarqueeSelectionTool contained in the palette.

To do this I suggest you the following lines (e.g. in your DiagramEditor subclass)


private void configurePalette() {
        final GFMarqueeToolEntry entry = findPaletteEntry(getPaletteRoot(), GFMarqueeToolEntry.class);
//        entry.setToolProperty(PROPERTY_MARQUEE_BEHAVIOR, BEHAVIOR_NODES_AND_CONNECTIONS);
        entry.setToolProperty(PROPERTY_MARQUEE_BEHAVIOR, BEHAVIOR_CONNECTIONS_TOUCHED);
}


    private static <T> T findPaletteEntry(final PaletteContainer paletteContainer,
                                          final Class<T> type) {
        for (final Object child : paletteContainer.getChildren()) {
            if (type.isInstance(child)) {
                return (T) child;
            }
            if (child instanceof PaletteContainer) {
                final T entry = findPaletteEntry((PaletteContainer) child, type);
                if (entry != null) {
                    return entry;
                }
            }
        }
        return null;
    }



Choose the property value 'BEHAVIOR_CONNECTIONS_TOUCHED' or 'BEHAVIOR_NODES_AND_CONNECTIONS' as you need.

Hope this helps!
Re: Using Marquee Tool to select Connectors. [message #1709107 is a reply to message #1708767] Thu, 24 September 2015 06:49 Go to previous message
steve dobbs is currently offline steve dobbsFriend
Messages: 15
Registered: March 2014
Junior Member
Works good. Thanks
Previous Topic:Undo/Redo not working with DiagramEditor subclass
Next Topic:Custom palette depending on diagram instance
Goto Forum:
  


Current Time: Tue Jan 16 19:37:01 GMT 2018

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

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