Package com.nomagic.magicdraw.uml
Class DiagramType
java.lang.Object
com.nomagic.magicdraw.uml.AbstractDiagramType
com.nomagic.magicdraw.uml.DiagramType
- All Implemented Interfaces:
DiagramTypeConstants,DiagramTypes,Cloneable
The
DiagramType class represents the diagram type-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface com.nomagic.magicdraw.uml.DiagramTypeConstants
STANDARD_CREATABLE_TYPES, STANDARD_NON_CREATABLE_TYPES, STANDARD_TYPESFields inherited from interface com.nomagic.uml2.diagram.DiagramTypes
CONTENT_DIAGRAM, DEPENDENCY_MATRIX, GENERIC_TABLE, GLOSSARY_TABLE, INSTANCE_TABLE, RELATION_MAP_DIAGRAM, UML_ACTIVITY_DIAGRAM, UML_ANY_DIAGRAM, UML_BEHAVIOR_DIAGRAM, UML_CLASS_DIAGRAM, UML_COMMUNICATION_DIAGRAM, UML_COMPONENT_DIAGRAM, UML_COMPOSITE_STRUCTURE_DIAGRAM, UML_DEPLOYMENT_DIAGRAM, UML_INTERACTION_DIAGRAM, UML_INTERACTION_OVERVIEW_DIAGRAM, UML_OBJECT_DIAGRAM, UML_PACKAGE_DIAGRAM, UML_PROFILE_DIAGRAM, UML_PROTOCOL_STATE_MACHINE_DIAGRAM, UML_SEQUENCE_DIAGRAM, UML_STATECHART_DIAGRAM, UML_STATIC_DIAGRAM, UML_USECASE_DIAGRAM, USER_INTERFACE_MODELING_DIAGRAM -
Constructor Summary
ConstructorsConstructorDescriptionDiagramType(String type) Constructs diagram type according given diagram type string representation. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddIgnoredDiagramType(String diagramType) Add diagram type, which will be ignored if descriptor for this diagram type not registered.static voidaddIgnoredDiagramType(String diagramType, boolean symbolDiagram) Add diagram type, which will be ignored if descriptor for this diagram type not registered.static voidaddIgnoredDiagramType(Collection<String> diagramTypes) Add diagram types, which will be ignored if descriptor for this diagram type not registered.static voidaddIgnoredDiagramTypes(Collection<String> diagramTypes, boolean symbolDiagram) Add diagram types, which will be ignored if descriptor for this diagram type not registered.clone()static List<?>configureContextTypeByDiagramType(Project project, String diagramType, List<Class> contextTypes) Configure owner types.static DiagramTypecreateDiagramType(String type) Creates diagram type of given type string representation.static voidfilterByHiddenSuggestedDSLDiagramTypes(String diagramType, Collection<?> contextTypes) Filters hidden suggested DSL diagram context types.static StringgetAbbreviatedType(String diagramType) Returns abbreviated type for given normal diagram type.Returns list of all diagram types.getAllSubtypes(String root, boolean creatable) collect all subtypes of the given root diagram type.Returns list of available to create (creatable) diagram types.static ClassgetDiagramActualElementType(String diagramType, Element owner) static DiagramTypegetDiagramType(Diagram diagram) Return diagram type for a given diagramTypes of diagrams must be ignored.static StringgetPluralHumanName(String type) Returns plural human name of the given type.static Collection<Class>static Collection<Class>getPossibleDiagramOwnerTypes(String type, boolean includeSuperTypeOwners) Returns root type of this diagram type.static StringgetRootType(String diagramType) Returns root type of given diagram type.static StringgetRootUMLType(String diagramType) Returns root type of the UML type diagram.static StringgetShortType(String diagramType) Returns short type for given normal diagram type.static StringgetSingularHumanName(String type) Returns singular human name of the given type.final StringReturns registered super type for diagram type.static StringgetSuperType(String derivedType) Returns registered super type for given diagram type.getType()Returns the diagram type string representationReturns UML diagram type.static booleanisCreatableDiagramType(String type) Check, whether diagram type is creatable.booleanisEqualType(DiagramType type) Checks if diagram type is equal to given diagram type.booleanisEqualType(String type) Checks if diagram type is equal to given diagram type.static booleanisIgnoredSymbolDiagram(DiagramPresentationElement diagramPresentationElement) Checks if diagram is ignored symbol diagrambooleanisTypeOf(DiagramType type) Checks if diagram type is of given diagram type (analogy ofinstanceofoperator)booleanChecks if diagram type is of given diagram type (analogy ofinstanceofoperator)static booleanChecks if given specific type extends given generic typestatic booleanstatic voidregisterContextTypeByDiagramTypeConfigurator(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Registers a new context type by diagram type configuratorstatic voidregisterDiagramType(String newType, String superType, boolean creatable) Adds and registers new diagram type.static voidregisterHumanNames(String newType, String singularName, String pluralName) voidSets the diagram type, according given diagram type string representationstatic voidunregisterContextTypeByDiagramTypeConfigurator(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Unregisters a new context type by diagram type configuratorstatic voidunregisterDiagramType(String type) Unregisters diagram type.Methods inherited from class com.nomagic.magicdraw.uml.AbstractDiagramType
isTypeOf
-
Field Details
-
DIAGRAMS_WITHOUT_AUTOMATIC_CONTEXT_SET
-
-
Constructor Details
-
DiagramType
Constructs diagram type according given diagram type string representation.- Parameters:
type- diagram type string representation- See Also:
-
-
Method Details
-
getShortType
Returns short type for given normal diagram type. For example "Activity Diagram" will be "activity".- Parameters:
diagramType- type- Returns:
- short type
-
getAbbreviatedType
Returns abbreviated type for given normal diagram type. For example "Activity Diagram" will be "act".- Parameters:
diagramType- type- Returns:
- abbreviated type
-
getDiagramType
Return diagram type for a given diagram- Parameters:
diagram- diagram- Returns:
- diagram type
-
setType
Sets the diagram type, according given diagram type string representation- Parameters:
type- diagram type string representation- See Also:
-
getType
Returns the diagram type string representation- Specified by:
getTypein classAbstractDiagramType- Returns:
- diagram type string representation
- See Also:
-
isEqualType
Checks if diagram type is equal to given diagram type.- Parameters:
type- diagram type- Returns:
trueif this diagram type is equal to given diagram type; otherwise -false.- See Also:
-
isEqualType
Checks if diagram type is equal to given diagram type.- Parameters:
type- diagram type string representation- Returns:
trueif this diagram type is equal to given diagram type; otherwise -false.- See Also:
-
isTypeOf
Checks if diagram type is of given diagram type (analogy ofinstanceofoperator)- Parameters:
type- diagram type.- Returns:
trueif this diagram type is a 'subtype' of given diagram type or equal to given diagram type; otherwise -false.- See Also:
-
isTypeOf
Checks if diagram type is of given diagram type (analogy ofinstanceofoperator)- Specified by:
isTypeOfin classAbstractDiagramType- Parameters:
type- diagram type string representation.- Returns:
trueif this diagram type is a 'subtype' of given diagram type or equal to given diagram type; otherwise -false.- See Also:
-
getRootType
Returns root type of this diagram type.- Returns:
- root type.
-
clone
- Overrides:
clonein classAbstractDiagramType
-
getAllDiagramTypes
Returns list of all diagram types.- Returns:
- list of all diagram types.
- See Also:
-
getCreatableDiagramTypes
Returns list of available to create (creatable) diagram types.- Returns:
- list of available to create (creatable) diagram types.
- See Also:
-
addIgnoredDiagramType
Add diagram type, which will be ignored if descriptor for this diagram type not registered. Ignored means that it will not show messages about not loaded diagrams when is loading diagram.- Parameters:
diagramType- type of diagram.
-
addIgnoredDiagramType
Add diagram type, which will be ignored if descriptor for this diagram type not registered. Ignored means that it will not show messages about not loaded diagrams when is loading diagram.- Parameters:
diagramType- type of diagram.symbolDiagram- true if diagram is symbolic
-
addIgnoredDiagramType
Add diagram types, which will be ignored if descriptor for this diagram type not registered. Ignored means that it will not show messages about not loaded diagrams when is loading diagram.- Parameters:
diagramTypes- type of diagram.
-
addIgnoredDiagramTypes
Add diagram types, which will be ignored if descriptor for this diagram type not registered. Ignored means that it will not show messages about not loaded diagrams when is loading diagram.- Parameters:
diagramTypes- type of diagram.symbolDiagram- true if diagram is symbolic
-
getIgnoredDiagramTypes
Types of diagrams must be ignored.- Returns:
- set of diagrams types which are ignored to show warnings about missing resources.
-
isIgnoredSymbolDiagram
Checks if diagram is ignored symbol diagram- Parameters:
diagramPresentationElement- diagram- Returns:
- true if diagram is ignored symbol diagram
-
createDiagramType
Creates diagram type of given type string representation.- Parameters:
type- diagram type string representation- Returns:
- created diagram type.
- See Also:
-
isCreatableDiagramType
Check, whether diagram type is creatable.- Parameters:
type- diagram type string representation- Returns:
- true, if type is creatable.
- See Also:
-
getSuperType
Returns registered super type for given diagram type.- Parameters:
derivedType- the given derived type.- Returns:
- the super diagram type or null.
-
getSuperType
Returns registered super type for diagram type.- Returns:
- the super diagram type or null.
-
registerDiagramType
Adds and registers new diagram type.- Parameters:
newType- the new diagram type.superType- the 'super diagram' type of the new diagram type. E.g.Interaction Diagramis a 'super diagram' forCollaboration DiagramandSequence Diagram.creatable- flag indicating if the registering type diagrams will be creatable.
-
unregisterDiagramType
Unregisters diagram type.- Parameters:
type- the diagram type.
-
registerHumanNames
-
getSingularHumanName
Returns singular human name of the given type.- Parameters:
type- the given type.- Returns:
- singular name.
-
getPluralHumanName
Returns plural human name of the given type.- Parameters:
type- the given type.- Returns:
- plural name.
-
getUMLDiagramType
Returns UML diagram type.- Returns:
- UML diagram type.
-
getStandardType
- Specified by:
getStandardTypein classAbstractDiagramType
-
getDiagramActualElementType
-
isTypeOf
Description copied from interface:DiagramTypesChecks if given specific type extends given generic type- Parameters:
unknown- specific typetype- generic type- Returns:
- true if extends
-
isTypeOf
-
getPossibleDiagramOwnerTypes
-
getPossibleDiagramOwnerTypes
public static Collection<Class> getPossibleDiagramOwnerTypes(@CheckForNull String type, boolean includeSuperTypeOwners) - Parameters:
type- diagram typeincludeSuperTypeOwners- should possible owners of provided diagram type's super-type's be included- Returns:
- collection of class types
-
getAllSubtypes
collect all subtypes of the given root diagram type.rootis inclusive in results- Parameters:
root- rot diagram type of the returned resultcreatable- if true, then only creatable types are returned- Returns:
- subtypes of given rood diagram type.
rootis inclusive in results
-
getRootType
Returns root type of given diagram type.- Returns:
- root type.
-
getRootUMLType
Returns root type of the UML type diagram.- Returns:
- root type one of the UML diagram type.
-
configureContextTypeByDiagramType
public static List<?> configureContextTypeByDiagramType(Project project, String diagramType, List<Class> contextTypes) Configure owner types. Appends allowed DSLed context types (Stereotypes), may remove passed metaclasses.- Parameters:
project- projectdiagramType- diagram typecontextTypes- collection of java.lang.Class or Stereotype (for DSL) objects- Returns:
- types
-
filterByHiddenSuggestedDSLDiagramTypes
public static void filterByHiddenSuggestedDSLDiagramTypes(String diagramType, Collection<?> contextTypes) Filters hidden suggested DSL diagram context types.- Parameters:
diagramType- type of the diagram.contextTypes- diagram context types.
-
unregisterContextTypeByDiagramTypeConfigurator
public static void unregisterContextTypeByDiagramTypeConfigurator(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Unregisters a new context type by diagram type configurator- Parameters:
configurator- configurator
-
registerContextTypeByDiagramTypeConfigurator
public static void registerContextTypeByDiagramTypeConfigurator(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Registers a new context type by diagram type configurator- Parameters:
configurator- configurator
-