Skip to main content



      Home
Home » Eclipse Projects » GEF » How to add serval connection creation tools?
How to add serval connection creation tools? [message #25744] Tue, 08 October 2002 11:36 Go to next message
Eclipse UserFriend
Hi,
Could you please tell me how can I add multiple connection creation tools so
that user can draw different type of connection?

In the logic editor example, it does this to create 1 connection tool:
tool = new DefaultPaletteToolEntry(

new ConnectionCreationTool(),

LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool
_Label,

LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool
_Description,

....);

My question is how can I add another one (with different connection type)?
The code above does not take the Wire.class as its factory (unlike
components). And the Wire object is created in getConnectionCreateCommand()
method of the LogicNodeEditPolicy class. If I want multiple connection (e.g
solid line, dash line), how does the LogicNodeEditPolicy knows which
connection to create?

Thank you.
Re: How to add serval connection creation tools? [message #26146 is a reply to message #25744] Wed, 09 October 2002 10:18 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

See AbstractConnectionCreationTool.setFactory(CreateRequest.Fact ory
factory).

It's true the Logic example never sets the factory, and also it never calls
CreateRequest.getNewObject(), because in this simple example, the new object
type is known to always be a Wire.

"Hal" <otaconss2@hotmail.com> wrote in message
news:anusm0$alq$1@rogue.oti.com...
> Hi,
> Could you please tell me how can I add multiple connection creation tools
so
> that user can draw different type of connection?
>
> In the logic editor example, it does this to create 1 connection tool:
> tool = new DefaultPaletteToolEntry(
>
> new ConnectionCreationTool(),
>
>
LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool
> _Label,
>
>
LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool
> _Description,
>
> ...);
>
> My question is how can I add another one (with different connection
type)?
> The code above does not take the Wire.class as its factory (unlike
> components). And the Wire object is created in
getConnectionCreateCommand()
> method of the LogicNodeEditPolicy class. If I want multiple connection
(e.g
> solid line, dash line), how does the LogicNodeEditPolicy knows which
> connection to create?
>
> Thank you.
>
>
Previous Topic:draw2d: findMouseEventTarget
Next Topic:How modelize & control & draw n-m / multivalued relationships with GEF?
Goto Forum:
  


Current Time: Wed Apr 16 14:57:11 EDT 2025

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

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

Back to the top