Class LayerManagerModeling

java.lang.Object
org.opentcs.guing.components.layer.DefaultLayerManager
org.opentcs.guing.components.layer.LayerManagerModeling
All Implemented Interfaces:
org.opentcs.components.Lifecycle, ActiveLayerProvider, org.opentcs.guing.components.layer.LayerEditor, LayerEditorModeling, org.opentcs.guing.components.layer.LayerGroupEditor, LayerGroupEditorModeling, org.opentcs.guing.components.layer.LayerGroupManager, org.opentcs.guing.components.layer.LayerManager, org.opentcs.util.event.EventHandler

public class LayerManagerModeling
extends org.opentcs.guing.components.layer.DefaultLayerManager
implements LayerEditorModeling, LayerGroupEditorModeling, ActiveLayerProvider
The LayerManager implementation for the model editor application.
  • Constructor Summary

    Constructors 
    Constructor Description
    LayerManagerModeling​(org.opentcs.guing.application.ViewManager viewManager, org.opentcs.util.event.EventBus eventBus)  
  • Method Summary

    Modifier and Type Method Description
    void add​(org.opentcs.guing.model.DrawnModelComponent modelComponent)
    Adds the given model component to the layer that is set in the component's layer wrapper property.
    void createLayer()
    Creates a new layer.
    void createLayerGroup()
    Creates a new layer group.
    void deleteLayer​(int layerId)
    Deletes the layer with the given layer ID.
    void deleteLayerGroup​(int groupId)
    Deletes the layer group with the given layer group ID.
    org.opentcs.guing.components.layer.LayerWrapper getActiveLayer()
    Returns the LayerWrapper instance that holds the currently active layer.
    void moveLayerDown​(int layerId)
    Moves the layer with the given ID one level down.
    void moveLayerUp​(int layerId)
    Moves the layer with the given ID one level up.
    void remove​(org.opentcs.guing.model.DrawnModelComponent modelComponent)
    Removes the given model component from its layer.
    protected void reset()  
    protected void restoreLayers()  
    void setLayerActive​(int layerId)
    Sets the layer with the given ID as the active layer.
    void setLayerGroupId​(int layerId, int groupId)
    Sets the group ID for the layer with the given ID.

    Methods inherited from class org.opentcs.guing.components.layer.DefaultLayerManager

    addComponent, addLayerGroupChangeListener, containsComponents, getComponents, getDrawings, getLayerChangeListener, getLayerGroup, getLayerGroups, getLayerWrapper, getLayerWrappers, getSystemModel, getViewManager, initialize, isInitialized, layerVisibilityChanged, notifyGroupAdded, notifyGroupRemoved, notifyGroupsChanged, notifyGroupsInitialized, onEvent, removeComponent, setGroupName, setGroupVisible, setLayerChangeListener, setLayerName, setLayerVisible, terminate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opentcs.guing.components.layer.LayerEditor

    setLayerName, setLayerVisible

    Methods inherited from interface org.opentcs.guing.components.layer.LayerGroupEditor

    setGroupName, setGroupVisible
  • Constructor Details

    • LayerManagerModeling

      @Inject public LayerManagerModeling​(org.opentcs.guing.application.ViewManager viewManager, org.opentcs.util.event.EventBus eventBus)
  • Method Details

    • createLayer

      public void createLayer()
      Description copied from interface: LayerEditorModeling
      Creates a new layer.
      Specified by:
      createLayer in interface LayerEditorModeling
    • deleteLayer

      public void deleteLayer​(int layerId) throws java.lang.IllegalArgumentException
      Description copied from interface: LayerEditorModeling
      Deletes the layer with the given layer ID.
      Specified by:
      deleteLayer in interface LayerEditorModeling
      Parameters:
      layerId - The ID of the layer to delete.
      Throws:
      java.lang.IllegalArgumentException - If a layer with the given layer ID doesn't exist.
    • add

      public void add​(org.opentcs.guing.model.DrawnModelComponent modelComponent)
      Description copied from interface: LayerEditorModeling
      Adds the given model component to the layer that is set in the component's layer wrapper property.
      Specified by:
      add in interface LayerEditorModeling
      Parameters:
      modelComponent - The model component to add.
    • remove

      public void remove​(org.opentcs.guing.model.DrawnModelComponent modelComponent)
      Description copied from interface: LayerEditorModeling
      Removes the given model component from its layer.
      Specified by:
      remove in interface LayerEditorModeling
      Parameters:
      modelComponent - The model component to remove.
    • moveLayerDown

      public void moveLayerDown​(int layerId)
      Description copied from interface: LayerEditorModeling
      Moves the layer with the given ID one level down.
      Specified by:
      moveLayerDown in interface LayerEditorModeling
      Parameters:
      layerId - The ID of the layer.
    • moveLayerUp

      public void moveLayerUp​(int layerId)
      Description copied from interface: LayerEditorModeling
      Moves the layer with the given ID one level up.
      Specified by:
      moveLayerUp in interface LayerEditorModeling
      Parameters:
      layerId - The ID of the layer.
    • setLayerActive

      public void setLayerActive​(int layerId)
      Description copied from interface: LayerEditorModeling
      Sets the layer with the given ID as the active layer.
      Specified by:
      setLayerActive in interface LayerEditorModeling
      Parameters:
      layerId - The ID of the layer.
    • createLayerGroup

      public void createLayerGroup()
      Description copied from interface: LayerGroupEditorModeling
      Creates a new layer group.
      Specified by:
      createLayerGroup in interface LayerGroupEditorModeling
    • deleteLayerGroup

      public void deleteLayerGroup​(int groupId) throws java.lang.IllegalArgumentException
      Description copied from interface: LayerGroupEditorModeling
      Deletes the layer group with the given layer group ID.
      Specified by:
      deleteLayerGroup in interface LayerGroupEditorModeling
      Parameters:
      groupId - The ID of the layer group to delete.
      Throws:
      java.lang.IllegalArgumentException - If a layer group with the given layer group ID doesn't exist.
    • setLayerGroupId

      public void setLayerGroupId​(int layerId, int groupId)
      Description copied from interface: LayerEditorModeling
      Sets the group ID for the layer with the given ID.
      Specified by:
      setLayerGroupId in interface LayerEditorModeling
      Parameters:
      layerId - The ID of the layer.
      groupId - The ID of the layer group.
    • getActiveLayer

      public org.opentcs.guing.components.layer.LayerWrapper getActiveLayer()
      Description copied from interface: ActiveLayerProvider
      Returns the LayerWrapper instance that holds the currently active layer.
      Specified by:
      getActiveLayer in interface ActiveLayerProvider
      Returns:
      The currently active layer.
    • reset

      protected void reset()
      Overrides:
      reset in class org.opentcs.guing.components.layer.DefaultLayerManager
    • restoreLayers

      protected void restoreLayers()
      Overrides:
      restoreLayers in class org.opentcs.guing.components.layer.DefaultLayerManager