private static void addClosePath(final Path2D path) { path.closePath(); }
@Implementation protected void close() { if (!hasPoints()) { mPath.moveTo(mLastX = 0, mLastY = 0); } mPath.closePath(); }
@Override public void close() { this.path2D.closePath(); }
path.lineTo(x + lineLength, y + 1); path.closePath();
Path2D path = new Path2D.Double(); path.moveTo(valoresX[0], valoresY[0]); for(int i = 1; i < valoresX.length; ++i) { path.lineTo(valoresX[i], valoresY[i]); } path.closePath();
/** * add Pennants to the shape * * @param path * @param positionOnPath * @return */ private int drawPennants(Path2D path, int positionOnPath) { if (pennants <= 0) { return positionOnPath; } for (int elements = 0; elements < pennants; elements++) { // move forward one pennant at a time // draw pennant path.moveTo(0, positionOnPath); positionOnPath += windBarbDefinition.basePennantLength / 2.0; path.lineTo(windBarbDefinition.longBarbLength, positionOnPath); // first edge positionOnPath += windBarbDefinition.basePennantLength / 2.0; path.lineTo(0, positionOnPath); // second edge path.closePath(); // only one square } return positionOnPath; } }
coords[4], coords[5]); } else if (pathSegmentType == PathIterator.SEG_CLOSE) { gp.closePath(); regions.add(new Area(gp)); } else {
coords[4], coords[5]); } else if (pathSegmentType == PathIterator.SEG_CLOSE) { gp.closePath(); regions.add(new Area(gp)); } else {
@Override public Path close() { path.closePath(); return this; }
@Override public Path close() { path.closePath(); return this; }
BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics g = image.getGraphics(); Path2D path = new Path2D.Double(); path.moveTo(20, 20); path.lineTo(20, 30); path.lineTo(40, 30); path.closePath(); g.setClip(path); g.drawImage(YourOrigioanlImage, 0, 0, null);
Path2D path = new Path2D.Double(); AffineTransform at = new AffineTransform(); path.moveTo(p1p2a.x, p1p2a.y); path.lineTo(p1p2b.x, p1p2b.y); path.append(c1.getPathIterator(at), true); path.lineTo(p2p3b.x, p2p3b.y); path.append(c2.getPathIterator(at), true); path.lineTo(p3p1b.x, p3p1b.y); path.append(c3.getPathIterator(at), true); path.closePath(); g.fill(path);
private Path2D decodePath3() { path.reset(); path.moveTo(decodeX(0.85294116f), decodeY(2.639706f)); path.lineTo(decodeX(0.85294116f), decodeY(2.639706f)); path.closePath(); return path; }
private static Mask createInstance () { final Path2D path = new Path2D.Double(); path.moveTo(10, 20); path.lineTo(13, 20); path.lineTo(13, 22); path.lineTo(10, 22); path.closePath(); return new Mask(new Area(path)); } }
private Path2D decodePath7() { path.reset(); path.moveTo(decodeX(1.0117648f), decodeY(1.3616071f)); path.lineTo(decodeX(2.0f), decodeY(0.8333333f)); path.lineTo(decodeX(2.0f), decodeY(1.8571429f)); path.lineTo(decodeX(1.0117648f), decodeY(1.3616071f)); path.closePath(); return path; }
private Path2D decodePath4() { path.reset(); path.moveTo(decodeX(2.0f), decodeY(0.25f)); path.lineTo(decodeX(2.631579f), decodeY(0.25f)); path.curveTo(decodeAnchorX(2.6315789222717285f, 3.0f), decodeAnchorY(0.25f, 0.0f), decodeAnchorX(2.8947367668151855f, 0.0f), decodeAnchorY(0.875f, -3.0f), decodeX(2.8947368f), decodeY(0.875f)); path.lineTo(decodeX(2.8947368f), decodeY(2.125f)); path.curveTo(decodeAnchorX(2.8947367668151855f, 0.0f), decodeAnchorY(2.125f, 3.0f), decodeAnchorX(2.6315789222717285f, 3.0f), decodeAnchorY(2.75f, 0.0f), decodeX(2.631579f), decodeY(2.75f)); path.lineTo(decodeX(2.0f), decodeY(2.75f)); path.lineTo(decodeX(2.0f), decodeY(0.25f)); path.closePath(); return path; }
private Path2D decodePath5() { path.reset(); path.moveTo(decodeX(2.0131578f), decodeY(0.375f)); path.lineTo(decodeX(2.5789473f), decodeY(0.375f)); path.curveTo(decodeAnchorX(2.5789473056793213f, 4.0f), decodeAnchorY(0.375f, 0.0f), decodeAnchorX(2.8421053886413574f, 0.0f), decodeAnchorY(1.0f, -4.0f), decodeX(2.8421054f), decodeY(1.0f)); path.lineTo(decodeX(2.8421054f), decodeY(2.0f)); path.curveTo(decodeAnchorX(2.8421053886413574f, 0.0f), decodeAnchorY(2.0f, 4.0f), decodeAnchorX(2.5789473056793213f, 4.0f), decodeAnchorY(2.625f, 0.0f), decodeX(2.5789473f), decodeY(2.625f)); path.lineTo(decodeX(2.0131578f), decodeY(2.625f)); path.lineTo(decodeX(2.0131578f), decodeY(0.375f)); path.closePath(); return path; }
private Path2D decodePath2() { path.reset(); path.moveTo(decodeX(0.0f), decodeY(0.25f)); path.lineTo(decodeX(2.125f), decodeY(0.25f)); path.curveTo(decodeAnchorX(2.125f, 3.0f), decodeAnchorY(0.25f, 0.0f), decodeAnchorX(2.75f, 0.0f), decodeAnchorY(0.875f, -3.0f), decodeX(2.75f), decodeY(0.875f)); path.lineTo(decodeX(2.75f), decodeY(2.125f)); path.curveTo(decodeAnchorX(2.75f, 0.0f), decodeAnchorY(2.125f, 3.0f), decodeAnchorX(2.125f, 3.0f), decodeAnchorY(2.75f, 0.0f), decodeX(2.125f), decodeY(2.75f)); path.lineTo(decodeX(0.0f), decodeY(2.75f)); path.lineTo(decodeX(0.0f), decodeY(0.25f)); path.closePath(); return path; }
private Path2D decodePath4() { path.reset(); path.moveTo(decodeX(1.0f), decodeY(0.375f)); path.lineTo(decodeX(2.0f), decodeY(0.375f)); path.curveTo(decodeAnchorX(2.0f, 4.0f), decodeAnchorY(0.375f, 0.0f), decodeAnchorX(2.625f, 0.0f), decodeAnchorY(1.0f, -4.0f), decodeX(2.625f), decodeY(1.0f)); path.lineTo(decodeX(2.625f), decodeY(2.0f)); path.curveTo(decodeAnchorX(2.625f, 0.0f), decodeAnchorY(2.0f, 4.0f), decodeAnchorX(2.0f, 4.0f), decodeAnchorY(2.625f, 0.0f), decodeX(2.0f), decodeY(2.625f)); path.lineTo(decodeX(1.0f), decodeY(2.625f)); path.lineTo(decodeX(1.0f), decodeY(0.375f)); path.closePath(); return path; }
private Path2D decodePath12() { path.reset(); path.moveTo(decodeX(0.0f), decodeY(0.71428573f)); path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeAnchorX(0.5555555820465088f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(0.5555556f), decodeY(0.0f)); path.curveTo(decodeAnchorX(0.5555555820465088f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(2.444444417953491f, -3.0f), decodeAnchorY(0.0f, 0.0f), decodeX(2.4444444f), decodeY(0.0f)); path.curveTo(decodeAnchorX(2.444444417953491f, 3.0f), decodeAnchorY(0.0f, 0.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, -3.0f), decodeX(3.0f), decodeY(0.71428573f)); path.curveTo(decodeAnchorX(3.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeAnchorX(3.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeX(3.0f), decodeY(3.0f)); path.lineTo(decodeX(0.0f), decodeY(3.0f)); path.curveTo(decodeAnchorX(0.0f, 0.0f), decodeAnchorY(3.0f, 0.0f), decodeAnchorX(0.0f, 0.0f), decodeAnchorY(0.7142857313156128f, 3.0f), decodeX(0.0f), decodeY(0.71428573f)); path.closePath(); return path; }