Class ObjectState
java.lang.Object
org.netbeans.api.visual.model.ObjectState
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 Summary
Modifier and TypeMethodDescriptionstatic ObjectState
Creates a normal (initial/default) state.deriveHighlighted
(boolean highlighted) Creates a state derived from this one where the highlighted flag will be set according to the parameter.deriveObjectFocused
(boolean focused) Creates a state derived from this one where the object-focused flag will be set according to the parameter.deriveObjectHovered
(boolean hovered) Creates a state derived from this one where the object-hovered flag will be set according to the parameter.deriveSelected
(boolean selected) Creates a state derived from this one where the selected flag will be set according to the parameter.deriveWidgetAimed
(boolean aimed) Creates a state derived from this one where the aimed flag will be set according to the parameter.deriveWidgetFocused
(boolean focused) Creates a state derived from this one where the widget-focused flag will be set according to the parameter.deriveWidgetHovered
(boolean hovered) Creates a state derived from this one where the widget-hovered flag will be set according to the parameter.boolean
Returns a value of focused-flag.boolean
Returns a value of highlighted-flag.boolean
Returns a value of hovered-flag.boolean
Returns a value of object-focused flag.boolean
Returns a value of object-hovered-flag.boolean
Returns a value of selected-flag.boolean
Returns a value of widget-aimed-flag.boolean
Returns a value of widget-focused-flag.boolean
Returns a value of widget-hovered-flag.
-
Method Details
-
isSelected
public boolean isSelected()Returns a value of selected-flag.- Returns:
- true, if selected
-
deriveSelected
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
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
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
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
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
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
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
Creates a normal (initial/default) state. No flags is set in the state.- Returns:
- the normal state
-