org.eclipse.draw2d.MarginBorder Java Examples
The following examples show how to use
org.eclipse.draw2d.MarginBorder.
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 erflute with Apache License 2.0 | 6 votes |
@Override public void addIndex(IndexFigure indexFigure, String name, boolean isFirst) { final ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 0, 0, 19))); image.setImage(Activator.getImage(ImageKey.BLANK_WHITE)); image.setOpaque(true); indexFigure.add(image); final StringBuilder text = new StringBuilder(); text.append(name); final Label label = createColumnLabel(); label.setBorder(new MarginBorder(new Insets(1, 0, 0, 4))); label.setForegroundColor(ColorConstants.black); label.setText(text.toString()); indexFigure.add(label); }
Example #2
Source File: SimpleStyleSupport.java From ermaster-b with Apache License 2.0 | 6 votes |
/** * {@inheritDoc} */ @Override public void initTitleBar(Figure top) { ToolbarLayout topLayout = new ToolbarLayout(); topLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT); topLayout.setStretchMinorAxis(true); top.setLayoutManager(topLayout); this.nameLabel = new Label(); this.nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20))); top.add(nameLabel); Figure separater = new Figure(); separater.setSize(-1, 1); separater.setBackgroundColor(this.getTextColor()); separater.setOpaque(true); top.add(separater); }
Example #3
Source File: SinkEditPart.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public SinkFigure() { GridLayout layoutThis = new GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; this.setLayoutManager(layoutThis); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(4))); this.addPoint(new Point(getMapMode().DPtoLP(5), getMapMode().DPtoLP(6))); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(4))); this.setFill(true); this.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5))); createContents(); }
Example #4
Source File: FunnyStyleSupport.java From ermaster-b with Apache License 2.0 | 6 votes |
/** * {@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 #5
Source File: FunnyStyleSupport.java From ermaster-b with Apache License 2.0 | 6 votes |
/** * {@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 #6
Source File: CsvSourceEditPart.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public CsvSourceFigure() { GridLayout layoutThis = new GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; this.setLayoutManager(layoutThis); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(11), getMapMode().DPtoLP(2))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(4))); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(4))); this.setFill(true); this.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5))); createContents(); }
Example #7
Source File: SourceEditPart.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public SourceFigure() { GridLayout layoutThis = new GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; this.setLayoutManager(layoutThis); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(11), getMapMode().DPtoLP(2))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(4))); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(4))); this.setFill(true); this.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5))); createContents(); }
Example #8
Source File: FunnyStyleSupport.java From ermaster-b with Apache License 2.0 | 6 votes |
public void addIndex(IndexFigure indexFigure, String name, boolean isFirst) { ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 0, 0, 19))); image.setImage(Activator.getImage(ImageKey.BLANK_WHITE)); image.setOpaque(true); indexFigure.add(image); // Label filler = new Label(); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16))); // filler.setBorder(new MarginBorder(new Insets(1, 4, 0, 16))); // indexFigure.add(filler); StringBuilder text = new StringBuilder(); text.append(name); Label label = this.createColumnLabel(); label.setBorder(new MarginBorder(new Insets(1, 0, 0, 4))); label.setForegroundColor(ColorConstants.black); label.setText(text.toString()); indexFigure.add(label); }
Example #9
Source File: CsvSinkEditPart.java From scava with Eclipse Public License 2.0 | 6 votes |
/** * @generated */ public CsvSinkFigure() { GridLayout layoutThis = new GridLayout(); layoutThis.numColumns = 1; layoutThis.makeColumnsEqualWidth = true; this.setLayoutManager(layoutThis); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(0))); this.addPoint(new Point(getMapMode().DPtoLP(10), getMapMode().DPtoLP(4))); this.addPoint(new Point(getMapMode().DPtoLP(5), getMapMode().DPtoLP(6))); this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode().DPtoLP(4))); this.setFill(true); this.setBorder(new MarginBorder(getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5))); createContents(); }
Example #10
Source File: CustomShapeCompartmentFigure.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override protected void configureFigure(IMapMode mm) { ScrollPane scrollpane = getScrollPane(); if (scrollpane == null) { scrollpane = scrollPane = new ScrollPane(); } scrollpane.setViewport(new FreeformViewport()); scrollPane.setScrollBarVisibility(ScrollPane.NEVER); scrollPane.setVerticalScrollBar(null); scrollpane.setLayoutManager(new ScrollPaneLayout()); IFigure contents = new BorderItemsAwareFreeFormLayer(); contents.setLayoutManager(new FreeFormLayoutEx()); scrollpane.setContents(contents); int MB = mm.DPtoLP(0); scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB)); int W_SZ = mm.DPtoLP(10); int H_SZ = mm.DPtoLP(10); scrollpane.setMinimumSize(new Dimension(W_SZ, H_SZ)); this.setFont(FONT_TITLE); }
Example #11
Source File: CustomSubprocessShapeCompartmentFigure.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override protected void configureFigure(IMapMode mm) { ScrollPane scrollpane = getScrollPane(); if(scrollpane==null){ scrollpane = scrollPane = new ScrollPane(); } scrollpane.setViewport(new FreeformViewport()); scrollPane.setScrollBarVisibility(ScrollPane.NEVER); scrollPane.setVerticalScrollBar(null); scrollpane.setLayoutManager(new ScrollPaneLayout() ); IFigure contents = new BorderItemsAwareFreeFormLayer(); contents.setLayoutManager(new FreeFormLayoutEx()); scrollpane.setContents(contents); int MB = mm.DPtoLP(0); scrollpane.setBorder(new MarginBorder(MB, MB,MB, MB)); int W_SZ = mm.DPtoLP(10); int H_SZ = mm.DPtoLP(10); scrollpane.setMinimumSize(new Dimension(W_SZ, H_SZ)); this.setFont(FONT_TITLE); }
Example #12
Source File: FunnyStyleSupport.java From ermasterr with Apache License 2.0 | 6 votes |
/** * {@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 #13
Source File: CustomMainProcessEditPart.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected IFigure createFigure() { IFigure l = super.createFigure() ; l.setBorder(new MarginBorder(30)); GravityConstrainedFlowLayout lm = new CustomGravityConstrainedFlowLayout(); lm.setVertical(true); lm.setStretchMajorAxis(false); lm.setStretchMinorAxis(false); lm.setMinorAlignment(GravityConstrainedFlowLayout.ALIGN_TOPLEFT); lm.setSpacing(20); l.setLayoutManager(lm); return l; }
Example #14
Source File: FunnyStyleSupport.java From erflute with Apache License 2.0 | 6 votes |
@Override public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode, String name, boolean isAdded, boolean isUpdated, boolean isRemoved) { columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0))); final ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7))); image.setImage(Activator.getImage(ImageKey.GROUP)); columnFigure.add(image); final StringBuilder text = new StringBuilder(); text.append(name); text.append(" (GROUP)"); setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved); final Label label = createColumnLabel(); label.setForegroundColor(ColorConstants.black); label.setLabelAlignment(PositionConstants.RIGHT); label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4))); label.setText(text.toString()); columnFigure.add(label); }
Example #15
Source File: FunnyStyleSupport.java From erflute with Apache License 2.0 | 6 votes |
@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 #16
Source File: SimpleStyleSupport.java From erflute with Apache License 2.0 | 6 votes |
@Override public void initTitleBar(Figure top) { final ToolbarLayout topLayout = new ToolbarLayout(); topLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT); topLayout.setStretchMinorAxis(true); top.setLayoutManager(topLayout); this.nameLabel = new Label(); nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20))); top.add(nameLabel); final Figure separater = new Figure(); separater.setSize(-1, 1); separater.setBackgroundColor(getTextColor()); separater.setOpaque(true); top.add(separater); }
Example #17
Source File: ModelPropertiesFigure.java From erflute with Apache License 2.0 | 6 votes |
private void addRow(String name, String value, String tableStyle) { final Border border = new MarginBorder(5); final ToolbarLayout layout = new ToolbarLayout(); layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT); layout.setStretchMinorAxis(true); final Label nameLabel = new Label(); final Label valueLabel = new Label(); nameLabel.setBorder(border); nameLabel.setText(name); nameLabel.setLabelAlignment(PositionConstants.LEFT); nameLabel.setForegroundColor(foregroundColor); add(nameLabel); if (!DisplayMessages.getMessage("action.title.change.design.simple").equals(tableStyle) && !DisplayMessages.getMessage("action.title.change.design.frame").equals(tableStyle)) { valueLabel.setBackgroundColor(ColorConstants.white); valueLabel.setOpaque(true); valueLabel.setForegroundColor(ColorConstants.black); } else { valueLabel.setOpaque(false); valueLabel.setForegroundColor(foregroundColor); } valueLabel.setBorder(border); valueLabel.setText(value); valueLabel.setLabelAlignment(PositionConstants.LEFT); add(valueLabel); }
Example #18
Source File: ClassFigure.java From JDeodorant with MIT License | 6 votes |
public ClassFigure(String name, Color color) { ToolbarLayout layout = new ToolbarLayout(); layout.setSpacing(5); setLayoutManager(layout); setBorder(new CompoundBorder( new LineBorder(1), new MarginBorder(0, 0, 0, 0))); setBackgroundColor(color); setOpaque(true); Label className = new Label(name, DecorationConstants.CLASS); className.setToolTip(new Label(name)); className.setFont(DecorationConstants.classFont); add(className); new ClassFigureMover(this); }
Example #19
Source File: FinalStateFigure.java From statecharts with Eclipse Public License 1.0 | 6 votes |
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 #20
Source File: SimpleStyleSupport.java From ermasterr with Apache License 2.0 | 6 votes |
/** * {@inheritDoc} */ @Override public void initTitleBar(final Figure top) { final ToolbarLayout topLayout = new ToolbarLayout(); topLayout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT); topLayout.setStretchMinorAxis(true); top.setLayoutManager(topLayout); nameLabel = new Label(); nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20))); top.add(nameLabel); final Figure separater = new Figure(); separater.setSize(-1, 1); separater.setBackgroundColor(getTextColor()); separater.setOpaque(true); top.add(separater); }
Example #21
Source File: RowHandle.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Initializes the handle. Sets the {@link DragTracker}and DragCursor. */ protected void initialize( ) { setOpaque( true ); LineBorder bd = new LineBorder( 1 ); bd.setColor( ReportColorConstants.HandleBorderColor ); setBorder( bd ); String tp = getTooltipText( ); if ( tp != null ) { Label tooltip = new Label( tp ); tooltip.setBorder( new MarginBorder( 0, 2, 0, 2 ) ); setToolTip( tooltip ); } setCursor( Cursors.ARROW ); }
Example #22
Source File: FunnyStyleSupport.java From ermasterr with Apache License 2.0 | 6 votes |
/** * {@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 #23
Source File: AbstractStyleSupport.java From erflute with Apache License 2.0 | 5 votes |
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 #24
Source File: NoteFigure.java From ermaster-b with Apache License 2.0 | 5 votes |
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 #25
Source File: PackageFigure.java From JDeodorant with MIT License | 5 votes |
public PackageFigure(String name, double scale){ this.name= name; setLayoutManager(new ProportionalFlowLayout(scale,5, 10)); setToolTip(new Label(name)); LineBorder border = new LineBorder(); border.setColor(ColorConstants.white); setBorder(new CompoundBorder(border, new MarginBorder(10, 5, 10, 5))); }
Example #26
Source File: IndexEditPart.java From erflute with Apache License 2.0 | 5 votes |
public void refreshTableColumns() { final ERDiagram diagram = getDiagram(); final IndexFigure indexFigure = (IndexFigure) getFigure(); final ERIndex index = (ERIndex) getModel(); final int notationLevel = diagram.getDiagramContents().getSettings().getNotationLevel(); final TableViewEditPart parent = (TableViewEditPart) getParent(); final List<?> figures = parent.getContentPane().getChildren(); boolean isFirst = false; if (!(figures.get(figures.size() - 1) instanceof IndexFigure)) { if (notationLevel != DiagramSettings.NOTATION_LEVLE_TITLE) { isFirst = true; parent.getContentPane().add(new GuideEditPart.GuideLineFigure()); final Label indexHeader = new Label(); indexHeader.setLabelAlignment(PositionConstants.LEFT); indexHeader.setText("<< index >>"); indexHeader.setBorder(new MarginBorder(new Insets(4, 3, 0, 0))); parent.getContentPane().add(indexHeader); } } parent.getContentPane().add(figure); if (notationLevel != DiagramSettings.NOTATION_LEVLE_TITLE) { final TableFigure tableFigure = (TableFigure) parent.getFigure(); addColumnFigure(diagram, tableFigure, indexFigure, index, isFirst, false); if (selected) { indexFigure.setBackgroundColor(ColorConstants.titleBackground); indexFigure.setForegroundColor(ColorConstants.titleForeground); } } else { indexFigure.clearLabel(); return; } }
Example #27
Source File: WalkerNoteFigure.java From erflute with Apache License 2.0 | 5 votes |
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 #28
Source File: AbstractStyleSupport.java From ermaster-b with Apache License 2.0 | 5 votes |
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); }
Example #29
Source File: FunnyStyleSupport.java From ermaster-b with Apache License 2.0 | 5 votes |
@Override public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode, String name, boolean isAdded, boolean isUpdated, boolean isRemoved) { columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0))); ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7))); image.setImage(Activator.getImage(ImageKey.GROUP)); columnFigure.add(image); // Label filler = new Label(); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16))); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 6))); // columnFigure.add(filler); // filler = new Label(); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16))); // columnFigure.add(filler); StringBuilder text = new StringBuilder(); text.append(name); text.append(" (GROUP)"); this.setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved); Label label = this.createColumnLabel(); label.setForegroundColor(ColorConstants.black); label.setLabelAlignment(PositionConstants.RIGHT); label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4))); label.setText(text.toString()); columnFigure.add(label); }
Example #30
Source File: AbstractStyleSupport.java From erflute with Apache License 2.0 | 5 votes |
protected Label createColumnLabel() { final Label label = new Label(); label.setBorder(new MarginBorder(new Insets(3, 5, 3, 5))); label.setLabelAlignment(PositionConstants.LEFT); return label; }