public MarkerFigure(String name) { ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(ColorConstants.black, 1)); setBackgroundColor(classColor); setOpaque(true); org.eclipse.draw2d.Label label = new org.eclipse.draw2d.Label(); label.setText(name); add(label); super.setCornerDimensions(new Dimension(0, 0)); this.name = name; }
public EdgeFigure() { tooltipFigure = new TooltipFigure(); setToolTip(tooltipFigure); this.setLineWidth(this.getLineWidth() * 2); this.setTargetDecoration(new PolylineDecoration()); label = new Label("e_"+ID.getId()); label.setOpaque(true); label.setBackgroundColor(ColorConstants.buttonLightest); label.setBorder(new LineBorder()); add(label, new MidpointLocator(this, 0)); guardedFigure = new GuardFigure(); blockedFigure = new BlockedFigure(); actionFigure = new ActionFigure (); add (actionFigure, new RelativeLocator(label,0.5,1.5)); }
public TableFigure() { ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); LineBorder lineBorder = new LineBorder(ColorConstants.lightGray, 2); setBorder(lineBorder); setOpaque(true); setBackgroundColor(ColorConstants.white); Font font = new Font(null, "宋体", 11, SWT.NORMAL); label.setFont(font); label.setBorder(new LineBorder(ColorConstants.lightGray)); label.setIcon(Activator.getImage(Activator.IMAGE_TABLE_16)); label.setOpaque(true); label.setBackgroundColor(ColorConstants.lightBlue); label.setForegroundColor(ColorConstants.black); add(label); add(columnFigure); }
ValueLabel(IValueModel model) { this.model = model; setOpaque(true); FontManager.setFont(this, PandionJConstants.VALUE_FONT_SIZE); setSize(model.isDecimal() || model.isBoolean() ? PandionJConstants.POSITION_WIDTH*2 : PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH); setForegroundColor(ColorConstants.black); setBackgroundColor(PandionJConstants.Colors.VARIABLE_BOX); setBorder(new LineBorder(ColorConstants.black, PandionJConstants.ARRAY_LINE_WIDTH, SWT.LINE_SOLID)); updateValue(); model.registerDisplayObserver((a) -> updateValue()); model.getRuntimeModel().registerDisplayObserver((e) -> { if(e.type == IRuntimeModel.Event.Type.STEP || e.type == IRuntimeModel.Event.Type.EVALUATION) { updateBackground(); } }); dirty = false; }
void update(int r, int g, int b) { boolean valid = r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255; colorFig.setOpaque(valid); colorFig.setBackgroundColor(valid ? PandionJUI.getColor(r, g, b) : null); colorFig.setBorder(new LineBorder(valid ? ColorConstants.black : PandionJConstants.Colors.ERROR)); if(valid) colorFig.setToolTip(null); else { Label label = new Label("Invalid RGB values"); label.setForegroundColor(PandionJConstants.Colors.ERROR); colorFig.setToolTip(label); } text.setText(r + ", " + g + ", " + b); }
/** * Create selection handles in the style as predefined in DeltaEcore * @see DEGraphicalEditorTheme */ @Override protected List<Object> createSelectionHandles() { List<Object> list = new ArrayList<Object>(); MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost()); moveHandle.setDragTracker(getDragTracker()); if (isDragAllowed()) { moveHandle.setCursor(Cursors.SIZEALL); } else { moveHandle.setCursor(SharedCursors.ARROW); } // set line style to meet the predefined theme DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme(); LineBorder border = new LineBorder(); border.setColor(theme.getSelectionSecondaryColor()); border.setWidth(theme.getLineWidth()); moveHandle.setBorder(border); list.add(moveHandle); return list; }
/** * createContents * void */ private void createContents() { setLayoutManager(new CombinedFragmentLayout()); setBorder(new LineBorder(0)); setFill(false); setXOR(false); fragmentBoundary = new Polygon(); fragmentBoundary.setFill(true); fragmentBoundary.setBackgroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.LightGray)); this.add(fragmentBoundary); fragmentLabel = new Label("None"); this.add(fragmentLabel); }
protected IFigure createDragSourceFeedbackFigure() { RectangleFigure r = new FeedbackFigure(); r.setOpaque(false); r.setAlpha(50); r.setBackgroundColor(ColorConstants.gray); r.setFill(false); r.setBorder(new LineBorder(ColorConstants.gray, 1)); addFeedback(r); return r; }
@Override protected IFigure createFigure() { RectangleFigure figure = new RectangleFigure(); figure.setBackgroundColor(BACKGROUND_COLOR); Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY); Border figureBorder = new LineBorder(borderCol, 2); figure.setBorder(figureBorder); figure.setOutline(false); GridLayout layoutManager = new GridLayout(); // zero margin, in order to connect the dependent axes to the shared one layoutManager.marginHeight = 0; layoutManager.marginWidth = 0; figure.setLayoutManager(layoutManager); datasetsPane = new RectangleFigure(); datasetsPane.setOutline(false); final SimpleLoweredBorder datasetBorder = new SimpleLoweredBorder(3); datasetsPane.setBorder(datasetBorder); GridLayout datasetsPaneLayout = new GridLayout(); datasetsPane.setLayoutManager(datasetsPaneLayout); figure.add(datasetsPane); arrowFigure = new ArrowFigure(false); figure.add(arrowFigure); axisNameLabel = new AxisNameFigure(this); figure.add(axisNameLabel); return figure; }
@Override protected IFigure createFigure() { final RectangleFigure figure = new RectangleFigure(); figure.setOutline(false); final Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY); final Border figureBorder = new LineBorder(borderCol, 2); figure.setBorder(figureBorder); figure.setLayoutManager(new GridLayout()); nameLabel = new DirectionalLabel(Activator.FONT_8); final ChartPaneEditPart.AxisLandingPad pad = (ChartPaneEditPart.AxisLandingPad) getModel(); nameLabel.setText(pad.pos == ChartPanePosition.MIN ? "Min Axis" : "Max Axis"); figure.add(nameLabel); figure.getLayoutManager().setConstraint(nameLabel, new GridData( GridData.FILL, GridData.FILL, true, true)); return figure; }
public void refreshFigure( ) { StyleHandle style = ( (DesignElementHandle) getDefaultHandle( ) ) .getPrivateStyle( ); //TODO:fixed the bug 191874 //( (LabelFigure) getFigure( ) ).setFont( getFont( ) ); ( (LabelFigure) getFigure( ) ).setImage( getImage( ) ); ( (LabelFigure) getFigure( ) ).setAlignment( PositionConstants.WEST ); ( (LabelFigure) getFigure( ) ).setDirection( getTextDirection( getDefaultHandle( )) ); // bidi_hcg ( (LabelFigure) getFigure( ) ).setText( getTemplateModel( ) .getDisplayDescription( ) ); ( (LabelFigure) getFigure( ) ) .setTextAlign( DesignChoiceConstants.TEXT_ALIGN_CENTER ); ( (LabelFigure) getFigure( ) ) .setForegroundColor( ReportColorConstants.ShadowLineColor ); ( (LabelFigure) getFigure( ) ).setDisplay( style.getDisplay( ) ); getFigure( ).setBorder( new LineBorder( 1 ) ); }
public void refreshFigure( ) { StyleHandle style = ( (DesignElementHandle) getModel( ) ).getPrivateStyle( ); ( (LabelFigure) getFigure( ) ).setFont( FontManager.getFont("Dialog", 10, SWT.ITALIC) ); //$NON-NLS-1$ //( (LabelFigure) getFigure( ) ).setImage( getImage( ) ); ( (LabelFigure) getFigure( ) ).setAlignment( PositionConstants.WEST ); // bidi_hcg start // Set direction before setting text ( (LabelFigure) getFigure( ) ).setDirection( getTextDirection( ) ); // bidi_hcg end ( (LabelFigure) getFigure( ) ).setText( MESSAGE ); ( (LabelFigure) getFigure( ) ).setTextAlign( DesignChoiceConstants.TEXT_ALIGN_LEFT ); ( (LabelFigure) getFigure( ) ).setForegroundColor( ReportColorConstants.RedWarning ); ( (LabelFigure) getFigure( ) ).setDisplay( style.getDisplay( ) ); getFigure( ).setBorder( new LineBorder( 1 ) ); }
/** * 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 ); }
public TextAreaModelFigure() { 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); this.setBorder(new LineBorder()); this.setMinimumSize(new Dimension(RETURN_WIDTH * 2, RETURN_WIDTH * 2)); }
public VerticalBlockModelFigure() { // if (blockModel instanceof VerticalBlockModel) PageXYLayout vertical = new PageXYLayout(); //vertical.setSpacing(5); // setLayoutManager(new VerticalFillLayout()); // if (blockModel instanceof HorizontalBlockModel) // setLayoutManager(new HorizontalFillLayout()); // FlowLayout vertical = new FlowLayout(); // vertical.setSpacing(MAX_FLAG); // vertical.setVertical(true); setLayoutManager(vertical); setOpaque(true); setBackgroundColor(ColorConstants.white); // this.setBounds(rect) border = new LineBorder(); // border.setLabel("垂直容器"); border.setColor(color); border.setWidth(1); // FocusBorder focus = new FocusBorder(); // this.setBorder(border); // border = new TitleBarBorder("Table dsf"); setBorder(border); }
public DepartmentNodeFigure() { ToolbarLayout layout= new ToolbarLayout(); setLayoutManager(layout); label = new Label(); label.setLabelAlignment(PositionConstants.LEFT); label.setForegroundColor(ColorConstants.blue); label.setIcon(Activator.getDefault().getImageRegistry().get(Activator.STATE_MACHINE)); label.setPreferredSize(700, 50); label.setBorder(new MarginBorder(TOP_LEVEL_SPACE)); add(label); Figure line = new RectangleFigure(); line.setBackgroundColor(ColorConstants.lightGray); line.setForegroundColor(ColorConstants.lightGray); line.setPreferredSize(700, 1); add(line); figure = new Figure(); figure.setLayoutManager(new XYLayout()); add(figure); setBorder(new LineBorder(ColorConstants.lightGray, 1)); }
private Label createFigure(final String inTitle) { setOpaque(true); setLayoutManager(new XYLayout()); setBorder(new LineBorder(ColorConstants.black)); setBackgroundColor(GraphicalViewerCreator.BG_COLOR); setSize(RelationsConstants.ITEM_WIDTH, RelationsConstants.ITEM_HEIGHT); final Label outLabel = new Label(inTitle); outLabel.setOpaque(true); outLabel.setBackgroundColor(GraphicalViewerCreator.BG_COLOR); outLabel.setLabelAlignment(PositionConstants.LEFT); add(outLabel); setConstraint(outLabel, new Rectangle(ICON_WIDTH, 0, LABEL_WIDTH, RelationsConstants.ITEM_HEIGHT)); final ImageFigure lImage = new ImageFigure(image); add(lImage); setConstraint(lImage, new Rectangle(-1, -1, ICON_WIDTH, ICON_WIDTH)); return outLabel; }
/** * Constructs a new ClassFigure with the specified background color * and fonts. * @param bgColor the background color of the class * @param nameFont the font to use for the name label of the class * @param contentFont the font to use for properties and operations * @param stereotypeFont the font to use for the stereotype label */ public ClassFigure(Color bgColor, Font nameFont, Font contentFont, Font stereotypeFont) { ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(ColorConstants.black, 1)); setBackgroundColor(bgColor); setOpaque(true); mStereotypeLabel = new Label(""); mNameLabel = new Label(""); mStereotypeLabel.setFont(stereotypeFont); mNameLabel.setFont(nameFont); mContentFont = contentFont; mPropertiesFigure = new ClassSectionFigure(false); mOperationsFigure = new ClassSectionFigure(false); mOnionRelationshipsFigure = new ClassSectionFigure(true); reconstruct(); }
public GraphFigure() { layout = new XYLayout(); setLayoutManager(layout); name.setForegroundColor(ColorConstants.red); add(name); setConstraint(name, new Rectangle(5, 5, -1, -1)); setForegroundColor(ColorConstants.black); setBorder(new LineBorder(2)); }
public void setSelected(boolean isSelected) { LineBorder lineBorder = (LineBorder) getBorder(); lineBorder.setColor(isSelected ? ColorConstants.gray : ColorConstants.lightGray); lineBorder.setWidth(isSelected ? 3 : 2); erase(); repaint(); }
private void updateLook(IStackFrameModel model, boolean termination) { if(!invisible) { if(model.isObsolete() || termination) { setBackgroundColor(PandionJConstants.Colors.OBSOLETE); setBorder(new LineBorder(model.exceptionOccurred() ? PandionJConstants.Colors.ERROR : ColorConstants.lightGray, 2, SWT.LINE_DASH)); } else if(model.exceptionOccurred()) { setBackgroundColor(PandionJConstants.Colors.INST_POINTER); setBorder(new LineBorder(PandionJConstants.Colors.ERROR, PandionJConstants.STACKFRAME_LINE_WIDTH, SWT.LINE_DASH)); if(model.getExceptionType().equals(NullPointerException.class.getName())) paintNullRefs(); Label labelExc = new Label(PandionJConstants.Messages.prettyException(model.getExceptionType())); labelExc.setForegroundColor(PandionJConstants.Colors.ERROR); setToolTip(labelExc); } else if(model.isExecutionFrame()) setBackgroundColor(PandionJConstants.Colors.INST_POINTER); else setBackgroundColor(PandionJConstants.Colors.VIEW_BACKGROUND); } layout.layout(this); if(label != null && frame.getSourceFile() != null && frame.getLineNumber() != -1) label.setToolTip(new Label(frame.getSourceFile().getName() + " (line " + frame.getLineNumber() +")")); }
ValueLabel(String fixedValue, boolean isIndexLabel){ setText(fixedValue); setOpaque(!isIndexLabel); setPreferredSize(PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH); if(isIndexLabel){ FontManager.setFont(this, PandionJConstants.INDEX_FONT_SIZE); setLabelAlignment(SWT.CENTER); setForegroundColor(ColorConstants.gray); setToolTip(new Label(fixedValue)); }else{ FontManager.setFont(this, PandionJConstants.VALUE_FONT_SIZE); setBackgroundColor(ColorConstants.white); setBorder(new LineBorder(ColorConstants.black, PandionJConstants.ARRAY_LINE_WIDTH, SWT.LINE_SOLID)); } }
@Override public IFigure createFigure(IValueModel v) { label = new Label(""); label.setOpaque(true); label.setBackgroundColor(ColorConstants.white); label.setBorder(new LineBorder(1)); label.setFont(PandionJUI.getFont(14)); update(v, Integer.parseInt(v.getCurrentValue())); v.registerDisplayObserver((value) -> { update(v, Integer.parseInt(v.getCurrentValue())); }); return label; }
@Override protected IFigure createFigure() { ScalableFreeformLayeredPane layer = new ScalableFreeformLayeredPane(); layer.setLayoutManager(new FreeformLayout()); layer.setBorder(new LineBorder(1)); layer.addLayoutListener(LayoutAnimator.getDefault()); return layer; }
public DwTooltipFigure() { setOpaque(true); setBackgroundColor(ColorConstants.white); setBorder( new CompoundBorder( new LineBorder( ColorConstants.black, 2 ), new MarginBorder( 12 ))); message = new TextFlow(); message.setText(""); add(message); }
public void endLayout() { if (tagCount > tagsAdded) add(createLabel((tagCount - tagsAdded) + " more...", JFaceResources.getTextFont())); Dimension d = getPreferredSize(); int width = d.width+BORDER_WIDTH2; int height = d.height+BORDER_WIDTH2; Rectangle b = PlatformUI.getWorkbench().getDisplay().getClientArea(); width = width > b.width?b.width-30:width; height = height > b.height?b.height-50:height; setPreferredSize(width, height); setBorder(new LineBorder(Activator.BGCOLOR, BORDER_WIDTH)); }
/** * DeleteSignFigure * @param string */ public DeleteSignFigure(String string) { setBorder(new LineBorder(ColorConstants.black)); setLayoutManager(new StackLayout() { @SuppressWarnings("unchecked") public void layout(IFigure figure) { Rectangle rectangle = figure.getClientArea(); List children = figure.getChildren(); IFigure child; org.eclipse.draw2d.geometry.Dimension dimension; int sizeValue = children.size(); for (int i = 0; i < children.size(); i++) { if (!(children.get(i) instanceof RectangleFigure)) { child = (IFigure) children.get(i); dimension = child.getPreferredSize(rectangle.width, rectangle.height); dimension.width = Math.min(dimension.width, rectangle.width); dimension.height = Math.min(dimension.height, rectangle.height); Rectangle childRect = new Rectangle(rectangle.x + (rectangle.width - dimension.width) / 2, rectangle.y + (rectangle.height - dimension.height) / 2 + (int) (i * dimension.height) - (sizeValue * 3), dimension.width, dimension.height); child.setBounds(childRect); } } } }); Label nameLabel = new Label(string); add(nameLabel); }
/** * ClassFigure * @param isDangling */ public ClassFigure(boolean isDangling) { setDangling(isDangling); ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setOpaque(true); setBorder(new LineBorder(ColorConstants.black)); }
/** * EnumerationFigure * @param isDangling */ public EnumerationFigure(boolean isDangling) { setDangling(isDangling); ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setOpaque(true); setBorder(new LineBorder(ColorConstants.black)); }
/** * ComponentFigure */ public ComponentFigure(boolean isDangling) { setDangling(isDangling); ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(ColorConstants.black, 1)); setOpaque(true); }
/** * InterfaceFigure * @param isDangling */ public InterfaceFigure(boolean isDangling) { setDangling(isDangling); ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setOpaque(true); setBorder(new LineBorder(ColorConstants.black)); }
/** * @param stereotype * @param interfaceName * @param image */ public DataStoreNodeFigure() { ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.Black))); setBackgroundColor(FigureUtil.getFigureImage()); setOpaque(true); }
/** * @param stereotype * @param interfaceName * @param image */ public CentralBufferFigure(String name, Image image) { // ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.Black))); setBackgroundColor(FigureUtil.getFigureImage()); setOpaque(true); }
public AmbivalenceEndFigure(String name) { ToolbarLayout layout = new ToolbarLayout(); setLayoutManager(layout); setBorder(new LineBorder(ColorConstants.black, 1)); setBackgroundColor(classColor); setOpaque(true); org.eclipse.draw2d.Label label = new org.eclipse.draw2d.Label(); label.setText("Am"); add(label); org.eclipse.draw2d.Label label2 = new org.eclipse.draw2d.Label(); label2.setText("End"); add(label2); }
/** * Instantiates a new map figure. */ public CalloutFigure() { super(); setOpaque(true); setBackgroundColor(ColorConstants.yellow); setForegroundColor(ColorConstants.black); setBorder(new LineBorder(ColorConstants.orange, 1)); }
private void updateChildVisuals(int index) { List children = getContentPane().getChildren(); for (int i=index; i<children.size(); i++) { IFigure child = (IFigure) children.get(i); if (i%2 == 0) child.setBackgroundColor(ColorConstants.white); else child.setBackgroundColor(alternatingColor); child.setBorder(new LineBorder(alternatingBorderColor, 1) { @Override public void paint(IFigure figure, Graphics graphics, Insets insets) { tempRect.setBounds(getPaintRectangle(figure, insets)); if (getWidth() % 2 == 1) { tempRect.width--; tempRect.height--; } tempRect.shrink(getWidth() / 2, getWidth() / 2); graphics.setLineWidth(getWidth()); // Set the timeline horizontal line color if(horizontalLineColor != null) { graphics.setForegroundColor(horizontalLineColor); graphics.setBackgroundColor(horizontalLineColor); } else if (getColor() != null) { graphics.setForegroundColor(getColor()); graphics.setBackgroundColor(getColor()); } if(!isHorizontalLinesHidden) { // The timeline horizontal grid line graphics.drawLine(tempRect.getBottomLeft(), tempRect.getBottomRight()); } } }); } }
private void createZoomableCanvas(Composite parent) { FormData data = new FormData(); data.top = new FormAttachment(100, -100); data.left = new FormAttachment(100, -100); data.right = new FormAttachment(100, 0); data.bottom = new FormAttachment(100, 0); thumbnail = new FigureCanvas(parent, SWT.NONE); thumbnail.setBackground(ColorConstants.white); thumbnail.setLayoutData(data); tb = new ScrollableThumbnail(); tb.setBorder(new LineBorder(1)); thumbnail.setContents(tb); }
@Override protected Border createBorder() { MarginBorder marginBorder = new MarginBorder(PADDING - 1); LineBorder lineBorder = new LineBorder(1); lineBorder.setColor(ColorConstants.black); return new CompoundBorder(lineBorder, marginBorder); }
public CompartmentSegment(final EObject eObject, final ISegmentFigure innerSegment, final PrimitiveFigureFactory primitiveFactory) { super(eObject); setEntry(primitiveFactory.createCrossPoint(this)); setExit(primitiveFactory.createCrossPoint(this)); add(innerSegment); primitiveFactory.createConnection(getEntry(), innerSegment.getEntry(), this); primitiveFactory.createConnection(innerSegment.getExit(), getExit(), this); setBorder(new LineBorder(getForegroundColor(), 1, Graphics.LINE_DASH)); innerFigure = innerSegment; }