本文整理汇总了Java中org.eclipse.draw2d.PolylineConnection.setSourceAnchor方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineConnection.setSourceAnchor方法的具体用法?Java PolylineConnection.setSourceAnchor怎么用?Java PolylineConnection.setSourceAnchor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolylineConnection
的用法示例。
在下文中一共展示了PolylineConnection.setSourceAnchor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRoundArrow
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void createRoundArrow ( final Figure figure )
{
final PolylineConnection c = new PolylineConnection ();
c.setSourceAnchor ( new ChopboxAnchor ( this.sourceRect ) );
c.setTargetAnchor ( new ChopboxAnchor ( this.targetRect ) );
final PolygonDecoration dec = new PolygonDecoration ();
dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
c.setTargetDecoration ( dec );
final MidpointLocator typeLocator = new MidpointLocator ( c, 0 );
typeLocator.setRelativePosition ( PositionConstants.NORTH );
this.typeLabel = new Label ( "" ); //$NON-NLS-1$
c.add ( this.typeLabel, typeLocator );
figure.add ( c );
this.roundConnection = c;
}
示例2: createConnections
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
public void createConnections ( final Layer layer, final SymbolController controller, final EList<Connection> connections )
{
if ( connections == null )
{
return;
}
for ( final Connection connection : connections )
{
final Controller start = AdapterHelper.adapt ( controller.getElement ( connection.getStart () ), Controller.class );
final Controller end = AdapterHelper.adapt ( controller.getElement ( connection.getEnd () ), Controller.class );
if ( start != null && end != null )
{
final PolylineConnection c = new PolylineConnection ();
c.setSourceAnchor ( new ChopboxAnchor ( start.getFigure () ) );
c.setTargetAnchor ( new ChopboxAnchor ( end.getFigure () ) );
c.setAntialias ( SWT.ON );
layer.add ( c );
}
}
}
示例3: makeConnection
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private PolylineConnection makeConnection(IFigure contents, IFigure source, NodeFigure target, Color color) {
PolylineConnection c = new PolylineConnection();
ConnectionAnchor targetAnchor = new ChopboxAnchor(target);
c.setTargetAnchor(targetAnchor);
c.setSourceAnchor(new ChopboxAnchor(source));
PolygonDecoration decoration = new PolygonDecoration();
decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
c.setTargetDecoration(decoration);
c.setForegroundColor(color);
ConnectionMouseListener listener = new ConnectionMouseListener(c);
c.addMouseMotionListener(listener);
c.addMouseListener(listener);
c.setCursor(Cursors.HAND);
contents.add(c);
connections.add(c);
return c;
}
示例4: createConnection
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private PolylineConnection createConnection ( final IFigure source, final IFigure target )
{
final PolylineConnection c = new PolylineConnection ();
final ChopboxAnchor sourceAnchor = new ChopboxAnchor ( source );
final ChopboxAnchor targetAnchor = new ChopboxAnchor ( target );
c.setSourceAnchor ( sourceAnchor );
c.setTargetAnchor ( targetAnchor );
return c;
}
示例5: connect
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void connect ( final IFigure figure, final IFigure source, final IFigure target )
{
final PolylineConnection c = new PolylineConnection ();
c.setSourceAnchor ( new ChopboxAnchor ( source ) );
c.setTargetAnchor ( new ChopboxAnchor ( target ) );
final PolygonDecoration dec = new PolygonDecoration ();
dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
dec.setBackgroundColor ( ColorConstants.black );
c.setTargetDecoration ( dec );
figure.add ( c );
}
示例6: addPointer
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void addPointer(PandionJFigure<?> figure, IReferenceModel ref, IEntityModel target,
PandionJFigure<?> targetFig) {
PolylineConnection pointer = new PolylineConnection();
pointer.setSourceAnchor(new ChopboxAnchor(figure));
pointer.setTargetAnchor(new PositionAnchor(targetFig, PositionAnchor.Position.LEFT));
setPointerDecoration(target, pointer);
addPointerObserver(ref, pointer);
pane.add(pointer);
}
示例7: addPointer2D
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void addPointer2D(ArrayReferenceFigure figure, IReferenceModel ref, int index, IEntityModel target,
PandionJFigure<?> targetFig) {
PolylineConnection pointer = new PolylineConnection();
pointer.setSourceAnchor(figure.getAnchor(index));
pointer.setTargetAnchor(new PositionAnchor(targetFig, PositionAnchor.Position.LEFT));
setPointerDecoration(target, pointer);
addPointerObserver(ref, pointer);
pane.add(pointer);
}
示例8: generateConnection
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private PolylineConnection generateConnection(Figure source, Figure target) {
PolylineConnection newconnection = new PolylineConnection();
newconnection.setSourceAnchor(new ChopboxAnchor(source));
newconnection.setTargetAnchor(new ChopboxAnchor(target));
return newconnection;
}