|
|
Re: I have confused by create my connection? [message #155833 is a reply to message #155681] |
Wed, 27 October 2004 06:11 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 ());
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03852 seconds