Java 类org.eclipse.draw2d.Ellipse 实例源码

项目:statecharts    文件:FinalStateFigure.java   
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);
}
项目:jive    文件:MessageFigure.java   
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);
}
项目:jive    文件:MessageFigure.java   
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);
}
项目:seg.jUCMNav    文件:TimerFigure.java   
/**
 * 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);

}
项目:neoscada    文件:EllipseController.java   
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 );
}
项目:gw4e.project    文件:StartVertexFigure.java   
protected void createLayout () {
    setLayoutManager(new XYLayout());
    setBackgroundColor(Activator.getStartVertexImageColor());
    setOpaque(true);
    this.setBorder(null); 
    ellipse = new Ellipse();
    add(ellipse);
    name = new Label("");
    add(name);

}
项目:gemoc-studio    文件:PossibleStepEditPart.java   
/**
 * 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;
}
项目:NEXCORE-UML-Modeler    文件:ClassFigure.java   
/**
 * @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);
    }
}
项目:statecharts    文件:EntryEditPart.java   
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();
}
项目:seg.jUCMNav    文件:EmptyPointFigure.java   
/**
 * 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);
}
项目:seg.jUCMNav    文件:OrForkJoinFigure.java   
/**
 * 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);
}
项目:lunifera-sharky-m2m    文件:ShapeEditPart.java   
/**
 * 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();
    }
}
项目:lunifera-sharky-m2m    文件:ShapeEditPart.java   
/**
 * 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();
    }
}
项目:OnionUmlVisualization    文件:HyperClassElementEditPart.java   
@Override
protected IFigure createFigure() {
    IFigure f = new Ellipse();
    f.setBackgroundColor(ColorConstants.black);
    f.setSize(6, 6);
    return f;
}
项目:statecharts    文件:FinalStateEditPart.java   
@Override
public Ellipse createPrimaryShape() {
    return new FinalStateFigure(getMapMode());
}
项目:snaker-designer    文件:EllipseElementFigure.java   
protected void customizeFigure() {
    this.ellipse = new Ellipse();
    add(this.ellipse, 0);
    this.ellipse.setBounds(getBounds());
    setSize(40, 40);
}
项目:seg.jUCMNav    文件:StartPointFigure.java   
/**
 * 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);
}
项目:lunifera-sharky-m2m    文件:CursorShapeEditPart.java   
/**
 * Return a new Ellipse which will be used as a cursor
 */
private IFigure createFigureForModel() {
    return new Ellipse();
}
项目:lunifera-sharky-m2m    文件:CursorShapeEditPart.java   
/**
 * Return a new Ellipse which will be used as a cursor
 */
private IFigure createFigureForModel() {
    return new Ellipse();
}
项目:gemoc-studio    文件:PossibleStepEditPart.java   
/**
 * Gets the {@link Ellipse}.
 * 
 * @return the {@link Ellipse}
 */
public Ellipse getEllipse() {
    return ellipse;
}