Package sc.fiji.snt

Record Class PathNodeEditor.Result

java.lang.Object
java.lang.Record
sc.fiji.snt.PathNodeEditor.Result
Record Components:
ok - whether the operation was performed
message - message for the user, or null
pathsChanged - whether paths were added/removed/replaced in the Path Manager (as opposed to a node of the editing path having merely changed). If true, the editing path is no longer valid and PathNodeEditor.getPath() returns null
modal - whether the message reports an aborted operation that should not be missed, i.e., should be displayed in a dialog rather than in a transient notification
Enclosing class:
PathNodeEditor

public static record PathNodeEditor.Result(boolean ok, String message, boolean pathsChanged, boolean modal) extends Record
Outcome of an edit operation
  • Constructor Details

    • Result

      public Result(boolean ok, String message, boolean pathsChanged, boolean modal)
      Creates an instance of a Result record class.
      Parameters:
      ok - the value for the ok record component
      message - the value for the message record component
      pathsChanged - the value for the pathsChanged record component
      modal - the value for the modal record component
  • Method Details

    • dispatch

      public void dispatch(Consumer<PathNodeEditor.Result> onPathsChanged, Consumer<PathNodeEditor.Result> onNodesChanged, Consumer<PathNodeEditor.Result> onRefused)
      Routes this outcome to the front-end reaction that applies, in order of precedence: paths changed (whether or not the operation succeeded), nodes changed, or operation refused/failed with the paths intact. Keeps that precedence in one place for all front-ends (canvas, Bdv, Bvv)
      Parameters:
      onPathsChanged - called if pathsChanged(): the editing path is no longer valid
      onNodesChanged - called if the operation succeeded and the editing path remains valid
      onRefused - called if the operation failed or was refused and the paths are intact
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ok

      public boolean ok()
      Returns the value of the ok record component.
      Returns:
      the value of the ok record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • pathsChanged

      public boolean pathsChanged()
      Returns the value of the pathsChanged record component.
      Returns:
      the value of the pathsChanged record component
    • modal

      public boolean modal()
      Returns the value of the modal record component.
      Returns:
      the value of the modal record component