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 mode
classId - id of the class to look up or modify
fieldId - id of the field to look up or modify
commentId - id of the comment to look up or modify
linkId - id of the link to look up or modify
forceAlternative - whether force alternative is enabled
snapshotValue - 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.
  • 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 mode
      classId - id of the class to look up or modify
      fieldId - id of the field to look up or modify
      commentId - id of the comment to look up or modify
      linkId - 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 mode
      classId - id of the class to look up or modify
      fieldId - id of the field to look up or modify
      commentId - id of the comment to look up or modify
      linkId - id of the link to look up or modify
      forceAlternative - 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 a LiveEditElement record class.
      Parameters:
      type - the value for the type record component
      classId - the value for the classId record component
      fieldId - the value for the fieldId record component
      commentId - the value for the commentId record component
      linkId - the value for the linkId record component
      forceAlternative - the value for the forceAlternative record component
      snapshotValue - the value for the snapshotValue record component
  • Method Details

    • forClass

      public static LiveEditElement forClass(String classId)
      Creates the default style for class elements.
      Parameters:
      classId - id of the class to look up or modify
      Returns:
      the for class result
    • forField

      public static LiveEditElement forField(String classId, String fieldId)
      Creates the default style for field elements.
      Parameters:
      classId - id of the class to look up or modify
      fieldId - id of the field to look up or modify
      Returns:
      the for field result
    • forClass

      public static LiveEditElement forClass(String classId, boolean alternative)
      Creates the default style for class elements.
      Parameters:
      classId - id of the class to look up or modify
      alternative - whether alternative is enabled
      Returns:
      the for class result
    • forField

      public static LiveEditElement forField(String classId, String fieldId, boolean alternative)
      Creates the default style for field elements.
      Parameters:
      classId - id of the class to look up or modify
      fieldId - id of the field to look up or modify
      alternative - whether alternative is enabled
      Returns:
      the for field result
    • forComment

      public static LiveEditElement forComment(String commentId)
      Creates the default style for comment elements.
      Parameters:
      commentId - id of the comment to look up or modify
      Returns:
      the for comment result
    • forLink

      public static LiveEditElement forLink(String linkId)
      Creates the default style for link elements.
      Parameters:
      linkId - id of the link to look up or modify
      Returns:
      the for link result
    • forLink

      public static LiveEditElement forLink(String linkId, LiveEditElement.LiveEditType type)
      Creates the default style for link elements.
      Parameters:
      linkId - id of the link to look up or modify
      type - type value that selects the operation mode
      Returns:
      the for link result
    • getActualId

      public String 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.
      Specified by:
      hashCode in class Record
      Returns:
      the hash code for this object
    • asSelectedElement

      public SelectedElement asSelectedElement()
      Converts this live edit element into a selected element.
      Returns:
      the as selected element result
    • equals

      public final boolean equals(Object other)
      Compares this live edit element with another object for value equality on the active canvas.
      Specified by:
      equals in class Record
      Parameters:
      other - other value used by the operation
      Returns:
      true when the condition is met; otherwise false
    • getRenamingComponent

      public JComponent getRenamingComponent(LiveEditComponents component)
      Returns the renaming component on the active canvas.
      Parameters:
      component - Swing component to configure
      Returns:
      the renaming component
    • 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
    • type

      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • classId

      public String classId()
      Returns the value of the classId record component.
      Returns:
      the value of the classId record component
    • fieldId

      public String fieldId()
      Returns the value of the fieldId record component.
      Returns:
      the value of the fieldId record component
    • commentId

      public String commentId()
      Returns the value of the commentId record component.
      Returns:
      the value of the commentId record component
    • linkId

      public String linkId()
      Returns the value of the linkId record component.
      Returns:
      the value of the linkId record component
    • forceAlternative

      public boolean forceAlternative()
      Returns the value of the forceAlternative record component.
      Returns:
      the value of the forceAlternative record component
    • snapshotValue

      public Object snapshotValue()
      Returns the value of the snapshotValue record component.
      Returns:
      the value of the snapshotValue record component