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

The following examples show how to use org.eclipse.draw2d.IFigure#setOpaque() . 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: FunnyStyleSupport.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(final IFigure columns) {
    initColumnArea(columns);

    columns.setBorder(new MarginBorder(0, 0, 0, 0));
    columns.setBackgroundColor(ColorConstants.white);
    columns.setOpaque(true);

    final Figure centerFigure = new Figure();
    centerFigure.setLayoutManager(new BorderLayout());
    centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    centerFigure.add(columns, BorderLayout.CENTER);
    getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
Example 2
Source File: FunnyStyleSupport.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createFooter() {
    final IFigure footer = new Figure();
    final BorderLayout footerLayout = new BorderLayout();
    footer.setLayoutManager(footerLayout);
    footer.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    final IFigure footer1 = new Figure();
    footer1.setSize(-1, 10);
    footer1.setBackgroundColor(Resources.VERY_LIGHT_GRAY);
    footer1.setOpaque(true);

    footer.add(footer1, BorderLayout.TOP);

    final IFigure footer2 = new Figure();
    footer2.setSize(-1, 7);

    footer.add(footer2, BorderLayout.BOTTOM);

    getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
Example 3
Source File: AbstractStyleSupport.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
protected void setColumnFigureColor(final IFigure figure, final boolean isSelectedReferenced, final boolean isSelectedForeignKey, final boolean isAdded, final boolean isUpdated, final boolean isRemoved) {
    if (isAdded) {
        figure.setBackgroundColor(Resources.ADDED_COLOR);
    } else if (isUpdated) {
        figure.setBackgroundColor(Resources.UPDATED_COLOR);
    } else if (isRemoved) {
        figure.setBackgroundColor(Resources.REMOVED_COLOR);
    }

    if (isSelectedReferenced && isSelectedForeignKey) {
        figure.setBackgroundColor(Resources.SELECTED_REFERENCED_AND_FOREIGNKEY_COLUMN);

    } else if (isSelectedReferenced) {
        figure.setBackgroundColor(Resources.SELECTED_REFERENCED_COLUMN);

    } else if (isSelectedForeignKey) {
        figure.setBackgroundColor(Resources.SELECTED_FOREIGNKEY_COLUMN);

    }

    figure.setOpaque(true);
}
 
Example 4
Source File: FunnyStyleSupport.java    From erflute with Apache License 2.0 6 votes vote down vote up
@Override
public void createFooter() {
    final IFigure footer = new Figure();
    final BorderLayout footerLayout = new BorderLayout();
    footer.setLayoutManager(footerLayout);
    footer.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));

    final IFigure footer1 = new Figure();
    footer1.setSize(-1, 1);
    footer1.setBackgroundColor(ColorConstants.black);
    footer1.setOpaque(true);
    footer.add(footer1, BorderLayout.TOP);

    final IFigure footer2 = new Figure();
    footer2.setSize(-1, 6);
    footer.add(footer2, BorderLayout.BOTTOM);

    getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
Example 5
Source File: AbstractStyleSupport.java    From erflute with Apache License 2.0 6 votes vote down vote up
protected void setColumnFigureColor(IFigure figure, boolean isSelectedReferenced, boolean isSelectedForeignKey, boolean isAdded,
        boolean isUpdated, boolean isRemoved) {
    if (isAdded) {
        figure.setBackgroundColor(DesignResources.ADDED_COLOR);
    } else if (isUpdated) {
        figure.setBackgroundColor(DesignResources.UPDATED_COLOR);
    } else if (isRemoved) {
        figure.setBackgroundColor(DesignResources.REMOVED_COLOR);
    }

    if (isSelectedReferenced && isSelectedForeignKey) {
        figure.setBackgroundColor(DesignResources.SELECTED_REFERENCED_AND_FOREIGNKEY_COLUMN);

    } else if (isSelectedReferenced) {
        figure.setBackgroundColor(DesignResources.SELECTED_REFERENCED_COLUMN);

    } else if (isSelectedForeignKey) {
        figure.setBackgroundColor(DesignResources.SELECTED_FOREIGNKEY_COLUMN);

    }

    figure.setOpaque(true);
}
 
Example 6
Source File: ChartReportItemUIUtil.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Refresh background color.
 * 
 * @param handle
 *            Item handle
 * @param figure
 *            Figure
 */
public static void refreshBackgroundColor( ExtendedItemHandle handle,
		IFigure figure )
{
	Object obj = handle.getProperty( StyleHandle.BACKGROUND_COLOR_PROP );

	figure.setOpaque( false );

	if ( obj != null )
	{
		int color = 0xFFFFFF;
		if ( obj instanceof String )
		{
			color = ColorUtil.parseColor( (String) obj );
		}
		else
		{
			color = ( (Integer) obj ).intValue( );
		}
		figure.setBackgroundColor( ColorManager.getColor( color ) );
		figure.setOpaque( true );
	}
}
 
Example 7
Source File: ListBandEditPart.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates the control figure
 * 
 */
private ListBandControlFigure createControlFigure( )
{
	controlFigure = new ListBandControlFigure( this );

	controlFigure.add( new ListControlDisplayNameFigure( this ) );

	controlFigure.add( new ListIconFigure( this ) );

	controlFigure.add( new ListBandControlVisible( this ) );

	// Sets the background
	for ( Iterator itr = controlFigure.getChildren( ).iterator( ); itr.hasNext( ); )
	{
		IFigure fig = (IFigure) itr.next( );
		fig.setOpaque( false );
	}
	return controlFigure;
}
 
Example 8
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(IFigure columns) {
	this.initColumnArea(columns);

	columns.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));
	columns.setBackgroundColor(ColorConstants.white);
	columns.setOpaque(true);

	Figure centerFigure = new Figure();
	centerFigure.setLayoutManager(new BorderLayout());
	centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

	centerFigure.add(columns, BorderLayout.CENTER);
	this.getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
Example 9
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createFooter() {
	IFigure footer = new Figure();
	BorderLayout footerLayout = new BorderLayout();
	footer.setLayoutManager(footerLayout);
	footer.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));

	IFigure footer1 = new Figure();
	footer1.setSize(-1, 1);
	footer1.setBackgroundColor(ColorConstants.black);
	footer1.setOpaque(true);
	footer.add(footer1, BorderLayout.TOP);

	IFigure footer2 = new Figure();
	footer2.setSize(-1, 6);
	footer.add(footer2, BorderLayout.BOTTOM);

	this.getTableFigure().add(footer, BorderLayout.BOTTOM);
}
 
Example 10
Source File: AbstractStyleSupport.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
protected void setColumnFigureColor(IFigure figure,
		boolean isSelectedReferenced, boolean isSelectedForeignKey,
		boolean isAdded, boolean isUpdated, boolean isRemoved) {
	if (isAdded) {
		figure.setBackgroundColor(Resources.ADDED_COLOR);
	} else if (isUpdated) {
		figure.setBackgroundColor(Resources.UPDATED_COLOR);
	} else if (isRemoved) {
		figure.setBackgroundColor(Resources.REMOVED_COLOR);
	}

	if (isSelectedReferenced && isSelectedForeignKey) {
		figure
				.setBackgroundColor(Resources.SELECTED_REFERENCED_AND_FOREIGNKEY_COLUMN);

	} else if (isSelectedReferenced) {
		figure.setBackgroundColor(Resources.SELECTED_REFERENCED_COLUMN);

	} else if (isSelectedForeignKey) {
		figure.setBackgroundColor(Resources.SELECTED_FOREIGNKEY_COLUMN);

	}

	figure.setOpaque(true);
}
 
Example 11
Source File: AbstractStyleSupport.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
protected void initColumnArea(final IFigure columns) {
    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    layout.setSpacing(0);

    columns.setBorder(new MarginBorder(0, 2, 2, 2));
    columns.setLayoutManager(layout);

    columns.setBackgroundColor(null);
    columns.setOpaque(false);
}
 
Example 12
Source File: FunnyStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public void createColumnArea(IFigure columns) {
    initColumnArea(columns);

    columns.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));
    columns.setBackgroundColor(ColorConstants.white);
    columns.setOpaque(true);

    final Figure centerFigure = new Figure();
    centerFigure.setLayoutManager(new BorderLayout());
    centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    centerFigure.add(columns, BorderLayout.CENTER);
    getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
Example 13
Source File: AbstractStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
protected void initColumnArea(IFigure columns) {
    final ToolbarLayout layout = new ToolbarLayout();
    layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
    layout.setStretchMinorAxis(true);
    layout.setSpacing(0);

    columns.setBorder(new MarginBorder(0, 2, 2, 2));
    columns.setLayoutManager(layout);

    columns.setBackgroundColor(null);
    columns.setOpaque(false);
}
 
Example 14
Source File: AbstractStyleSupport.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
protected void initColumnArea(IFigure columns) {
	ToolbarLayout layout = new ToolbarLayout();
	layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
	layout.setStretchMinorAxis(true);
	layout.setSpacing(0);

	columns.setBorder(new MarginBorder(0, 2, 2, 2));
	columns.setLayoutManager(layout);

	columns.setBackgroundColor(null);
	columns.setOpaque(false);
}