Package sc.fiji.snt.gui
Record Class NodeEditCommand.MenuState
java.lang.Object
java.lang.Record
sc.fiji.snt.gui.NodeEditCommand.MenuState
- Record Components:
hasNode- whether there is an active nodenodeLocked- whether the active node is lockedcanUndo- whether there are edits that can be undone
- Enclosing class:
NodeEditCommand
public static record NodeEditCommand.MenuState(boolean hasNode, boolean nodeLocked, boolean canUndo)
extends Record
The editor state that determines which commands are enabled
-
Constructor Summary
ConstructorsConstructorDescriptionMenuState(boolean hasNode, boolean nodeLocked, boolean canUndo) Creates an instance of aMenuStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUndo()Returns the value of thecanUndorecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasNode()Returns the value of thehasNoderecord component.booleanisEnabled(NodeEditCommand cmd) booleanReturns the value of thenodeLockedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MenuState
public MenuState(boolean hasNode, boolean nodeLocked, boolean canUndo) Creates an instance of aMenuStaterecord class.- Parameters:
hasNode- the value for thehasNoderecord componentnodeLocked- the value for thenodeLockedrecord componentcanUndo- the value for thecanUndorecord component
-
-
Method Details
-
isEnabled
- Returns:
- whether
cmdis currently applicable
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
hasNode
public boolean hasNode()Returns the value of thehasNoderecord component.- Returns:
- the value of the
hasNoderecord component
-
nodeLocked
public boolean nodeLocked()Returns the value of thenodeLockedrecord component.- Returns:
- the value of the
nodeLockedrecord component
-
canUndo
public boolean canUndo()Returns the value of thecanUndorecord component.- Returns:
- the value of the
canUndorecord component
-