Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » I have confused by create my connection?
I have confused by create my connection? [message #155581] Tue, 26 October 2004 07:21 Go to next message
Eclipse UserFriend
Originally posted by: hitdemo2002.yahoo.com.cn

i was creating my connection by imitated GEF's examples
Re: I have confused by create my connection? [message #155681 is a reply to message #155581] Tue, 26 October 2004 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You need to provide a different factory for each line type.

"hitdemo2002" <hitdemo2002@yahoo.com.cn> wrote in message
news:clktpc$f6l$1@eclipse.org...
> i was creating my connection by imitated GEF's examples
Re: I have confused by create my connection? [message #155833 is a reply to message #155681] Wed, 27 October 2004 06:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hitdemo2002.yahoo.com.cn

Does all line must created with ConnectionCreationToolEntry?

the factory that i must providered means SimpleFactory?
____________________________________________________________ _________________
ConnectionCreationToolEntry conn = new ConnectionCreationToolEntry(
LogicMessages.LogicPlugin_Tool_CreationTool_TopoLine_Label, LogicMessages.LogicPlugin_Tool_CreationTool_TopoLine_Descrip tion,
new SimpleFactory(TopoLine.class),
ImageDescriptor.createFromFile(TopoLine.class,"icons/topoline16.gif "),
ImageDescriptor.createFromFile(TopoLine.class, "icons/topoline24.gif"));

entries.add(conn);
____________________________________________________________ _________________
Re: I have confused by create my connection? [message #155841 is a reply to message #155681] Wed, 27 October 2004 06:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hitdemo2002.yahoo.com.cn

logic's connection entry is:
—————————————————————————————— —————————————————————————————— ——————————————————
tool = new ConnectionCreationToolEntry(
LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool_Label,
LogicMessages.LogicPlugin_Tool_ConnectionCreationTool_Connec tionCreationTool_Description,null,
ImageDescriptor.createFromFile(ODF.class,"icons/connection16.gif "),
ImageDescriptor.createFromFile(ODF.class, "icons/connection24.gif"));

entries.add(tool);

—————————————————————————————— —————————————————————————————— ——————————————————
Does logic's connection's model should be Wire? but it seems that the
upper code not relate a model with a connection entry.because fatory is
null.
Re: I have confused by create my connection? [message #155849 is a reply to message #155681] Wed, 27 October 2004 06:53 Go to previous message
Eclipse UserFriend
Originally posted by: hitdemo2002.yahoo.com.cn

if i create my line ,Does i must create a editpart like LogicEditPart? or
in

public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart
connEditPart){
Wire wire = (Wire) connEditPart.getModel();
return getNodeFigure().getConnectionAnchor(wire.getSourceTerminal() );
}

change code to

public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart
connEditPart){
if (connEditPart instanceof Wire ){
Wire wire = (Wire) connEditPart.getModel();
return getNodeFigure().getConnectionAnchor(wire.getSourceTerminal() );
}else if (connEditPart instanceof MyLine ){
MyLine myLine= (MyLine) connEditPart.getModel();
return getNodeFigure().getConnectionAnchor(myLine.getSourceTerminal ());
}
}
Previous Topic:is there any way that i can create splite editpart?
Next Topic:Create a block arrow
Goto Forum:
  


Current Time: Sat Apr 20 00:51:35 GMT 2024

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

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

Back to the top