Package diva.util.java2d

Examples of diva.util.java2d.Polygon2D.lineTo()


        // 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));
View Full Code Here


        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));
View Full Code Here

        } else if (type.equals("polygon")) {
            Polygon2D poly = new Polygon2D.Double();
            poly.moveTo(coords[0], coords[1]);

            for (int i = 2; i < coords.length; i += 2) {
                poly.lineTo(coords[i], coords[i + 1]);
            }

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
View Full Code Here

            } else {
                Polyline2D poly = new Polyline2D.Double();
                poly.moveTo(coords[0], coords[1]);

                for (int i = 2; i < coords.length; i += 2) {
                    poly.lineTo(coords[i], coords[i + 1]);
                }

                s = poly;
            }
View Full Code Here

        } else if (type.equals("polygon")) {
            Polygon2D poly = new Polygon2D.Double();
            poly.moveTo(coords[0], coords[1]);

            for (int i = 2; i < coords.length; i += 2) {
                poly.lineTo(coords[i], coords[i + 1]);
            }

            poly.closePath();

            PaintedShape ps = new PaintedShape(poly);
View Full Code Here

            } else {
                Polyline2D poly = new Polyline2D.Double();
                poly.moveTo(coords[0], coords[1]);

                for (int i = 2; i < coords.length; i += 2) {
                    poly.lineTo(coords[i], coords[i + 1]);
                }

                s = poly;
            }
View Full Code Here

        case BLOB_DIAMOND:

            Polygon2D polygon = new Polygon2D.Float();
            polygon.moveTo(_originX, _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY - _unit);
            polygon.lineTo(_originX + (3.0 * _unit), _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY + _unit);
            polygon.lineTo(_originX, _originY);
            polygon.closePath();
            _shape = polygon;
View Full Code Here

        case BLOB_DIAMOND:

            Polygon2D polygon = new Polygon2D.Float();
            polygon.moveTo(_originX, _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY - _unit);
            polygon.lineTo(_originX + (3.0 * _unit), _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY + _unit);
            polygon.lineTo(_originX, _originY);
            polygon.closePath();
            _shape = polygon;
            break;
View Full Code Here

            Polygon2D polygon = new Polygon2D.Float();
            polygon.moveTo(_originX, _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY - _unit);
            polygon.lineTo(_originX + (3.0 * _unit), _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY + _unit);
            polygon.lineTo(_originX, _originY);
            polygon.closePath();
            _shape = polygon;
            break;
        }
View Full Code Here

            Polygon2D polygon = new Polygon2D.Float();
            polygon.moveTo(_originX, _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY - _unit);
            polygon.lineTo(_originX + (3.0 * _unit), _originY);
            polygon.lineTo(_originX + (1.5 * _unit), _originY + _unit);
            polygon.lineTo(_originX, _originY);
            polygon.closePath();
            _shape = polygon;
            break;
        }

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.