Package diva.canvas.toolbox

Examples of diva.canvas.toolbox.VectorFigure


                .getSelectionInteractor();
        BoundsManipulator manip = new BoundsManipulator();
        defaultInteractor.setPrototypeDecorator(manip);

        // Create a simple Vector Figure that draws a cross
        VectorFigure one = new VectorFigure();
        one.add(new Line2D.Double(0.0, 0.0, 100.0, 100.0));
        one.add(new Line2D.Double(100.0, 0.0, 0.0, 100.0));
        layer.add(one);
        one.setInteractor(defaultInteractor);

        // Here's a more complicated one, where we explicitly set the
        // shape to be a circle.
        VectorFigure two = new VectorFigure();
        Shape circle = new Ellipse2D.Double(0.0, 0.0, 100.0, 100.0);

        // Draw some filled circles
        two.fillMode();
        two.setShape(circle);
        two.add(Color.blue);
        two.add(circle);

        two.add(Color.yellow);
        two.add(new Ellipse2D.Double(10.0, 10.0, 80.0, 80.0));

        two.add(Color.red);
        two.add(new Ellipse2D.Double(20.0, 20.0, 60.0, 60.0));

        // Draw some lines
        two.lineMode();
        two.add(Color.black);
        two.add(new Line2D.Double(14.65, 14.65, 85.35, 85.35));
        two.add(new Line2D.Double(85.35, 14.65, 14.65, 85.35));

        two.translate(200, 100);
        layer.add(two);
        two.setInteractor(defaultInteractor);
    }
View Full Code Here

TOP

Related Classes of diva.canvas.toolbox.VectorFigure

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.