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 performedmessage- message for the user, or nullpathsChanged- 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 andPathNodeEditor.getPath()returns nullmodal- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(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.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.booleanmodal()Returns the value of themodalrecord component.booleanok()Returns the value of theokrecord component.booleanReturns the value of thepathsChangedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Result
Creates an instance of aResultrecord class.- Parameters:
ok- the value for theokrecord componentmessage- the value for themessagerecord componentpathsChanged- the value for thepathsChangedrecord componentmodal- the value for themodalrecord 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 ifpathsChanged(): the editing path is no longer validonNodesChanged- called if the operation succeeded and the editing path remains validonRefused- called if the operation failed or was refused and the paths are intact
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ok
public boolean ok()Returns the value of theokrecord component.- Returns:
- the value of the
okrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
pathsChanged
public boolean pathsChanged()Returns the value of thepathsChangedrecord component.- Returns:
- the value of the
pathsChangedrecord component
-
modal
public boolean modal()Returns the value of themodalrecord component.- Returns:
- the value of the
modalrecord component
-