Class Layer

java.lang.Object
org.opentcs.data.model.visualization.Layer
All Implemented Interfaces:
java.io.Serializable

public class Layer
extends java.lang.Object
implements java.io.Serializable
Describes a layer in a plant model which is used to group model elements.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    Layer​(int id, int ordinal, boolean visible, java.lang.String name, int groupId)
    Creates a new instance.
  • Method Summary

    Modifier and Type Method Description
    int getGroupId()
    Returns the ID of the layer group this layer is assigned to.
    int getId()
    Returns the unique ID of this layer.
    java.lang.String getName()
    Returns the name of this layer.
    int getOrdinal()
    Returns the ordinal of this layer.
    boolean isVisible()
    Returns whether this layer is visible or not.
    java.lang.String toString()  
    Layer withGroupId​(int groupId)
    Creates a copy of this object, with the given group ID.
    Layer withName​(java.lang.String name)
    Creates a copy of this object, with the given name.
    Layer withOrdinal​(int ordinal)
    Creates a copy of this object, with the given ordinal.
    Layer withVisible​(boolean visible)
    Creates a copy of this object, with the given visible state.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Layer

      public Layer​(int id, int ordinal, boolean visible, java.lang.String name, int groupId)
      Creates a new instance.
      Parameters:
      id - The unique ID of the layer.
      ordinal - The ordinal of the layer.
      visible - Whether the layer is visible or not.
      name - The name of the layer.
      groupId - The ID of the layer group the layer is assigned to.
  • Method Details

    • getId

      public int getId()
      Returns the unique ID of this layer.
      Returns:
      The unique Id of this layer.
    • getOrdinal

      public int getOrdinal()
      Returns the ordinal of this layer. Layers with a higher ordinal are positioned above layers with a lower ordinal.
      Returns:
      The ordinal of this layer.
    • withOrdinal

      public Layer withOrdinal​(int ordinal)
      Creates a copy of this object, with the given ordinal.
      Parameters:
      ordinal - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • isVisible

      public boolean isVisible()
      Returns whether this layer is visible or not.
      Returns:
      Whether this layer is visible or not.
    • withVisible

      public Layer withVisible​(boolean visible)
      Creates a copy of this object, with the given visible state.
      Parameters:
      visible - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • getName

      public java.lang.String getName()
      Returns the name of this layer.
      Returns:
      The name of this layer.
    • withName

      public Layer withName​(java.lang.String name)
      Creates a copy of this object, with the given name.
      Parameters:
      name - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • getGroupId

      public int getGroupId()
      Returns the ID of the layer group this layer is assigned to.
      Returns:
      The ID of the layer group this layer is assigned to.
    • withGroupId

      public Layer withGroupId​(int groupId)
      Creates a copy of this object, with the given group ID.
      Parameters:
      groupId - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object