Java examples for 2D Graphics:Path
add Path Iterator To General Path
//package com.java2s; import java.awt.geom.*; public class Main { private static void addPathIteratorToGeneralPath(PathIterator pi, GeneralPath gp) {//w ww. j a v a 2 s . co m float aF[] = new float[6]; for (int linies = 0; !pi.isDone(); pi.next()) { int i = pi.currentSegment(aF); switch (i) { case PathIterator.SEG_MOVETO: //Estem juntant 2 figures i nom?s ho fem quan una segueix a l'altre if (linies > 0) gp.moveTo(aF[0], aF[1]); break; case PathIterator.SEG_LINETO: gp.lineTo(aF[0], aF[1]); break; case PathIterator.SEG_QUADTO: gp.quadTo(aF[0], aF[1], aF[2], aF[3]); break; case PathIterator.SEG_CUBICTO: gp.curveTo(aF[0], aF[1], aF[2], aF[3], aF[4], aF[5]); break; } linies++; } } }