@Override public ConnectionAnchor getTargetConnectionAnchor(Request request) { return new ChopboxAnchor(this.getFigure()); }
@Override public ConnectionAnchor getSourceConnectionAnchor(Request request) { return new ChopboxAnchor(this.getFigure()); }
/** * Obtains the {@link ConnectionAnchor}. * * @param specificConnectionAnchors * Specific {@link ConnectionAnchor} map. * @param connectionModelType * {@link ConnectionModel} type. * @return {@link ConnectionAnchor}. */ private ConnectionAnchor getConnectionAnchor( Map<Class<?>, ConnectionAnchor> specificConnectionAnchors, Class<?> connectionModelType) { // Obtain the specific connection anchor ConnectionAnchor connectionAnchor = specificConnectionAnchors .get(connectionModelType); if (connectionAnchor != null) { return connectionAnchor; } // Obtain default connection anchor connectionAnchor = this.connectionAnchors.get(connectionModelType); if (connectionAnchor != null) { return connectionAnchor; } // Return anchor around the figure return new ChopboxAnchor(this.getFigure()); }
@Override public ConnectionAnchor getSourceConnectionAnchor( ConnectionEditPart connection) { // Obtain the type of connection Class<?> connectionModelType = connection.getModel().getClass(); ConnectionAnchor anchor = this.getOfficeFloorFigure() .getSourceConnectionAnchor(connectionModelType); if (anchor != null) { return anchor; } // No anchor so provide around figure return new ChopboxAnchor(this.getFigure()); }
@Override public ConnectionAnchor getTargetConnectionAnchor( ConnectionEditPart connection) { // Obtain the type of connection Class<?> connectionModelType = connection.getModel().getClass(); ConnectionAnchor anchor = this.getOfficeFloorFigure() .getTargetConnectionAnchor(connectionModelType); if (anchor != null) { return anchor; } // No anchor so provide around figure return new ChopboxAnchor(this.getFigure()); }
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 ); } } }
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 ); } } }
this.connectionAnchor = new ChopboxAnchor(point);