Record Class SelectedElement
java.lang.Object
java.lang.Record
lu.kbra.modelizer_next.ui.canvas.datastruct.SelectedElement
- 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 modify
public record SelectedElement(SelectedElement.SelectedType type, String classId, String fieldId, String commentId, String linkId)
extends Record
Identifier of the currently selected model element and its kind.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerates supported selected type values. -
Constructor Summary
ConstructorsConstructorDescriptionSelectedElement(SelectedElement.SelectedType type, String classId, String fieldId, String commentId, String linkId) Creates an instance of aSelectedElementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasLiveEditElement(boolean alternative) Converts this selected element into a live edit element.asLiveEditElement(boolean alternative, boolean style) Converts this selected element into a live edit element.asStyleEditElement(boolean alternative, Object currentStyle) Converts this selected element into a style edit target.classId()Returns the value of theclassIdrecord component.Returns the value of thecommentIdrecord component.final booleanCompares this selected element with another object for value equality on the active canvas.fieldId()Returns the value of thefieldIdrecord component.static SelectedElementCreates the default style for class elements.static SelectedElementforComment(String commentId) Creates the default style for comment elements.static SelectedElementCreates the default style for field elements.static SelectedElementCreates the default style for link elements.Returns the actual ID 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.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
SelectedElement
public SelectedElement(SelectedElement.SelectedType type, String classId, String fieldId, String commentId, String linkId) Creates an instance of aSelectedElementrecord class.
-
-
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
-
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
-
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. -
asLiveEditElement
Converts this selected element into a live edit element.- Parameters:
alternative- whether alternative is enabled- Returns:
- the as live edit element result
-
asLiveEditElement
Converts this selected element into a live edit element.- Parameters:
alternative- whether alternative is enabledstyle- whether style is enabled- Returns:
- the as live edit element result
-
asStyleEditElement
Converts this selected element into a style edit target.- Parameters:
alternative- whether alternative is enabledcurrentStyle- current style value used by the operation- Returns:
- the as style edit element result
-
equals
Compares this selected element with another object for value equality on the active canvas. -
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
-