// © Michiel Kamermans 2010 - CC 3.0 license (AT-NC) /** * A colllection of PathShape objects */ class ShapeCollection { // the list of paths ArrayList pathshapes; // the constructor simply sets up an empty list ShapeCollection() { pathshapes = new ArrayList(); } // get current pathshape PathShape getCurrent() { return (PathShape) pathshapes.get(pathshapes.size()-1); } // create a new path to work with PathShape newPathShape() { PathShape newshape = new PathShape(); pathshapes.add(newshape); return newshape; } // remove the last path from the list PathShape removePathShape() { return (PathShape) pathshapes.remove(pathshapes.size()-1); } // get the size of this collection int size() { return pathshapes.size(); } // draw cascade void draw() { for(int s=0, end=pathshapes.size(); s