|
|
|
|
Re: I have confused by create my connection? [message #155849 is a reply to message #155681] |
Wed, 27 October 2004 02: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.05548 seconds