static void removeFromLayers(Shape shape) { if (!layerOf.containsKey(shape)) return; int oldLayer = layerOf.get(shape); layerContents.get(oldLayer).remove(shape); if (layerContents.get(oldLayer).isEmpty()) { layerContents.remove(oldLayer); layers.remove((Integer) oldLayer); } layerOf.remove(shape); }
static void removeCounter(Counter counter) { counters.remove(counter); }