Package java.awt

Examples of java.awt.Graphics.fillPolygon()


            plus(gFill);
            cross(gFill);
            break;
        case Constants.PS_TRIANGLEDOWN:
            gFill.setColor( this.getForeground() );
            gFill.fillPolygon(
                    new int[] {0, getWidth(), getWidth() / 2}, // X points
                    new int[] {0, 0, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLELEFT:
View Full Code Here


                    new int[] {0, 0, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLELEFT:
            gFill.setColor( this.getForeground() );
            gFill.fillPolygon(
                    new int[] {0, getWidth(), getWidth()}, // X points
                    new int[] {getHeight() / 2, 0, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLERIGHT:
View Full Code Here

                    new int[] {0, getWidth(), getWidth()}, // X points
                    new int[] {getHeight() / 2, 0, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLERIGHT:
            gFill.fillPolygon(
                    new int[] {0, getWidth(), 0}, // X points
                    new int[] {0, getHeight() / 2, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLEUP:
View Full Code Here

                    new int[] {0, getHeight() / 2, getHeight()}, // Y points
                    3);
            break;
        case Constants.PS_TRIANGLEUP:
            gFill.setColor( this.getForeground() );
            gFill.fillPolygon(
                    new int[] {getWidth(), getWidth() / 2, 0}, // X points
                    new int[] {getHeight(), 0, getHeight()}, // Y points
                    3);
            break;
        }
View Full Code Here

    for (int i = 0; i < polygonList.size(); i++) {
      ClickPolygon elem = polygonList.get(i);
      ClickPolygon scaled = scaledPolygonList.get(i);
      if (elem.isOn()) {
        g.setColor(Color.red);
        g.fillPolygon(scaled);
      } else {
        g.setColor(Color.blue);
        g.fillPolygon(scaled);
      }
    }
View Full Code Here

      if (elem.isOn()) {
        g.setColor(Color.red);
        g.fillPolygon(scaled);
      } else {
        g.setColor(Color.blue);
        g.fillPolygon(scaled);
      }
    }
  }

  /** Draw from the last point to this point, then remember new point */
 
View Full Code Here

                x = (int) Math.round(zoom * x);
                y = (int) Math.round(zoom * y);
                int[] xs = { x - offs, x, x + offs, x };
                int[] ys = { y, y - offs, y, y + offs };
                gCopy.setColor(Color.WHITE);
                gCopy.fillPolygon(xs, ys, 4);
                gCopy.setColor(Color.BLACK);
                gCopy.drawPolygon(xs, ys, 4);
            }
        }

View Full Code Here

        }
       
        public void paint( Graphics g ) {
            Graphics g2 = g.create();
            g2.setColor( color );
            g2.fillPolygon( shape );
        }
    }
   
    /**
     Size of the slider labels (Size of the lowest & highest labels will affect
View Full Code Here

                g.setColor(MAGNIFYING_INTERIOR);
            }
            g.fillOval(cx - 5, cy - 5, 10, 10);
            g.setColor(Color.BLACK);
            g.drawOval(cx - 5, cy - 5, 10, 10);
            g.fillPolygon(xp, yp, xp.length);
        }
    }

    @Override
    public void mousePressed(InstanceState state, MouseEvent e) {
View Full Code Here

        } else {
            depress = 0;
            int[] xp = new int[] { x, x + w - DEPTH, x + w, x + w, x + DEPTH, x };
            int[] yp = new int[] { y, y, y + DEPTH, y + h, y + h, y + h - DEPTH };
            g.setColor(color.darker());
            g.fillPolygon(xp, yp, xp.length);
            g.setColor(color);
            g.fillRect(x, y, w - DEPTH, h - DEPTH);
            g.setColor(Color.BLACK);
            g.drawRect(x, y, w - DEPTH, h - DEPTH);
            g.drawLine(x + w - DEPTH, y + h - DEPTH, x + w, y + h);
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.