* Builds a proxy <tt>GraphicsNode</tt> for the input
* <tt>Marker</tt> to be drawn at the middle positions
*/
protected ProxyGraphicsNode[] buildMiddleMarkerProxies() {
ExtendedPathIterator iter = getExtShape().getExtendedPathIterator();
double[] prev = new double[7];
double[] curr = new double[7];
double[] next = new double[7], tmp = null;
int prevSegType = 0, currSegType = 0, nextSegType = 0;
// Get the first three points on the path
if (iter.isDone()) {
return null;
}
prevSegType = iter.currentSegment(prev);
double[] moveTo = new double[2];
if (prevSegType != PathIterator.SEG_MOVETO) {
return null;
}
moveTo[0] = prev[0];
moveTo[1] = prev[1];
iter.next();
if (iter.isDone()) {
return null;
}
currSegType = iter.currentSegment(curr);
if (currSegType == PathIterator.SEG_MOVETO) {
moveTo[0] = curr[0];
moveTo[1] = curr[1];
} else if (currSegType == PathIterator.SEG_CLOSE) {
currSegType = PathIterator.SEG_LINETO;
curr[0] = moveTo[0];
curr[1] = moveTo[1];
}
iter.next();
Vector proxies = new Vector();
while (!iter.isDone()) {
nextSegType = iter.currentSegment(next);
if (nextSegType == PathIterator.SEG_MOVETO) {
moveTo[0] = next[0];
moveTo[1] = next[1];
} else if (nextSegType == PathIterator.SEG_CLOSE) {
nextSegType = PathIterator.SEG_LINETO;
next[0] = moveTo[0];
next[1] = moveTo[1];
}
proxies.addElement(createMiddleMarker(prev, prevSegType,
curr, currSegType,
next, nextSegType));
tmp = prev;
prev = curr;
prevSegType = currSegType;
curr = next;
currSegType = nextSegType;
next = tmp;
iter.next();
}
ProxyGraphicsNode [] gn = new ProxyGraphicsNode[proxies.size()];
proxies.copyInto(gn);