Package java.awt

Examples of java.awt.Polygon$PolygonPathIterator


        da2.setLinePaint(Color.lightGray);
        da2.setStroke(new BasicStroke(2));

        int[] xpoints = new int[] { 15, 15, 50, 50, 90, 50, 50, 15 };
        int[] ypoints = new int[] { 30, 70, 70, 90, 50, 10, 30, 30 };
        Shape shape = new Polygon(xpoints, ypoints, xpoints.length);

        BasicIconPart testPart = new BasicIconPart(shape);
        testPart.setRenderingAttributes(da);
        testPart.setGradient(true);
View Full Code Here


        ip.setRenderingAttributes(invisDa);
        invisibleImage = OMIconFactory.getIcon(buttonSize, buttonSize, ip);

        IconPartList ipl = new IconPartList();

        Polygon triangle = new Polygon(new int[] { 50, 90, 10, 50 }, new int[] {
                10, 90, 90, 10 }, 4);

        BasicIconPart bip = new BasicIconPart(triangle);
        bip.setRenderingAttributes(yellowDa);
        ipl.add(bip);
View Full Code Here

    int[] py = new int[edges];
    for (int i=0; i<edges; ++i) {
      px[i] = _ox + _x + (int)Math.round((x[i] + 1.0) * (_w-1) / 2.0); // From 0 to width-1, included
      py[i] = _oy + _y -1 - (int)Math.round((y[i] + 1.0) * (_h-1) / 2.0); // From 0 to height-1, included
    }
    polygon = new Polygon(px,py,edges);
  }
View Full Code Here

        double  theta = Math.atan2((slopeEndposY-posY),(slopeEndposX-posX));

        AffineTransform affineTransform = new AffineTransform();
        affineTransform.setToTranslation(slopeEndposX, slopeEndposY);
        affineTransform.rotate(theta);
        Polygon first = new Polygon(new int[] {-5,0,-5},new int[] {2,0,-2},3);
        Shape firstArrow = affineTransform.createTransformedShape(first);
        g2.fill(firstArrow);
        g2.draw(firstArrow);

        // Restore old preferences
View Full Code Here

    /* (non-Javadoc)
     * @see jsynoptic.plugins.circuit.RectangleCircuitComponent#createSymbol()
     */
    protected Polygon[] createSymbol(){
        Polygon[] res = new Polygon[2];
        res[0] = new Polygon(new int[] {3,6,6,8,6,6,3},new int[] {4,4,3,5,7,6,6},7);
        res[1] = new Polygon(new int[] {1,1,3,3,2,2,3,3},new int[] {2,8,8,7,7,3,3,2},8);

        return res;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see jsynoptic.plugins.circuit.RectangleCircuitComponent#createSymbol()
     */
    protected Polygon[] createSymbol(){
        Polygon[] res = new Polygon[2];
        res[0] = new Polygon(new int[] {2,5,5,7,5,5,2},new int[] {4,4,3,5,7,6,6},7);
        res[1] = new Polygon(new int[] {6,6,7,7,6,6,8,8},new int[] {2,3,3,7,7,8,8,2},8);
       
        return res;
    }
View Full Code Here

    if (coordinates == null || coordinates.length == 0 || coordinates.length % 2 != 0)
    {
      throw new JRRuntimeException("A polygon must have an even number of coordinates");
    }
   
    Polygon polygon = new Polygon();
   
    int i;
    for (i = 0; i < coordinates.length - 2; i += 2)
    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }
    if (coordinates[i] != coordinates[0] || coordinates[i + 1] != coordinates[1])
    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }

    return polygon;
  }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jpox.store.mapping.JavaTypeMapping#setObject(org.jpox.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
    {
      Polygon poly = (Polygon)value;
        if (poly == null)
        {
            getDataStoreMapping(0).setObject(preparedStatement, exprIndex[0], null);
            getDataStoreMapping(1).setObject(preparedStatement, exprIndex[1], null);
            getDataStoreMapping(2).setObject(preparedStatement, exprIndex[2], null);
View Full Code Here

        }

        int[] xpoints = (int[])getDataStoreMapping(0).getObject(resultSet,exprIndex[0]);
        int[] ypoints = (int[])getDataStoreMapping(1).getObject(resultSet,exprIndex[1]);
        int npoints = getDataStoreMapping(2).getInt(resultSet,exprIndex[2]);
        return new Polygon(xpoints, ypoints, npoints);
    }
View Full Code Here

     * @param value The overall value for this java type
     * @return The value for this datastore index
     */
    public Object getValueForDatastoreMapping(NucleusContext nucleusCtx, int index, Object value)
    {
        Polygon poly = (Polygon)value;
        if (index == 0)
        {
            return poly.xpoints;
        }
        else if (index == 1)
View Full Code Here

TOP

Related Classes of java.awt.Polygon$PolygonPathIterator

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.