Package diva.canvas.toolbox

Examples of diva.canvas.toolbox.BasicEllipse


        FigureLayer layer = graphicsPane.getForegroundLayer();

        _rectangle = new BasicRectangle(50, 50, 80, 80, Color.black);
        layer.add(_rectangle);

        _circle = new BasicEllipse(150, 50, 80, 80, Color.green);
        layer.add(_circle);

        GeneralPath path = new GeneralPath();
        path.moveTo(120, 240);
        path.lineTo(240, 240);
View Full Code Here


                Color.blue);
        layer.add(blue);
        blue.setInteractor(dragger);

        // Create a circle and make it draggable
        BasicFigure red = new BasicEllipse(200.0, 200.0, 50.0, 50.0, Color.red);
        layer.add(red);
        red.setInteractor(dragger);
    }
View Full Code Here

    }

    /** Utility function to add the "ports" to the composite figure.
     */
    public void addPorts(CompositeFigure tc) {
        Figure p1 = new BasicEllipse(150.0, 100.0, 20.0, 20.0, Color.red);
        p1.translate(-10, -10);

        Figure p2 = new BasicEllipse(200.0, 150.0, 20.0, 20.0, Color.blue);
        p2.translate(-10, -10);

        Figure p3 = new BasicEllipse(150.0, 200.0, 20.0, 20.0, Color.yellow);
        p3.translate(-10, -10);

        Figure p4 = new BasicEllipse(100.0, 150.0, 20.0, 20.0, Color.magenta);
        p4.translate(-10, -10);

        tc.add(p1);
        tc.add(p2);
        tc.add(p3);
        tc.add(p4);

        p1.setInteractor(defaultInteractor);
        p2.setInteractor(defaultInteractor);
        p3.setInteractor(defaultInteractor);
        p4.setInteractor(defaultInteractor);
    }
View Full Code Here

     */
    public void createFigures() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        figureA = new BasicRectangle(10.0, 10.0, 100.0, 50.0, Color.red);
        figureB = new BasicEllipse(100.0, 100.0, 100.0, 100.0, Color.green);
        figureC = new BasicEllipse(300.0, 100.0, 100.0, 100.0, Color.blue);

        layer.add(figureA);
        layer.add(figureB);
        layer.add(figureC);
    }
View Full Code Here

                    || actor instanceof ListenFeedBackDelay;

            BasicFigure f;

            if (isEllipse) {
                f = new BasicEllipse(0, 0, _size, _size);
                f.setFillPaint(Color.blue);
            } else {
                f = new BasicRectangle(0, 0, _size, _size);
                f.setFillPaint(Color.pink);
            }
View Full Code Here

            ColorAttribute colorAttribute = (ColorAttribute) colorAttributes
                    .get(0);
            color = colorAttribute.asColor();
        }

        return new BasicEllipse(-10, -6, 6, 6, color, 1);
    }
View Full Code Here

                    || actor instanceof ContentionAlarm;

            BasicFigure f;

            if (isEllipse) {
                f = new BasicEllipse(0, 0, _size, _size);
            } else {
                f = new BasicRectangle(0, 0, _size, _size);
                f.setFillPaint(Color.blue);
            }
View Full Code Here

        rect.setStrokePaint(Color.red);
        figureLayer.add(rect);
        rect.setInteractor(selectionInteractor);

        // Here's an ellipse
        BasicEllipse oval = new BasicEllipse(160.0, 10.0, 120.0, 80.0);
        oval.setLineWidth(2);
        oval.setFillPaint(Color.magenta);
        figureLayer.add(oval);
        oval.setInteractor(selectionInteractor);

        // Create a star using a general path object
        Polygon2D p = new Polygon2D.Double();
        p.moveTo(-100.0f, -25.0f);
        p.lineTo(+100.0f, -25.0f);
View Full Code Here

            // Add to the layer
            layer.add(labelFigure);
            labelFigure.setInteractor(defaultInteractor);

            // Draw a small circle there so we can see it
            Figure mark = new BasicEllipse(pt.getX() - 2, pt.getY() - 2, 4, 4,
                    Color.red);
            layer.add(mark);
        }
    }
View Full Code Here

     * attached to any arbitrary figure.
     */
    public void createLabeledWrappers() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        Figure a = new BasicEllipse(420, 100, 100, 50);
        LabelWrapper wrapperA = new LabelWrapper(a, "Foo!\nBar!\nBaz!");
        layer.add(wrapperA);
        wrapperA.setInteractor(defaultInteractor);

        Figure b = new BasicRectangle(460, 200, 50, 40, Color.green);
View Full Code Here

TOP

Related Classes of diva.canvas.toolbox.BasicEllipse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.