Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
 /**
  * Get the layer that the given shape is in. See {@link #setLayer} for more information about
  * layers.
  *
  * @param shape the shape whose layer index will be returned.
  * @return the index of the layer that <code>shape</code> is contained in.
  * @see #setLayer
  */
 static int getLayerOf(Shape shape) {
   return layerOf.get(shape);
 }