org.eclipse.draw2d.ConnectionRouter Java Examples

The following examples show how to use org.eclipse.draw2d.ConnectionRouter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GenericLevelPresets.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected IFigure createMain ()
{
    final Figure baseFigure = new LayeredPane ();

    final Layer rootFigure = new Layer ();

    this.connLayer = new ConnectionLayer ();
    this.connLayer.setAntialias ( 1 );
    this.connLayer.setConnectionRouter ( ConnectionRouter.NULL );

    baseFigure.add ( this.connLayer );
    baseFigure.add ( rootFigure );

    rootFigure.setLayoutManager ( new BorderLayout () );
    rootFigure.setBackgroundColor ( ColorConstants.white );

    rootFigure.add ( createArrowFigure (), BorderLayout.RIGHT );
    rootFigure.add ( createEntryGrid ( this.connLayer ), BorderLayout.CENTER );

    return baseFigure;
}
 
Example #2
Source File: LinkPart.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected IFigure createFigure() {
	Link link = (Link) getModel();
	link.editPart = this;
	SankeyDiagram editor = ((ProductSystemNode) link.sourceNode.parent).editor;
	PolylineConnection conn = new LinkFigure(link.getWidth(), editor);
	if (editor.isRouted()) {
		conn.setConnectionRouter(ROUTER);
	} else {
		conn.setConnectionRouter(ConnectionRouter.NULL);
	}
	link.figure = conn;
	conn.setTolerance(0);
	conn.setForegroundColor(link.getColor());
	return conn;
}
 
Example #3
Source File: ColumnConnection.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void setConnectionRouter( ConnectionRouter cr )
{
	if ( cr == null )
		super.setConnectionRouter( new ColumnConnectionRouter( ) );
	else
		super.setConnectionRouter( cr );
}
 
Example #4
Source File: ProductSystemGraphEditor.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public void setRouted(boolean routed) {
	this.routed = routed;
	ConnectionRouter router = ConnectionRouter.NULL;
	if (routed)
		router = TreeConnectionRouter.instance;
	for (ProcessNode node : model.getChildren())
		for (Link link : node.links)
			link.figure.setConnectionRouter(router);
}
 
Example #5
Source File: ProductSystemNode.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public void setRouted(boolean enabled) {
	ConnectionRouter router = ConnectionRouter.NULL;
	if (enabled)
		router = LinkPart.ROUTER;
	for (Node node : children) {
		if (!(node instanceof ProcessNode))
			continue;
		ProcessNode pNode = (ProcessNode) node;
		for (Link link : pNode.links) {
			link.figure.setConnectionRouter(router);
		}
	}
}
 
Example #6
Source File: RubberBandRoutingSupport.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected void forceInitialLocations(ConnData cd) {
	List<RelativeBendpoint> constraint = createConstraint(cd.conn, cd.initialVisualPoints);
	ConnectionRouter router = cd.conn.getConnectionRouter();
	router.setConstraint(cd.conn, constraint);
	router.route(cd.conn);
}
 
Example #7
Source File: LinkPart.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
private ConnectionRouter getConnectionRouter() {
	return getEditor().isRouted() ? TreeConnectionRouter.instance : ConnectionRouter.NULL;
}
 
Example #8
Source File: ProcessLinkCreatePolicy.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest request) {
	return ConnectionRouter.NULL;
}