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 voidadd(org.opentcs.guing.model.DrawnModelComponent modelComponent)Adds the given model component to the layer that is set in the component's layer wrapper property.voidcreateLayer()Creates a new layer.voidcreateLayerGroup()Creates a new layer group.voiddeleteLayer(int layerId)Deletes the layer with the given layer ID.voiddeleteLayerGroup(int groupId)Deletes the layer group with the given layer group ID.org.opentcs.guing.components.layer.LayerWrappergetActiveLayer()Returns theLayerWrapperinstance that holds the currently active layer.voidmoveLayerDown(int layerId)Moves the layer with the given ID one level down.voidmoveLayerUp(int layerId)Moves the layer with the given ID one level up.voidremove(org.opentcs.guing.model.DrawnModelComponent modelComponent)Removes the given model component from its layer.protected voidreset()protected voidrestoreLayers()voidsetLayerActive(int layerId)Sets the layer with the given ID as the active layer.voidsetLayerGroupId(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, terminateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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:LayerEditorModelingCreates a new layer.- Specified by:
createLayerin interfaceLayerEditorModeling
-
deleteLayer
public void deleteLayer(int layerId) throws java.lang.IllegalArgumentExceptionDescription copied from interface:LayerEditorModelingDeletes the layer with the given layer ID.- Specified by:
deleteLayerin interfaceLayerEditorModeling- 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:LayerEditorModelingAdds the given model component to the layer that is set in the component's layer wrapper property.- Specified by:
addin interfaceLayerEditorModeling- Parameters:
modelComponent- The model component to add.
-
remove
public void remove(org.opentcs.guing.model.DrawnModelComponent modelComponent)Description copied from interface:LayerEditorModelingRemoves the given model component from its layer.- Specified by:
removein interfaceLayerEditorModeling- Parameters:
modelComponent- The model component to remove.
-
moveLayerDown
public void moveLayerDown(int layerId)Description copied from interface:LayerEditorModelingMoves the layer with the given ID one level down.- Specified by:
moveLayerDownin interfaceLayerEditorModeling- Parameters:
layerId- The ID of the layer.
-
moveLayerUp
public void moveLayerUp(int layerId)Description copied from interface:LayerEditorModelingMoves the layer with the given ID one level up.- Specified by:
moveLayerUpin interfaceLayerEditorModeling- Parameters:
layerId- The ID of the layer.
-
setLayerActive
public void setLayerActive(int layerId)Description copied from interface:LayerEditorModelingSets the layer with the given ID as the active layer.- Specified by:
setLayerActivein interfaceLayerEditorModeling- Parameters:
layerId- The ID of the layer.
-
createLayerGroup
public void createLayerGroup()Description copied from interface:LayerGroupEditorModelingCreates a new layer group.- Specified by:
createLayerGroupin interfaceLayerGroupEditorModeling
-
deleteLayerGroup
public void deleteLayerGroup(int groupId) throws java.lang.IllegalArgumentExceptionDescription copied from interface:LayerGroupEditorModelingDeletes the layer group with the given layer group ID.- Specified by:
deleteLayerGroupin interfaceLayerGroupEditorModeling- 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:LayerEditorModelingSets the group ID for the layer with the given ID.- Specified by:
setLayerGroupIdin interfaceLayerEditorModeling- 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:ActiveLayerProviderReturns theLayerWrapperinstance that holds the currently active layer.- Specified by:
getActiveLayerin interfaceActiveLayerProvider- Returns:
- The currently active layer.
-
reset
protected void reset()- Overrides:
resetin classorg.opentcs.guing.components.layer.DefaultLayerManager
-
restoreLayers
protected void restoreLayers()- Overrides:
restoreLayersin classorg.opentcs.guing.components.layer.DefaultLayerManager
-