Record Class LiveEditElement
java.lang.Object
java.lang.Record
lu.kbra.modelizer_next.ui.canvas.datastruct.LiveEditElement
- Record Components:
type- type value that selects the operation modeclassId- id of the class to look up or modifyfieldId- id of the field to look up or modifycommentId- id of the comment to look up or modifylinkId- id of the link to look up or modifyforceAlternative- whether force alternative is enabledsnapshotValue- snapshot value value used by the operation
public record LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId, boolean forceAlternative, Object snapshotValue)
extends Record
Model element currently being edited inline on the canvas.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates supported live edit type values. -
Constructor Summary
ConstructorsConstructorDescriptionLiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId) Creates a live edit element instance on the active canvas.LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId, boolean forceAlternative) Creates a live edit element instance on the active canvas.LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId, boolean forceAlternative, Object snapshotValue) Creates an instance of aLiveEditElementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionConverts this live edit element into a selected element.classId()Returns the value of theclassIdrecord component.Returns the value of thecommentIdrecord component.final booleanCompares this live edit element with another object for value equality on the active canvas.fieldId()Returns the value of thefieldIdrecord component.booleanReturns the value of theforceAlternativerecord component.static LiveEditElementCreates the default style for class elements.static LiveEditElementCreates the default style for class elements.static LiveEditElementforComment(String commentId) Creates the default style for comment elements.static LiveEditElementCreates the default style for field elements.static LiveEditElementCreates the default style for field elements.static LiveEditElementCreates the default style for link elements.static LiveEditElementforLink(String linkId, LiveEditElement.LiveEditType type) Creates the default style for link elements.Returns the actual ID on the active canvas.getRenamingComponent(LiveEditComponents component) Returns the renaming component on the active canvas.final inthashCode()Computes the hash code that matches this object's equality rules on the active canvas.linkId()Returns the value of thelinkIdrecord component.Returns the value of thesnapshotValuerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
LiveEditElement
public LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId) Creates a live edit element instance on the active canvas.- Parameters:
type- type value that selects the operation modeclassId- id of the class to look up or modifyfieldId- id of the field to look up or modifycommentId- id of the comment to look up or modifylinkId- id of the link to look up or modify
-
LiveEditElement
public LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId, boolean forceAlternative) Creates a live edit element instance on the active canvas.- Parameters:
type- type value that selects the operation modeclassId- id of the class to look up or modifyfieldId- id of the field to look up or modifycommentId- id of the comment to look up or modifylinkId- id of the link to look up or modifyforceAlternative- whether force alternative is enabled
-
LiveEditElement
public LiveEditElement(LiveEditElement.LiveEditType type, String classId, String fieldId, String commentId, String linkId, boolean forceAlternative, Object snapshotValue) Creates an instance of aLiveEditElementrecord class.- Parameters:
type- the value for thetyperecord componentclassId- the value for theclassIdrecord componentfieldId- the value for thefieldIdrecord componentcommentId- the value for thecommentIdrecord componentlinkId- the value for thelinkIdrecord componentforceAlternative- the value for theforceAlternativerecord componentsnapshotValue- the value for thesnapshotValuerecord component
-
-
Method Details
-
forClass
Creates the default style for class elements.- Parameters:
classId- id of the class to look up or modify- Returns:
- the for class result
-
forField
Creates the default style for field elements.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
- the for field result
-
forClass
Creates the default style for class elements.- Parameters:
classId- id of the class to look up or modifyalternative- whether alternative is enabled- Returns:
- the for class result
-
forField
Creates the default style for field elements.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modifyalternative- whether alternative is enabled- Returns:
- the for field result
-
forComment
Creates the default style for comment elements.- Parameters:
commentId- id of the comment to look up or modify- Returns:
- the for comment result
-
forLink
Creates the default style for link elements.- Parameters:
linkId- id of the link to look up or modify- Returns:
- the for link result
-
forLink
Creates the default style for link elements.- Parameters:
linkId- id of the link to look up or modifytype- type value that selects the operation mode- Returns:
- the for link result
-
getActualId
Returns the actual ID on the active canvas.- Returns:
- the actual ID
-
hashCode
public final int hashCode()Computes the hash code that matches this object's equality rules on the active canvas. -
asSelectedElement
Converts this live edit element into a selected element.- Returns:
- the as selected element result
-
equals
Compares this live edit element with another object for value equality on the active canvas. -
getRenamingComponent
Returns the renaming component on the active canvas.- Parameters:
component- Swing component to configure- Returns:
- the renaming component
-
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. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
classId
Returns the value of theclassIdrecord component.- Returns:
- the value of the
classIdrecord component
-
fieldId
Returns the value of thefieldIdrecord component.- Returns:
- the value of the
fieldIdrecord component
-
commentId
Returns the value of thecommentIdrecord component.- Returns:
- the value of the
commentIdrecord component
-
linkId
Returns the value of thelinkIdrecord component.- Returns:
- the value of the
linkIdrecord component
-
forceAlternative
public boolean forceAlternative()Returns the value of theforceAlternativerecord component.- Returns:
- the value of the
forceAlternativerecord component
-
snapshotValue
Returns the value of thesnapshotValuerecord component.- Returns:
- the value of the
snapshotValuerecord component
-