Interface IMapLayer

All Superinterfaces:
IVisibleMapObject

public interface IMapLayer
extends IVisibleMapObject
Represents a "layer" of components whose visibility can be controlled as one. This is a Composite Design Pattern of IVisibleMapObjects. This is used for setting an unspecified set of components to all be visible or invisible. Since an IMapLayer is itself an IVisibleMapObject, IMapLayers can be nested inside of other IMapLayers.
Author:
swong
  • Method Details

    • addComponent

      boolean addComponent​(IVisibleMapObject comp)
      Add a component to the layer. The component's visibility will be set to the layer's visibility.
      Parameters:
      comp - A component whose visibility can be controlled.
      Returns:
      True if the component was not already in the layer.
    • removeComponent

      boolean removeComponent​(IVisibleMapObject comp)
      Remove the specified component from the layer. The component's visibility is unchanged.
      Parameters:
      comp - A component whose visibility can be controlled.
      Returns:
      True if the component was in the layer.
    • getComponents

      java.util.Set<IVisibleMapObject> getComponents()
      Return a copy of the set of components comprising this layer
      Returns:
      A Set of IVisibleMapObjects
    • clear

      void clear()
      Remove all the components from the layer. The components' visibility is unchanged.
    • reset

      void reset()
      Reset all the components' visibility to the layer's visibility. This is used to restore the visibility setting for any components which have been individually mutated.
    • make

      static IMapLayer make()
      Instantiate an empty layer whose visibility is false.
      Returns:
      An empty invisible layer.