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

The following examples show how to use org.eclipse.draw2d.IFigure#remove() . 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: ReportElementEditPart.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void clearGuideHandle( )
{
	IFigure layer = getHandleLayer( );
	List list = layer.getChildren( );
	List temp = new ArrayList( );
	int size = list.size( );

	for ( int i = 0; i < size; i++ )
	{
		Object obj = list.get( i );
		if ( obj instanceof AbstractGuideHandle )
		{
			temp.add( obj );
		}
	}

	size = temp.size( );
	for ( int i = 0; i < size; i++ )
	{
		IFigure figure = (IFigure) temp.get( i );
		layer.remove( figure );
	}
}
 
Example 2
Source File: TableResizeEditPolice.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void removeSelectionHandles( )
{
	if ( handles == null )
		return;
	IFigure layer = getLayer( LayerConstants.HANDLE_LAYER );
	for ( int i = 0; i < handles.size( ); i++ )
	{
		Object figure = handles.get( i );
		if ( figure instanceof IFigure )
		{
			layer.remove( (IFigure) figure );
		}

	}
	handles = null;
}
 
Example 3
Source File: TableCellResizeEditPolicy.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void removeSelectionHandles( )
{
	if ( handles == null )
		return;
	IFigure layer = getLayer( LayerConstants.HANDLE_LAYER );
	IFigure topLayer = getTopLayer( LayerConstants.HANDLE_LAYER );
	for ( int i = 0; i < handles.size( ); i++ )
	{
		Object figure = handles.get( i );
		if ( figure instanceof TableHFHandle )
		{
			topLayer.remove( (IFigure) figure );
		}
		else if ( figure instanceof TableSelectionHandle )
		{
			layer.remove( (IFigure) figure );
		}
		else if ( figure instanceof IFigure )
		{
			layer.remove( (IFigure) figure );
		}

	}

	handles = null;
}
 
Example 4
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 5
Source File: RootFigure.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
private void removeFigure(IFigure figure) {
	final IFigure parent = figure.getParent();
	parent.remove(figure);

	// TODO rather mark this area as damaged
	parent.revalidate();
}
 
Example 6
Source File: ScriptedTaskEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof ScriptedTaskNameEditPart) {
		return true;
	}
	if (childEditPart instanceof ScriptedTaskScriptedTaskOutputVariablesCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getScriptedTaskOutputVariablesCompartmentFigure();
		pane.remove(((ScriptedTaskScriptedTaskOutputVariablesCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 7
Source File: TypeEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof TypeNameEditPart) {
		return true;
	}
	if (childEditPart instanceof TypeTypeFieldsCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getTypeFieldsCompartmentFigure();
		pane.remove(((TypeTypeFieldsCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 8
Source File: LanguageEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof LanguageNameEditPart) {
		return true;
	}
	if (childEditPart instanceof LanguageLanguageParametersCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getLanguageParametersCompartmentFigure();
		pane.remove(((LanguageLanguageParametersCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 9
Source File: StatechartTextEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void removeChildVisual(EditPart childEditPart) {
	if (childEditPart instanceof StatechartTextExpressionEditPart) {
		IFigure pane = getPrimaryShape().getCompartment();
		IFigure compartmentFigure = ((StatechartTextExpressionEditPart) childEditPart).getFigure();
		pane.remove(compartmentFigure);
	} else
		super.removeChildVisual(childEditPart);
}
 
Example 10
Source File: RegionEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void removeChildVisual(EditPart childEditPart) {
	if (childEditPart instanceof RegionCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getCompartmentPane();
		IFigure figure = ((RegionCompartmentEditPart) childEditPart).getFigure();
		pane.remove(figure);
	} else
		super.removeChildVisual(childEditPart);
}
 
Example 11
Source File: CrosstabCellEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void deactivate( )
{
	// 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.remove( handle );
	}
	super.deactivate( );
}
 
Example 12
Source File: TableCellEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void deactivate( )
{
	// 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.remove( handle );
	}
	super.deactivate( );
}
 
Example 13
Source File: LaneEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof LaneNameEditPart) {
		return true;
	}
	if (childEditPart instanceof LaneLaneCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getFigureLaneContainerFigure();
		pane.remove(((LaneLaneCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 14
Source File: PoolEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
	if (childEditPart instanceof PoolNameEditPart) {
		return true;
	}
	if (childEditPart instanceof PoolPoolCompartmentEditPart) {
		IFigure pane = getPrimaryShape().getFigurePoolContainerFigure();
		pane.remove(((PoolPoolCompartmentEditPart) childEditPart).getFigure());
		return true;
	}
	return false;
}
 
Example 15
Source File: NodeElementEditPart.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
public void reorder() {
    final IFigure parentFigure = figure.getParent();
    parentFigure.remove(figure);
    parentFigure.add(figure);
    figure.repaint();
}