/** * Returns the index of the given layer within its parent, or -1 if the parent is null. */ public static int indexInParent (Layer layer) { GroupLayer parent = layer.parent(); if (parent == null) { return -1; } for (int ii = parent.size()-1; ii >= 0; ii--) { if (parent.get(ii) == layer) { return ii; } } throw new AssertionError(); }
protected void clearRoot() { GroupLayer root = graphics().rootLayer(); for (int ii = root.size()-1; ii >= 0; ii--) root.get(ii).destroy(); }
GroupLayer gl = (GroupLayer)layer; for (int ii = gl.size()-1; ii >= 0; ii--) { Layer child = gl.get(ii); if (!child.visible()) continue; // ignore invisible children try {