Package java.awt

Examples of java.awt.Graphics2D.fillPolygon()


            // I tried antialiased with simple coordinates. Didn't look ideal that way either.
            // Also, I'm not sure what this will look like outside Mac. Some rendering might be slightly different.
            // Current problem is that it leaves a pixel or two uncovered.
            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
            g.setColor(raised ? Color.WHITE : Color.BLACK);
            g.fillPolygon(new int[]{0, getWidth() - 1, getWidth() - 1 - borderWidth, borderWidth},
                    new int[]{0, 0, borderHeight, borderHeight}, 4);
            g.setColor(raised ? new Color(0xC0C0C0) : new Color(0x404040));
            g.fillPolygon(new int[]{0, borderWidth, borderWidth, 0},
                    new int[]{1, borderHeight + 1, getHeight() - 1 - borderHeight, getHeight() - 1}, 4);
            g.setColor(raised ? new Color(0x404040) : new Color(0xC0C0C0));
View Full Code Here


            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
            g.setColor(raised ? Color.WHITE : Color.BLACK);
            g.fillPolygon(new int[]{0, getWidth() - 1, getWidth() - 1 - borderWidth, borderWidth},
                    new int[]{0, 0, borderHeight, borderHeight}, 4);
            g.setColor(raised ? new Color(0xC0C0C0) : new Color(0x404040));
            g.fillPolygon(new int[]{0, borderWidth, borderWidth, 0},
                    new int[]{1, borderHeight + 1, getHeight() - 1 - borderHeight, getHeight() - 1}, 4);
            g.setColor(raised ? new Color(0x404040) : new Color(0xC0C0C0));
            g.fillPolygon(new int[]{getWidth() - borderWidth - 1, getWidth() - 1, getWidth() - 1, getWidth() - borderWidth - 1},
                    new int[]{borderHeight + 1, 1, getHeight() - 1, getHeight() - 1 - borderHeight}, 4);
            g.setColor(raised ? Color.BLACK : Color.WHITE);
View Full Code Here

                    new int[]{0, 0, borderHeight, borderHeight}, 4);
            g.setColor(raised ? new Color(0xC0C0C0) : new Color(0x404040));
            g.fillPolygon(new int[]{0, borderWidth, borderWidth, 0},
                    new int[]{1, borderHeight + 1, getHeight() - 1 - borderHeight, getHeight() - 1}, 4);
            g.setColor(raised ? new Color(0x404040) : new Color(0xC0C0C0));
            g.fillPolygon(new int[]{getWidth() - borderWidth - 1, getWidth() - 1, getWidth() - 1, getWidth() - borderWidth - 1},
                    new int[]{borderHeight + 1, 1, getHeight() - 1, getHeight() - 1 - borderHeight}, 4);
            g.setColor(raised ? Color.BLACK : Color.WHITE);
            g.fillPolygon(new int[]{borderWidth + 1, getWidth() - borderWidth - 2, getWidth() - 2, 1},
                    new int[]{getHeight() - borderHeight - 1, getHeight() - borderHeight - 1, getHeight() - 1, getHeight() - 1
            },
View Full Code Here

                    new int[]{1, borderHeight + 1, getHeight() - 1 - borderHeight, getHeight() - 1}, 4);
            g.setColor(raised ? new Color(0x404040) : new Color(0xC0C0C0));
            g.fillPolygon(new int[]{getWidth() - borderWidth - 1, getWidth() - 1, getWidth() - 1, getWidth() - borderWidth - 1},
                    new int[]{borderHeight + 1, 1, getHeight() - 1, getHeight() - 1 - borderHeight}, 4);
            g.setColor(raised ? Color.BLACK : Color.WHITE);
            g.fillPolygon(new int[]{borderWidth + 1, getWidth() - borderWidth - 2, getWidth() - 2, 1},
                    new int[]{getHeight() - borderHeight - 1, getHeight() - borderHeight - 1, getHeight() - 1, getHeight() - 1
            },
                    4);
        } finally {
            g.dispose();
View Full Code Here

      AffineTransform at = AffineTransform.getTranslateInstance(x1, y1);
      at.concatenate(AffineTransform.getRotateInstance(angle));
      g2.transform(at);
     
      g2.drawLine(0, 0, len, 0);
      g2.fillPolygon(new int[]{len, len-ARROW_H, len-ARROW_H, len}, new int[]{0, -ARROW_W, ARROW_W, 0}, 4);
    }

}
View Full Code Here

      xInts[i] = (int) temp.x;
      yInts[i] = (int) temp.y;
    }
    g.setStroke(stroke);
    g.setColor(f);
    g.fillPolygon(xInts, yInts, vertexCount);
    g.setColor(s);
    g.drawPolygon(xInts, yInts, vertexCount);
    restoreState(g);
  }
View Full Code Here

   
    for (int i=0;i<list.size();i++) {
      ControlPoint pt = (ControlPoint) list.get(i);
      g.translate(10+(width * pt.pos),y+barHeight);
      g.setColor(pt.col);
      g.fillPolygon(poly);
      g.setColor(Color.black);
      g.drawPolygon(poly);
     
      if (pt == selected) {
        g.drawLine(-5, 12, 5, 12);
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.