Class DiagramPresentationElement
- java.lang.Object
-
- com.nomagic.magicdraw.uml.MDElementImpl
-
- com.nomagic.magicdraw.uml.ElementImpl
-
- com.nomagic.magicdraw.uml.symbols.PresentationElement
-
- com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement
-
- All Implemented Interfaces:
com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer
,BaseElement
,MDElement
,ModelElementProvider
,com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
,StereotypesDisplayModeOwner
,NameOwner
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
@OpenApi public class DiagramPresentationElement extends PresentationElement implements com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner, StereotypesDisplayModeOwner, com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer
Class for representing UML diagram. Diagram purpose is to contain set of presentation elements.
For diagram creation useModelElementsManager
class.
For working with diagram presentation elements usePresentationElementsManager
class.- See Also:
ModelElementsManager
,PresentationElementsManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker
static interface
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator
Configurator for opening diagram presentation element.static class
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.PathToMoveCache
A cache for storing paths from deep symbols structure for moving together with some symbol.-
Nested classes/interfaces inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.PresentationElement.SmartListenerConfigData, com.nomagic.magicdraw.uml.symbols.PresentationElement.StructureCache
-
-
Field Summary
Fields Modifier and Type Field Description static int
CANVAS_SIZE
private com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineManager
centerlineManager
private com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer
container
private java.lang.String
contentHash
private com.nomagic.utils.ExtendedPropertyChangeSupport
contentListeners
private com.nomagic.magicdraw.uml.symbols.DiagramContentState
contentState
static java.lang.String
DIAGRAM_CONTENT_LOADED_PROPERTY
static java.lang.String
DIAGRAM_ORIENTATION_HORIZONTAL
Horizontal diagram orientation mode.static java.util.List<java.lang.String>
DIAGRAM_ORIENTATION_MODES
Diagram orientation modes.static java.lang.String
DIAGRAM_ORIENTATION_VERTICAL
Vertical diagram orientation mode.static java.util.List<java.lang.String>
DIAGRAM_USE_STEREOTYPE_MODES
Diagram use stereotype modes.private DiagramFrameView
diagramFrame
private java.lang.ref.WeakReference<DiagramSurface>
diagramSurface
private boolean
dummyMode
In dummy mode symbols in diagram may use smart autosize capabilities on resize and etc.private java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider>
dynamicRepresentationProviders
private java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider>
dynamicStyleProviders
static java.lang.String
FORCE_CONTENT_SAVE_PROPERTY
private boolean
forceStoreContentOnSave
private static java.util.Collection<com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker>
HEAVY_WEIGHT_SYMBOLS_CHECKER
private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementInitializer
initializer
Diagram presentation element initializer.private static java.lang.ThreadLocal<java.lang.Boolean>
inLoadContents
private long
lastModificationUpdateTime
For better performance we want to keep this info here, not in properties shapestatic java.util.List<java.lang.String>
LINE_JUMP_PLACES
Possible values of line jump place of a diagram.private static java.lang.String
LOAD_CONTENTS_TASK_NAME
private static java.util.concurrent.Executor
loadContentsExecutor
private com.nomagic.magicdraw.uml.symbols.SortManager
manipulationSortManager
Manager for sorted manipulation shape views in this diagram view.static int
MAX_GRID_SIZE
static int
MIN_GRID_SIZE
private boolean
modificationTimeUpdateDisabled
Explicitly prevent update diagram modification timeprivate com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator
openConfigurator
Configurator for opening diagram presentation element.private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.PathToMoveCache
pathToMoveCache
A cache for storing paths from deep symbols structure for moving together with some symbol.private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementsCache
presentationElementsCache
private java.lang.String
realType
Real type of diagram.private com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject
representation
private com.nomagic.magicdraw.uml.symbols.RequiredFeature
requiredFeature
private com.nomagic.magicdraw.uml.symbols.SortManager
sortManager
Manager for sorted shape views in this diagram viewprivate DiagramType
type
private boolean
updatingDiagramModificationTime
A flag telling that modification time for this diagram is updating at the momentprivate java.util.Set<Element>
usedElementsCache
private com.nomagic.magicdraw.core.options.DiagramViewOptions
viewOptions
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DEFAULT_LINE_WIDTH, DOTTED_STROKE, HANDLE_SIZE, MAX_LINE_WIDTH, MIN_LINE_WIDTH, SHADOW_WIDTH, SOLID_STROKE
-
Fields inherited from interface com.nomagic.magicdraw.uml.symbols.shapes.StereotypesDisplayModeOwner
DSL_STEREOTYPE_DISPLAY_MODE_ALL, DSL_STEREOTYPE_DISPLAY_MODE_LAST, DSL_STEREOTYPE_DISPLAY_MODE_NONE, DSL_STEREOTYPE_DISPLAY_MODES, STEREOTYPE_DISPLAY_MODE_DO_NOT_DISPLAY_STEREOTYPES, STEREOTYPE_DISPLAY_MODE_ICON, STEREOTYPE_DISPLAY_MODE_SHAPE_IMAGE, STEREOTYPE_DISPLAY_MODE_SHAPE_IMAGE_AND_TEXT, STEREOTYPE_DISPLAY_MODE_TEXT, STEREOTYPE_DISPLAY_MODE_TEXT_AND_ICON, STEREOTYPES_DISPLAY_MODES, STEREOTYPES_DISPLAY_MODES_SIMPLE
-
-
Constructor Summary
Constructors Constructor Description DiagramPresentationElement()
Constructs new empty diagram.DiagramPresentationElement(Diagram diagram)
DiagramPresentationElement(Diagram diagram, com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject repObject)
DiagramPresentationElement(Diagram diagram, DiagramType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(Visitor visitor)
Method accepts visitor, and calls method visit<class name>(this) of visitor .boolean
addContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the listener for changes in all symbols contained in the diagram.private void
addDefaultDynamicStyleProviders()
static void
addDiagramCreationInfo(Diagram diagram)
static void
addDiagramCreationInfo(Diagram diagram, boolean overwrite)
void
addDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
void
addDynamicStyleProvider(com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider dynamicStyleProvider)
void
addPresentationElement(PresentationElement element, int index)
Add given child to this symbol at given indexvoid
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Just hack, registers the same listener to the containerprivate <T> void
addProvider(T provider, java.util.Collection<T> providers)
static void
adjustInitialDiagramFrameBounds(java.awt.Rectangle bounds)
Adjust initial diagram frame bounds.void
applyForcedProperties()
Applies properties stored in default style for diagram and marked as forced.boolean
areFeaturesAvailable()
void
atInsert()
Invalidates object at insertvoid
autosizeSuspendedSymbolsWithHiddenContent()
private java.awt.Rectangle
calculateInitialDiagramFrameBounds()
Gets bounds which should be set for the diagram's frame.boolean
canAddChild(PresentationElement o)
Check of given symbol can be added as child into this symbol.boolean
canAddInstance(PresentationElement view)
Object view has no children.boolean
canDeleteChild(BaseElement obj)
Checks if given element can be deleted from this element.private void
cleanupAfterLoad()
private void
clearUsedElementsCache()
DiagramPresentationElement
clone()
Returns a copy of theElement
.void
close()
Closes diagram window.void
close(boolean closeWindow)
Closes opened diagram If close window is 'false' and there is a possibility to back to previous diagram in that window, when previous diagram is opened Otherwise, diagram window is closedjava.util.Collection<PresentationElement>
collectPresentationElementsRecursively()
Collects all elements in this diagram recursively.java.util.Collection<PresentationElement>
collectShowingManipulatedElementsRecursively()
Collects all visible manipulated elements in this diagram recursively.java.util.Collection<PresentationElement>
collectShowingPresentationElementsRecursively()
Collects all visible elements in this diagram recursively.private static void
collectUsedModelElements(PresentationElement element, java.util.Set<Element> result)
boolean
coversPoint(int x, int y)
checks if object covers provided pointprivate void
createDiagramFrame()
void
createDiagramInfoShape(boolean simple)
protected void
createPropertyManager()
Create default property manager for Diagram, initializes default properties.void
dispose()
disposes ends of links when link is deletedprivate void
doLoadContent(ProgressStatus status)
private void
doUnload()
void
ensureLoaded()
Ensures that diagram is loaded.private static void
executeInLoadContentsState(java.lang.Boolean state, java.lang.Runnable runnable)
PresentationElement
findPresentationElement(Element element, java.lang.Class presentationElementClass)
Finds presentation element for given model element of given symbol type in this diagram.PresentationElement
findPresentationElementForPathConnecting(BaseElement element, java.lang.Class presentationElementClass)
Finds presentation element to connect some PathElement for given model element of given type in this diagram.java.util.stream.Stream<PresentationElement>
findPresentationElementsForPathConnecting(Element element, java.lang.Class presentationElementClass)
Finds presentations element to connect some PathElement for given model element of given type in this diagram.private static Property
findStereotypePropertyFor(Element element, java.lang.String propertyName)
Looks for first available property with given name among available stereotypes for given element.protected void
fireContentPropertyChange(PresentationElement source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners.void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners.java.lang.String
getAspectRatioMode()
java.awt.Color
getBackgroundColor()
java.awt.Rectangle
getBounds()
Delegate bounds request to its container.com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineManager
getCenterlineManager()
Gets centerline manager for this diagram.com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer
getContainer()
java.lang.String
getContentHash()
com.nomagic.magicdraw.uml.symbols.DiagramContentState
getContentState()
static java.lang.String
getCurrentDate()
DiagramLayouter
getDefaultDiagramLayouter()
Style
getDefaultStyleForDiagram(StyleManager styleManager)
Finds style for this diagramjava.lang.String
getDefaultStyleID()
Diagram
getDiagram()
Returns Diagram model element of this presentation element.DiagramFrameView
getDiagramFrame()
Get the frame of the diagram.com.nomagic.magicdraw.uml.symbols.DiagramNotLoadedReasons
getDiagramNotLoadedReasons()
java.lang.String
getDiagramOrientationMode()
Gets diagram orientation mode.DiagramPresentationElement
getDiagramPresentationElement()
Returns diagram of this presentation element.DiagramPropertiesShape
getDiagramPropertiesShape()
DiagramSurface
getDiagramSurface()
Returns diagram surface for this presentation element.DiagramType
getDiagramType()
Returns the type of the diagram.com.nomagic.magicdraw.core.options.DiagramViewOptions
getDiagramViewOptions()
Gets diagram view options.long
getDiagramWindowActivationTime()
Returns diagram activation time.java.lang.String
getDSLStereotypesDisplayMode()
Gets DSL stereotype display mode.java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider>
getDynamicRepresentationProviders()
java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider>
getDynamicStyleProviders()
Diagram
getElement()
Returns model element of this presentation element.int
getGridSize()
java.lang.String
getHumanType()
Returns human representation of the data typejava.lang.String
getID()
Returns the ID of theElement
.java.lang.String
getLineJumpPlace()
Returns current line jump place value of the diagram.PresentationElement
getManipulatedElementAt(java.awt.Point pt)
Gets manipulate object view at specified point pt.PresentationElement
getManipulatedElementAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Gets manipulate symbol at specified point pt.com.nomagic.magicdraw.uml.symbols.SortManager
getManipulationSortManager()
Returns manipulation sort manager for this diagram view.java.lang.String
getName()
Gets the name of thisDiagramPresentationElement
object.com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator
getOpenConfigurator()
float
getPathGridSize()
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.PathToMoveCache
getPathToMoveCache()
PresentationElement
getPresentationElementAt(java.awt.Point relativePoint)
Searches and returns object that covers given point.PresentationElement
getPresentationElementAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Gets object view at point.java.util.List<PresentationElement>
getPresentationElements()
Returns all children of this elementjava.util.List<PresentationElement>
getPresentationElementsAt(java.awt.Point pt)
Searches and returns all objects that covers given point.java.util.List<PresentationElement>
getPresentationElementsAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Gets object view at point.Property
getProperty(java.lang.String id)
Returns element's property with given id.java.lang.String
getRealType()
Returns real diagram type.com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject
getRepresentation()
com.nomagic.magicdraw.uml.symbols.RequiredFeature
getRequiredFeature()
Required feature can be plugin or core feature.java.awt.Point
getScrollPosition()
Gets scroll position of the diagram.com.nomagic.magicdraw.uml.symbols.SortManager
getSortManager()
Returns sort manager for this diagram view.java.util.List<com.nomagic.magicdraw.uml.symbols.SortManager>
getSortManagers(boolean create)
Gets sort managers registered for this diagram.java.lang.String
getStereotypesDisplayMode()
Gets stereotype display mode.java.lang.String
getSuspendShapeAutoResizeMode()
java.lang.String
getUnsupportedReason()
Returns if possible reason why this diagram cannot be loaded, otherwise -null
.java.util.Collection<Element>
getUsedModelElements()
Returns collection of model elements that has views in this diagram.java.util.Collection<Element>
getUsedModelElements(boolean checkOnlyPersistent)
Deprecated.checkOnlyPersistent parameter is ignored.java.util.Collection<Element>
getUsedModelElements(boolean checkOnlyPersistent, boolean checkOnlyFriendly)
Deprecated.checkOnlyPersistent and checkOnlyFriendly parameters are ignored.java.util.Set<Element>
getUsedModelElements(UsedElementPolicy usedElementPolicy)
Returns collection of model elements that are used in this diagram.java.lang.String
getUseStereotypeMode()
Gets diagram use stereotype mode.java.awt.Rectangle
getVisibleBounds()
Returns user visible bounds of the diagram.float
getZoom()
boolean
hasDiagramSurface()
boolean
hasHeavyWeightSymbols()
Check is diagram has heavy weight symbols - symbols those can be painted correctly only if diagram is displayed in some JComponentprivate boolean
hasManipulationSortManager()
Indicates if diagram has manipulation sort manager.boolean
hasRegisteredRealTypeDescriptor()
boolean
hasSelectableSymbols()
boolean
hasVerticalOrientation()
Returns true if diagram has vertical orientation.void
initialize()
Initialize symbol and its children state.void
internalApplyProperties(PropertyManager man)
Applies properties from given property managervoid
internalSilentApply()
Silently applies all properties after initializationboolean
intersects(int x, int y, int width, int height)
checks whether object intersects with given rectanglestatic void
invokeOnDispatcher(java.lang.Runnable runnable)
boolean
isActive()
boolean
isAutosized()
boolean
isDiagramWindowActive()
Indicates if diagram is active.boolean
isDiagramWindowOpen()
Indicates if diagram is opened.boolean
isDummyMode()
boolean
isElementInDiagram(Element element)
Checks if given element exist in any diagram.boolean
isElementInDiagram(Element element, boolean skipProxyCheck, UsedElementPolicy usedElementPolicy)
Checks if given element exist in any diagram.boolean
isElementInDiagram(Element element, UsedElementPolicy usedElementPolicy)
Checks if given element exist in any diagram.boolean
isEmpty()
boolean
isForceStoreContentOnSave()
boolean
isInitialFrameSizeSet()
boolean
isLabelsAutoDisplaySuspended()
boolean
isLoaded()
Check if diagram is loaded.boolean
isModificationTimeUpdateDisabled()
Indicates if automatic diagram modification time update is disabledboolean
isOpening()
boolean
isPluginAvailable()
boolean
isProfileLoaded()
boolean
isShapesAutoResizeSuspended()
boolean
isShowAbbreviatedDiagramType()
boolean
isShowActivations()
boolean
isShowContextKind()
boolean
isShowContextName()
boolean
isShowContextType()
boolean
isShowDiagramFrame()
boolean
isShowDiagramInfo()
boolean
isShowDiagramName()
boolean
isShowDiagramOwner()
boolean
isShowDiagramType()
boolean
isShowGrid()
boolean
isShowMessageNumbers()
boolean
isShowParameters()
boolean
isSnapToGridPaths()
boolean
isSnapToGridShapes()
boolean
isSupported()
boolean
isSymbolDiagram()
Checks if diagram displays symbols as its contents.boolean
isUseAdvancedNumbering()
boolean
isUseFlowLayoutLogic()
Indicates if smart path/shape edit should be used in this diagram.boolean
isUseGradientForFill()
Do we need to use gradient for fill color? Returns value of fill gradient property.boolean
layout(boolean useCommands)
Layout the diagram using default layouter.boolean
layout(boolean useCommands, DiagramLayouter layouter)
Layouts the diagram with the specified layouter.boolean
layout(boolean useCommands, DiagramLayouter diagramLayouter, AbstractDiagramLayouterOptionsGroup options)
Layout the diagram.void
loadContents(ProgressStatus status)
Loads diagram to memory.void
loadDiagramViewOptions()
Loads values of @DiagramViewOptions
for this diagram from project options.protected void
onFontChange()
void
open()
Open the diagramvoid
open(boolean showProgress)
Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already openvoid
open(boolean loadContent, boolean showProgress)
Open the diagram.void
open(boolean loadContent, boolean showProgress, boolean inActiveTab)
Open the diagram.void
openInActiveTab(boolean showProgress)
Open diagram in currently active diagram tab If no other diagram is opened yet, creates a new tab If this diagram is already opened, simply activates that tabvoid
paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
void
paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
void
positionDiagramInfoShapeOnFrame(DiagramPropertiesShape shape)
void
preferredSize(java.awt.Dimension dim)
void
propertyChange(java.beans.PropertyChangeEvent evt)
Listens for property change it can be: data was edited text box was editedvoid
recalculateInternalDataRequired()
void
recursiveAutosize()
Resize recursively all symbols.static void
registerHeavyWeightSymbolsChecker(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker checker)
void
registerInProject()
private boolean
rejectAddAsPartView(PresentationElement view)
boolean
removeContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregister the given listener from the diagram.private void
removeDiagramViewOptions()
Removes @DiagramViewOptions
of this diagram from project options.void
removeDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
void
removeDynamicStyleProvider(com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider dynamicStyleProvider)
void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Just hack, unregister the same listener from the containerprivate <T> void
removeProvider(T provider, java.util.Collection<T> providers)
private void
repaintLater()
void
resetContainer()
In case diagram type changes in wayDiagramObjectViewContainer
needs to be changed it should be reset and new one will be created ongetContainer()
first call.void
resetLastModificationUpdateTime()
Reset cached last diagram modification time.void
sAddPresentationElement(PresentationElement element, int index)
Add given child to this symbol at given indexvoid
setAspectRatioMode(java.lang.String mode)
void
setAutosize(boolean val)
void
setBounds(java.awt.Rectangle r)
sets bounds( empty method )void
setContentHash(java.lang.String contentHash)
sets identifier of contents.void
setDefaultStyleID(java.lang.String id)
Sets new diagram style id to representation objectprivate static void
setDiagramInfoTagValue(Diagram diagram, java.lang.String tagName, java.util.function.Supplier<java.lang.String> value, boolean overwrite, java.util.Collection<TaggedValue> taggedValues)
void
setDiagramOrientationMode(java.lang.String mode)
Sets diagram orientation mode.void
setDiagramRepresentationObject(com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject repObject)
Initializes all persistent data from it's representation object except for diagram contents.void
setDiagramSurface(DiagramSurface canvas)
void
setDiagramType(DiagramType type)
Sets the type of the diagram and fires the property change event with name ExtendedPropertyNames.EDIT_DIAGRAM_TYPE .void
setDSLStereotypesDisplayMode(java.lang.String mode)
Sets DSL stereotype display mode value.void
setDummyMode(boolean dummyMode)
void
setForceStoreContentOnSave(boolean forceStoreContentOnSave)
void
setGridSize(int grid)
Sets grid size.void
setID(java.lang.String id)
Sets the specified ID to theElement
.void
setInitialDiagramFrameBounds()
Sets initial diagram frame bounds for this diagram's frame.void
setInitialFrameSizeSet(boolean value)
Set a flag that diagram frame size should not be recalculated on opening.void
setInitializer(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementInitializer initializer)
Sets custom diagram presentation element initializer.void
setLabelsAutoDisplaySuspended(boolean enabled)
void
setModificationTimeUpdateDisabled(boolean modificationTimeUpdateDisabled)
Disables automatic diagram modification time update.void
setOpenConfigurator(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator openConfigurator)
Sets open configurator.void
setPresentationElements(java.util.List<PresentationElement> elements)
Sets children of this elementvoid
setRealType(java.lang.String realType)
If diagram type is not registered then known type is set.void
setRequiredFeature(com.nomagic.magicdraw.uml.symbols.RequiredFeature feature)
Sets required feature for this diagram.void
setShapesAutoResizeSuspended(boolean enabled)
void
setShowAbbreviatedDiagramType(boolean show)
void
setShowActivations(boolean b)
void
setShowContextKind(boolean show)
void
setShowContextName(boolean show)
void
setShowContextType(boolean show)
void
setShowDiagramFrame(boolean show)
private void
setShowDiagramFrame(boolean show, boolean useSimpleSet)
void
setShowDiagramInfo(boolean showDiagramInfo)
void
setShowDiagramName(boolean show)
void
setShowDiagramOwner(boolean show)
void
setShowDiagramType(boolean show)
void
setShowGrid(boolean showGrid)
Sets show grid flagvoid
setShowMessageNumbers(boolean b)
void
setShowParameters(boolean show)
void
setSnapToGridPaths(boolean snap)
void
setSnapToGridShapes(boolean snap)
Sets show grid flagvoid
setStereotypesDisplayMode(java.lang.String mode)
Sets stereotype display mode value.void
setSuspendShapeAutoResizeMode(java.lang.String mode)
void
setUseAdvancedNumbering(boolean b)
void
setUseGradientForFill(boolean use)
Sets elements gradient fill option.void
setUseStereotypeMode(java.lang.String mode)
Sets diagram use stereotype mode.void
setZoom(float zoom)
(package private) com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer
sGetContainer()
private void
snapViewToGrid()
Snap all views to the grid.void
snapViewToGrid(PresentationElement el)
Snaps provided presentation element to gridvoid
sSetAspectRatioMode(java.lang.String mode)
void
sSetAutosize(boolean val)
void
sSetBounds(java.awt.Rectangle r)
sets bounds( empty method )void
sSetDiagramActivationTime(long activationTime)
Marks diagram window activation time.void
sSetDiagramFrame(DiagramFrameView diagramFrame)
void
sSetDiagramOrientationMode(java.lang.String mode)
Simple set for diagram orientation mode propertyvoid
sSetDiagramType(DiagramType type)
Sets the type of the diagram.void
sSetDiagramWindowActive(boolean active)
Marks diagram window (in)active.void
sSetDiagramWindowOpen(boolean open)
Marks diagram window open/close.void
sSetDSLStereotypesDisplayMode(java.lang.String mode)
Simple sets (no updates) DSL stereotypes display mode.void
sSetElement(Element element)
Sets diagram element for this object.private void
sSetForceStoreContentOnSave(boolean forceStoreContentOnSave)
void
sSetGridSize(int grid)
Sets grid size.void
sSetLabelsAutoDisplaySuspended(boolean enabled)
void
sSetLineJumpPlace(java.lang.String lineJumpPlace)
Sets value of line jump place.void
sSetPresentationElements(java.util.List<PresentationElement> elements)
Sets children of this elementvoid
sSetScrollPosition(java.awt.Point p)
Sets scroll position of the diagram.void
sSetShapesAutoResizeSuspended(boolean enabled)
void
sSetShowAbbreviatedDiagramType(boolean show)
void
sSetShowActivations(boolean b)
void
sSetShowContextKind(boolean show)
void
sSetShowContextName(boolean show)
void
sSetShowContextType(boolean show)
void
sSetShowDiagramFrame(boolean show)
void
sSetShowDiagramInfo(boolean b)
void
sSetShowDiagramName(boolean show)
void
sSetShowDiagramOwner(boolean show)
void
sSetShowDiagramType(boolean show)
void
sSetShowGrid(boolean showGrid)
Sets show grid flagvoid
sSetShowParameters(boolean show)
void
sSetSnapToGridPaths(boolean snap)
void
sSetSnapToGridShapes(boolean snap)
Sets show grid flagvoid
sSetStereotypesDisplayMode(java.lang.String mode)
Simple sets (no updates) stereotypes display mode.void
sSetSuspendShapeAutoResizeMode(java.lang.String mode)
void
sSetUseStereotypeMode(java.lang.String mode)
Simple set for diagram use stereotype mode propertyvoid
sSetZoom(float zoom)
Sets zoom size.void
unloadDiagram()
Disposes all symbols and creates not loaded data.void
unregisterFromProject()
static void
unRegisterHeavyWeightSymbolsChecker(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker checker)
private void
updateDiagramFrame()
Updates diagram frame for this diagram.void
updateDiagramPropertiesShapeModificationTime()
void
updateFrameSize(PresentationElement element)
boolean
useParentProperties()
Does this element uses parent properties or has it own?-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addPresentationElementWithoutResize, addProperty, adjustBoundsForMoving, adjustChildBounds, adjustChildBoundsForMoving, alwaysShowTooltip, applyProperties, askDeleteDataConfirmation, atInsertChildren, autosizeAndResizeManipulatedParent, autosizeAndResizeParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddInstance, canBeDisposedOnUpdate, canChangeElementParent, canChangeParent, canChangeParent, canFill, canHavePaths, changeProperties, changeProperty, changePropertyManager, checkElementParentOnAdd, checkProxyVisibility, checkShowsProxy, childrenForMoving, clearAntialiasingState, clearShowsProxy, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, constructChangePropertyCommand, createPropertyChangeListener, createSmartListenerConfig, disposeChildren, disposeListener, draw, drawBackground, drawSymbol, drawSymbolBackground, dynamicFillColor, dynamicLineColor, dynamicLineWidth, dynamicLineWidth, dynamicPaintShadow, dynamicStroke, dynamicStroke, dynamicStroke, dynamicStyleFillColor, dynamicStyleFillPaint, dynamicStyleLineColor, dynamicStyleTextColor, dynamicStyleTransparency, dynamicStyleTransparency, dynamicStyleValue, dynamicTextAlignment, dynamicTextColor, editName, editName, findParentForData, findPresentationElement, generateID, getActualElement, getActualProperty, getAdditionalRenderersToNotify, getAssignableModelElementsClasses, getBooleanPropertyValue, getBoundsShape, getBoundsToRepaint, getBoundsWithChildrenOnEdge, getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getChildPresentationElementForContextMenu, getChildrenWithSymbolProperties, getConfiguration, getDrawComparator, getDynamicConfigurations, getDynamicStyleOwner, getElementNumberDisplayMode, getElementsForLinkConnecting, getElementToConnectLink, getElementToMove, getExpectedDataParent, getFillColor, getFont, getFontHeight, getFontRenderContext, getHumanName, getIntersection, getLineColor, getLineWidth, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getManipulationPreferredDimension, getMiddlePoint, getMiddlePoint, getMiddlePointX, getMiddlePointX, getMiddlePointY, getMiddlePointY, getMinimumDimension, getNotCopyBounds, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolPropertyOwner, getPreferredBounds, getPreferredDimension, getPreferredDimensionForAutosize, getPreferredSize, getPresentationElementAt, getPresentationElementCount, getPresentationElementIndex, getPresentationElementStroke, getPresentationElementStroke, getProjectImpl, getPropertyManager, getPropertyManagerName, getRealPropertyManager, getRenderer, getSelected, getStereotypeColor, getStereotypeFont, getStringPropertyValue, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, getSymbolRenderer, getTextColor, getTolerance, getVisibility, getVisiblePresentationElements, handleModelDelete, hasManipulatedPresentationElements, hasManipulator, hasSharedData, initializeAndAutosize, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetBoundsShape, internalGetElementsForLinkConnecting, internalGetElementToConnectLink, internalGetPresentationElementStroke, internalSnapToGrid, internalSnapToGrid, internalUpdatePresentationElement, invalidate, isCanChildrenChangeEdge, isChildVisible, isContentHidden, isCreateElementListener, isDetectable, isDisposed, isLayouting, isMovableByMoveManager, isNotNull, isParentOf, isParentOf, isPreserveProportionsWhenGrowing, isSelected, isShowElementTypeAsLabel, isShowsProxy, isSnapToGrid, isSortable, isTestUpdateFlag, isTextEditable, isUseFillColor, isUseFillColorByProperty, isVisible, isVisibleInDiagram, isVisibleOrShrunken, movePathElements, movePathElementsRecursively, mustShowContextMenu, notifyCreated, notifyDiagramFrameSizeChange, notifyRepaintManager, onFind, onFind, paintAdornments, paintAdornmentsBackground, paintChildrenAndAdornments, paintChildrenBackground, paintSelfBackground, preDisposeOnUpdate, prepareForFillDrawing, prepareForLineDrawing, prepareForShadowDrawing, prepareForTextDrawing, recreateListeners, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, removePresentationElement, resizeParent, sAddPresentationElement, selectChildrenForMoving, selectObjectsForMoving, selectPathsForMoving, setAllSelected, setBounds, setCreateElementListener, setDummyResizeMode, setElement, setFillColor, setFont, setFontProperty, setLayouting, setLineColor, setLineWidth, setLoadedVisibility, setLocation, setLocation, setNeedRecreateListeners, setParent, setPropertyManager, setPropertyManagerName, setSelected, setSelected, setSize, setSize, setSize, setStereotypeColor, setStereotypeFont, setStrokeIfNotTheSame, setTestUpdateFlag, setTextColor, setTextColorProperty, setTextEditable, setUseFillColor, setVisibility, setVisible, silentApply, silentApply, simpleSetBounds, simpleSetBounds, snapToGrid, snapToGrid, snapViewToGrid, sortObjectsByX, sortObjectsByY, sRemovePresentationElement, sSetBounds, sSetLineWidth, sSetLocation, sSetLocation, sSetParent, sSetParentForAll, sSetSize, sSetSize, sSetSize, sSetVisibility, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, updateLater, updateModelByView, updateModelByViewInternal, updateViewAfterPropertyChange
-
Methods inherited from class com.nomagic.magicdraw.uml.MDElementImpl
accept, canAdd, canAdd, canAddChild, canBeDeleted, compareTo, createSortKeys, getClassType, getCommandForAppending, getProject, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, setProjectProvider, sGetID, toString
-
-
-
-
Field Detail
-
FORCE_CONTENT_SAVE_PROPERTY
public static final java.lang.String FORCE_CONTENT_SAVE_PROPERTY
- See Also:
- Constant Field Values
-
MIN_GRID_SIZE
public static final int MIN_GRID_SIZE
- See Also:
- Constant Field Values
-
MAX_GRID_SIZE
public static final int MAX_GRID_SIZE
- See Also:
- Constant Field Values
-
CANVAS_SIZE
public static final int CANVAS_SIZE
- See Also:
- Constant Field Values
-
forceStoreContentOnSave
private boolean forceStoreContentOnSave
-
DIAGRAM_CONTENT_LOADED_PROPERTY
public static final java.lang.String DIAGRAM_CONTENT_LOADED_PROPERTY
- See Also:
- Constant Field Values
-
HEAVY_WEIGHT_SYMBOLS_CHECKER
private static final java.util.Collection<com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker> HEAVY_WEIGHT_SYMBOLS_CHECKER
-
LOAD_CONTENTS_TASK_NAME
private static final java.lang.String LOAD_CONTENTS_TASK_NAME
- See Also:
- Constant Field Values
-
inLoadContents
private static final java.lang.ThreadLocal<java.lang.Boolean> inLoadContents
-
dynamicStyleProviders
private java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider> dynamicStyleProviders
-
dynamicRepresentationProviders
private final java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider> dynamicRepresentationProviders
-
modificationTimeUpdateDisabled
private boolean modificationTimeUpdateDisabled
Explicitly prevent update diagram modification time
-
lastModificationUpdateTime
private long lastModificationUpdateTime
For better performance we want to keep this info here, not in properties shape
-
updatingDiagramModificationTime
private boolean updatingDiagramModificationTime
A flag telling that modification time for this diagram is updating at the moment
-
dummyMode
private boolean dummyMode
In dummy mode symbols in diagram may use smart autosize capabilities on resize and etc.
-
loadContentsExecutor
private static final java.util.concurrent.Executor loadContentsExecutor
-
container
@CheckForNull private com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer container
-
sortManager
@CheckForNull private com.nomagic.magicdraw.uml.symbols.SortManager sortManager
Manager for sorted shape views in this diagram view
-
manipulationSortManager
@CheckForNull private com.nomagic.magicdraw.uml.symbols.SortManager manipulationSortManager
Manager for sorted manipulation shape views in this diagram view.
-
diagramSurface
private java.lang.ref.WeakReference<DiagramSurface> diagramSurface
-
contentState
private final com.nomagic.magicdraw.uml.symbols.DiagramContentState contentState
-
viewOptions
private com.nomagic.magicdraw.core.options.DiagramViewOptions viewOptions
-
diagramFrame
@CheckForNull private DiagramFrameView diagramFrame
-
requiredFeature
@CheckForNull private com.nomagic.magicdraw.uml.symbols.RequiredFeature requiredFeature
-
contentListeners
@CheckForNull private com.nomagic.utils.ExtendedPropertyChangeSupport contentListeners
-
DIAGRAM_ORIENTATION_VERTICAL
public static final java.lang.String DIAGRAM_ORIENTATION_VERTICAL
Vertical diagram orientation mode.- See Also:
- Constant Field Values
-
DIAGRAM_ORIENTATION_HORIZONTAL
public static final java.lang.String DIAGRAM_ORIENTATION_HORIZONTAL
Horizontal diagram orientation mode.- See Also:
- Constant Field Values
-
DIAGRAM_ORIENTATION_MODES
public static final java.util.List<java.lang.String> DIAGRAM_ORIENTATION_MODES
Diagram orientation modes.
-
DIAGRAM_USE_STEREOTYPE_MODES
public static final java.util.List<java.lang.String> DIAGRAM_USE_STEREOTYPE_MODES
Diagram use stereotype modes.
-
LINE_JUMP_PLACES
public static final java.util.List<java.lang.String> LINE_JUMP_PLACES
Possible values of line jump place of a diagram.
-
centerlineManager
@CheckForNull private com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineManager centerlineManager
-
representation
private com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject representation
-
type
private DiagramType type
-
realType
@CheckForNull private java.lang.String realType
Real type of diagram. This value maybe different from mType if realType is not registered
-
openConfigurator
@CheckForNull private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator openConfigurator
Configurator for opening diagram presentation element. It knows if open action is supported and has action which is executed before open is performed; if action returns false, open is canceled.
-
initializer
private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementInitializer initializer
Diagram presentation element initializer. It can be set custom initializer for every diagram presentation element.
-
contentHash
@CheckForNull private java.lang.String contentHash
-
pathToMoveCache
private final com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.PathToMoveCache pathToMoveCache
A cache for storing paths from deep symbols structure for moving together with some symbol. The calculation of these paths is time consuming operation, so it is better to cache these calculations and update them if structure is changed (path is connected to some symbol or path is added/removed from some symbol)
-
usedElementsCache
@CheckForNull private java.util.Set<Element> usedElementsCache
-
presentationElementsCache
private com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementsCache presentationElementsCache
-
-
Constructor Detail
-
DiagramPresentationElement
@OpenApi public DiagramPresentationElement()
Constructs new empty diagram. Do not use this constructor to create a diagram explicitly. Open API provides method for diagrams creation.
-
DiagramPresentationElement
public DiagramPresentationElement(@CheckForNull Diagram diagram)
-
DiagramPresentationElement
public DiagramPresentationElement(@CheckForNull Diagram diagram, @CheckForNull DiagramType type)
-
DiagramPresentationElement
public DiagramPresentationElement(@CheckForNull Diagram diagram, @CheckForNull com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject repObject)
-
-
Method Detail
-
addDefaultDynamicStyleProviders
private void addDefaultDynamicStyleProviders()
-
setDiagramRepresentationObject
public void setDiagramRepresentationObject(com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject repObject)
Initializes all persistent data from it's representation object except for diagram contents.- Parameters:
repObject
- object
-
hasRegisteredRealTypeDescriptor
public boolean hasRegisteredRealTypeDescriptor()
-
createDiagramFrame
private void createDiagramFrame()
-
sSetDiagramType
@OpenApi public void sSetDiagramType(@CheckForNull DiagramType type)
Sets the type of the diagram.- Parameters:
type
- the type of the diagram
-
setDiagramType
@OpenApi public void setDiagramType(DiagramType type)
Sets the type of the diagram and fires the property change event with name ExtendedPropertyNames.EDIT_DIAGRAM_TYPE .- Parameters:
type
- the type of the diagram- See Also:
ExtendedPropertyNames.EDIT_DIAGRAM_TYPE
,Project
-
getDiagramType
@OpenApi public DiagramType getDiagramType()
Returns the type of the diagram.- Returns:
- the type of the diagram
- See Also:
DiagramTypes.UML_CLASS_DIAGRAM
,DiagramTypes.UML_USECASE_DIAGRAM
,DiagramTypes.UML_COMMUNICATION_DIAGRAM
,DiagramTypes.UML_SEQUENCE_DIAGRAM
,DiagramTypes.UML_STATECHART_DIAGRAM
,DiagramTypes.UML_PROTOCOL_STATE_MACHINE_DIAGRAM
,DiagramTypes.UML_ACTIVITY_DIAGRAM
,DiagramTypes.UML_COMPOSITE_STRUCTURE_DIAGRAM
,DiagramTypes.UML_OBJECT_DIAGRAM
,DiagramTypes.UML_PACKAGE_DIAGRAM
,DiagramTypes.UML_COMPONENT_DIAGRAM
,DiagramTypes.UML_DEPLOYMENT_DIAGRAM
,DiagramTypes.UML_PROFILE_DIAGRAM
-
dispose
public void dispose()
Description copied from class:PresentationElement
disposes ends of links when link is deleted- Specified by:
dispose
in interfaceBaseElement
-
unregisterFromProject
public void unregisterFromProject()
-
removeDiagramViewOptions
private void removeDiagramViewOptions()
Removes @DiagramViewOptions
of this diagram from project options.
-
atInsert
public void atInsert()
Description copied from class:PresentationElement
Invalidates object at insert- Specified by:
atInsert
in interfaceBaseElement
-
registerInProject
public void registerInProject()
-
loadDiagramViewOptions
public void loadDiagramViewOptions()
Loads values of @DiagramViewOptions
for this diagram from project options.
-
getHumanType
public java.lang.String getHumanType()
Returns human representation of the data type- Specified by:
getHumanType
in interfaceBaseElement
- Returns:
- the name of the data
-
clone
public DiagramPresentationElement clone()
Description copied from class:ElementImpl
Returns a copy of theElement
.- Specified by:
clone
in interfaceBaseElement
- Returns:
- the cloned object
-
getDiagram
@OpenApi public Diagram getDiagram()
Returns Diagram model element of this presentation element.- Returns:
- Diagram object of this element.
- See Also:
getElement()
-
getElement
public Diagram getElement()
Description copied from class:PresentationElement
Returns model element of this presentation element. Some presentation elements (for example TextBoxes) do not have model elements.- Specified by:
getElement
in interfaceModelElementProvider
- Overrides:
getElement
in classPresentationElement
- Returns:
- model element of this presentation element.
-
sSetZoom
public void sSetZoom(float zoom)
Sets zoom size.- Parameters:
zoom
- zoom value
-
setZoom
public void setZoom(float zoom)
-
getZoom
public float getZoom()
- Returns:
- diagram zoom value
-
paintSelf
public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
-
paintChildren
public void paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
Description copied from class:PresentationElement
Listens for property change it can be: data was edited text box was edited- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
getContainer
public com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer getContainer()
- Returns:
- diagram container
-
intersects
public boolean intersects(int x, int y, int width, int height)
checks whether object intersects with given rectangle- Returns:
- true if object and rectangle intersects
-
coversPoint
public boolean coversPoint(int x, int y)
checks if object covers provided point- Returns:
- true if object covers this point
-
sAddPresentationElement
public void sAddPresentationElement(PresentationElement element, int index)
Description copied from class:PresentationElement
Add given child to this symbol at given index- Parameters:
element
- child to addindex
- index to add at. Can be -1
-
addPresentationElement
public void addPresentationElement(PresentationElement element, int index)
Description copied from class:PresentationElement
Add given child to this symbol at given index- Parameters:
element
- child to addindex
- index to add at. Can be -1
-
isEmpty
public boolean isEmpty()
-
getPresentationElements
public java.util.List<PresentationElement> getPresentationElements()
Description copied from class:PresentationElement
Returns all children of this element- Overrides:
getPresentationElements
in classPresentationElement
- Returns:
- all children of this element. The collection is unmodifiable.
-
setPresentationElements
public void setPresentationElements(java.util.List<PresentationElement> elements)
Description copied from class:PresentationElement
Sets children of this element- Parameters:
elements
- children
-
sSetPresentationElements
public void sSetPresentationElements(java.util.List<PresentationElement> elements)
Description copied from class:PresentationElement
Sets children of this element- Parameters:
elements
- children
-
setBounds
public void setBounds(java.awt.Rectangle r) throws NoRectangleDefinedException
sets bounds( empty method )- Parameters:
r
- rectangle of bounds- Throws:
NoRectangleDefinedException
- always
-
sSetBounds
public void sSetBounds(java.awt.Rectangle r) throws NoRectangleDefinedException
sets bounds( empty method )- Parameters:
r
- rectangle of bounds.- Throws:
NoRectangleDefinedException
- always
-
accept
@OpenApi public void accept(Visitor visitor) throws java.lang.Exception
Description copied from interface:MDElement
Method accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.
-
open
@OpenApi public void open()
Open the diagram
-
open
@OpenApi public void open(boolean showProgress)
Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already open- Parameters:
showProgress
- show progress dialog
-
open
public void open(boolean loadContent, boolean showProgress)
Open the diagram.- Parameters:
loadContent
- load diagram contentshowProgress
- show progress dialog
-
openInActiveTab
@OpenApi public void openInActiveTab(boolean showProgress)
Open diagram in currently active diagram tab If no other diagram is opened yet, creates a new tab If this diagram is already opened, simply activates that tab- Parameters:
showProgress
- show progress dialog
-
open
public void open(boolean loadContent, boolean showProgress, boolean inActiveTab)
Open the diagram.- Parameters:
loadContent
- load diagram contentshowProgress
- show progress dialog
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Just hack, registers the same listener to the container- Specified by:
addPropertyChangeListener
in interfaceBaseElement
- Overrides:
addPropertyChangeListener
in classcom.nomagic.magicdraw.uml.MDElementImpl
- Parameters:
l
- thePropertyChangeListener
to be added.- See Also:
PropertyChangeSupport
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Just hack, unregister the same listener from the container- Specified by:
removePropertyChangeListener
in interfaceBaseElement
- Overrides:
removePropertyChangeListener
in classcom.nomagic.magicdraw.uml.MDElementImpl
- Parameters:
l
- the PropertyChangeListener to be removed.- See Also:
PropertyChangeSupport
-
getName
public java.lang.String getName()
Gets the name of thisDiagramPresentationElement
object.
-
getGridSize
public int getGridSize()
- Returns:
- grid size
-
setGridSize
public void setGridSize(int grid)
Sets grid size. If snap to grid flag is set, snap all views to the grid.- Parameters:
grid
- grid size
-
snapViewToGrid
private void snapViewToGrid()
Snap all views to the grid.
-
snapViewToGrid
public void snapViewToGrid(PresentationElement el)
Snaps provided presentation element to grid- Parameters:
el
- element
-
getPathGridSize
public float getPathGridSize()
- Returns:
- path grid size
-
sSetGridSize
public void sSetGridSize(int grid)
Sets grid size.- Parameters:
grid
- grid size
-
setShowGrid
public void setShowGrid(boolean showGrid)
Sets show grid flag- Parameters:
showGrid
- show grid
-
sSetShowGrid
public void sSetShowGrid(boolean showGrid)
Sets show grid flag- Parameters:
showGrid
- show grid value
-
isShowGrid
public boolean isShowGrid()
- Returns:
- show grid flag
-
sSetShowDiagramOwner
public void sSetShowDiagramOwner(boolean show)
-
sSetShowAbbreviatedDiagramType
public void sSetShowAbbreviatedDiagramType(boolean show)
-
sSetShowDiagramName
public void sSetShowDiagramName(boolean show)
-
sSetShowParameters
public void sSetShowParameters(boolean show)
-
sSetShowContextName
public void sSetShowContextName(boolean show)
-
sSetShowContextType
public void sSetShowContextType(boolean show)
-
sSetShowDiagramType
public void sSetShowDiagramType(boolean show)
-
sSetShowContextKind
public void sSetShowContextKind(boolean show)
-
setShowAbbreviatedDiagramType
public void setShowAbbreviatedDiagramType(boolean show)
-
setShowDiagramName
public void setShowDiagramName(boolean show)
-
setShowParameters
public void setShowParameters(boolean show)
-
setShowContextName
public void setShowContextName(boolean show)
-
setShowContextType
public void setShowContextType(boolean show)
-
setShowDiagramType
public void setShowDiagramType(boolean show)
-
updateDiagramFrame
private void updateDiagramFrame()
Updates diagram frame for this diagram.
-
setShowContextKind
public void setShowContextKind(boolean show)
-
isShowAbbreviatedDiagramType
public boolean isShowAbbreviatedDiagramType()
- Specified by:
isShowAbbreviatedDiagramType
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowDiagramName
public boolean isShowDiagramName()
- Specified by:
isShowDiagramName
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowParameters
public boolean isShowParameters()
- Specified by:
isShowParameters
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowContextName
public boolean isShowContextName()
- Specified by:
isShowContextName
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowContextType
public boolean isShowContextType()
- Specified by:
isShowContextType
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowDiagramType
public boolean isShowDiagramType()
- Specified by:
isShowDiagramType
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
isShowContextKind
public boolean isShowContextKind()
- Specified by:
isShowContextKind
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
-
sSetShowDiagramFrame
public void sSetShowDiagramFrame(boolean show)
-
setShowDiagramFrame
private void setShowDiagramFrame(boolean show, boolean useSimpleSet)
-
isShowDiagramOwner
public boolean isShowDiagramOwner()
-
isShowDiagramFrame
public boolean isShowDiagramFrame()
-
setShowDiagramOwner
public void setShowDiagramOwner(boolean show)
-
setShowDiagramFrame
public void setShowDiagramFrame(boolean show)
-
sSetElement
public void sSetElement(@CheckForNull Element element)
Sets diagram element for this object.
-
setSnapToGridShapes
public void setSnapToGridShapes(boolean snap)
Sets show grid flag- Parameters:
snap
- snap value
-
sSetSnapToGridShapes
public void sSetSnapToGridShapes(boolean snap)
Sets show grid flag- Parameters:
snap
- snap value
-
isSnapToGridShapes
public boolean isSnapToGridShapes()
- Returns:
- show grid flag.
-
canAddInstance
public boolean canAddInstance(PresentationElement view)
Description copied from class:PresentationElement
Object view has no children.
-
rejectAddAsPartView
private boolean rejectAddAsPartView(PresentationElement view)
-
canAddChild
public boolean canAddChild(PresentationElement o)
Description copied from class:PresentationElement
Check of given symbol can be added as child into this symbol.- Parameters:
o
- symbol- Returns:
- true if symbol can be added
-
findPresentationElement
@OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull Element element, @CheckForNull java.lang.Class presentationElementClass)
Finds presentation element for given model element of given symbol type in this diagram. Does recursive search in the diagram.- Parameters:
element
- the given ModelElement.presentationElementClass
- the class of presentation element or null if any.- Returns:
- found presentation element or null if given ModelElement does not have presentation element in this diagram.
-
findPresentationElementForPathConnecting
@CheckForNull @OpenApi public final PresentationElement findPresentationElementForPathConnecting(BaseElement element, java.lang.Class presentationElementClass)
Finds presentation element to connect some PathElement for given model element of given type in this diagram. Does recursive search. For example if TemplateSignature will be passes as element, Class owning that signature will be found.- Parameters:
element
- the given ModelElementpresentationElementClass
- the class of presentation element or null if any.- Returns:
- found presentation element or null if given ModelElement does not have presentation element in this diagram.
-
findPresentationElementsForPathConnecting
@OpenApi public final java.util.stream.Stream<PresentationElement> findPresentationElementsForPathConnecting(Element element, java.lang.Class presentationElementClass)
Finds presentations element to connect some PathElement for given model element of given type in this diagram. Does recursive search. For example if TemplateSignature will be passes as element, Class owning that signature will be found.- Parameters:
element
- the given ModelElementpresentationElementClass
- the class of presentation element or null if any.- Returns:
- a stream of presentation elements
-
getSortManagers
public java.util.List<com.nomagic.magicdraw.uml.symbols.SortManager> getSortManagers(boolean create)
Gets sort managers registered for this diagram.- Parameters:
create
- indicates if sort managers should be created if they aren't created yet.- Returns:
- sort managers registered for this diagram.
-
getSortManager
public com.nomagic.magicdraw.uml.symbols.SortManager getSortManager()
Returns sort manager for this diagram view.- Returns:
- symbol sort manager.
-
hasManipulationSortManager
private boolean hasManipulationSortManager()
Indicates if diagram has manipulation sort manager.- Returns:
- true if diagram has manipulation sort manager, false otherwise.
-
getManipulationSortManager
public com.nomagic.magicdraw.uml.symbols.SortManager getManipulationSortManager()
Returns manipulation sort manager for this diagram view.- Returns:
- manipulation symbol sort manager.
-
getPresentationElementAt
@CheckForNull public PresentationElement getPresentationElementAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Description copied from class:PresentationElement
Gets object view at point.- Parameters:
relativePoint
- object view at point location.sortManagerProvider
- sort manager for searching elements.- Returns:
- object view at this point.
-
getPresentationElementAt
@CheckForNull public PresentationElement getPresentationElementAt(java.awt.Point relativePoint)
Searches and returns object that covers given point.- Parameters:
relativePoint
- point where searching for object- Returns:
- object that covers given point, null if no objects found
-
getPresentationElementsAt
public java.util.List<PresentationElement> getPresentationElementsAt(java.awt.Point pt)
Searches and returns all objects that covers given point.- Parameters:
pt
- point where searching for object- Returns:
- object that covers given point, null if no objects found
-
getPresentationElementsAt
@CheckForNull public java.util.List<PresentationElement> getPresentationElementsAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Description copied from class:PresentationElement
Gets object view at point.- Parameters:
relativePoint
- object view at point location.sortManagerProvider
- sort manager for searching elements.- Returns:
- object view at this point.
-
getManipulatedElementAt
@CheckForNull public PresentationElement getManipulatedElementAt(java.awt.Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
Description copied from class:PresentationElement
Gets manipulate symbol at specified point pt.- Parameters:
relativePoint
-Point
sortManagerProvider
- provides sort manager in which to search.- Returns:
- manipulate symbol
-
getManipulatedElementAt
@CheckForNull public PresentationElement getManipulatedElementAt(java.awt.Point pt)
Gets manipulate object view at specified point pt.- Parameters:
pt
-Point
- Returns:
- manipulate object view
-
onFontChange
protected void onFontChange()
-
setShowMessageNumbers
public void setShowMessageNumbers(boolean b)
-
setUseAdvancedNumbering
public void setUseAdvancedNumbering(boolean b)
-
isShowMessageNumbers
public boolean isShowMessageNumbers()
-
isUseAdvancedNumbering
public boolean isUseAdvancedNumbering()
-
isShowDiagramInfo
public boolean isShowDiagramInfo()
-
sSetShowDiagramInfo
public void sSetShowDiagramInfo(boolean b)
-
resetLastModificationUpdateTime
public void resetLastModificationUpdateTime()
Reset cached last diagram modification time.
-
getDiagramPropertiesShape
@CheckForNull public DiagramPropertiesShape getDiagramPropertiesShape()
-
setShowDiagramInfo
public void setShowDiagramInfo(boolean showDiagramInfo)
-
createDiagramInfoShape
public void createDiagramInfoShape(boolean simple)
-
positionDiagramInfoShapeOnFrame
public void positionDiagramInfoShapeOnFrame(DiagramPropertiesShape shape)
-
addDiagramCreationInfo
public static void addDiagramCreationInfo(Diagram diagram)
-
findStereotypePropertyFor
@CheckForNull private static Property findStereotypePropertyFor(Element element, java.lang.String propertyName)
Looks for first available property with given name among available stereotypes for given element. Checks "DiagramInfo"first for better performance- Parameters:
element
- given elementpropertyName
- property name- Returns:
- first available property with given name among available stereotypes for given element or null if not found
-
addDiagramCreationInfo
public static void addDiagramCreationInfo(Diagram diagram, boolean overwrite)
-
setDiagramInfoTagValue
private static void setDiagramInfoTagValue(Diagram diagram, java.lang.String tagName, java.util.function.Supplier<java.lang.String> value, boolean overwrite, java.util.Collection<TaggedValue> taggedValues)
-
sSetShowActivations
public void sSetShowActivations(boolean b)
-
setShowActivations
public void setShowActivations(boolean b)
-
isShowActivations
public boolean isShowActivations()
-
sSetDiagramOrientationMode
public void sSetDiagramOrientationMode(java.lang.String mode)
Simple set for diagram orientation mode property- Parameters:
mode
- - diagram orientation mode.
-
setDiagramOrientationMode
public void setDiagramOrientationMode(java.lang.String mode)
Sets diagram orientation mode.- Parameters:
mode
- - diagram orientation mode.
-
getLineJumpPlace
public java.lang.String getLineJumpPlace()
Returns current line jump place value of the diagram.- Returns:
- line jump place mode
-
sSetLineJumpPlace
public void sSetLineJumpPlace(java.lang.String lineJumpPlace)
Sets value of line jump place.- Parameters:
lineJumpPlace
- line jump place mode
-
getDiagramOrientationMode
public java.lang.String getDiagramOrientationMode()
Gets diagram orientation mode.- Returns:
- diagram orientation mode.
-
sSetUseStereotypeMode
public void sSetUseStereotypeMode(java.lang.String mode)
Simple set for diagram use stereotype mode property- Parameters:
mode
- - diagram orientation mode.
-
setUseStereotypeMode
public void setUseStereotypeMode(java.lang.String mode)
Sets diagram use stereotype mode.- Parameters:
mode
- - diagram orientation mode.
-
getUseStereotypeMode
public java.lang.String getUseStereotypeMode()
Gets diagram use stereotype mode.- Specified by:
getUseStereotypeMode
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
- Returns:
- diagram orientation mode.
-
getAspectRatioMode
public java.lang.String getAspectRatioMode()
-
setAspectRatioMode
public void setAspectRatioMode(java.lang.String mode)
-
sSetAspectRatioMode
public void sSetAspectRatioMode(java.lang.String mode)
-
hasVerticalOrientation
public boolean hasVerticalOrientation()
Returns true if diagram has vertical orientation.- Returns:
- true if diagram has vertical orientation, false otherwise.
-
internalSilentApply
public void internalSilentApply()
Description copied from class:PresentationElement
Silently applies all properties after initialization
-
internalApplyProperties
public void internalApplyProperties(PropertyManager man)
Description copied from class:PresentationElement
Applies properties from given property manager- Parameters:
man
- new properties
-
useParentProperties
public boolean useParentProperties()
Description copied from class:PresentationElement
Does this element uses parent properties or has it own?- Overrides:
useParentProperties
in classPresentationElement
- Returns:
- true, if element does not have properties and uses parent's.
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
- Returns:
- background color
-
preferredSize
public void preferredSize(java.awt.Dimension dim)
-
setDiagramSurface
public void setDiagramSurface(@CheckForNull DiagramSurface canvas)
-
getDiagramSurface
@CheckForNull public DiagramSurface getDiagramSurface()
Description copied from class:PresentationElement
Returns diagram surface for this presentation element. DiagramSurface is null if diagram of this element is not opened in some window.- Overrides:
getDiagramSurface
in classPresentationElement
- Returns:
- diagram surface or null if diagram is not opened.
-
recursiveAutosize
public void recursiveAutosize()
Description copied from class:PresentationElement
Resize recursively all symbols. Method must be called if something is changed in symbol (for example minimum size) and you want to resize (autosize) all hierarchy
-
hasDiagramSurface
public boolean hasDiagramSurface()
-
canDeleteChild
public boolean canDeleteChild(BaseElement obj)
Description copied from interface:BaseElement
Checks if given element can be deleted from this element. Follofing rules must be true in order to have result true: 1.this element must be editable. 2.project must be editable. 3.the type of given child must be valid for teamwork lock for edit operation (for example class, package and etc, not Attribute).- Specified by:
canDeleteChild
in interfaceBaseElement
- Overrides:
canDeleteChild
in classcom.nomagic.magicdraw.uml.MDElementImpl
- Parameters:
obj
- a given child- Returns:
- true, if given element can be deleted from current element.
-
isModificationTimeUpdateDisabled
public boolean isModificationTimeUpdateDisabled()
Indicates if automatic diagram modification time update is disabled- Returns:
- true when diagram modification time update is disabled
-
setModificationTimeUpdateDisabled
public void setModificationTimeUpdateDisabled(boolean modificationTimeUpdateDisabled)
Disables automatic diagram modification time update.- Parameters:
modificationTimeUpdateDisabled
- true to disable automatic diagram modification time update.
-
updateDiagramPropertiesShapeModificationTime
public void updateDiagramPropertiesShapeModificationTime()
-
isLoaded
@OpenApi public boolean isLoaded()
Check if diagram is loaded.- Returns:
- true if diagram contents is loaded
-
getContentState
public com.nomagic.magicdraw.uml.symbols.DiagramContentState getContentState()
-
ensureLoaded
@OpenApi public void ensureLoaded()
Ensures that diagram is loaded. If diagram is not loaded, loads it. Make sure the project is active before invoking this method. Otherwise diagram may not be loaded.
-
loadContents
public void loadContents(@CheckForNull ProgressStatus status)
Loads diagram to memory. This method should be used only when diagram is not loaded. Make sure the project is active before invoking this method. Otherwise diagram may not be loaded.- Parameters:
status
- progress status.
-
doLoadContent
private void doLoadContent(@CheckForNull ProgressStatus status)
-
cleanupAfterLoad
private void cleanupAfterLoad()
-
getUnsupportedReason
public java.lang.String getUnsupportedReason()
Returns if possible reason why this diagram cannot be loaded, otherwise -null
.- Returns:
- unsupported reason
-
getDiagramNotLoadedReasons
public com.nomagic.magicdraw.uml.symbols.DiagramNotLoadedReasons getDiagramNotLoadedReasons()
-
invokeOnDispatcher
public static void invokeOnDispatcher(java.lang.Runnable runnable)
-
executeInLoadContentsState
private static void executeInLoadContentsState(java.lang.Boolean state, java.lang.Runnable runnable)
-
isProfileLoaded
public boolean isProfileLoaded()
- Returns:
- true if diagram does not requires profile or profile is loaded (method used from diagram descriptor)
-
isPluginAvailable
public boolean isPluginAvailable()
- Returns:
- true if diagram does not requires plugin or this plugin is available.
-
areFeaturesAvailable
public boolean areFeaturesAvailable()
- Returns:
- true if diagram does not requires additional features or all required features are available.
-
isSupported
public boolean isSupported()
- Returns:
- true if this diagram is supported in this edition or in current plugins configuration.
-
applyForcedProperties
public void applyForcedProperties()
Applies properties stored in default style for diagram and marked as forced. They can be marked as forced using "apply" from styles dialog.
-
getDiagramPresentationElement
public DiagramPresentationElement getDiagramPresentationElement()
Description copied from class:PresentationElement
Returns diagram of this presentation element.- Overrides:
getDiagramPresentationElement
in classPresentationElement
- Returns:
- diagram of this presentation element.
-
setSnapToGridPaths
public void setSnapToGridPaths(boolean snap)
-
sSetSnapToGridPaths
public void sSetSnapToGridPaths(boolean snap)
-
isSnapToGridPaths
public boolean isSnapToGridPaths()
-
getProperty
public Property getProperty(java.lang.String id)
Description copied from class:PresentationElement
Returns element's property with given id.- Overrides:
getProperty
in classPresentationElement
- Parameters:
id
- ID of property.- Returns:
- property with given id or null if element does not have such property.
- See Also:
PresentationElement.useParentProperties()
-
close
@OpenApi public final void close()
Closes diagram window.
-
close
public void close(boolean closeWindow)
Closes opened diagram If close window is 'false' and there is a possibility to back to previous diagram in that window, when previous diagram is opened Otherwise, diagram window is closed- Parameters:
closeWindow
- if window should be closed
-
unloadDiagram
public void unloadDiagram() throws java.lang.Exception
Disposes all symbols and creates not loaded data.- Throws:
java.lang.Exception
- in case of some error
-
doUnload
private void doUnload() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getDefaultDiagramLayouter
public DiagramLayouter getDefaultDiagramLayouter()
-
layout
@OpenApi public boolean layout(boolean useCommands)
Layout the diagram using default layouter.Make sure before doing layout:
- diagram is opened - use
open()
to open diagram. - session is closed - use
SessionManager.closeSession(Project)
to close session.
PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.- Parameters:
useCommands
- true to create commands. If true, this command will be available in project's command history.- Returns:
- true if layout was performed.
- diagram is opened - use
-
layout
@OpenApi public boolean layout(boolean useCommands, DiagramLayouter layouter)
Layouts the diagram with the specified layouter.Make sure before doing layout:
- diagram is opened - use
open()
to open diagram. - session is closed - use
SessionManager.closeSession(Project)
to close session.
PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.- Parameters:
useCommands
- true to create commands. If true, this command will be available in project's command historylayouter
- layouter to be used for layouting- Returns:
- true if layout was performed.
- diagram is opened - use
-
layout
@OpenApi public boolean layout(boolean useCommands, DiagramLayouter diagramLayouter, AbstractDiagramLayouterOptionsGroup options)
Layout the diagram.Make sure before doing layout:
- diagram is opened - use
open()
to open diagram. - session is closed - use
SessionManager.closeSession(Project)
to close session.
PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.- Parameters:
useCommands
- true to create commands. If true, this command will be available in project's command historydiagramLayouter
- layouter to useoptions
- layout options- Returns:
- true if layout was performed
- diagram is opened - use
-
getUsedModelElements
@OpenApi @Deprecated public java.util.Collection<Element> getUsedModelElements(boolean checkOnlyPersistent)
Deprecated.checkOnlyPersistent parameter is ignored. UsegetUsedModelElements()
Returns collection of model elements that are drawn in this diagram.- Parameters:
checkOnlyPersistent
- if true, result includes elements for symbols which are saved to XMI and not created at run-time. If false, includes all elements.- Returns:
- collection of model elements.
-
getUsedModelElements
@Deprecated public java.util.Collection<Element> getUsedModelElements(boolean checkOnlyPersistent, boolean checkOnlyFriendly)
Deprecated.checkOnlyPersistent and checkOnlyFriendly parameters are ignored. UsegetUsedModelElements()
Returns collection of model elements that are drawn in this diagram.- Parameters:
checkOnlyPersistent
- if true, result includes elements for symbols which are saved to XMI and not created at run-time. If false, includes all elements.checkOnlyFriendly
- check only "friendly" symbols- Returns:
- collection of model elements.
-
getUsedModelElements
@OpenApi public java.util.Collection<Element> getUsedModelElements()
Returns collection of model elements that has views in this diagram.- Returns:
- collection of model elements.
-
getUsedModelElements
@OpenApi public java.util.Set<Element> getUsedModelElements(UsedElementPolicy usedElementPolicy)
Returns collection of model elements that are used in this diagram.- Parameters:
usedElementPolicy
- used element policy- Returns:
- collection of model elements.
-
collectShowingManipulatedElementsRecursively
@OpenApi public java.util.Collection<PresentationElement> collectShowingManipulatedElementsRecursively()
Collects all visible manipulated elements in this diagram recursively.- Returns:
- manipulated elements in this diagram
-
collectShowingPresentationElementsRecursively
@OpenApi public java.util.Collection<PresentationElement> collectShowingPresentationElementsRecursively()
Collects all visible elements in this diagram recursively.- Returns:
- visible elements in this diagram
-
collectPresentationElementsRecursively
@OpenApi public java.util.Collection<PresentationElement> collectPresentationElementsRecursively()
Collects all elements in this diagram recursively.- Returns:
- elements in this diagram
-
clearUsedElementsCache
private void clearUsedElementsCache()
-
isElementInDiagram
@OpenApi public boolean isElementInDiagram(Element element)
Checks if given element exist in any diagram.- Parameters:
element
- element- Returns:
- true if element exist in any diagram otherwise false
-
isElementInDiagram
@OpenApi public boolean isElementInDiagram(Element element, UsedElementPolicy usedElementPolicy)
Checks if given element exist in any diagram.- Parameters:
element
- element- Returns:
- true if element exist in any diagram otherwise false
-
isElementInDiagram
public boolean isElementInDiagram(Element element, boolean skipProxyCheck, UsedElementPolicy usedElementPolicy)
Checks if given element exist in any diagram.- Parameters:
element
- elementskipProxyCheck
- enables to skip if diagram's actual element is proxy- Returns:
- true if element exist in any diagram otherwise false
-
collectUsedModelElements
private static void collectUsedModelElements(PresentationElement element, java.util.Set<Element> result)
-
setDefaultStyleID
public void setDefaultStyleID(@CheckForNull java.lang.String id)
Sets new diagram style id to representation object- Parameters:
id
- new id
-
getDefaultStyleID
@CheckForNull public java.lang.String getDefaultStyleID()
- Returns:
- Returns the defaultStyleForDiagramID, can be null if default style is equal to diagram style, or diagram is loaded.
-
getDefaultStyleForDiagram
@CheckForNull public Style getDefaultStyleForDiagram(StyleManager styleManager)
Finds style for this diagram- Parameters:
styleManager
- manager to find in.- Returns:
- found style, null if no style is created.
-
getRealType
@CheckForNull public java.lang.String getRealType()
Returns real diagram type. Real diagram type is diagram type which is not registered but loaded from project file.- Returns:
- real type. Can be null.
-
setRealType
public void setRealType(@CheckForNull java.lang.String realType)
If diagram type is not registered then known type is set. Real type is preserved for saving.- Parameters:
realType
- real diagram type.
-
sSetScrollPosition
public void sSetScrollPosition(java.awt.Point p)
Sets scroll position of the diagram.Note, it does not affect actual property value of the opened diagram. It only sets persistent data so the value can be restored after project reload. If user is manipulating the diagram property value will be overwritten.
- Parameters:
p
- new scroll position
-
sSetDiagramWindowOpen
public void sSetDiagramWindowOpen(boolean open)
Marks diagram window open/close.Note, it does not affect actual property value of the opened diagram. It only sets persistent data so the value can be restored after project reload. If user is manipulating the diagram property value will be overwritten.
- Parameters:
open
- new state
-
sSetDiagramWindowActive
public void sSetDiagramWindowActive(boolean active)
Marks diagram window (in)active.Note, it does not affect actual property value of the opened diagram. It only sets persistent data so the value can be restored after project reload. If user is manipulating the diagram property value will be overwritten.
- Parameters:
active
- new state
-
sSetDiagramActivationTime
public void sSetDiagramActivationTime(long activationTime)
Marks diagram window activation time.Note, it does not affect actual property value of the opened diagram. It only sets persistent data so the value can be restored after project reload. If user is manipulating the diagram property value will be overwritten.
- Parameters:
activationTime
- time of activation
-
getScrollPosition
public java.awt.Point getScrollPosition()
Gets scroll position of the diagram.Note that property value is backed by project options and it may not reflect real value at all times.
- Returns:
- point designating the scroll position
- See Also:
sSetScrollPosition(Point)
-
isDiagramWindowOpen
public boolean isDiagramWindowOpen()
Indicates if diagram is opened.Note that property value is backed by project options and it may not reflect real value at all times.
- Returns:
- true if diagram is opened
- See Also:
sSetDiagramWindowOpen(boolean)
-
isDiagramWindowActive
public boolean isDiagramWindowActive()
Indicates if diagram is active.Note that property value is backed by project options and it may not reflect real value at all times.
- Returns:
- true if diagram is active
- See Also:
sSetDiagramWindowActive(boolean)
-
getDiagramWindowActivationTime
public long getDiagramWindowActivationTime()
Returns diagram activation time.Note that property value is backed by project options and it may not reflect real value at all times.
- Returns:
- diagram activation time
- See Also:
sSetDiagramActivationTime(long)
-
getCurrentDate
public static java.lang.String getCurrentDate()
-
isDummyMode
public boolean isDummyMode()
-
setDummyMode
public void setDummyMode(boolean dummyMode)
-
isActive
public boolean isActive()
-
hasSelectableSymbols
public boolean hasSelectableSymbols()
-
sSetDiagramFrame
public void sSetDiagramFrame(@CheckForNull DiagramFrameView diagramFrame)
-
getDiagramFrame
@OpenApi @CheckForNull public DiagramFrameView getDiagramFrame()
Get the frame of the diagram.- Returns:
- frame of the diagram.
-
setRequiredFeature
public void setRequiredFeature(@CheckForNull com.nomagic.magicdraw.uml.symbols.RequiredFeature feature)
Sets required feature for this diagram. Required feature can be plugin or core feature or profile. If required feature is not available diagram should not be loaded.- Parameters:
feature
- new required feature. Can be null.
-
getRequiredFeature
@CheckForNull public com.nomagic.magicdraw.uml.symbols.RequiredFeature getRequiredFeature()
Required feature can be plugin or core feature.- Returns:
- required feature for this diagram. If feature is not available diagram will be not loaded. If returns null no feature is required.
-
setInitialDiagramFrameBounds
public void setInitialDiagramFrameBounds()
Sets initial diagram frame bounds for this diagram's frame.
-
calculateInitialDiagramFrameBounds
@CheckForNull private java.awt.Rectangle calculateInitialDiagramFrameBounds()
Gets bounds which should be set for the diagram's frame.
-
adjustInitialDiagramFrameBounds
public static void adjustInitialDiagramFrameBounds(java.awt.Rectangle bounds)
Adjust initial diagram frame bounds.- Parameters:
bounds
- bounds
-
getVisibleBounds
@CheckForNull public java.awt.Rectangle getVisibleBounds()
Returns user visible bounds of the diagram.- Returns:
- visible bounds or null if the diagram is not opened.
-
getStereotypesDisplayMode
public java.lang.String getStereotypesDisplayMode()
Description copied from interface:StereotypesDisplayModeOwner
Gets stereotype display mode.- Specified by:
getStereotypesDisplayMode
in interfacecom.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
- Specified by:
getStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Returns:
- stereotype display mode.
-
sSetStereotypesDisplayMode
public void sSetStereotypesDisplayMode(java.lang.String mode)
Description copied from interface:StereotypesDisplayModeOwner
Simple sets (no updates) stereotypes display mode.- Specified by:
sSetStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Parameters:
mode
- stereotypes display mode value.
-
setStereotypesDisplayMode
public void setStereotypesDisplayMode(java.lang.String mode)
Description copied from interface:StereotypesDisplayModeOwner
Sets stereotype display mode value.- Specified by:
setStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Parameters:
mode
- stereotype display mode.
-
getDSLStereotypesDisplayMode
public java.lang.String getDSLStereotypesDisplayMode()
Description copied from interface:StereotypesDisplayModeOwner
Gets DSL stereotype display mode.- Specified by:
getDSLStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Returns:
- stereotype display mode.
-
sSetDSLStereotypesDisplayMode
public void sSetDSLStereotypesDisplayMode(java.lang.String mode)
Description copied from interface:StereotypesDisplayModeOwner
Simple sets (no updates) DSL stereotypes display mode.- Specified by:
sSetDSLStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Parameters:
mode
- stereotypes display mode value.
-
setDSLStereotypesDisplayMode
public void setDSLStereotypesDisplayMode(java.lang.String mode)
Description copied from interface:StereotypesDisplayModeOwner
Sets DSL stereotype display mode value.- Specified by:
setDSLStereotypesDisplayMode
in interfaceStereotypesDisplayModeOwner
- Parameters:
mode
- stereotype display mode.
-
isAutosized
public boolean isAutosized()
-
sSetAutosize
public void sSetAutosize(boolean val)
-
setAutosize
public void setAutosize(boolean val)
-
updateFrameSize
public void updateFrameSize(PresentationElement element)
-
getBounds
public java.awt.Rectangle getBounds()
Delegate bounds request to its container.- Overrides:
getBounds
in classPresentationElement
- Returns:
- bounds
- See Also:
PresentationElementsManager.reshapeShapeElement(com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement, java.awt.Rectangle)
-
isUseFlowLayoutLogic
public boolean isUseFlowLayoutLogic()
Indicates if smart path/shape edit should be used in this diagram.- Returns:
- true if smart symbol editing should be used, false otherwise.
-
addContentPropertyChangeListener
@OpenApi public boolean addContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the listener for changes in all symbols contained in the diagram.- Parameters:
listener
- thePropertyChangeListener
to be added- Returns:
- true if listener was added - it wasn't there yet, otherwise false
-
removeContentPropertyChangeListener
@OpenApi public boolean removeContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregister the given listener from the diagram.- Parameters:
listener
- the PropertyChangeListener to be removed- Returns:
- true if listener was removed
-
fireContentPropertyChange
protected void fireContentPropertyChange(PresentationElement source, java.lang.String propertyName, @CheckForNull java.lang.Object oldValue, @CheckForNull java.lang.Object newValue)
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.- Parameters:
source
- source elementpropertyName
- the programmatic name of the property that was changed.oldValue
- the old value of the propertynewValue
- the new value of the property- See Also:
PropertyChangeSupport
-
firePropertyChange
public void firePropertyChange(java.lang.String propertyName, @CheckForNull java.lang.Object oldValue, @CheckForNull java.lang.Object newValue)
Description copied from interface:BaseElement
DelegatesfirePropertyChange
to thePropertyChangeSupport
, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.- Specified by:
firePropertyChange
in interfaceBaseElement
- Parameters:
propertyName
- the programmatic name of the property that was changed.oldValue
- the old value of the propertynewValue
- the new value of the property- See Also:
PropertyChangeSupport
-
recalculateInternalDataRequired
public void recalculateInternalDataRequired()
-
isInitialFrameSizeSet
@OpenApi public boolean isInitialFrameSizeSet()
- Returns:
- false if diagram frame size should not recalculated on opening.
-
setInitialFrameSizeSet
@OpenApi public void setInitialFrameSizeSet(boolean value)
Set a flag that diagram frame size should not be recalculated on opening.- Parameters:
value
- new value
-
getCenterlineManager
public com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineManager getCenterlineManager()
Gets centerline manager for this diagram.- Returns:
- centerline manager for this diagram.
-
setUseGradientForFill
public void setUseGradientForFill(boolean use)
Sets elements gradient fill option. Will presentation element use gradient fill, or not for painting.- Parameters:
use
- true to use.
-
isUseGradientForFill
public boolean isUseGradientForFill()
Do we need to use gradient for fill color? Returns value of fill gradient property.- Returns:
- True, when use gradient fill property is true.
-
resetContainer
public void resetContainer()
In case diagram type changes in wayDiagramObjectViewContainer
needs to be changed it should be reset and new one will be created ongetContainer()
first call.
-
getID
public java.lang.String getID()
Description copied from interface:BaseElement
Returns the ID of theElement
. If the ID isnull
, new id for element is generated. Element id is persistence and do not changes during project save/load.- Specified by:
getID
in interfaceBaseElement
- Overrides:
getID
in classcom.nomagic.magicdraw.uml.MDElementImpl
- Returns:
- the ID of the
Element
.
-
setID
public void setID(java.lang.String id)
Description copied from interface:BaseElement
Sets the specified ID to theElement
.- Specified by:
setID
in interfaceBaseElement
- Overrides:
setID
in classcom.nomagic.magicdraw.uml.MDElementImpl
- Parameters:
id
- the id to be set.
-
setOpenConfigurator
public void setOpenConfigurator(@CheckForNull com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator openConfigurator)
Sets open configurator.- Parameters:
openConfigurator
- open configurator.
-
getOpenConfigurator
@CheckForNull public com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.OpenConfigurator getOpenConfigurator()
-
isSymbolDiagram
@OpenApi public boolean isSymbolDiagram()
Checks if diagram displays symbols as its contents. Other type of diagrams may be tables, matrices.- Returns:
- true if diagram displays symbols
-
initialize
public void initialize()
Description copied from class:PresentationElement
Initialize symbol and its children state. Symbol must be initialized before doing any resize, painting and etc. These operations can lead to unpredictable results otherwise.
-
createPropertyManager
protected void createPropertyManager()
Create default property manager for Diagram, initializes default properties.
-
setInitializer
public void setInitializer(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementInitializer initializer)
Sets custom diagram presentation element initializer.- Parameters:
initializer
- custom diagram presentation element initializer.
-
getPathToMoveCache
public com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.PathToMoveCache getPathToMoveCache()
- Returns:
- paths to move cache
-
getContentHash
@CheckForNull public java.lang.String getContentHash()
-
setContentHash
public void setContentHash(@CheckForNull java.lang.String contentHash)
sets identifier of contents. If identifier is the same diagram are the same.- Parameters:
contentHash
- content hash
-
getRepresentation
public com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject getRepresentation()
-
getDiagramViewOptions
public com.nomagic.magicdraw.core.options.DiagramViewOptions getDiagramViewOptions()
Gets diagram view options.- Returns:
- diagram view options.
-
isOpening
public boolean isOpening()
- Returns:
- true if diagram is in opening mode at the moment
-
hasHeavyWeightSymbols
public boolean hasHeavyWeightSymbols()
Check is diagram has heavy weight symbols - symbols those can be painted correctly only if diagram is displayed in some JComponent- Returns:
- true if heavy weight symbols exists in the diagram
-
registerHeavyWeightSymbolsChecker
public static void registerHeavyWeightSymbolsChecker(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker checker)
-
unRegisterHeavyWeightSymbolsChecker
public static void unRegisterHeavyWeightSymbolsChecker(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.HeavyWeightSymbolsChecker checker)
-
sGetContainer
@CheckForNull com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer sGetContainer()
-
getDynamicStyleProviders
public java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider> getDynamicStyleProviders()
-
addDynamicStyleProvider
public final void addDynamicStyleProvider(com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider dynamicStyleProvider)
-
removeDynamicStyleProvider
public final void removeDynamicStyleProvider(com.nomagic.magicdraw.uml.symbols.DynamicStyleProvider dynamicStyleProvider)
-
addDynamicRepresentationProvider
public final void addDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
-
removeDynamicRepresentationProvider
public final void removeDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
-
getDynamicRepresentationProviders
public java.util.Collection<com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider> getDynamicRepresentationProviders()
-
addProvider
private <T> void addProvider(T provider, java.util.Collection<T> providers)
-
removeProvider
private <T> void removeProvider(T provider, java.util.Collection<T> providers)
-
repaintLater
private void repaintLater()
-
isForceStoreContentOnSave
public boolean isForceStoreContentOnSave()
-
setForceStoreContentOnSave
public void setForceStoreContentOnSave(boolean forceStoreContentOnSave)
-
sSetForceStoreContentOnSave
private void sSetForceStoreContentOnSave(boolean forceStoreContentOnSave)
-
isShapesAutoResizeSuspended
public boolean isShapesAutoResizeSuspended()
-
sSetShapesAutoResizeSuspended
public void sSetShapesAutoResizeSuspended(boolean enabled)
-
setShapesAutoResizeSuspended
public void setShapesAutoResizeSuspended(boolean enabled)
-
autosizeSuspendedSymbolsWithHiddenContent
public void autosizeSuspendedSymbolsWithHiddenContent()
-
isLabelsAutoDisplaySuspended
public boolean isLabelsAutoDisplaySuspended()
-
sSetLabelsAutoDisplaySuspended
public void sSetLabelsAutoDisplaySuspended(boolean enabled)
-
setLabelsAutoDisplaySuspended
public void setLabelsAutoDisplaySuspended(boolean enabled)
-
getSuspendShapeAutoResizeMode
public java.lang.String getSuspendShapeAutoResizeMode()
-
sSetSuspendShapeAutoResizeMode
public void sSetSuspendShapeAutoResizeMode(java.lang.String mode)
-
setSuspendShapeAutoResizeMode
public void setSuspendShapeAutoResizeMode(java.lang.String mode)
-
-