triangle.lineTo(0, 0); triangle.lineTo((-lineWidth * scaleX), (lineWidth * scaleY / 2)); triangle.closePath(); tailShape = triangle; at.translate(x2, y2);
triangle.lineTo(0, 0); triangle.lineTo((lineWidth * scaleX), (lineWidth * scaleY / 2)); triangle.closePath(); headShape = triangle; at.translate(x1, y1);
p.closePath(); g2d.setColor(mapper.getMappedColor(param.getColor())); g2d.fill(p);
Graphics g = ...; Graphics2D g2d = (Graphics2D) g; Path2D.Double triangle = new Path2D.Double(); triangle.moveTo(x1, y1); triangle.pathTo(x2, y2); triangle.pathTo(x3, y3); triangle.closePath(); g2d.fill(triangle);
public static Shape getHexBorderArea(int cuttype, double thickness, double inset) { Path2D.Double area = new Path2D.Double(); area.moveTo(HEX_UR.x + getDeltaR(cuttype, inset), HEX_UR.y + inset); area.lineTo(HEX_UL.x + getDeltaL(cuttype, inset), HEX_UL.y + inset); area.lineTo(HEX_UL.x + getDeltaL(cuttype, inset + thickness), HEX_UL.y + inset + thickness); area.lineTo(HEX_UR.x + getDeltaR(cuttype, inset + thickness), HEX_UR.y + inset + thickness); area.closePath(); return PerfectHextoHex.createTransformedShape(area); }
private static Shape getHCAU01(double thickness) { Path2D.Double area = new Path2D.Double(); area.append(getHCLU01(), false); area.lineTo(HEX_MR.x + getDeltaL(CUT_BORDER, thickness), HEX_MR.y + thickness); area.lineTo(HEX_UL.x + getDeltaL(CUT_BORDER, thickness), HEX_UL.y + thickness); area.closePath(); return area; }
@Override public void execute(Path2D.Double path, Context ctx){ path.closePath(); } }
/** Closes a path for area charts if one is available. */ void closePath( Graphics2D g, Path2D.Double path, double previousX, Rectangle2D bounds, double yTopMargin) { if (path != null) { double yBottomOfArea = getBounds().getY() + getBounds().getHeight() - yTopMargin; path.lineTo(previousX, yBottomOfArea); path.closePath(); g.fill(path); } } }
private Path2D.Double createGatewayShape(double x, double y, double width, double height) { double middleX = x + (width / 2); double middleY = y + (height / 2); Path2D.Double gatewayShape = new Path2D.Double(Path2D.WIND_NON_ZERO, 4); gatewayShape.moveTo(x, middleY); gatewayShape.lineTo(middleX, y); gatewayShape.lineTo(x + width, middleY); gatewayShape.lineTo(middleX, y + height); gatewayShape.closePath(); return gatewayShape; }
path.lineTo(xOffset + barWidth, zeroOffset); path.lineTo(xOffset, zeroOffset); path.closePath();
path.closePath(); g.setColor(series.getFillColor()); g.fill(path);
outlinePath.lineTo(startx + BOX_SIZE - lineOffset, starty + BOX_SIZE - lineOffset); outlinePath.lineTo(startx + BOX_SIZE - lineOffset, starty + lineOffset); outlinePath.closePath();
tmp.moveTo(coords[0], coords[1]); } else if (type == 4) { tmp.closePath();
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); // Make a diamond double diamondHalfSize = (double) markerSize / 2 * 1.3; Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - diamondHalfSize, yOffset); path.lineTo(xOffset, yOffset - diamondHalfSize); path.lineTo(xOffset + diamondHalfSize, yOffset); path.lineTo(xOffset, yOffset + diamondHalfSize); path.closePath(); g.fill(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); double halfSize = (double) markerSize / 2; // Make a triangle Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - halfSize, yOffset - halfSize + markerSize - 1); path.lineTo(xOffset - halfSize + markerSize, yOffset - halfSize + markerSize - 1); path.lineTo(xOffset, yOffset - halfSize - 1); path.closePath(); g.fill(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); double halfSize = (double) markerSize / 2; // Make a triangle Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - halfSize, 1 + yOffset - halfSize); path.lineTo(xOffset, 1 + yOffset - halfSize + markerSize); path.lineTo(xOffset - halfSize + markerSize, 1 + yOffset - halfSize); path.closePath(); g.fill(path); } }
/** Closes a path for area charts if one is available. */ void closePath( Graphics2D g, Path2D.Double path, double previousX, Rectangle2D bounds, double yTopMargin) { if (path != null) { double yBottomOfArea = getBounds().getY() + getBounds().getHeight() - yTopMargin; path.lineTo(previousX, yBottomOfArea); path.closePath(); g.fill(path); } } }
rhombus.lineTo(graphicInfo.getX(), graphicInfo.getY() + graphicInfo.getHeight() / 2); rhombus.closePath(); return rhombus; } else if (SHAPE_TYPE.Ellipse.equals(shapeType)) {
@Override public void execute(Path2D.Double path, Context ctx){ path.closePath(); } }