Package com.nomagic.magicdraw.uml
Class DiagramDescriptor
java.lang.Object
com.nomagic.magicdraw.uml.DiagramDescriptor
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
NonSymbolDiagramDescriptor
Descriptor of some extended diagram.
This descriptor is used to define a new diagram type in the MagicDraw application. New diagram type be extended from some already existing type. New diagram will have separate diagram panel with its own toolbar.
This descriptor is used to define a new diagram type in the MagicDraw application. New diagram type be extended from some already existing type. New diagram will have separate diagram panel with its own toolbar.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DiagramDescriptor
clone()
void
configureNewDiagram
(Diagram diagram, Namespace parent) Configure new created diagramcom.nomagic.ui.banners.Banner
Gets banner for this diagram descriptor.Diagram category name.Returns manager of actions used in the diagram.abstract DiagramContextAMConfigurator
abstract AMConfigurator
abstract AMConfigurator
abstract String
Return diagram type id.com.nomagic.magicdraw.uml.DiagramDescriptor.DiagramWrapper
getKind()
Returns a diagram kind used for grouping diagrams by their nature - symbolic diagram, table and so on.abstract String
Return diagram human name.protected Collection<?>
Returns path for profile of this diagram.com.nomagic.magicdraw.uml.symbols.RequiredFeature
Gets required feature by this diagram descriptor.Collection<com.nomagic.magicdraw.core.Feature>
Gets required features which are needed by this diagram descriptor.final com.nomagic.magicdraw.plugins.RequiredPluginInfo
Required plugin for this diagramabstract String
Return diagram human name.If descriptor provides icon URL, this method should not be overridden.abstract URL
URL of small icon for diagram.getSmartManipulatorsActions
(boolean superType) com.nomagic.magicdraw.actions.SmartManipulatorsAMConfigurator
getStereotypes
(Project project) abstract String
Returns super type of this diagram.abstract ResizableIcon
Resizable icon for diagram.getTargetsManipulatorsActions
(boolean superType) boolean
Does diagram has content.boolean
importProfile
(Project project, boolean ui) Import profile for this diagram into a given project.abstract boolean
Returns creatable flag.boolean
isProfileLoaded
(Project project) boolean
Indicates if all necessary prerequisites are available to support this type of diagram.static boolean
isSupported
(DiagramDescriptor diagramDescriptor) boolean
Check if this diagram is used to draw symbols.protected boolean
profileLoaded
(Project project) Checks if UML Profile for this diagram already loaded in the model.void
setBanner
(com.nomagic.ui.banners.Banner banner) Sets banner for this diagram descriptor.void
setCategory
(String category) Set diagram category name.void
void
setRequiredFeatures
(Collection<com.nomagic.magicdraw.core.Feature> requiredFeatures) Sets required features which are needed by this diagram descriptor.void
setRequiredPlugin
(com.nomagic.magicdraw.plugins.RequiredPluginInfo plugin) Sets required plugin for this diagram.void
setResourceProviderID
(String resourceProviderID) Usual diagrams should provide resource provider id, in other case buttons groups and descriptions will be not translatable.protected void
setSmallIcon
(ResizableIcon icon) boolean
Checks if diagram properties for this diagram should be stored.
-
Constructor Details
-
DiagramDescriptor
public DiagramDescriptor()
-
-
Method Details
-
getSuperType
Returns super type of this diagram.- Returns:
- String the 'super diagram' type of the diagram type.
E.g.
Interaction Diagram
is a 'super diagram' forCollaboration Diagram
andSequence Diagram
.
-
isCreatable
@OpenApi public abstract boolean isCreatable()Returns creatable flag.- Returns:
- boolean flag indicating if the diagram will be creatable.
-
isUsedForSymbols
@OpenApi public boolean isUsedForSymbols()Check if this diagram is used to draw symbols. Some diagram may be used to display tables, graphs or other components (for example dependency matrix table)- Returns:
- true if diagram is used to draw symbols
-
storeDiagramProperties
public boolean storeDiagramProperties()Checks if diagram properties for this diagram should be stored.- Returns:
- true if diagram properties for this diagram should be stored.
-
getDiagramToolbarConfigurator
- Returns:
- AMConfigurator which configures described diagram toolbar.
-
getDiagramShortcutsConfigurator
- Returns:
- AMConfigurator which configures described diagram shortcuts.
-
getDiagramContextConfigurator
- Returns:
- AMConfigurator which configures described diagram context menu actions.
-
getDiagramTypeId
Return diagram type id. It is used to identify the diagram.- Returns:
- String used to identify diagram type.
- See Also:
-
getAbbreviation
- Returns:
- the abbreviation
-
getSingularDiagramTypeHumanName
Return diagram human name. It is used to show the diagram type in the UI.- Returns:
- human diagram name in singular.
-
getPluralDiagramTypeHumanName
Return diagram human name. It is used to show the diagram type in the UI.- Returns:
- human diagram name in plural.
-
getSVGIcon
Resizable icon for diagram. svg and wmf format. Used in Content diagram.- Returns:
- resizable icon in svg or wmf formats.
-
getSmallIconURL
URL of small icon for diagram. Used in browser and menu.- Returns:
- URL to icon shown diagram in browser and menu items.
-
getResourceProviderID
- Returns:
- resource provider id which is used to translate text read from descriptor file. May be null.
-
setResourceProviderID
Usual diagrams should provide resource provider id, in other case buttons groups and descriptions will be not translatable.- Parameters:
resourceProviderID
- provider id which is used to translate text read from descriptor file. May be null.
-
getHelpID
- Returns:
- online help page name
-
setHelpID
- Parameters:
helpID
- new online page name
-
setSmallIcon
-
getSmallIcon
If descriptor provides icon URL, this method should not be overridden.- Returns:
- icon
-
getMainMenuConfigurator
- Returns:
- AMConfigurator which configures main menu for adding this diagram specific actions.
-
getMainToolbarConfigurator
- Returns:
- AMConfigurator which configures main toolbar for adding this diagram specific actions.
-
profileLoaded
Checks if UML Profile for this diagram already loaded in the model.- Parameters:
project
- project- Returns:
- true, if profile already loaded. Here returns true.
-
isProfileLoaded
- Parameters:
project
- project- Returns:
- true if required profile is loaded.
-
getProfiles
Returns path for profile of this diagram. If path is not null, profile will be loaded during diagram creation.- Returns:
- some path to xml file of profile or null if profile does not exist for this type of the diagram.
-
getDiagramWrapper
public com.nomagic.magicdraw.uml.DiagramDescriptor.DiagramWrapper getDiagramWrapper() -
importProfile
Import profile for this diagram into a given project.- Parameters:
project
- projectui
- show ui messages in case of some problems- Returns:
- true if required profiles are attached to project
-
getDiagramActions
Returns manager of actions used in the diagram. Later these actions must be configured for toolbar or shortcuts. Only one instance of action must be used in the configurators. If this rule is not applied, some problems may occur(for example changed by user keyboard shortcuts for action may not be saved).- Returns:
- manager of actions.
-
clone
-
getStereotypes
- Parameters:
project
- project- Returns:
- list of stereotypes ids, these stereotypes will be assigned to the diagram element.
-
getSmartManipulatorsConfigurator
@CheckForNull public com.nomagic.magicdraw.actions.SmartManipulatorsAMConfigurator getSmartManipulatorsConfigurator() -
getTargetsManipulatorsConfigurator
-
getSmartManipulatorsActions
-
getTargetsManipulatorsActions
-
getRequiredPlugin
@CheckForNull public final com.nomagic.magicdraw.plugins.RequiredPluginInfo getRequiredPlugin()Required plugin for this diagram- Returns:
- required plugin for this diagram. If plugin is not available diagram will be not loaded. If returns null no plugin is required.
-
setRequiredPlugin
public void setRequiredPlugin(@CheckForNull com.nomagic.magicdraw.plugins.RequiredPluginInfo plugin) Sets required plugin for this diagram. If required plugin is not available diagram should not be loaded.- Parameters:
plugin
- new required feature. Can be null.
-
getRequiredFeatures
Gets required features which are needed by this diagram descriptor.- Returns:
- required features which are needed by this diagram descriptor.
-
setRequiredFeatures
Sets required features which are needed by this diagram descriptor.- Parameters:
requiredFeatures
- required features which are needed by this diagram descriptor.
-
isSupported
public boolean isSupported()Indicates if all necessary prerequisites are available to support this type of diagram. It can be required plugin or required feature.- Returns:
- true if diagram is supported, false otherwise.
-
isSupported
-
getCategory
Diagram category name.- Returns:
- diagram category
-
getKind
Returns a diagram kind used for grouping diagrams by their nature - symbolic diagram, table and so on.- Returns:
- diagram kind
-
setCategory
Set diagram category name.- Parameters:
category
- category diagram category name
-
getRequiredFeature
@CheckForNull public com.nomagic.magicdraw.uml.symbols.RequiredFeature getRequiredFeature()Gets required feature by this diagram descriptor.- Returns:
- required feature by this diagram descriptor.
-
getBanner
@CheckForNull public com.nomagic.ui.banners.Banner getBanner()Gets banner for this diagram descriptor.- Returns:
- banner for this diagram descriptor.
-
setBanner
public void setBanner(@CheckForNull com.nomagic.ui.banners.Banner banner) Sets banner for this diagram descriptor.- Parameters:
banner
- banner to set.
-
configureNewDiagram
Configure new created diagram- Parameters:
diagram
- diagramparent
- parent
-
hasContent
public boolean hasContent()Does diagram has content. e.g. does diagram has content for locking/unlocking- Returns:
- does diagram has content
-