Package java.awt

Examples of java.awt.Graphics2D.fillPolygon()


      // fill color
      g.setColor(java.awt.Color.WHITE);
      int x = Math.min(width-1, (int) (stop.w*width));
      int[] xPoints = { x-5, x, x+5 };
      int[] yPoints = { 0, 15, 0 };
      g.fillPolygon(xPoints, yPoints, 3);

      // border color
      boolean isEndpoint = index == 0 || index == gradient.size()-1;
      if (isEndpoint) {
        g.setColor(java.awt.Color.GRAY);
View Full Code Here


      g.setColor(java.awt.Color.BLACK);
    }
    int x = Math.min(width-1, (int) (stop.w*width));
    int[] xPoints = { x-5, x, x+5 };
    int[] yPoints = { 0, 15, 0 };
    g.fillPolygon(xPoints, yPoints, 3);

    // border color
    g.setColor(java.awt.Color.WHITE);
    g.drawLine(x-5, 0, x, 15);
    g.drawLine(x, 15, x+5, 0);
View Full Code Here

    // fill color
    g.setColor(java.awt.Color.WHITE);
    int x = Math.min(width-1, (int) (markerPos * width));
    int[] xPoints = { x-MARKER_WIDTH, x, x+MARKER_WIDTH };
    int[] yPoints = { 0, MARKER_HEIGHT, 0 };
    g.fillPolygon(xPoints, yPoints, 3);

    g.setColor(java.awt.Color.BLACK);
    g.drawLine(x-MARKER_WIDTH, 0, x, MARKER_HEIGHT);
    g.drawLine(x, MARKER_HEIGHT, x+MARKER_WIDTH, 0);
    g.drawLine(x-MARKER_WIDTH, 0, x+MARKER_WIDTH, 0);
View Full Code Here

        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            g2.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
            g2.setColor(comment.getBorderColor().darker());
            g2.fillPolygon(xpoints, ypoints, 3);
        }

        /**
         * Set the three x coordinates of the triangle (in the coordinate system containing the comment and commentSource)
         * @param x1
View Full Code Here

        int[] xs = new int[]{1,3,4,6,9,14,14};
        int[] ys = new int[]{14,9,6,4,3,1,14};
        int nb = 7;
        gc.setColor(c);
        gc.fillPolygon( xs, ys, nb);
        gc.setColor(f);
        gc.drawPolygon( xs, ys, nb);
        return bi;
    }
View Full Code Here

        xPoints[0] = x;
        xPoints[1] = x - handleWidth / 2;
        xPoints[2] = x + handleWidth / 2;
        if (i == selectedIndex) {
          g.setColor(colors.get(i));
          g.fillPolygon(xPoints, yPoints, 3);
          g.fillRect(xPoints[1], yPoints[1] + 2, handleWidth + 1, 2);
          g.setColor(Color.black);
        }
        g.drawPolygon(xPoints, yPoints, 3);
      }
View Full Code Here

        xPoints[0] = x;
        xPoints[1] = x - handleWidth / 2;
        xPoints[2] = x + handleWidth / 2;
        if (i == selectedIndex) {
          g.setColor(colors.get(i));
          g.fillPolygon(xPoints, yPoints, 3);
          g.fillRect(xPoints[1], yPoints[1] + 2, handleWidth + 1, 2);
          g.setColor(Color.black);
        }
        g.drawPolygon(xPoints, yPoints, 3);
      }
View Full Code Here

        xPoints[0] = x;
        xPoints[1] = x - handleWidth / 2;
        xPoints[2] = x + handleWidth / 2;
        if (i == selectedIndex) {
          g.setColor(colors.get(i));
          g.fillPolygon(xPoints, yPoints, 3);
          g.fillRect(xPoints[1], yPoints[1] + 2, handleWidth + 1, 2);
          g.setColor(Color.black);
        }
        g.drawPolygon(xPoints, yPoints, 3);
      }
View Full Code Here

        }
        if (highlighted || popupVisible) {
            size = HOVER_ARROW_SIZE;
        }
        if (!sameFrom) {
            g.fillPolygon(
                    new int[]{from.x - size / 2, from.x + size / 2, from.x},
                    new int[]{from.y - size / 2, from.y - size / 2, from.y + size / 2},
                    3);
        }
        if (!sameTo) {
View Full Code Here

                    new int[]{from.x - size / 2, from.x + size / 2, from.x},
                    new int[]{from.y - size / 2, from.y - size / 2, from.y + size / 2},
                    3);
        }
        if (!sameTo) {
            g.fillPolygon(
                    new int[]{to.x - size / 2, to.x + size / 2, to.x},
                    new int[]{to.y - size / 2, to.y - size / 2, to.y + size / 2},
                    3);
        }
        g.setStroke(oldStroke);
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.