How to add serval connection creation tools? [message #25744] |
Tue, 08 October 2002 11:36  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02576 seconds