Package java.awt

Examples of java.awt.Polygon.translate()


        } else {
            for (int y = startY; y <= endY; y++) {
                grid = createGridPolygon(startX, y, 1);
                for (int x = startX; x <= endX; x++) {
                    g2d.drawPolygon(Converter.getPolygonArray(grid));
                    grid.translate(tileSize.x + 1, 0);
                }
            }
        }
    }
View Full Code Here


      int bottomY = (int)(.81 * r);
     
      int[] xPoints = new int[]{ 0, topX, bottomX, -bottomX, -topX };
      int[] yPoints = new int[]{ -(int)r, topY, bottomY, bottomY, topY };
      Polygon pentagon = new Polygon(xPoints, yPoints, 5);
      pentagon.translate(x+width/2, y+width/2);
 
      // draw
      g.drawPolygon(pentagon);
    }
  }
View Full Code Here

    BufferedImage merge = new BufferedImage(bounds.width, bounds.height, BufferedImage.TYPE_INT_ARGB);
    Graphics drawG = merge.getGraphics();
    drawG.drawImage(steeringWheel, 0, 0, null);
    g.drawImage(merge, bounds.x, bounds.y, null);
    Polygon poly = painter.getSteeringWheelHandle((int)Math.rint(getPreferredSize().getWidth()), castValue());
    poly.translate(bounds.x, bounds.y);
    handle = poly;
    if (!paintLabels()) paintCurrentLabel(g, (int)Math.rint(castValue(getSelectedIndex())));
    else paintLabels(g);
  }
View Full Code Here

   * Paint the label over the center of the tracker handle (commonly known as thumb)
   */
  private void paintHorizontalLabel(Graphics g, int value) {
    Rectangle bounds = getBounds();
    Polygon poly = painter.getSteeringWheelHandle((int)Math.rint(bounds.getWidth()), castValue(value));
    poly.translate(bounds.x, bounds.y)
    Rectangle rect = poly.getBounds();
    Label label = new Label(metric);
    label.setText(getItem(value));
    label.setFont(getFont());
    paintLabelAt(g, label, rect);
View Full Code Here

    int bottomY = (int)(.81 * r);
   
    int[] xPoints = new int[]{ 0, topX, bottomX, -bottomX, -topX };
    int[] yPoints = new int[]{ -(int)r, topY, bottomY, bottomY, topY };
    Polygon pentagon = new Polygon(xPoints, yPoints, 5);
    pentagon.translate(x+width/2, y+width/2);

    // draw
    g.drawPolygon(pentagon);
  }

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.