Package lu.kbra.modelizer_next.ui.canvas
Class DiagramCanvas
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
lu.kbra.modelizer_next.ui.canvas.DiagramCanvas
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,CaptureManager,DiagramCanvasExt,ElementCreator,ElementDeleter,ElementEditor,ElementRenderer,ExportManager,LinkLayoutManager,LiveEditor,NodeLayoutCache,NodeLayoutManager,VisibilityManager
public class DiagramCanvas
extends JPanel
implements NodeLayoutCache, ElementEditor, ElementRenderer, ElementDeleter, ElementCreator, VisibilityManager, CaptureManager, LinkLayoutManager, ExportManager, NodeLayoutManager, LiveEditor
Swing component that displays and edits one diagram panel.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BasicStrokestatic final BasicStrokestatic final Fontstatic final Colorstatic final intstatic final intstatic final intstatic ClipboardSnapshotstatic final Colorstatic final BasicStrokestatic final intstatic final intstatic final intstatic final intstatic final doublestatic booleanstatic final Stringstatic final intstatic final intstatic final BasicStrokestatic final intstatic final BasicStrokestatic final Colorstatic final BasicStrokestatic final doublestatic final BasicStrokestatic final doublestatic final Colorstatic final Colorstatic final BasicStrokestatic final doublestatic final intstatic final FontFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDiagramCanvas(MainFrame mainFrame, ModelDocument modelDocument, PanelType panelType, DocumentChangeListener documentEventListener) Creates a diagram canvas instance. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidAdds the comment.default voidaddDraggedLayout(List<DraggedLayout> layouts, Set<String> seen, SelectedElement element, NodeLayout fallbackLayout) Adds the dragged layout.default voidaddField()Adds the field.default voidaddLink()Adds the link.default voidaddTable()Adds the table on the active canvas.default voidaddToSelection(SelectedElement element) Adds the to selection.default StringappendSuffix(String value, String suffix) Appends the suffix on the active canvas.default voidapplyDefaultPaletteToClass(ClassModel classModel) Applies the default palette to class.default voidapplyDefaultPaletteToClass(ClassModel classModel, boolean deep, boolean visibleOnly) Deprecated.default voidapplyDefaultPaletteToComment(CommentModel commentModel) Applies the default palette to comment.default voidapplyDefaultPaletteToField(FieldModel fieldModel) Applies the default palette to field.default voidapplyDefaultPaletteToLink(LinkModel linkModel) Applies the default palette to link.default voidApplies the default palette to selection.default voidapplyPaletteToClass(StylePalette palette, ClassModel classModel) Applies the palette to class.default voidapplyPaletteToClass(StylePalette palette, ClassModel classModel, boolean deep, boolean visibleOnly) Applies the palette to class.default voidapplyPaletteToComment(StylePalette palette, CommentModel commentModel) Applies the palette to comment.default voidapplyPaletteToField(StylePalette palette, FieldModel fieldModel) Applies the palette to field.default voidapplyPaletteToLink(StylePalette palette, LinkModel linkModel) Applies the palette to link.default voidapplyPaletteToSelection(StylePalette palette) Applies the palette to selection.default StringblankToFallback(String primary, String secondary, String fallback) Returns the fallback text when the preferred value is blank.default voidbuildDragRenderLayers(DraggedSelection selection) Builds a drag render layers.default StringbuildForeignKeyFieldName(ClassModel targetClass, FieldModel targetField) Builds a foreign key field name.default StringbuildForeignKeyFieldTechnicalName(ClassModel targetClass, FieldModel targetField) Builds a foreign key field technical name.default StringbuildLinkPath(LinkModel linkModel) Builds a link path.default StringBuilds a selection path.buildSelfLinkPoints(LinkModel linkModel, Point2D fromPoint, Point2D toPoint) Builds a self link points.default doubleclamp(double value, double min, double max) Constrains a numeric value to the supplied range.default voidClears the selection.default Point2DcomputeConceptualAnchorPoint(Rectangle2D bounds, AnchorSide side, int index, boolean big, int totalCount) Computes the conceptual anchor point on the active canvas.default Point2DcomputeConceptualSideCenter(Rectangle2D bounds, AnchorSide side, boolean big) Computes the conceptual side center on the active canvas.default Point2DcomputePolylineMiddlePoint(List<Point2D> points) Computes the polyline middle point on the active canvas.default doublecomputeUprightAngleAtMiddle(List<Point2D> points) Computes the upright angle at middle on the active canvas.default voidConfigures the graphics on the active canvas.default voidCopies the selection.default DraggedSelectioncreateDraggedSelection(SelectedElement hitSelection, NodeLayout hitLayout, Point2D.Double worldPoint, Rectangle2D hitBounds) Creates a dragged selection.default BufferedImagecreateExportImage(ViewExportScope scope) Creates an export image on the active canvas.default BufferedImagecreateExportPreviewImage(ViewExportScope scope, int maxWidth, int maxHeight) Creates an export preview image on the active canvas.default Graphics2DCreates a graphics context on the active canvas.default MouseAdapterCreates a mouse adapter on the active canvas.default voidCuts the selection and places it on the clipboard.default voidDeletes the selection.default voidDuplicates the selection.default voidOpens or applies editing for the selected on the active canvas.default voidEnsures that the conceptual anchor cache exists or is up to date on the active canvas.default voidEnsures that the layouts exists or is up to date.default FieldModelensureTechnicalSourceField(ClassModel sourceClass, ClassModel targetClass, FieldModel targetField) Ensures that the technical source field exists or is up to date.default Point2DfindBoundTargetAnchor(Graphics2D g2, CommentModel commentModel) Finds the bound target anchor that matches the supplied input.default ClassModelfindClassById(String id) Finds the class by ID that matches the supplied input.default CommentModelfindCommentById(String commentId) Finds the comment by ID that matches the supplied input.default FieldModelfindFieldById(String classId, String fieldId) Finds the field by ID that matches the supplied input.default FieldModelfindFieldById(ClassModel classModel, String fieldId) Finds the field by ID that matches the supplied input.default FieldHitResultfindFieldHit(ClassModel classModel, Rectangle2D classBounds, Point2D.Double worldPoint) Finds the field hit that matches the supplied input.default LinkModelfindLinkByAssociationClassId(String classId) Finds the link by association class ID that matches the supplied input.default LinkModelfindLinkById(String id) Finds the link by ID that matches the supplied input.default ClassModelfindOwnerClassOfField(String fieldId) Finds the owner class of field that matches the supplied input.default FieldModelfindPrimaryKeyField(String classId) Finds the primary key field that matches the supplied input.default HitResultfindTopmostHit(Point2D.Double worldPoint) Finds the topmost hit that matches the supplied input.default ObjectfindType(SelectedElement selectedElement) Finds the type that matches the supplied input.default voidfocusAll()default voidfocusBounds(Rectangle2D bounds) Moves and zooms the current canvas view so the supplied world-space bounds fit inside the viewport.default voidReturns the active links.getCanvasAction(String actionKey) Returns the canvas action.default intgetConceptualSideLinkCount(String classId, AnchorSide side) Returns the conceptual side link count.default StringgetEditableClassName(ClassModel classModel) Returns the editable class name.default StringgetEditableCommentText(String commentId) Returns the editable comment text.default StringgetEditableFieldName(FieldModel fieldModel) Returns the editable field name.default DimensiongetExportSize(ViewExportScope scope) Returns the export size on the active canvas.floatReturns the height on the active canvas.default SelectedElementReturns the link creation source.default Point2D.DoubleReturns the mouse viewport pos on the active canvas.default Point2D.DoubleReturns the mouse world pos on the active canvas.default SelectedElementgetSelectedDragAnchor(SelectedElement element) Returns the selected drag anchor on the active canvas.default SelectionInfoReturns the selection info.default StyleScopeReturns the style scope on the active canvas.default intgetTechnicalSideLinkCount(String classId, AnchorSide side, String ignoredLinkId) Returns the technical side link count.default Point2D.DoubleReturns the viewport center on the active canvas.default Point2D.DoubleReturns the viewport center world on the active canvas.default List<FieldModel> getVisibleFields(ClassModel classModel) Deprecated.default voidhandleMouseDragged(MouseEvent event) Handles the mouse dragged on the active canvas.default voidhandleMousePressed(MouseEvent event) Handles the mouse pressed on the active canvas.default voidhandleMouseReleased(MouseEvent event) Handles the mouse released on the active canvas.default voidHandles the mouse wheel moved on the active canvas.default booleanhasAssociationClass(LinkModel linkModel) Checks whether this object has an association class.default booleanhasOutgoingTechnicalLink(String classId, String fieldId) Checks whether this object has an outgoing technical link.default booleanChecks whether this object has a selection.default voidInstalls the default key bindings on the active canvas.default voidinstallKeyBind(InputMap inputMap, ActionMap actionMap, KeyStroke keyStroke, String actionKey, Runnable action) Installs the key bind on the active canvas.default voidInstalls the key bindings on the active canvas.default voidInvalidates the conceptual anchor cache so it will be recalculated on the active canvas.default booleanisClassSelected(String classId) Checks whether class selected is enabled or applies.default booleanisCommentSelected(String commentId) Checks whether comment selected is enabled or applies.default booleanChecks whether drag rendering active is enabled or applies.default booleanisElementSelected(SelectedElement element) Checks whether element selected is enabled or applies on the active canvas.default booleanisFieldSelected(String classId, String fieldId) Checks whether field selected is enabled or applies.default booleanisInCommentResizeHandle(Rectangle2D bounds, Point2D.Double worldPoint) Checks whether in comment resize handle is enabled or applies.default booleanisLinkConnectedTo(LinkModel linkModel, String classId) Checks whether link connected to is enabled or applies.default booleanisLinkSelected(String linkId) Checks whether link selected is enabled or applies.default booleanisPointNearGeometry(Point2D.Double worldPoint, LinkGeometry geometry) Checks whether point near geometry is enabled or applies on the active canvas.default booleanisValidPreviewTarget(SelectedElement target) Checks whether valid preview target is enabled or applies on the active canvas.default booleanlinkEndpointExists(String classId, String fieldId) Checks whether the link endpoint exists.default StringMaps the ID on the active canvas.default voidmoveFieldSelection(int delta) Moves the field selection.default voidmoveSelectedFieldInList(int delta) Moves the selected field in list.default SelectedElementNormalizes the connection source selection.default SelectedElementNormalizes the connection target selection.default voidNotifies the frame that the document content changed.default voidNotifies listeners that the selection changed changed.default voidOpens the edit dialog for selection.voidPaints the component.default voidpaintExport(Graphics2D graphics, ViewExportScope rawScope) Paints the export.default voidPastes the selection from the clipboard.default voidRebuilds the conceptual anchor cache on the active canvas.default voidremoveFromSelection(SelectedElement element) Removes the from selection.voidResets the UI after document restore on the active canvas.default Point2DresolveClassCenterAnchor(String classId) Resolves the class center anchor from the current model and layout state.default StringresolveClassTitle(ClassModel classModel) Resolves the class title from the current model and layout state.default Point2DresolveCommentCenterAnchor(String commentId) Resolves the comment center anchor from the current model and layout state.default Point2DresolveConceptualPreviewAnchor(String classId, Point2D reference) Resolves the conceptual preview anchor from the current model and layout state.default StringresolveFieldName(FieldModel fieldModel) Resolves the field name from the current model and layout state.default LinkGeometryresolveLinkGeometry(LinkModel linkModel) Resolves the link geometry from the current model and layout state.default Point2DresolveLinkMiddleAnchor(String linkId) Resolves the link middle anchor from the current model and layout state.default NodeLayoutresolveNodeLayoutForSelection(SelectedElement element, NodeLayout fallbackLayout) Resolves the node layout for selection from the current model and layout state.default Point2DresolveOppositeReferencePoint(String classId, String fieldId) Resolves the opposite reference point from the current model and layout state.default Point2DResolves the preview source anchor from the current model and layout state.default Point2DResolves the preview source anchor reference from the current model and layout state.default Point2DResolves the preview target anchor from the current model and layout state.default AnchorSideresolveTechnicalEndpointSide(String classId, String fieldId, String oppositeClassId, String oppositeFieldId, boolean selfLink) Resolves the technical endpoint side from the current model and layout state.default Point2DresolveTechnicalFieldAnchor(String classId, String fieldId, Point2D oppositeReference) Resolves the technical field anchor from the current model and layout state.default FieldAnchorresolveTechnicalFieldAnchor(String classId, String fieldId, String oppositeClassId, String oppositeFieldId) Resolves the technical field anchor from the current model and layout state.default Point2DresolveTechnicalSelfLinkAnchor(String classId, String fieldId, AnchorSide side) Resolves the technical self link anchor from the current model and layout state.default SelectedElementresolveTechnicalSourceEndpoint(SelectedElement source, SelectedElement target) Resolves the technical source endpoint from the current model and layout state.default SelectedElementResolves the technical target endpoint from the current model and layout state.default Point2D.DoublescreenToWorld(Point point) Converts screen coordinates into world coordinates.default voidselect(SelectedElement element) Selects an element and updates dependent UI state.default voidSelects the all on the active canvas.default voidsetAssociationClassForLink(String classId, String linkId) Sets the association class for link.default voidsetDefaultPalette(StylePalette defaultPalette) Sets the default palette on the active canvas.default voidsetEditableClassName(ClassModel classModel, String value) Sets the editable class name.default voidsetEditableCommentText(String commentId, String value) Sets the editable comment text.default voidsetEditableFieldName(FieldModel fieldModel, String value) Sets the editable field name.default booleanshouldExportClass(ClassModel classModel) Decides whether the canvas should export class.default booleanshouldExportComment(CommentModel commentModel) Decides whether the canvas should export comment.default booleanshouldExportLink(LinkModel linkModel) Decides whether the canvas should export link.default doublestringWidth(Font titleFont, String classTitle) Measures the width of text with the supplied font.default voidupdateSelectionFromMouse(SelectedElement element, MouseEvent event) Updates the selection from mouse.default Point2D.DoubleworldToViewport(Point2D world) Converts world coordinates into viewport coordinates.default Point2D.DoubleworldToviewportZoom(Point2D world) Converts a world-space size into a zoomed viewport size.default Point2D.DoubleworldToViewportZoom(Dimension world) Converts a world-space size into a zoomed viewport size.Deprecated.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.CaptureManager
captureClass, captureComment, captureField, captureLink, captureLinkLayout, captureNodeLayoutMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.DiagramCanvasExt
getCanvas, getDocument, getFrame, getPanelTypeMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.ElementCreator
createConceptualLink, createFieldFromClipboard, createLinkFromClipboard, createRemappedCommentBinding, createTechnicalLink, finishLinkCreationMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.ElementDeleter
deleteClass, deleteComment, deleteField, deleteLinkMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.ElementEditor
bindCommentToTarget, editClass, editComment, editField, editLinkMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.ElementRenderer
drawAlignedLinkLabel, drawArrowHead, drawAssociationClassConnector, drawCardinalityLabel, drawClasses, drawCommentConnector, drawComments, drawConceptualLogicalClassField, drawExportGrid, drawGrid, drawLinkPreview, drawLinks, drawMultilineText, drawPhysicalClassField, resolveClassColumWidths, resolveClassFieldPropsMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.ExportManager
computeExportContentBounds, computeExportSize, computeExportWorldBounds, computeSelectionBounds, getViewportExportSizeMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.LinkLayoutManager
applyLinkLayout, applyLinkLayout, chooseBestConceptualSidePair, chooseSelfLinkFromSide, chooseTechnicalSelfLinkSide, computeConceptualSortValue, resolveConceptualAnchorPairMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.LiveEditor
applyLiveEditContext, applyStyle, buildClassContext, buildClassFieldContext, buildCommentContext, buildLinkCardinalityContext, buildLinkLabelContext, cancelLiveEditElement, confirmRenamingElement, createRenamingField, editSelectionStyle, getStyleObject, invokeRenamingElement, invokeStyleEditingElement, isLiveEditingElement, renameSelection, revertStyleObject, updateLiveEditLayout, updateLiveEditPreviewMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.NodeLayoutCache
findNodeLayout, findOrCreateLinkLayout, findOrCreateNodeLayout, getPanelStateMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.NodeLayoutManager
applyNodeLayout, computeClassBounds, computeClipboardBounds, computeCommentBounds, expandBounds, resolveRenderLayoutMethods inherited from interface lu.kbra.modelizer_next.ui.canvas.VisibilityManager
isCommentVisible
-
Field Details
-
PASTE_OFFSET
public static final double PASTE_OFFSET- See Also:
-
DEBUG_DRAW_LINK_ANCHORS_PROPERTY
-
DEBUG_DRAW_LINK_ANCHORS
public static boolean DEBUG_DRAW_LINK_ANCHORS -
clipboardSnapshot
-
TITLE_FONT
-
BODY_FONT
-
COMMENT_MIN_WIDTH
public static final int COMMENT_MIN_WIDTH- See Also:
-
COMMENT_RESIZE_HANDLE_SIZE
public static final int COMMENT_RESIZE_HANDLE_SIZE- See Also:
-
COMMENT_MIN_HEIGHT
public static final int COMMENT_MIN_HEIGHT- See Also:
-
COMMENT_MIN_WIDTH_VALUE
public static final int COMMENT_MIN_WIDTH_VALUE- See Also:
-
CLASS_MIN_WIDTH
public static final int CLASS_MIN_WIDTH- See Also:
-
CLASS_HEADER_HEIGHT
public static final int CLASS_HEADER_HEIGHT- See Also:
-
CLASS_ROW_HEIGHT
public static final int CLASS_ROW_HEIGHT- See Also:
-
TEXT_PADDING
public static final int TEXT_PADDING- See Also:
-
CANVAS_BACKGROUND_COLOR
-
GRID_COLOR
-
SELECTION_COLOR
-
SELECTION_FILL_COLOR
-
COMMENT_CONNECTOR_COLOR
-
DEFAULT_STROKE
-
FIELD_SELECTION_STROKE
-
SELECTION_STROKE
-
LINK_DEFAULT_STROKE
-
COMMENT_CONNECTOR_SELECTION_STROKE
-
ASSOCIATION_CONNECTOR_DEFAULT_STROKE
-
ASSOCIATION_CONNECTOR_SELECTION_STROKE
-
LINK_PREVIEW_STROKE
-
LINK_HIT_DISTANCE
public static final double LINK_HIT_DISTANCE- See Also:
-
CONCEPTUAL_ANCHOR_SPACING
public static final double CONCEPTUAL_ANCHOR_SPACING- See Also:
-
SELF_LINK_OUTSIDE_OFFSET
public static final double SELF_LINK_OUTSIDE_OFFSET- See Also:
-
EXPORT_MARGIN
public static final int EXPORT_MARGIN- See Also:
-
DEFAULT_EXPORT_WIDTH
public static final int DEFAULT_EXPORT_WIDTH- See Also:
-
DEFAULT_EXPORT_HEIGHT
public static final int DEFAULT_EXPORT_HEIGHT- See Also:
-
-
Constructor Details
-
DiagramCanvas
public DiagramCanvas(MainFrame mainFrame, ModelDocument modelDocument, PanelType panelType, DocumentChangeListener documentEventListener) Creates a diagram canvas instance.- Parameters:
mainFrame- main frame that owns the canvas or actionmodelDocument- document to read or modifypanelType- diagram panel type whose model or layout should be useddocumentEventListener- listener notified when the document changes
-
-
Method Details
-
getCanvasAction
Returns the canvas action.- Parameters:
actionKey- key under which the action is registered- Returns:
- the canvas action
-
getHeight
Returns the height on the active canvas.- Parameters:
bodyFont- font used for measurement or drawing- Returns:
- the height
-
paintComponent
Paints the component.- Overrides:
paintComponentin classJComponent- Parameters:
g- graphics context supplied by Swing
-
resetUiAfterDocumentRestore
public void resetUiAfterDocumentRestore()Resets the UI after document restore on the active canvas. -
findClassById
Finds the class by ID that matches the supplied input.- Parameters:
id- stable id of the model element- Returns:
- the matching class by ID, or
nullwhen no match exists
-
findCommentById
Finds the comment by ID that matches the supplied input.- Parameters:
commentId- id of the comment to look up or modify- Returns:
- the matching comment by ID, or
nullwhen no match exists
-
findFieldById
Finds the field by ID that matches the supplied input.- Parameters:
classModel- class model affected by the operationfieldId- id of the field to look up or modify- Returns:
- the matching field by ID, or
nullwhen no match exists
-
findFieldById
Finds the field by ID that matches the supplied input.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
- the matching field by ID, or
nullwhen no match exists
-
findLinkByAssociationClassId
Finds the link by association class ID that matches the supplied input.- Parameters:
classId- id of the class to look up or modify- Returns:
- the matching link by association class ID, or
nullwhen no match exists
-
findLinkById
Finds the link by ID that matches the supplied input.- Parameters:
id- stable id of the model element- Returns:
- the matching link by ID, or
nullwhen no match exists
-
findOwnerClassOfField
Finds the owner class of field that matches the supplied input.- Parameters:
fieldId- id of the field to look up or modify- Returns:
- the matching owner class of field, or
nullwhen no match exists
-
findPrimaryKeyField
Finds the primary key field that matches the supplied input.- Parameters:
classId- id of the class to look up or modify- Returns:
- the matching primary key field, or
nullwhen no match exists
-
findType
Finds the type that matches the supplied input.- Parameters:
selectedElement- selected element to read or update- Returns:
- the matching type, or
nullwhen no match exists
-
linkEndpointExists
Checks whether the link endpoint exists.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
truewhen the condition is met; otherwisefalse
-
addToSelection
Adds the to selection.- Parameters:
element- element value used by the operation
-
clearSelection
default void clearSelection()Clears the selection. -
getSelectionInfo
Returns the selection info.- Returns:
- the selection info
-
getStyleScope
Returns the style scope on the active canvas.- Returns:
- the style scope
-
hasSelection
default boolean hasSelection()Checks whether this object has a selection.- Returns:
trueif selection exists; otherwisefalse
-
isClassSelected
Checks whether class selected is enabled or applies.- Parameters:
classId- id of the class to look up or modify- Returns:
trueif class selected is enabled or applies; otherwisefalse
-
isCommentSelected
Checks whether comment selected is enabled or applies.- Parameters:
commentId- id of the comment to look up or modify- Returns:
trueif comment selected is enabled or applies; otherwisefalse
-
isElementSelected
Checks whether element selected is enabled or applies on the active canvas.- Parameters:
element- element value used by the operation- Returns:
trueif element selected is enabled or applies; otherwisefalse
-
isFieldSelected
Checks whether field selected is enabled or applies.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
trueif field selected is enabled or applies; otherwisefalse
-
isLinkSelected
Checks whether link selected is enabled or applies.- Parameters:
linkId- id of the link to look up or modify- Returns:
trueif link selected is enabled or applies; otherwisefalse
-
removeFromSelection
Removes the from selection.- Parameters:
element- element value used by the operation
-
select
Selects an element and updates dependent UI state.- Parameters:
element- element value used by the operation
-
selectAll
default void selectAll()Selects the all on the active canvas. -
updateSelectionFromMouse
Updates the selection from mouse.- Parameters:
element- element value used by the operationevent- event object supplied by Swing
-
blankToFallback
Returns the fallback text when the preferred value is blank.- Parameters:
primary- text value for primarysecondary- text value for secondaryfallback- text value for fallback- Returns:
- the blank to fallback result
-
getEditableClassName
Returns the editable class name.- Parameters:
classModel- class model affected by the operation- Returns:
- the editable class name
-
getEditableCommentText
Returns the editable comment text.- Parameters:
commentId- id of the comment to look up or modify- Returns:
- the editable comment text
-
getEditableFieldName
Returns the editable field name.- Parameters:
fieldModel- field model affected by the operation- Returns:
- the editable field name
-
resolveClassTitle
Resolves the class title from the current model and layout state.- Parameters:
classModel- class model affected by the operation- Returns:
- the resolved class title
-
resolveFieldName
Resolves the field name from the current model and layout state.- Parameters:
fieldModel- field model affected by the operation- Returns:
- the resolved field name
-
setEditableClassName
Sets the editable class name.- Parameters:
classModel- class model affected by the operationvalue- value to process
-
setEditableCommentText
Sets the editable comment text.- Parameters:
commentId- id of the comment to look up or modifyvalue- value to process
-
setEditableFieldName
Sets the editable field name.- Parameters:
fieldModel- field model affected by the operationvalue- value to process
-
applyDefaultPaletteToClass
Applies the default palette to class.- Parameters:
classModel- class model affected by the operation
-
applyDefaultPaletteToClass
@Deprecated default void applyDefaultPaletteToClass(ClassModel classModel, boolean deep, boolean visibleOnly) Deprecated.Applies the default palette to class.- Parameters:
classModel- class model affected by the operationdeep- whether deep is enabledvisibleOnly- whether visible only is enabled
-
applyDefaultPaletteToComment
Applies the default palette to comment.- Parameters:
commentModel- comment model affected by the operation
-
applyDefaultPaletteToField
Applies the default palette to field.- Parameters:
fieldModel- field model affected by the operation
-
applyDefaultPaletteToLink
Applies the default palette to link.- Parameters:
linkModel- link model affected by the operation
-
applyPaletteToClass
Applies the palette to class.- Parameters:
palette- palette value used by the operationclassModel- class model affected by the operation
-
applyPaletteToClass
default void applyPaletteToClass(StylePalette palette, ClassModel classModel, boolean deep, boolean visibleOnly) Applies the palette to class.- Parameters:
palette- palette value used by the operationclassModel- class model affected by the operationdeep- whether deep is enabledvisibleOnly- whether visible only is enabled
-
applyPaletteToComment
Applies the palette to comment.- Parameters:
palette- palette value used by the operationcommentModel- comment model affected by the operation
-
applyPaletteToField
Applies the palette to field.- Parameters:
palette- palette value used by the operationfieldModel- field model affected by the operation
-
applyPaletteToLink
Applies the palette to link.- Parameters:
palette- palette value used by the operationlinkModel- link model affected by the operation
-
applyDefaultPaletteToSelection
Applies the default palette to selection.- Parameters:
palette- palette value used by the operation
-
applyPaletteToSelection
Applies the palette to selection.- Parameters:
palette- palette value used by the operation
-
setDefaultPalette
Sets the default palette on the active canvas.- Parameters:
defaultPalette- default palette value used by the operation
-
copySelection
default void copySelection()Copies the selection. -
cutSelection
default void cutSelection()Cuts the selection and places it on the clipboard. -
duplicateSelection
default void duplicateSelection()Duplicates the selection. -
pasteSelection
default void pasteSelection()Pastes the selection from the clipboard. -
buildSelfLinkPoints
Builds a self link points.- Parameters:
linkModel- link model affected by the operationfromPoint- point in canvas coordinatestoPoint- point in canvas coordinates- Returns:
- the built self link points
-
computePolylineMiddlePoint
Computes the polyline middle point on the active canvas.- Parameters:
points- points in canvas coordinates- Returns:
- the compute polyline middle point result
-
computeUprightAngleAtMiddle
Computes the upright angle at middle on the active canvas.- Parameters:
points- points in canvas coordinates- Returns:
- the compute upright angle at middle result
-
resolveClassCenterAnchor
Resolves the class center anchor from the current model and layout state.- Parameters:
classId- id of the class to look up or modify- Returns:
- the resolved class center anchor
-
resolveCommentCenterAnchor
Resolves the comment center anchor from the current model and layout state.- Parameters:
commentId- id of the comment to look up or modify- Returns:
- the resolved comment center anchor
-
resolveLinkGeometry
Resolves the link geometry from the current model and layout state.- Parameters:
linkModel- link model affected by the operation- Returns:
- the resolved link geometry
-
resolveLinkMiddleAnchor
Resolves the link middle anchor from the current model and layout state.- Parameters:
linkId- id of the link to look up or modify- Returns:
- the resolved link middle anchor
-
resolvePreviewSourceAnchor
Resolves the preview source anchor from the current model and layout state.- Parameters:
g2- graphics context used for drawing- Returns:
- the resolved preview source anchor
-
resolvePreviewTargetAnchor
Resolves the preview target anchor from the current model and layout state.- Parameters:
target- target value used by the operation- Returns:
- the resolved preview target anchor
-
computeConceptualAnchorPoint
default Point2D computeConceptualAnchorPoint(Rectangle2D bounds, AnchorSide side, int index, boolean big, int totalCount) Computes the conceptual anchor point on the active canvas.- Parameters:
bounds- bounds used for layout or hit testingside- node side to inspectindex- zero-based index to read or updatebig- whether big is enabledtotalCount- count value to use- Returns:
- the compute conceptual anchor point result
-
computeConceptualSideCenter
Computes the conceptual side center on the active canvas.- Parameters:
bounds- bounds used for layout or hit testingside- node side to inspectbig- whether big is enabled- Returns:
- the compute conceptual side center result
-
ensureConceptualAnchorCache
default void ensureConceptualAnchorCache()Ensures that the conceptual anchor cache exists or is up to date on the active canvas. -
getConceptualSideLinkCount
Returns the conceptual side link count.- Parameters:
classId- id of the class to look up or modifyside- node side to inspect- Returns:
- the conceptual side link count
-
invalidateConceptualAnchorCache
default void invalidateConceptualAnchorCache()Invalidates the conceptual anchor cache so it will be recalculated on the active canvas. -
rebuildConceptualAnchorCache
default void rebuildConceptualAnchorCache()Rebuilds the conceptual anchor cache on the active canvas. -
findFieldHit
default FieldHitResult findFieldHit(ClassModel classModel, Rectangle2D classBounds, Point2D.Double worldPoint) Finds the field hit that matches the supplied input.- Parameters:
classModel- class model affected by the operationclassBounds- bounds used for layout or hit testingworldPoint- point in canvas coordinates- Returns:
- the matching field hit, or
nullwhen no match exists
-
findTopmostHit
Finds the topmost hit that matches the supplied input.- Parameters:
worldPoint- point in canvas coordinates- Returns:
- the matching topmost hit, or
nullwhen no match exists
-
isInCommentResizeHandle
Checks whether in comment resize handle is enabled or applies.- Parameters:
bounds- bounds used for layout or hit testingworldPoint- point in canvas coordinates- Returns:
trueif in comment resize handle is enabled or applies; otherwisefalse
-
isPointNearGeometry
Checks whether point near geometry is enabled or applies on the active canvas.- Parameters:
worldPoint- point in canvas coordinatesgeometry- resolved link geometry to draw or inspect- Returns:
trueif point near geometry is enabled or applies; otherwisefalse
-
createExportImage
Creates an export image on the active canvas.- Parameters:
scope- export scope to use- Returns:
- the created export image
-
createExportPreviewImage
Creates an export preview image on the active canvas.- Parameters:
scope- export scope to usemaxWidth- width valuemaxHeight- height value- Returns:
- the created export preview image
-
getExportSize
Returns the export size on the active canvas.- Parameters:
scope- export scope to use- Returns:
- the export size
-
paintExport
Paints the export.- Parameters:
graphics- graphics context used for drawingrawScope- raw scope value used by the operation
-
editSelected
default void editSelected()Opens or applies editing for the selected on the active canvas. -
addComment
default void addComment()Adds the comment. -
addField
default void addField()Adds the field. -
addLink
default void addLink()Adds the link. -
addTable
default void addTable()Adds the table on the active canvas. -
deleteSelection
default void deleteSelection()Deletes the selection. -
moveFieldSelection
default void moveFieldSelection(int delta) Moves the field selection.- Parameters:
delta- numeric delta value
-
moveSelectedFieldInList
default void moveSelectedFieldInList(int delta) Moves the selected field in list.- Parameters:
delta- numeric delta value
-
addDraggedLayout
default void addDraggedLayout(List<DraggedLayout> layouts, Set<String> seen, SelectedElement element, NodeLayout fallbackLayout) Adds the dragged layout.- Parameters:
layouts- layout objects to read or modifyseen- seen value used by the operationelement- element value used by the operationfallbackLayout- layout object to read or modify
-
buildDragRenderLayers
Builds a drag render layers.- Parameters:
selection- selection state to read or update
-
createDraggedSelection
default DraggedSelection createDraggedSelection(SelectedElement hitSelection, NodeLayout hitLayout, Point2D.Double worldPoint, Rectangle2D hitBounds) Creates a dragged selection.- Parameters:
hitSelection- hit selection value used by the operationhitLayout- layout object to read or modifyworldPoint- point in canvas coordinateshitBounds- bounds used for layout or hit testing- Returns:
- the created dragged selection
-
isDragRenderingActive
default boolean isDragRenderingActive()Checks whether drag rendering active is enabled or applies.- Returns:
trueif drag rendering active is enabled or applies; otherwisefalse
-
resolveNodeLayoutForSelection
default NodeLayout resolveNodeLayoutForSelection(SelectedElement element, NodeLayout fallbackLayout) Resolves the node layout for selection from the current model and layout state.- Parameters:
element- element value used by the operationfallbackLayout- layout object to read or modify- Returns:
- the resolved node layout for selection
-
buildForeignKeyFieldName
Builds a foreign key field name.- Parameters:
targetClass- target class value used by the operationtargetField- target field value used by the operation- Returns:
- the built foreign key field name
-
buildForeignKeyFieldTechnicalName
Builds a foreign key field technical name.- Parameters:
targetClass- target class value used by the operationtargetField- target field value used by the operation- Returns:
- the built foreign key field technical name
-
buildLinkPath
Builds a link path.- Parameters:
linkModel- link model affected by the operation- Returns:
- the built link path
-
buildSelectionPath
Builds a selection path.- Returns:
- the built selection path
-
createMouseAdapter
Creates a mouse adapter on the active canvas.- Returns:
- the created mouse adapter
-
handleMouseDragged
Handles the mouse dragged on the active canvas.- Parameters:
event- event object supplied by Swing
-
getSelectedDragAnchor
Returns the selected drag anchor on the active canvas.- Parameters:
element- element value used by the operation- Returns:
- the selected drag anchor
-
handleMousePressed
Handles the mouse pressed on the active canvas.- Parameters:
event- event object supplied by Swing
-
handleMouseReleased
Handles the mouse released on the active canvas.- Parameters:
event- event object supplied by Swing
-
handleMouseWheelMoved
Handles the mouse wheel moved on the active canvas.- Parameters:
event- event object supplied by Swing
-
focusSelection
default void focusSelection() -
focusAll
default void focusAll() -
focusBounds
Moves and zooms the current canvas view so the supplied world-space bounds fit inside the viewport.- Parameters:
bounds- bounds to focus
-
appendSuffix
Appends the suffix on the active canvas.- Parameters:
value- value to processsuffix- suffix to append when needed- Returns:
- the append suffix result
-
clamp
default double clamp(double value, double min, double max) Constrains a numeric value to the supplied range.- Parameters:
value- value to processmin- numeric min valuemax- numeric max value- Returns:
- the clamp result
-
configureGraphics
Configures the graphics on the active canvas.- Parameters:
g2- graphics context used for drawing
-
createGraphicsContext
Creates a graphics context on the active canvas.- Returns:
- the created graphics context
-
ensureLayouts
default void ensureLayouts()Ensures that the layouts exists or is up to date. -
ensureTechnicalSourceField
default FieldModel ensureTechnicalSourceField(ClassModel sourceClass, ClassModel targetClass, FieldModel targetField) Ensures that the technical source field exists or is up to date.- Parameters:
sourceClass- source class value used by the operationtargetClass- target class value used by the operationtargetField- target field value used by the operation- Returns:
- the ensure technical source field result
-
findBoundTargetAnchor
Finds the bound target anchor that matches the supplied input.- Parameters:
g2- graphics context used for drawingcommentModel- comment model affected by the operation- Returns:
- the matching bound target anchor, or
nullwhen no match exists
-
getActiveLinks
Returns the active links.- Returns:
- the active links
-
getLinkCreationSource
Returns the link creation source.- Returns:
- the link creation source
-
getTechnicalSideLinkCount
Returns the technical side link count.- Parameters:
classId- id of the class to look up or modifyside- node side to inspectignoredLinkId- id of the element to read or modify- Returns:
- the technical side link count
-
getVisibleFields
Deprecated.Returns the visible fields.- Parameters:
classModel- class model affected by the operation- Returns:
- the visible fields
-
hasAssociationClass
Checks whether this object has an association class.- Parameters:
linkModel- link model affected by the operation- Returns:
trueif association class exists; otherwisefalse
-
hasOutgoingTechnicalLink
Checks whether this object has an outgoing technical link.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
trueif outgoing technical link exists; otherwisefalse
-
installKeyBindings
default void installKeyBindings()Installs the key bindings on the active canvas. -
isLinkConnectedTo
Checks whether link connected to is enabled or applies.- Parameters:
linkModel- link model affected by the operationclassId- id of the class to look up or modify- Returns:
trueif link connected to is enabled or applies; otherwisefalse
-
isValidPreviewTarget
Checks whether valid preview target is enabled or applies on the active canvas.- Parameters:
target- target value used by the operation- Returns:
trueif valid preview target is enabled or applies; otherwisefalse
-
mapId
Maps the ID on the active canvas.- Parameters:
idMap- map to read or updateoldId- id of the element to read or modify- Returns:
- the map ID result
-
getMouseWorldPos
Returns the mouse world pos on the active canvas.- Returns:
- the mouse world pos
-
getMouseViewportPos
Returns the mouse viewport pos on the active canvas.- Returns:
- the mouse viewport pos
-
normalizeConnectionSourceSelection
Normalizes the connection source selection.- Parameters:
selection- selection state to read or update- Returns:
- the normalize connection source selection result
-
normalizeConnectionTargetSelection
Normalizes the connection target selection.- Parameters:
selection- selection state to read or update- Returns:
- the normalize connection target selection result
-
notifyDocumentChanged
default void notifyDocumentChanged()Notifies the frame that the document content changed. -
notifySelectionChanged
default void notifySelectionChanged()Notifies listeners that the selection changed changed. -
openEditDialogForSelection
default void openEditDialogForSelection()Opens the edit dialog for selection. -
resolveConceptualPreviewAnchor
Resolves the conceptual preview anchor from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyreference- reference value used by the operation- Returns:
- the resolved conceptual preview anchor
-
resolveOppositeReferencePoint
Resolves the opposite reference point from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modify- Returns:
- the resolved opposite reference point
-
resolvePreviewSourceAnchorReference
Resolves the preview source anchor reference from the current model and layout state.- Returns:
- the resolved preview source anchor reference
-
resolveTechnicalEndpointSide
default AnchorSide resolveTechnicalEndpointSide(String classId, String fieldId, String oppositeClassId, String oppositeFieldId, boolean selfLink) Resolves the technical endpoint side from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modifyoppositeClassId- id of the element to read or modifyoppositeFieldId- id of the element to read or modifyselfLink- whether self link is enabled- Returns:
- the resolved technical endpoint side
-
resolveTechnicalFieldAnchor
default Point2D resolveTechnicalFieldAnchor(String classId, String fieldId, Point2D oppositeReference) Resolves the technical field anchor from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modifyoppositeReference- opposite reference value used by the operation- Returns:
- the resolved technical field anchor
-
resolveTechnicalFieldAnchor
default FieldAnchor resolveTechnicalFieldAnchor(String classId, String fieldId, String oppositeClassId, String oppositeFieldId) Resolves the technical field anchor from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modifyoppositeClassId- id of the element to read or modifyoppositeFieldId- id of the element to read or modify- Returns:
- the resolved technical field anchor
-
resolveTechnicalSelfLinkAnchor
Resolves the technical self link anchor from the current model and layout state.- Parameters:
classId- id of the class to look up or modifyfieldId- id of the field to look up or modifyside- node side to inspect- Returns:
- the resolved technical self link anchor
-
resolveTechnicalSourceEndpoint
default SelectedElement resolveTechnicalSourceEndpoint(SelectedElement source, SelectedElement target) Resolves the technical source endpoint from the current model and layout state.- Parameters:
source- source object used by the operationtarget- target value used by the operation- Returns:
- the resolved technical source endpoint
-
resolveTechnicalTargetEndpoint
Resolves the technical target endpoint from the current model and layout state.- Parameters:
target- target value used by the operation- Returns:
- the resolved technical target endpoint
-
screenToWorld
Converts screen coordinates into world coordinates.- Parameters:
point- point in canvas coordinates- Returns:
- the screen to world result
-
setAssociationClassForLink
Sets the association class for link.- Parameters:
classId- id of the class to look up or modifylinkId- id of the link to look up or modify
-
shouldExportClass
Decides whether the canvas should export class.- Parameters:
classModel- class model affected by the operation- Returns:
trueif the operation should happen; otherwisefalse
-
shouldExportComment
Decides whether the canvas should export comment.- Parameters:
commentModel- comment model affected by the operation- Returns:
trueif the operation should happen; otherwisefalse
-
shouldExportLink
Decides whether the canvas should export link.- Parameters:
linkModel- link model affected by the operation- Returns:
trueif the operation should happen; otherwisefalse
-
getViewportCenterWorld
Returns the viewport center world on the active canvas.- Returns:
- the viewport center world
-
getViewportCenter
Returns the viewport center on the active canvas.- Returns:
- the viewport center
-
worldToViewport
Converts world coordinates into viewport coordinates.- Parameters:
world- world value used by the operation- Returns:
- the world to viewport result
-
worldToviewportZoom
Converts a world-space size into a zoomed viewport size.- Parameters:
world- world value used by the operation- Returns:
- the world toviewport zoom result
-
worldToViewportZoom
Converts a world-space size into a zoomed viewport size.- Parameters:
world- world value used by the operation- Returns:
- the world to viewport zoom result
-
wrapText
Deprecated.Wraps text into lines that fit within the requested width.- Parameters:
text- text to display or editfont- font used for measurement or drawingmaxWidth- width value- Returns:
- the matching values
-
stringWidth
Measures the width of text with the supplied font.- Parameters:
titleFont- font used for measurement or drawingclassTitle- text value for class title- Returns:
- the string width result
-
installDefaultKeyBindings
Installs the default key bindings on the active canvas.- Parameters:
actions- actions value used by the operation
-
installKeyBind
default void installKeyBind(InputMap inputMap, ActionMap actionMap, KeyStroke keyStroke, String actionKey, Runnable action) Installs the key bind on the active canvas.- Parameters:
inputMap- Swing input map to updateactionMap- Swing action map to updatekeyStroke- keyboard shortcut to registeractionKey- key under which the action is registeredaction- action to register or execute
-