Interface ElementRenderer

All Superinterfaces:
DiagramCanvasExt
All Known Implementing Classes:
DiagramCanvas

public interface ElementRenderer extends DiagramCanvasExt
Contains drawing helpers for classes, comments, fields, links, and overlays.
  • Method Details

    • drawAlignedLinkLabel

      default void drawAlignedLinkLabel(Graphics2D g2, String text, Point2D point, double angle, boolean bottom, Direction2D dir)
      Draws the aligned link label.
      Parameters:
      g2 - graphics context used for drawing
      text - text to display or edit
      point - point in canvas coordinates
      angle - angle in radians
      bottom - whether the label is drawn below the link path
      dir - preferred label direction
    • drawArrowHead

      default void drawArrowHead(Graphics2D g2, Point2D from, Point2D to)
      Draws the arrow head.
      Parameters:
      g2 - graphics context used for drawing
      from - start point or source value
      to - target point or destination value
    • drawAssociationClassConnector

      default void drawAssociationClassConnector(Graphics2D g2, LinkModel linkModel, LinkGeometry geometry)
      Draws the association class connector.
      Parameters:
      g2 - graphics context used for drawing
      linkModel - link model affected by the operation
      geometry - resolved link geometry to draw or inspect
    • drawCardinalityLabel

      @Deprecated default void drawCardinalityLabel(Graphics2D g2, String text, Point2D anchor, Point2D adjacentPoint, double angle, boolean bottom, Optional<Direction2D> forcedDirection)
      Deprecated.
      Draws the cardinality label.
      Parameters:
      g2 - graphics context used for drawing
      text - text to display or edit
      anchor - anchor point used by the link or label
      adjacentPoint - neighboring point used to orient the label
      angle - angle in radians
      bottom - whether the label is drawn below the link path
      forcedDirection - optional direction that overrides automatic label direction
    • drawClasses

      default void drawClasses(Graphics2D g2)
      Draws the classes.
      Parameters:
      g2 - graphics context used for drawing
    • resolveClassColumWidths

      default lu.kbra.pclib.datastructure.triplet.Triplet<Double,Double,Double> resolveClassColumWidths(List<FieldModel> visibleFields)
      Returns:
      [ name column width, flags column width, type column width ]
    • resolveClassFieldProps

      default lu.kbra.pclib.datastructure.pair.Pair<lu.kbra.pclib.datastructure.triplet.Triplet<Double,Double,Double>,lu.kbra.pclib.datastructure.pair.Pair<Boolean,Boolean>> resolveClassFieldProps(List<FieldModel> visibleFields)
      Returns:
      [ [ name column width, flags column width, type column width ], [ any flags, any type ] ]
    • drawPhysicalClassField

      default void drawPhysicalClassField(Graphics2D g2, Rectangle2D bounds, double rowY, lu.kbra.pclib.datastructure.triplet.Triplet<Double,Double,Double> columnWidths, ClassModel classModel, FieldModel fieldModel, lu.kbra.pclib.datastructure.pair.Pair<Boolean,Boolean> anyFlagsTypes)
      Draws the physical class field.
      Parameters:
      g2 - graphics context used for drawing
      bounds - bounds used for layout or hit testing
      rowY - numeric row y value
      columnWidths - column widths value used by the operation
      classModel - class model affected by the operation
      fieldModel - field model affected by the operation
      anyFlagsTypes - whether any flags types is enabled
    • drawConceptualLogicalClassField

      default void drawConceptualLogicalClassField(Graphics2D g2, Rectangle2D bounds, double rowY, ClassModel classModel, FieldModel fieldModel)
      Draws the conceptual logical class field.
      Parameters:
      g2 - graphics context used for drawing
      bounds - bounds used for layout or hit testing
      rowY - numeric row y value
      classModel - class model affected by the operation
      fieldModel - field model affected by the operation
    • drawCommentConnector

      default void drawCommentConnector(Graphics2D g2, CommentModel commentModel, Rectangle2D bounds)
      Draws the comment connector.
      Parameters:
      g2 - graphics context used for drawing
      commentModel - comment model affected by the operation
      bounds - bounds used for layout or hit testing
    • drawComments

      default void drawComments(Graphics2D g2)
      Draws the comments.
      Parameters:
      g2 - graphics context used for drawing
    • drawExportGrid

      default void drawExportGrid(Graphics2D g2, Dimension size)
      Draws the export grid.
      Parameters:
      g2 - graphics context used for drawing
      size - size value used by the operation
    • drawGrid

      default void drawGrid(Graphics2D g2)
      Draws the grid.
      Parameters:
      g2 - graphics context used for drawing
    • drawLinkPreview

      default void drawLinkPreview(Graphics2D g2)
      Draws the link preview.
      Parameters:
      g2 - graphics context used for drawing
    • drawLinks

      default void drawLinks(Graphics2D g2)
      Draws the links.
      Parameters:
      g2 - graphics context used for drawing
    • drawMultilineText

      default void drawMultilineText(Graphics2D g2, String text, Rectangle2D bounds, int padding)
      Draws the multiline text.
      Parameters:
      g2 - graphics context used for drawing
      text - text to display or edit
      bounds - bounds used for layout or hit testing
      padding - numeric padding value