ListIterator it = figureList.listIterator(0);
int i = 0;
while (it.hasNext()) {
CanvasFigure cfig = (CanvasFigure) it.next();
if (cfig instanceof ImageFigure) {
ImageFigure fig = (ImageFigure) cfig;
Shape shape = fig.getShape();
Paint fill = fig.getFillPaint();
Paint outline = fig.getStrokePaint();
float lineWidth = fig.getLineWidth();
Composite composite = fig.getComposite();
try {
String type = getType(shape);
String coords = getCoords(shape);
String config = getConfig(fill, outline, (int) lineWidth, composite);
typeList.add(type);
coordList.add(coords);
configList.add(config);
} catch (Exception e) {
continue; // ignore unsupported figures
}
} else if (cfig instanceof ImageLabel) {
ImageLabel fig = (ImageLabel) cfig;
Font font = fig.getFont();
String text = fig.getString();
Paint fill = fig.getFillPaint();
typeList.add("text");
coordList.add(getCoords((Point2D.Double) fig.getAnchorPoint()));
configList.add(getConfig(text, font, fill));
}
i++;
}