Class ObjectState

java.lang.Object
org.netbeans.api.visual.model.ObjectState

public class ObjectState extends Object
This class holds a state of a object or a widget. The object state is a set of those following flags: selected, highlighted (also called secondary selection), object-hovered, widget-hovered, widget-aimed.

Initial (normal) value of object state is used for Widget.state and in ObjectScene class.

  • Method Details

    • isSelected

      public boolean isSelected()
      Returns a value of selected-flag.
      Returns:
      true, if selected
    • deriveSelected

      public ObjectState deriveSelected(boolean selected)
      Creates a state derived from this one where the selected flag will be set according to the parameter.
      Parameters:
      selected - the new selected-flag of the new state.
      Returns:
      the new state
    • isHighlighted

      public boolean isHighlighted()
      Returns a value of highlighted-flag.
      Returns:
      true, if highlighted
    • deriveHighlighted

      public ObjectState deriveHighlighted(boolean highlighted)
      Creates a state derived from this one where the highlighted flag will be set according to the parameter.
      Parameters:
      highlighted - the new highlighted-flag of the new state.
      Returns:
      the new state
    • isHovered

      public boolean isHovered()
      Returns a value of hovered-flag.
      Returns:
      true, if object-hovered or widget-hovered flag is set
    • isObjectHovered

      public boolean isObjectHovered()
      Returns a value of object-hovered-flag.
      Returns:
      true, if object-hovered
    • deriveObjectHovered

      public ObjectState deriveObjectHovered(boolean hovered)
      Creates a state derived from this one where the object-hovered flag will be set according to the parameter.
      Parameters:
      hovered - the new object-hovered-flag of the new state.
      Returns:
      the new state
    • isWidgetHovered

      public boolean isWidgetHovered()
      Returns a value of widget-hovered-flag.
      Returns:
      true, if widget-hovered
    • deriveWidgetHovered

      public ObjectState deriveWidgetHovered(boolean hovered)
      Creates a state derived from this one where the widget-hovered flag will be set according to the parameter.
      Parameters:
      hovered - the new widget-hovered-flag of the new state.
      Returns:
      the new state
    • isFocused

      public boolean isFocused()
      Returns a value of focused-flag.
      Returns:
      true, if object-focused or widget-focused flag is set
    • isObjectFocused

      public boolean isObjectFocused()
      Returns a value of object-focused flag.
      Returns:
      true, if object-focused
    • deriveObjectFocused

      public ObjectState deriveObjectFocused(boolean focused)
      Creates a state derived from this one where the object-focused flag will be set according to the parameter.
      Parameters:
      focused - the new object-focused-flag of the new state.
      Returns:
      the new state
    • isWidgetFocused

      public boolean isWidgetFocused()
      Returns a value of widget-focused-flag.
      Returns:
      true, if widget-focused
    • deriveWidgetFocused

      public ObjectState deriveWidgetFocused(boolean focused)
      Creates a state derived from this one where the widget-focused flag will be set according to the parameter.
      Parameters:
      focused - the new widget-focused-flag of the new state.
      Returns:
      the new state
    • isWidgetAimed

      public boolean isWidgetAimed()
      Returns a value of widget-aimed-flag.
      Returns:
      true, if widget-aimed
    • deriveWidgetAimed

      public ObjectState deriveWidgetAimed(boolean aimed)
      Creates a state derived from this one where the aimed flag will be set according to the parameter.
      Parameters:
      aimed - the new aimed-flag of the new state.
      Returns:
      the new state
    • createNormal

      public static ObjectState createNormal()
      Creates a normal (initial/default) state. No flags is set in the state.
      Returns:
      the normal state