org.eclipse.draw2d.BorderLayout Java Examples

The following examples show how to use org.eclipse.draw2d.BorderLayout. 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: BorderContainerController.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public static Object convert ( final Alignment alignment )
{
    switch ( alignment )
    {
        case BOTTOM:
            return BorderLayout.BOTTOM;
        case TOP:
            return BorderLayout.TOP;
        case CENTER:
            return BorderLayout.CENTER;
        case LEFT:
            return BorderLayout.LEFT;
        case RIGHT:
            return BorderLayout.RIGHT;
        default:
            return null;
    }
}
 
Example #2
Source File: FinalStateFigure.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
protected void createContents() {
	int size = mapMode.DPtoLP(2);
	this.setBorder(new MarginBorder(size, size, size, size));
	Ellipse whiteCircle = new Ellipse();
	whiteCircle.setOutline(false);
	whiteCircle.setLineWidth(1);
	whiteCircle.setBackgroundColor(ColorConstants.white);
	size = mapMode.DPtoLP(3);
	whiteCircle.setBorder(new MarginBorder(size, size, size, size));
	BorderLayout layout = new BorderLayout();
	whiteCircle.setLayoutManager(layout);
	Object data = BorderLayout.CENTER;
	this.add(whiteCircle, data);
	Ellipse blackCircle = new Ellipse();
	blackCircle.setOutline(false);
	blackCircle.setLineWidth(mapMode.DPtoLP(1));
	blackCircle.setBackgroundColor(ColorConstants.black);
	data = BorderLayout.CENTER;
	whiteCircle.add(blackCircle, data);
}
 
Example #3
Source File: RootFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public RootFigure(ResourceManager resourceManager) {
	fResourceManager = resourceManager;
	setStyleProvider(null);

	fTimeViewDetails = new TimeBaseConverter(this);

	final BorderLayout layout = new BorderLayout();
	layout.setVerticalSpacing(10);
	setLayoutManager(layout);

	setOpaque(true);
	updateStyle(fStyleProvider);

	fDetailFigure = new DetailFigure(getStyleProvider());
	add(fDetailFigure, BorderLayout.CENTER);

	fOverviewFigure = new OverviewFigure(getStyleProvider());
	add(fOverviewFigure, BorderLayout.BOTTOM);
}
 
Example #4
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 #5
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 #6
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 #7
Source File: BorderContainerController.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public BorderContainerController ( final SymbolController controller, final BorderContainer element, final BasicViewElementFactory factory ) throws Exception
{
    this.figure = new Layer ();
    this.figure.setOpaque ( false );

    this.figure.setLayoutManager ( this.layout = new BorderLayout () );

    this.layout.setHorizontalSpacing ( element.getHorizontalSpacing () );
    this.layout.setVerticalSpacing ( element.getVerticalSpacing () );

    for ( final BorderChild child : element.getChildren () )
    {
        final Controller elementController = factory.create ( controller, child.getElement () );
        final IFigure childFigure = elementController.getFigure ();

        controller.addRawElement ( child.getName (), new BorderChildController ( childFigure ) );

        this.figure.add ( childFigure, convert ( child.getAlignment () ) );
    }

    controller.addElement ( element, this );
}
 
Example #8
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 #9
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 #10
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 #11
Source File: CursorFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public CursorFigure(ITimelineStyleProvider styleProvider) {
	setLayoutManager(new CursorFigureLayout());

	updateStyle(styleProvider);

	final Triangle topTriangle = new Triangle();
	topTriangle.setSize(TRIANGLE_SIZE, TRIANGLE_SIZE);
	topTriangle.setOpaque(true);
	topTriangle.setDirection(PositionConstants.RIGHT);
	add(topTriangle, BorderLayout.TOP);

	final Triangle bottomTriangle = new Triangle();
	bottomTriangle.setSize(TRIANGLE_SIZE, TRIANGLE_SIZE);
	topTriangle.setOpaque(true);
	bottomTriangle.setDirection(PositionConstants.LEFT);
	add(bottomTriangle, BorderLayout.BOTTOM);

	fLineFigure = new RectangleFigure();
	fLineFigure.setLineWidth(1);
	add(fLineFigure, BorderLayout.CENTER);

	new CursorMover(this);
}
 
Example #12
Source File: WalkerNoteFigure.java    From erflute with Apache License 2.0 5 votes vote down vote up
public void create() {
    setBorder(new MarginBorder(RETURN_WIDTH));
    setLayoutManager(new BorderLayout());
    final FlowPage page = new FlowPage();
    label = new TextFlow();
    final ParagraphTextLayout layout = new ParagraphTextLayout(label, ParagraphTextLayout.WORD_WRAP_SOFT);
    label.setLayoutManager(layout);
    label.setOpaque(false);
    page.add(label);
    add(page, BorderLayout.CENTER);
}
 
Example #13
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(Figure top) {
	top.setLayoutManager(new BorderLayout());

	FlowLayout layout = new FlowLayout();
	layout.setStretchMinorAxis(true);
	Figure title = new Figure();
	top.add(title, BorderLayout.TOP);
	title.setLayoutManager(layout);

	if (new BigDecimal("1.5").equals(getSettings().getTitleFontEm())) {
		title.setBorder(new MarginBorder(new Insets(2, 2, 2, 2)));
	} else {
		title.setBorder(new MarginBorder(new Insets(4, 4, 4, 4)));
	}

	ImageFigure image = new ImageFigure();
	image.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));
	image.setImage(Activator.getImage(this.getTableFigure().getImageKey()));
	title.add(image);

	this.nameLabel = new Label();
	this.nameLabel.setBorder(new MarginBorder(new Insets(0, 0, 0, 20)));
	title.add(this.nameLabel);

	Figure separater = new Figure();
	separater.setSize(-1, 1);
	separater.setBackgroundColor(ColorConstants.black);
	separater.setOpaque(true);

	top.add(separater, BorderLayout.BOTTOM);
}
 
Example #14
Source File: FinalStateFigure.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public FinalStateFigure(IMapMode mapMode) {
	this.mapMode = mapMode;
	BorderLayout layout = new BorderLayout();

	this.setLayoutManager(layout);

	this.setOutline(false);
	this.setLineWidth(0);
	this.setBackgroundColor(ColorConstants.black);
	createContents();
}
 
Example #15
Source File: AbstractStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public void createTitleBar() {
    final Figure top = new Figure();
    tableFigure.add(top, BorderLayout.TOP);

    initTitleBar(top);
}
 
Example #16
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 #17
Source File: FunnyStyleSupport.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public void initTitleBar(Figure top) {
    top.setLayoutManager(new BorderLayout());

    final FlowLayout layout = new FlowLayout();
    layout.setStretchMinorAxis(true);
    final Figure title = new Figure();
    top.add(title, BorderLayout.TOP);
    title.setLayoutManager(layout);

    title.setBorder(new MarginBorder(new Insets(2, 2, 2, 2)));

    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));
    image.setImage(Activator.getImage(getTableFigure().getImageKey()));
    title.add(image);

    this.nameLabel = new Label();
    nameLabel.setBorder(new MarginBorder(new Insets(0, 0, 0, 20)));
    title.add(nameLabel);

    final Figure separater = new Figure();
    separater.setSize(-1, 1);
    separater.setBackgroundColor(ColorConstants.black);
    separater.setOpaque(true);

    top.add(separater, BorderLayout.BOTTOM);
}
 
Example #18
Source File: InitialStateFigure.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
private void init() {
	this.setLayoutManager(new BorderLayout());
	this.setOutline(false);
	this.setLineWidth(0);
	this.setSize(new Dimension(2, 2));
	this.setBorder(new MarginBorder(2, 2, 2, 2));
}
 
Example #19
Source File: NoteFigure.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public void create() {
	this.setBorder(new MarginBorder(RETURN_WIDTH));
	this.setLayoutManager(new BorderLayout());
	FlowPage page = new FlowPage();

	label = new TextFlow();
	ParagraphTextLayout layout = new ParagraphTextLayout(label,
			ParagraphTextLayout.WORD_WRAP_SOFT);
	label.setLayoutManager(layout);
	label.setOpaque(false);

	page.add(label);

	this.add(page, BorderLayout.CENTER);
}
 
Example #20
Source File: NoteFigure.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
public void create() {
    setBorder(new MarginBorder(RETURN_WIDTH));
    setLayoutManager(new BorderLayout());
    final FlowPage page = new FlowPage();

    label = new TextFlow();
    final ParagraphTextLayout layout = new ParagraphTextLayout(label, ParagraphTextLayout.WORD_WRAP_SOFT);
    label.setLayoutManager(layout);
    label.setOpaque(false);

    page.add(label);

    this.add(page, BorderLayout.CENTER);
}
 
Example #21
Source File: AbstractStyleSupport.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
@Override
public void createTitleBar() {
    final Figure top = new Figure();
    tableFigure.add(top, BorderLayout.TOP);

    initTitleBar(top);
}
 
Example #22
Source File: FunnyStyleSupport.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void initTitleBar(final Figure top) {
    top.setLayoutManager(new BorderLayout());

    final Figure title = new Figure();
    top.add(title, BorderLayout.TOP);
    final FlowLayout titleLayout = new FlowLayout();
    titleLayout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
    title.setLayoutManager(titleLayout);

    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
    image.setImage(ERDiagramActivator.getImage(getTableFigure().getImageKey()));
    title.add(image);

    nameLabel = new Label();
    nameLabel.setBorder(new MarginBorder(new Insets(5, 0, 5, 20)));
    title.add(nameLabel);

    final Figure separater = new Figure();
    separater.setSize(-1, 1);
    separater.setBackgroundColor(ColorConstants.black);
    separater.setOpaque(true);

    top.add(separater, BorderLayout.BOTTOM);
}
 
Example #23
Source File: ManualOverride.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
private Figure createRV ()
{
    final Figure rvFigure = new Figure ();
    rvFigure.setLayoutManager ( new BorderLayout () );
    final Label label = new Label ( Messages.ManualOverride_ResetValue_Label );
    label.setBorder ( new MarginBorder ( 10 ) );
    rvFigure.add ( label, BorderLayout.RIGHT );

    this.rvRect = new RoundedRectangle ();
    this.rvRect.setLayoutManager ( new BorderLayout () );
    this.rvValue = new Label ();
    this.rvRect.setBackgroundColor ( ColorConstants.lightGray );
    this.rvValue.setBorder ( new MarginBorder ( 10 ) );
    this.rvRect.add ( this.rvValue, BorderLayout.CENTER );

    this.rvRectBlinker = new StyleBlinker () {

        @Override
        public void update ( final CurrentStyle style )
        {
            ManualOverride.this.rvRect.setBackgroundColor ( style.background );
            ManualOverride.this.rvRect.setForegroundColor ( style.foreground );
            ManualOverride.this.rvRect.setFont ( style.font );
        }
    };
    this.rvRectStyler = new StateStyler ( this.rvRectBlinker );

    rvFigure.add ( this.rvRect, BorderLayout.CENTER );
    return rvFigure;
}
 
Example #24
Source File: AbstractBaseDraw2DDetailsPart.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
private IFigure createNaPanel ()
{
    final Figure naPanel = new Figure ();

    final BorderLayout layout = new BorderLayout ();
    naPanel.setLayoutManager ( layout );

    final Label label = new Label ();
    label.setText ( Messages.AbstractBaseDraw2DDetailsPart_Label_NotAvail_Text );
    naPanel.add ( label, BorderLayout.CENTER );

    return naPanel;
}
 
Example #25
Source File: RoundDetailsPart.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
private IFigure createSourceValue ()
{
    this.sourceRect = new RoundedRectangle ();
    this.sourceRect.setLayoutManager ( new BorderLayout () );
    this.sourceRect.setBackgroundColor ( ColorConstants.lightGray );
    this.sourceRect.setForegroundColor ( ColorConstants.black );
    this.sourceRect.setBorder ( new MarginBorder ( 10 ) );

    this.sourceRect.add ( this.sourceLabel = new Label (), BorderLayout.CENTER );

    return this.sourceRect;
}
 
Example #26
Source File: RoundDetailsPart.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
private IFigure createTargetValue ()
{
    this.targetRect = new RoundedRectangle ();
    this.targetRect.setLayoutManager ( new BorderLayout () );
    this.targetRect.setBackgroundColor ( ColorConstants.lightGray );
    this.targetRect.setForegroundColor ( ColorConstants.black );
    this.targetRect.setBorder ( new MarginBorder ( 10 ) );

    this.targetRect.add ( this.targetLabel = new Label (), BorderLayout.CENTER );

    return this.targetRect;
}
 
Example #27
Source File: DetailFigure.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public DetailFigure(ITimelineStyleProvider styleProvider) {
	final BorderLayout layout = new BorderLayout();
	layout.setHorizontalSpacing(0);
	layout.setVerticalSpacing(0);
	setLayoutManager(layout);

	add(new TracksFigure(styleProvider), BorderLayout.CENTER);
	add(new TimeAxisFigure(styleProvider), BorderLayout.BOTTOM);

	new DetailAreaListener(this);
}
 
Example #28
Source File: TableFigure.java    From erflute with Apache License 2.0 4 votes vote down vote up
public TableFigure(DiagramSettings settings) {
    this.columns = new Figure();
    setLayoutManager(new BorderLayout());
    setSettings(settings);
}
 
Example #29
Source File: AbstractStyleSupport.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
@Override
public void createColumnArea(final IFigure columns) {
    initColumnArea(columns);
    tableFigure.add(columns, BorderLayout.CENTER);
}
 
Example #30
Source File: TableFigure.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
public TableFigure(final String tableStyle) {
    columns = new Figure();
    setLayoutManager(new BorderLayout());
    setTableStyle(tableStyle);
}