MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / GeneralPath

Class GeneralPath

CodenameOne/src/com/codename1/ui/geom/GeneralPath.java:93–3373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91///
92/// - com.codename1.ui.Graphics#fillShape
93public final class GeneralPath implements Shape {
94
95 /// Same constant as `PathIterator#WIND_EVEN_ODD`
96 public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD;
97 /// Same constant as `PathIterator#WIND_NON_ZERO`
98 public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO;
99 /// The buffers size
100 private static final int BUFFER_SIZE = 10;
101 /// The buffers capacity
102 private static final int BUFFER_CAPACITY = 10;
103 private static final int MAX_POOL_SIZE = 20;
104 private static final ArrayList<GeneralPath> pathPool = new ArrayList<GeneralPath>();
105 private static final ArrayList<Rectangle> rectPool = new ArrayList<Rectangle>();
106 private static final ArrayList<float[]> floatPool = new ArrayList<float[]>();
107 private static final ArrayList<boolean[]> boolPool = new ArrayList<boolean[]>();
108 private static final ArrayList<Iterator> iteratorPool = new ArrayList<Iterator>();
109 /// The space amount in points buffer for different segmenet's types
110 private static final int[] pointShift = {
111 2, // MOVETO
112 2, // LINETO
113 4, // QUADTO
114 6, // CUBICTO
115 0}; // CLOSE
116 private static final Pt tmpV1 = new Pt();
117 private static final Pt tmpV2 = new Pt();
118 /// The point's types buffer
119 byte[] types;
120 /// The points buffer
121 float[] points;
122 /// The point's type buffer size
123 int typeSize;
124 /// The points buffer size
125 int pointSize;
126 /// The path rule
127 int rule;
128
129 /// Constructs a GeneralPath with the default (`#WIND_NON_ZERO`)
130 /// winding rule and initial capacity (10).
131 public GeneralPath() {
132 this(WIND_NON_ZERO, BUFFER_SIZE);
133 }
134
135
136 /// Constructs a GeneralPath with a specific winding rule and the default
137 /// initial capacity (10).
138 ///
139 /// #### Parameters
140 ///
141 /// - `rule`: @param rule The winding rule. One of `#WIND_NON_ZERO` and
142 /// `#WIND_EVEN_ODD`
143 ///
144 /// #### See also
145 ///
146 /// - #WIND_NON_ZERO
147 ///
148 /// - #WIND_EVEN_ODD
149 public GeneralPath(int rule) {
150 this(rule, BUFFER_SIZE);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected