Java Code Examples for org.eclipse.draw2d.IFigure#add()

The following examples show how to use org.eclipse.draw2d.IFigure#add() . 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: CrosstabCellEditPart.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void activate( )
{
	if ( handles == null )
	{
		handles = getHandleList( );
	}
	// IFigure layer = getLayer( CrosstabTableEditPart.CELL_HANDLE_LAYER );
	IFigure layer = getLayer( LayerConstants.HANDLE_LAYER );
	int size = handles.size( );
	for ( int i = 0; i < size; i++ )
	{
		Figure handle = (Figure) handles.get( i );
		layer.add( handle );
	}
	super.activate( );
}
 
Example 2
Source File: ThrowLinkEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof ThrowLinkEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 3
Source File: BoundaryMessageEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof BoundaryMessageEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 4
Source File: BoundarySignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof BoundarySignalEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 5
Source File: CatchLinkEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof CatchLinkEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 6
Source File: StartSignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof StartSignalEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 7
Source File: EndSignalEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof EndSignalEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 8
Source File: IntermediateErrorCatchEvent3EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof IntermediateErrorCatchEventLabel3EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 9
Source File: EndTerminatedEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof EndTerminatedEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 10
Source File: LinkFigure.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public LinkFigure(IFigure parent) {
	leftLine = new Polyline();
	leftLine.setAntialias(SWT.ON);
	rightLine = new Polyline();
	rightLine.setAntialias(SWT.ON);
	parent.add(leftLine);
	parent.add(rightLine);
	this.parent = parent;
}
 
Example 11
Source File: StartSignalEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof StartSignalEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 12
Source File: StartEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof StartEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 13
Source File: StartMessageEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof StartMessageEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 14
Source File: BoundarySignalEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof BoundarySignalEventLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 15
Source File: InclusiveGateway2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof InclusiveGatewayLabel2EditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 16
Source File: TypeEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof TypeNameEditPart) {
		((TypeNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureTypeLabelFigure());
		return true;
	}
	if (childEditPart instanceof TypeTypeFieldsCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getTypeFieldsCompartmentFigure();
		setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way 
		pane.add(((TypeTypeFieldsCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 17
Source File: EndEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
	if (borderItemEditPart instanceof EndEventLabelEditPart) {
		BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
		locator.setBorderItemOffset(new Dimension(-20, -20));
		borderItemContainer.add(borderItemEditPart.getFigure(), locator);
	} else {
		super.addBorderItem(borderItemContainer, borderItemEditPart);
	}
}
 
Example 18
Source File: InputScaleDetails.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
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 );
}
 
Example 19
Source File: Annotation.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Sets annotation order to front
 */
public void toFront() {
	final IFigure par = getParent();
	if (par != null) {
		par.remove(this);
		final int end = par.getChildren() != null ? par.getChildren().size() : 0;
		par.add(this, end);
	}
}
 
Example 20
Source File: ImageTest.java    From ermaster-b with Apache License 2.0 4 votes vote down vote up
private static void initialize(IFigure parent) throws FileNotFoundException {
	parent.add(createContents());
}