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_TYPES
Fields 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 void
addIgnoredDiagramType
(String diagramType) Add diagram type, which will be ignored if descriptor for this diagram type not registered.static void
addIgnoredDiagramType
(String diagramType, boolean symbolDiagram) Add diagram type, which will be ignored if descriptor for this diagram type not registered.static void
addIgnoredDiagramType
(Collection<String> diagramTypes) Add diagram types, which will be ignored if descriptor for this diagram type not registered.static void
addIgnoredDiagramTypes
(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 DiagramType
createDiagramType
(String type) Creates diagram type of given type string representation.static void
filterByHiddenSuggestedDSLDiagramTypes
(String diagramType, Collection<?> contextTypes) Filters hidden suggested DSL diagram context types.static String
getAbbreviatedType
(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 Class
getDiagramActualElementType
(String diagramType, Element owner) static DiagramType
getDiagramType
(Diagram diagram) Return diagram type for a given diagramTypes of diagrams must be ignored.static String
getPluralHumanName
(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 String
getRootType
(String diagramType) Returns root type of given diagram type.static String
getRootUMLType
(String diagramType) Returns root type of the UML type diagram.static String
getShortType
(String diagramType) Returns short type for given normal diagram type.static String
getSingularHumanName
(String type) Returns singular human name of the given type.final String
Returns registered super type for diagram type.static String
getSuperType
(String derivedType) Returns registered super type for given diagram type.getType()
Returns the diagram type string representationReturns UML diagram type.static boolean
isCreatableDiagramType
(String type) Check, whether diagram type is creatable.boolean
isEqualType
(DiagramType type) Checks if diagram type is equal to given diagram type.boolean
isEqualType
(String type) Checks if diagram type is equal to given diagram type.static boolean
isIgnoredSymbolDiagram
(DiagramPresentationElement diagramPresentationElement) Checks if diagram is ignored symbol diagramboolean
isTypeOf
(DiagramType type) Checks if diagram type is of given diagram type (analogy ofinstanceof
operator)boolean
Checks if diagram type is of given diagram type (analogy ofinstanceof
operator)static boolean
Checks if given specific type extends given generic typestatic boolean
static void
registerContextTypeByDiagramTypeConfigurator
(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Registers a new context type by diagram type configuratorstatic void
registerDiagramType
(String newType, String superType, boolean creatable) Adds and registers new diagram type.static void
registerHumanNames
(String newType, String singularName, String pluralName) void
Sets the diagram type, according given diagram type string representationstatic void
unregisterContextTypeByDiagramTypeConfigurator
(com.nomagic.magicdraw.uml.DiagramType.ContextTypesConfigurator configurator) Unregisters a new context type by diagram type configuratorstatic void
unregisterDiagramType
(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:
getType
in classAbstractDiagramType
- Returns:
- diagram type string representation
- See Also:
-
isEqualType
Checks if diagram type is equal to given diagram type.- Parameters:
type
- diagram type- Returns:
true
if 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:
true
if this diagram type is equal to given diagram type; otherwise -false
.- See Also:
-
isTypeOf
Checks if diagram type is of given diagram type (analogy ofinstanceof
operator)- Parameters:
type
- diagram type.- Returns:
true
if 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 ofinstanceof
operator)- Specified by:
isTypeOf
in classAbstractDiagramType
- Parameters:
type
- diagram type string representation.- Returns:
true
if 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:
clone
in 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 Diagram
is a 'super diagram' forCollaboration Diagram
andSequence 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:
getStandardType
in classAbstractDiagramType
-
getDiagramActualElementType
-
isTypeOf
Description copied from interface:DiagramTypes
Checks 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.root
is 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.
root
is 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
-