public ExtendedGeneralPath(Shape s) : this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)
        {
            PathIterator pi = s.getPathIterator(null);

            setWindingRule(pi.getWindingRule());
            append(pi, false);
        }
示例#2
0
        public GeneralPath(Shape shape) :
            this(WIND_NON_ZERO, BUFFER_SIZE)
        {
            PathIterator p = shape.getPathIterator(null);

            setWindingRule(p.getWindingRule());
            append(p, false);
        }
        public void CloseAllFigures()
        {
            ExtendedGeneralPath p  = new ExtendedGeneralPath();
            PathIterator        pi = NativeObject.getPathIterator(null);
            JPI lastSeg            = JPI.SEG_CLOSE;

            float [] points = new float[6];

            p.setWindingRule(pi.getWindingRule());
            while (!pi.isDone())
            {
                JPI curSeg = (JPI)pi.currentSegment(points);
                switch (curSeg)
                {
                case JPI.SEG_CLOSE:
                    p.closePath();
                    break;

                case JPI.SEG_MOVETO:
                    if (lastSeg != JPI.SEG_CLOSE)
                    {
                        p.closePath();
                    }
                    p.moveTo(points[0], points[1]);
                    break;

                case JPI.SEG_LINETO:
                    p.lineTo(points[0], points[1]);
                    break;

                case JPI.SEG_QUADTO:
                    p.quadTo(points[0], points[1], points[2], points[3]);
                    break;

                case JPI.SEG_CUBICTO:
                    p.curveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
                    break;

                default:
                    break;
                }
                lastSeg = curSeg;
                pi.next();
            }

            p.closePath();
            Shape = p;
        }
示例#4
0
        public Shape createTransformedShape(Shape src)
        {
            if (src == null)
            {
                return(null);
            }
            if (src is GeneralPath)
            {
                return(((GeneralPath)src).createTransformedShape(this));
            }
            PathIterator path = src.getPathIterator(this);
            GeneralPath  dst  = new GeneralPath(path.getWindingRule());

            dst.append(path, false);
            return(dst);
        }
示例#5
0
 public int getWindingRule()
 {
     return(p.getWindingRule());
 }