示例#1
0
            public int currentSegment(double[] coords)
            {
                if (isDone())
                {
                    // awt.4B=Iterator out of bounds
                    throw new java.util.NoSuchElementException("Iterator out of bounds"); //$NON-NLS-1$
                }
                int type;

                if (index == 0)
                {
                    type      = PathIteratorConstants.SEG_MOVETO;
                    coords[0] = x1;
                    coords[1] = y1;
                }
                else
                {
                    type      = PathIteratorConstants.SEG_LINETO;
                    coords[0] = x2;
                    coords[1] = y2;
                }
                if (t != null)
                {
                    t.transform(coords, 0, coords, 0, 1);
                }
                return(type);
            }
示例#2
0
            public int currentSegment(double[] coords)
            {
                if (isDone())
                {
                    throw new java.util.NoSuchElementException("Iterator out of bounds"); //$NON-NLS-1$
                }
                int type;
                int count;

                if (index == 0)
                {
                    type      = PathIteratorConstants.SEG_MOVETO;
                    coords[0] = c.getX1();
                    coords[1] = c.getY1();
                    count     = 1;
                }
                else
                {
                    type      = PathIteratorConstants.SEG_CUBICTO;
                    coords[0] = c.getCtrlX1();
                    coords[1] = c.getCtrlY1();
                    coords[2] = c.getCtrlX2();
                    coords[3] = c.getCtrlY2();
                    coords[4] = c.getX2();
                    coords[5] = c.getY2();
                    count     = 3;
                }
                if (t != null)
                {
                    t.transform(coords, 0, coords, 0, count);
                }
                return(type);
            }
示例#3
0
            public int currentSegment(double[] coords)
            {
                if (isDone())
                {
                    throw new java.util.NoSuchElementException("Iterator out of bounds"); //$NON-NLS-1$
                }
                if (index == 5)
                {
                    return(PathIteratorConstants.SEG_CLOSE);
                }
                int type;

                if (index == 0)
                {
                    type      = PathIteratorConstants.SEG_MOVETO;
                    coords[0] = x;
                    coords[1] = y;
                }
                else
                {
                    type = PathIteratorConstants.SEG_LINETO;
                    switch (index)
                    {
                    case 1:
                        coords[0] = x + width;
                        coords[1] = y;
                        break;

                    case 2:
                        coords[0] = x + width;
                        coords[1] = y + height;
                        break;

                    case 3:
                        coords[0] = x;
                        coords[1] = y + height;
                        break;

                    case 4:
                        coords[0] = x;
                        coords[1] = y;
                        break;
                    }
                }
                if (t != null)
                {
                    t.transform(coords, 0, coords, 0, 1);
                }
                return(type);
            }
示例#4
0
            public int currentSegment(double[] coords)
            {
                if (isDone())
                {
                    // awt.4B=Iterator out of bounds
                    throw new java.util.NoSuchElementException("Iterator out of bounds"); //$NON-NLS-1$
                }
                int type  = p.types[typeIndex];
                int count = GeneralPath.pointShift[type];

                for (int i = 0; i < count; i++)
                {
                    coords[i] = p.points[pointIndex + i];
                }
                if (t != null)
                {
                    t.transform(coords, 0, coords, 0, count / 2);
                }
                pointIndex += count;
                return(type);
            }
示例#5
0
 public void transform(AffineTransform t)
 {
     t.transform(points, 0, points, 0, pointSize / 2);
 }
 public void transform(AffineTransform t)
 {
     t.transform(points, 0, points, 0, pointSize / 2);
 }