Package lu.kbra.modelizer_next.ui.canvas
Interface ElementRenderer
- All Superinterfaces:
DiagramCanvasExt
- All Known Implementing Classes:
DiagramCanvas
Contains drawing helpers for classes, comments, fields, links, and overlays.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddrawAlignedLinkLabel(Graphics2D g2, String text, Point2D point, double angle, boolean bottom, Direction2D dir) Draws the aligned link label.default voiddrawArrowHead(Graphics2D g2, Point2D from, Point2D to) Draws the arrow head.default voiddrawAssociationClassConnector(Graphics2D g2, LinkModel linkModel, LinkGeometry geometry) Draws the association class connector.default voiddrawCardinalityLabel(Graphics2D g2, String text, Point2D anchor, Point2D adjacentPoint, double angle, boolean bottom, Optional<Direction2D> forcedDirection) Deprecated.default voidDraws the classes.default voiddrawCommentConnector(Graphics2D g2, CommentModel commentModel, Rectangle2D bounds) Draws the comment connector.default voidDraws the comments.default voiddrawConceptualLogicalClassField(Graphics2D g2, Rectangle2D bounds, double rowY, ClassModel classModel, FieldModel fieldModel) Draws the conceptual logical class field.default voiddrawExportGrid(Graphics2D g2, Dimension size) Draws the export grid.default voiddrawGrid(Graphics2D g2) Draws the grid.default voidDraws the link preview.default voiddrawLinks(Graphics2D g2) Draws the links.default voiddrawMultilineText(Graphics2D g2, String text, Rectangle2D bounds, int padding) Draws the multiline text.default voiddrawPhysicalClassField(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.resolveClassColumWidths(List<FieldModel> visibleFields) 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) Methods inherited from interface lu.kbra.modelizer_next.ui.canvas.DiagramCanvasExt
getCanvas, getDocument, getFrame, getPanelType
-
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 drawingtext- text to display or editpoint- point in canvas coordinatesangle- angle in radiansbottom- whether the label is drawn below the link pathdir- preferred label direction
-
drawArrowHead
Draws the arrow head.- Parameters:
g2- graphics context used for drawingfrom- start point or source valueto- 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 drawinglinkModel- link model affected by the operationgeometry- 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 drawingtext- text to display or editanchor- anchor point used by the link or labeladjacentPoint- neighboring point used to orient the labelangle- angle in radiansbottom- whether the label is drawn below the link pathforcedDirection- optional direction that overrides automatic label direction
-
drawClasses
Draws the classes.- Parameters:
g2- graphics context used for drawing
-
resolveClassColumWidths
default lu.kbra.pclib.datastructure.triplet.Triplet<Double,Double, resolveClassColumWidthsDouble> (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, resolveClassFieldPropsDouble>, lu.kbra.pclib.datastructure.pair.Pair<Boolean, Boolean>> (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 drawingbounds- bounds used for layout or hit testingrowY- numeric row y valuecolumnWidths- column widths value used by the operationclassModel- class model affected by the operationfieldModel- field model affected by the operationanyFlagsTypes- 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 drawingbounds- bounds used for layout or hit testingrowY- numeric row y valueclassModel- class model affected by the operationfieldModel- field model affected by the operation
-
drawCommentConnector
Draws the comment connector.- Parameters:
g2- graphics context used for drawingcommentModel- comment model affected by the operationbounds- bounds used for layout or hit testing
-
drawComments
Draws the comments.- Parameters:
g2- graphics context used for drawing
-
drawExportGrid
Draws the export grid.- Parameters:
g2- graphics context used for drawingsize- size value used by the operation
-
drawGrid
Draws the grid.- Parameters:
g2- graphics context used for drawing
-
drawLinkPreview
Draws the link preview.- Parameters:
g2- graphics context used for drawing
-
drawLinks
Draws the links.- Parameters:
g2- graphics context used for drawing
-
drawMultilineText
Draws the multiline text.- Parameters:
g2- graphics context used for drawingtext- text to display or editbounds- bounds used for layout or hit testingpadding- numeric padding value
-