Examples of PaintedList


Examples of diva.util.java2d.PaintedList

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

        // Create the graphic
        PaintedList graphic = new PaintedList();

        Polygon2D polygon = new Polygon2D.Double();
        polygon.moveTo(30, 50);
        polygon.lineTo(70, 80);
        polygon.lineTo(70, 20);
        graphic.add(new PaintedShape(polygon, Color.red, 1.0f));

        Line2D line1 = new Line2D.Double(10, 50, 30, 50);
        graphic.add(new PaintedPath(line1));

        Line2D line2 = new Line2D.Double(70, 50, 90, 50);
        graphic.add(new PaintedPath(line2));

        // Create the icon
        BasicRectangle background = new BasicRectangle(0, 0, 100, 100,
                Color.green.brighter().brighter());
        IconFigure _icon1 = new IconFigure(background, graphic);
View Full Code Here

Examples of diva.util.java2d.PaintedList

    /** Create a new blank figure.
     */
    public PaintedFigure() {
        super();
        _paintedList = new PaintedList();
    }
View Full Code Here

Examples of diva.util.java2d.PaintedList

            icon.addTerminal(east, SwingConstants.EAST, 50);
        }

        public Figure createFigure() {
            // Create the graphic
            PaintedList graphic = new PaintedList();

            Polygon2D polygon = new Polygon2D.Double();
            polygon.moveTo(30, 50);
            polygon.lineTo(70, 80);
            polygon.lineTo(70, 20);
            graphic.add(new PaintedShape(polygon, Color.red, 1.0f));

            Line2D line1 = new Line2D.Double(10, 50, 30, 50);
            graphic.add(new PaintedPath(line1));

            Line2D line2 = new Line2D.Double(70, 50, 90, 50);
            graphic.add(new PaintedPath(line2));

            // Create the icon
            BasicRectangle background = new BasicRectangle(0, 0, 100, 100,
                    Color.green);
            IconFigure icon = new IconFigure(background, graphic);
View Full Code Here

Examples of diva.util.java2d.PaintedList

            XmlDocument document = new XmlDocument((URL) null);
            XmlReader reader = new XmlReader();
            reader.parse(document, in);

            XmlElement root = document.getRoot();
            PaintedList paintedList = SVGParser.createPaintedList(root);
            figure = new PaintedFigure(paintedList);
        } catch (Exception ex) {
            return super.createIcon();
        }
View Full Code Here

Examples of diva.util.java2d.PaintedList

    /** Given an XmlElement, create a PaintedList.
     *  @param root The XmlElement.
     *  @return The PaintedList.
     */
    public static PaintedList createPaintedList(XmlElement root) {
        PaintedList list = new PaintedList();
        String name = root.getType();

        if (!name.equals("svg")) {
            throw new IllegalArgumentException("Input XML has a root"
                    + "name which is '" + name + "' instead of 'svg':" + root);
        }

        Iterator children = root.elements();

        while (children.hasNext()) {
            XmlElement child = (XmlElement) children.next();
            PaintedObject object = createPaintedObject(child.getType(), child
                    .getAttributeMap(), child.getPCData());

            if (object != null) {
                list.add(object);
            }
        }

        return list;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.