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); }
FoundMessageFigure(final boolean isTransparent) { super(isTransparent); final Ellipse circle = new Ellipse(); circle.setBackgroundColor(ColorConstants.lightGray); circle.setLineWidth(1); final Rectangle bounds = Rectangle.SINGLETON; final int diameter = PreferencesPlugin.getDefault().eventHeight(); bounds.x = 0; bounds.y = 0; bounds.width = diameter; bounds.height = diameter; circle.setBounds(bounds); final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, false); locator.setUDistance(0); locator.setVDistance(0); add(circle, locator); }
LostMessageFigure(final boolean isTransparent, final boolean isException) { super(isTransparent, isException); final Ellipse circle = new Ellipse(); circle.setBackgroundColor(ColorConstants.lightGray); circle.setLineWidth(1); final Rectangle bounds = Rectangle.SINGLETON; final int diameter = PreferencesPlugin.getDefault().eventHeight(); bounds.x = 0; bounds.y = 0; bounds.width = diameter; bounds.height = diameter; circle.setBounds(bounds); final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(this, true); locator.setUDistance(0); locator.setVDistance(0); add(circle, locator); }
/** * Creates a filled circle containing an L like segment to simulate a clock. * * @see seg.jUCMNav.figures.PathNodeFigure#createFigure() */ protected void createFigure() { ellipse = new Ellipse(); // we're making it larger than the empty point. ellipse.setBounds(new Rectangle(preferredSize.width / 8, preferredSize.height / 8, DEFAULT_WIDTH * 3 / 4, DEFAULT_HEIGHT * 3 / 4)); ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref()); poly = new Polyline(); poly.addPoint(new Point(DEFAULT_WIDTH / 2, preferredSize.height / 8)); poly.addPoint(new Point(DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2)); poly.addPoint(new Point(preferredSize.width * 7 / 8, DEFAULT_HEIGHT / 2)); poly.setAntialias(GeneralPreferencePage.getAntialiasingPref()); ellipse.add(poly); ellipse.setLineWidth(2); ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref()); poly.setLineWidth(2); add(ellipse); }
public EllipseController ( final SymbolController controller, final org.eclipse.scada.vi.model.Ellipse element, final ResourceManager manager ) { super ( controller, manager ); final PrecisionRectangle rect = new PrecisionRectangle (); if ( element.getSize () != null ) { rect.setPreciseSize ( element.getSize ().getWidth (), element.getSize ().getHeight () ); } this.figure = new Ellipse () { @Override public void addNotify () { super.addNotify (); start (); } @Override public void removeNotify () { stop (); super.removeNotify (); } }; this.figure.setBounds ( rect ); controller.addElement ( element, this ); applyCommon ( element ); }
protected void createLayout () { setLayoutManager(new XYLayout()); setBackgroundColor(Activator.getStartVertexImageColor()); setOpaque(true); this.setBorder(null); ellipse = new Ellipse(); add(ellipse); name = new Label(""); add(name); }
/** * Creates the {@link Ellipse} of the main {@link IFigure}. * * @return the {@link Ellipse} of the main {@link IFigure} */ private Ellipse createEllipse() { final Ellipse res = new Ellipse(); res.setSize(SIZE, SIZE); res.setForegroundColor(ColorConstants.listBackground); return res; }
/** * @see org.eclipse.draw2d.Figure#add(org.eclipse.draw2d.IFigure, * java.lang.Object, int) */ @Override public void add(IFigure figure, Object constraint, int index) { if (!(figure instanceof Ellipse)) { super.add(figure, constraint, index); } }
protected Ellipse createPrimaryShape() { switch (resolveSemanticElement().getKind()) { case DEEP_HISTORY: return new DeepHistoryFigure(); case SHALLOW_HISTORY: return new ShallowHistoryFigure(); case INITIAL: return new InitialStateFigure(); } throw new IllegalStateException(); }
/** * A simple filled circle taking up half the available space. * * @see seg.jUCMNav.figures.PathNodeFigure#createFigure() */ protected void createFigure() { ellipse = new Ellipse(); ellipse.setBounds(new Rectangle(preferredSize.width / 4, preferredSize.height / 4, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2)); ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref()); add(ellipse); }
/** * An invisible ellipse two which to bind the anchors; not used otherwise. * * @see seg.jUCMNav.figures.PathNodeFigure#createFigure() */ protected void createFigure() { ellipse = new Ellipse(); ellipse.setBounds(new Rectangle(preferredSize.width / 4, preferredSize.height / 4, 0, 0)); // Size: 0 (invisible) ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref()); add(ellipse); }
/** * Return a IFigure depending on the instance of the current model element. * This allows this EditPart to be used for both sublasses of Shape. */ private IFigure createFigureForModel() { if (getModel() instanceof EllipticalShape) { return new Ellipse(); } else if (getModel() instanceof RectangularShape) { return new RectangleFigure(); } else { // if Shapes gets extended the conditions above must be updated throw new IllegalArgumentException(); } }
@Override protected IFigure createFigure() { IFigure f = new Ellipse(); f.setBackgroundColor(ColorConstants.black); f.setSize(6, 6); return f; }
@Override public Ellipse createPrimaryShape() { return new FinalStateFigure(getMapMode()); }
protected void customizeFigure() { this.ellipse = new Ellipse(); add(this.ellipse, 0); this.ellipse.setBounds(getBounds()); setSize(40, 40); }
/** * An ellipse that fills 2/3 of the area. * * @see seg.jUCMNav.figures.PathNodeFigure#createFigure() */ protected void createFigure() { int width = preferredSize.width; int height = preferredSize.height; ellipse = new Ellipse(); ellipse.setBounds(new Rectangle(13, 13, 16, 16)); ellipse.setBackgroundColor(ColorManager.LINE); ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref()); add(ellipse); // create the text inside the main figure flowPage = new FlowPage(); stubTypeText = new TextFlow(); stubTypeText.setLayoutManager(new SimpleTextLayout(stubTypeText)); // TODO CONCERNS: should use default font? stubTypeText.setFont(new Font(null, "Verdana", 12, SWT.BOLD)); //$NON-NLS-1$ stubTypeText.setText("F"); //$NON-NLS-1$ stubTypeText.setForegroundColor(ColorManager.WHITE); flowPage.add(stubTypeText); // TODO CONCERNS: depends on font size! flowPage.setBounds(new Rectangle(16, 12, 20, 20)); flowPage.setVisible(false); add(flowPage); // The lightning for an abort failure point PointList pts = new PointList(); pts.addPoint(23, 27); pts.addPoint(27, 33); pts.addPoint(20, 32); pts.addPoint(28, 42); pts.addPoint(28, 37); pts.addPoint(28, 42); pts.addPoint(23, 41); lightning = new Polyline(); lightning.setLineWidth(2); lightning.setAntialias(GeneralPreferencePage.getAntialiasingPref()); lightning.setPoints(pts); lightning.setVisible(false); add(lightning); bar = new Polyline(); bar.addPoint(new Point(15, 15)); bar.addPoint(new Point(27, 27)); bar.setLineWidth(3); bar.setVisible(false); bar.setForegroundColor(ColorManager.WHITE); add(bar); }
/** * Return a new Ellipse which will be used as a cursor */ private IFigure createFigureForModel() { return new Ellipse(); }
/** * Gets the {@link Ellipse}. * * @return the {@link Ellipse} */ public Ellipse getEllipse() { return ellipse; }