Class DiagramDescriptor

java.lang.Object
com.nomagic.magicdraw.uml.DiagramDescriptor
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
NonSymbolDiagramDescriptor

@OpenApi public abstract class DiagramDescriptor extends Object implements Cloneable
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.
  • Constructor Details

    • DiagramDescriptor

      public DiagramDescriptor()
  • Method Details

    • getSuperType

      @OpenApi public abstract String 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' for Collaboration Diagram and Sequence 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

      @CheckForNull @OpenApi public abstract AMConfigurator getDiagramToolbarConfigurator()
      Returns:
      AMConfigurator which configures described diagram toolbar.
    • getDiagramShortcutsConfigurator

      @CheckForNull @OpenApi public abstract AMConfigurator getDiagramShortcutsConfigurator()
      Returns:
      AMConfigurator which configures described diagram shortcuts.
    • getDiagramContextConfigurator

      @CheckForNull @OpenApi public abstract DiagramContextAMConfigurator getDiagramContextConfigurator()
      Returns:
      AMConfigurator which configures described diagram context menu actions.
    • getDiagramTypeId

      @OpenApi public abstract String getDiagramTypeId()
      Return diagram type id. It is used to identify the diagram.
      Returns:
      String used to identify diagram type.
      See Also:
    • getAbbreviation

      @CheckForNull public String getAbbreviation()
      Returns:
      the abbreviation
    • getSingularDiagramTypeHumanName

      @OpenApi public abstract String getSingularDiagramTypeHumanName()
      Return diagram human name. It is used to show the diagram type in the UI.
      Returns:
      human diagram name in singular.
    • getPluralDiagramTypeHumanName

      @OpenApi public abstract String getPluralDiagramTypeHumanName()
      Return diagram human name. It is used to show the diagram type in the UI.
      Returns:
      human diagram name in plural.
    • getSVGIcon

      @CheckForNull @OpenApi public abstract ResizableIcon getSVGIcon()
      Resizable icon for diagram. svg and wmf format. Used in Content diagram.
      Returns:
      resizable icon in svg or wmf formats.
    • getSmallIconURL

      @CheckForNull @OpenApi public abstract URL getSmallIconURL()
      URL of small icon for diagram. Used in browser and menu.
      Returns:
      URL to icon shown diagram in browser and menu items.
    • getResourceProviderID

      @CheckForNull public String getResourceProviderID()
      Returns:
      resource provider id which is used to translate text read from descriptor file. May be null.
    • setResourceProviderID

      public void setResourceProviderID(@CheckForNull String resourceProviderID)
      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

      @CheckForNull public String getHelpID()
      Returns:
      online help page name
    • setHelpID

      public void setHelpID(@CheckForNull String helpID)
      Parameters:
      helpID - new online page name
    • setSmallIcon

      protected void setSmallIcon(@CheckForNull ResizableIcon icon)
    • getSmallIcon

      @CheckForNull public ResizableIcon getSmallIcon()
      If descriptor provides icon URL, this method should not be overridden.
      Returns:
      icon
    • getMainMenuConfigurator

      @CheckForNull public AMConfigurator getMainMenuConfigurator()
      Returns:
      AMConfigurator which configures main menu for adding this diagram specific actions.
    • getMainToolbarConfigurator

      @CheckForNull public AMConfigurator getMainToolbarConfigurator()
      Returns:
      AMConfigurator which configures main toolbar for adding this diagram specific actions.
    • profileLoaded

      protected boolean profileLoaded(Project project)
      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

      public boolean isProfileLoaded(Project project)
      Parameters:
      project - project
      Returns:
      true if required profile is loaded.
    • getProfiles

      protected Collection<?> 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

      public boolean importProfile(Project project, boolean ui)
      Import profile for this diagram into a given project.
      Parameters:
      project - project
      ui - show ui messages in case of some problems
      Returns:
      true if required profiles are attached to project
    • getDiagramActions

      @OpenApi @CheckForNull public MDActionsManager 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

      protected DiagramDescriptor clone()
      Overrides:
      clone in class Object
    • getStereotypes

      public List<String> getStereotypes(Project project)
      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

      @CheckForNull public TargetElementAMConfigurator getTargetsManipulatorsConfigurator()
    • getSmartManipulatorsActions

      public ActionsManager getSmartManipulatorsActions(boolean superType)
    • getTargetsManipulatorsActions

      public ActionsManager getTargetsManipulatorsActions(boolean superType)
    • 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

      public Collection<com.nomagic.magicdraw.core.Feature> getRequiredFeatures()
      Gets required features which are needed by this diagram descriptor.
      Returns:
      required features which are needed by this diagram descriptor.
    • setRequiredFeatures

      public void setRequiredFeatures(Collection<com.nomagic.magicdraw.core.Feature> requiredFeatures)
      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

      public static boolean isSupported(@CheckForNull DiagramDescriptor diagramDescriptor)
    • getCategory

      @CheckForNull @OpenApi public String getCategory()
      Diagram category name.
      Returns:
      diagram category
    • getKind

      public String getKind()
      Returns a diagram kind used for grouping diagrams by their nature - symbolic diagram, table and so on.
      Returns:
      diagram kind
    • setCategory

      @OpenApi public void setCategory(@CheckForNull String category)
      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

      public void configureNewDiagram(Diagram diagram, @CheckForNull Namespace parent)
      Configure new created diagram
      Parameters:
      diagram - diagram
      parent - parent
    • hasContent

      public boolean hasContent()
      Does diagram has content. e.g. does diagram has content for locking/unlocking
      Returns:
      does diagram has content