Refine search
g.setColor(c); int dX = x2 - x1; int dY = y2 - y1; yPoints[3] = y2 + dy; g.fillPolygon(xPoints, yPoints, 4);
g.setColor(c); int dX = x2 - x1; int dY = y2 - y1; yPoints[3] = y2 + dy; g.fillPolygon(xPoints, yPoints, 4);
g.setColor(hazAlfa(fila)); g.fillPolygon(carp); g.setColor(darkShadow.darker()); g.drawPolygon(carp); carp.addPoint(0, lines[i + 1]); carp.addPoint(0, lines[i]); g.setColor(hazAlfa(fila + 2)); g.fillPolygon(carp); g.setColor(darkShadow.darker()); g.drawPolygon(carp);
Color fg = getForeground(); Color bg = getBackground(); g.setColor( new Color( (fg.getRed() + (2 * bg.getRed())) / 3, (fg.getGreen() + (2 * bg.getGreen())) / 3, g.setColor(getForeground()); g.fillPolygon(xP, yP, 3);
break; g.setColor(new Color(0.85F, 0.85F, 0.85F)); g.drawLine(HALF_WIDTH_OFFSET, r.height - HEIGHT_OFFSET - 1, r.width - HALF_WIDTH_OFFSET - 1, r.height - HEIGHT_OFFSET - 1); g.drawLine(r.width - HALF_WIDTH_OFFSET - 1, 0, r.width - HALF_WIDTH_OFFSET - 1, r.height - HEIGHT_OFFSET - 1); g.drawLine(HALF_WIDTH_OFFSET, 0, HALF_WIDTH_OFFSET, r.height - HEIGHT_OFFSET - 1); g.setColor(new Color(0.65F, 0.65F, 0.65F)); g.drawLine(HALF_WIDTH_OFFSET + 1, 0, r.width - HALF_WIDTH_OFFSET - 1, 0); g.setColor(Color.BLACK); Polygon p = new Polygon(); p.addPoint(i + HALF_WIDTH_OFFSET, r.height - HEIGHT_OFFSET); p.addPoint(i + WIDTH_OFFSET, r.height - ARROW_HEIGHT); p.addPoint(i, r.height - ARROW_HEIGHT); g.fillPolygon(p);
@Override public void draw(Graphics g) { g.setColor(Color.gray); //fillColor int[] xPoints = getXs(this.points); int[] yPoints = getYs(this.points); int nPoints = xPoints.length; g.fillPolygon(xPoints, yPoints, nPoints); }
/** * Draws the hotspot where the user can join the node to a source node * * @param g The Java2D Graphics * @param col The color to draw */ public void drawTailHotspot(final Graphics g, final Color col) { final Point p = displayPosition; g.setColor(col); final int x = p.x + nodeWidth; final int y = p.y + halfNodeHeight; final int[] xpoints = {x, x + hotSpotOffset, x, x}; final int[] ypoints = {y - halfHotSpotSize, y, y + halfHotSpotSize, y - halfHotSpotSize}; g.fillPolygon(xpoints, ypoints, xpoints.length); }
public void paintIcon (java.awt.Component c, Graphics g, int x, int y) { g.setColor ( armed ? UIManager.getColor ( "List.selectionForeground" ) : //NOI18N UIManager.getColor ( "controlShadow" ) ); //NOI18N /* int[] xPoints = new int[] {x+getIconWidth()/2, x+getIconWidth(), x}; int[] yPoints = new int[] {y, y+getIconHeight()-1, y+getIconHeight()-1}; */ int[] xPoints = new int[]{x, x + 8, x + 4}; int[] yPoints = new int[]{y + 5, y + 5, y}; g.fillPolygon ( xPoints, yPoints, 3 ); } }
public void paintIcon (java.awt.Component c, Graphics g, int x, int y) { g.setColor ( armed ? UIManager.getColor ( "List.selectionForeground" ) : //NOI18N UIManager.getColor ( "controlShadow" ) ); //NOI18N /* int[] xPoints = new int[] {x+getIconWidth()/2, x+getIconWidth(), x}; int[] yPoints = new int[] {y, y+getIconHeight()-1, y+getIconHeight()-1}; */ int[] xPoints = new int[]{x, x + 8, x + 4}; int[] yPoints = new int[]{y + 5, y + 5, y}; g.fillPolygon ( xPoints, yPoints, 3 ); } }
public void paintIcon (java.awt.Component c, Graphics g, int x, int y) { x++; g.setColor ( armed ? UIManager.getColor ( "List.selectionForeground" ) : //NOI18N UIManager.getColor ( "controlShadow" ) ); //NOI18N /* int[] xPoints = new int[] {(x+getIconWidth()/2), x+getIconWidth()-1, x}; int[] yPoints = new int[] {y+getIconHeight()-2, y, y}; */ int[] xPoints = new int[]{x, x + 8, x + 4}; int[] yPoints = new int[]{y, y, y + 4}; g.fillPolygon ( xPoints, yPoints, 3 ); }
public void paintIcon (java.awt.Component c, Graphics g, int x, int y) { x++; g.setColor ( armed ? UIManager.getColor ( "List.selectionForeground" ) : //NOI18N UIManager.getColor ( "controlShadow" ) ); //NOI18N /* int[] xPoints = new int[] {(x+getIconWidth()/2), x+getIconWidth()-1, x}; int[] yPoints = new int[] {y+getIconHeight()-2, y, y}; */ int[] xPoints = new int[]{x, x + 8, x + 4}; int[] yPoints = new int[]{y, y, y + 4}; g.fillPolygon ( xPoints, yPoints, 3 ); }
public void paint(Graphics g) { // Create triangle int px[] = {20, 400, 210}; int py[] = {400, 400, 20}; g.setColor(Color.black); g.fillPolygon(px, py, 3); g.setColor(Color.white); paintTriangle(g, new Point(20,400),new Point(400,400),new Point(210,20), deep); }
public static void drawDiamondSelectorCorner(Graphics g, Color outline, Color body, int x, int y, int size) { int [] xs = new int[] {x, x + size, x, x - size}; int [] ys = new int[] {y - size, y, y + size, y}; g.setColor(body); g.fillPolygon(xs, ys, xs.length); g.setColor(outline); g.drawPolygon(xs, ys, xs.length); }
public void paintIcon( Component c, Graphics g, int x, int y ){ g = g.create(); ((Graphics2D)g).setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); g.setColor( c.getForeground() ); g.fillPolygon( new int[]{ x + 1, x + 8, x + 4 }, new int[]{ y + 1, y + 1, y + 6 }, 3 ); g.dispose(); } });
public void paint(Graphics g) { int[] xPoints = {100,50,150}; int[] yPoints = {100,200,200}; g.setColor(Color.black); g.drawPolygon(xPoints, yPoints, 3); g.setColor(Color.red); g.fillPolygon(xPoints, yPoints, 3); }
public void highlight(Graphics g, int xOff, int yOff, Color color) { checkObject(); g.setColor(color); int [] xPoints = new int[4]; int [] yPoints = new int[4]; for (int i = 0; i < 4; i++) { xPoints[i] = Math.round(xOff + m_coords[i][0]); yPoints[i] = Math.round(yOff + m_coords[i][1]); } g.fillPolygon( xPoints, yPoints, 4); }
@Override public void paint(Graphics g) { g.setColor(Color.black); g.drawPolygon(p); g.setColor(Color.gray); g.fillPolygon(p); }
public void paintComponent(Graphics g) { Dimension size = getSize(); // if too small, just don't draw if (size.width < 21 || size.height < 21) { return; } int mid = size.height / 2; g.setColor(color); int end = size.width - 15; g.fillRect(5, mid, end - 5, 2); g.fillPolygon(new int[]{end, end + 10, end}, new int[]{mid + 10, mid, mid - 10}, 3); } }
Image myImage = new BufferedImage(...); Graphics graphImage = myImage.getGraphics(); graphImage.setColor(Color.BLUE); graphImage.fillPolygon(...); // set some blue pixels inside the BufferedImage
public void drawInto(Graphics g) { if ((g == null) || (!visible)) return; Color oldColor = g.getColor(); g.setColor(this.backColor); g.fillPolygon(areaShape); if (selected && highlight) { g.setColor(highlightBorderColor); } else { g.setColor(this.normalBorderColor); } g.drawPolygon(this.areaShape); g.setColor(oldColor); }