Class InstanceContainer

    • Field Detail

      • m_Color

        protected Color m_Color
        the associated color.
      • m_Visible

        protected boolean m_Visible
        whether the instance is visible.
    • Constructor Detail

      • InstanceContainer

        public InstanceContainer​(InstanceContainerManager manager,
                                 Instance data)
        Initializes the container.
        Parameters:
        manager - the owning manager
        data - the instance to encapsulate
    • Method Detail

      • assign

        public void assign​(InstanceContainer c)
        Updates itself with the values from given container (the manager is excluded!).
        Parameters:
        c - the container to get the values from
      • setColor

        public void setColor​(Color value)
        Sets the color to use.
        Specified by:
        setColor in interface ColorContainer
        Parameters:
        value - the color
      • getColor

        public Color getColor()
        Returns the current color in use.
        Specified by:
        getColor in interface ColorContainer
        Returns:
        the color
      • setVisible

        public void setVisible​(boolean value)
        Sets the instance's visibility.
        Specified by:
        setVisible in interface VisibilityContainer
        Parameters:
        value - if true then the instance will be visible
      • isVisible

        public boolean isVisible()
        Returns whether the instance is visible.
        Specified by:
        isVisible in interface VisibilityContainer
        Returns:
        true if the instance is visible
      • setData

        public void setData​(Instance value)
        Sets the instance.
        Parameters:
        value - the instance
      • getData

        public Instance getData()
        Returns the stored instance.
        Returns:
        the instance
      • getDisplayID

        public String getDisplayID()
        Returns the displayed container's ID.
        Specified by:
        getDisplayID in interface NamedContainer
        Returns:
        the displayed ID
      • getDatabaseID

        public int getDatabaseID()
        Returns the database ID.
        Specified by:
        getDatabaseID in interface DatabaseIDHandler
        Returns:
        the database ID
      • hashCode

        public int hashCode()
        Returns the hashcode of the instance.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • toString

        public String toString()
        Returns a short string representation of the container.
        Overrides:
        toString in class AbstractContainer
        Returns:
        a string representation