Package com.nomagic.magicdraw.uml
Class ElementIcon
java.lang.Object
com.nomagic.magicdraw.icons.ElementIconsRegistry
com.nomagic.magicdraw.uml.ElementIcon
Utility class for providing icons for Elements.
Icon can be provided for BaseElement object, class type of Element, diagram type.
See
ClassTypes
for useful utility methods to work with class types.
Use BaseElement.getClassType()
to retrieve class type of the Element.-
Field Summary
Fields inherited from class com.nomagic.magicdraw.icons.ElementIconsRegistry
ABSTRACT_CLASS, ACCEPT_TIME_EVENT_ACTION, AGGREGATION, ARTIFACT_DEPLOYMENT_INSTANCE, ARTIFACT_INSTANCE, ASSEMBLY_CONNECTOR, CALL_MESSAGE, CHOICE_PSEUDO_STATE, COMPONENT_INSTANCE, COMPOSITE_STATE, COMPOSITION, CONCURRENT_STATE, CREATE_MESSAGE, DEEP_HISTORY_PSEUDO_STATE, DELEGATION_CONNECTOR, DESTROY_MESSAGE, DEVICE_INSTANCE, DIRECTED_AGGREGATION, DIRECTED_ASSOCIATION, DIRECTED_COMPOSITION, DOCUMENTATION, ENTRY_POINT_PSEUDO_STATE, EXECUTION_ENVIRONMENT_INSTANCE, EXIT_POINT_PSEUDO_STATE, FORK_PSEUDO_STATE, INITIAL_PSEUDO_STATE, JOIN_PSEUDO_STATE, JUNCTION_PSEUDO_STATE, LINK, METACLASS, MODEL_MODEL_LIBRARY, NARY_ASSOCIATION, NODE_INSTANCE, NON_NAVIGABLE_ASSOCIATION, NONE_ICON, PACKAGE_MODEL_LIBRARY, PROFILE_MODEL_LIBRARY, REPLY_MESSAGE, SEND_MESSAGE, SHALLOW_HISTORY_PSEUDO_STATE, SUBMACHINE_STATE, SUBSYSTEM, SUBSYSTEM_INSTANCE, TERMINATE_PSEUDO_STATE, USECASE_INSTANCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResizableIcon
get16x16Icon
(ResizableIcon icon) Return scaled down to 16x16 icon for a given iconstatic ResizableIcon
getIcon
(BaseElement element) Returns icon for a given elementstatic ResizableIcon
getIcon
(BaseElement element, boolean hideCustomPathStyle) Returns icon for a given elementstatic ResizableIcon
getIconByClassType
(Class classType) Returns icon by class type of the element.static ResizableIcon
getIconByClassType
(Class classType, Stereotype stereotype) Returns icon by class type and stereotype.static ResizableIcon
getIconByClassType
(Class classType, Collection<Stereotype> stereotypes) Returns icon, according class type and stereotypes.static ResizableIcon
Returns icon by diagram type.static ResizableIcon
getIconByDiagramType
(String diagramType) Returns icon by diagram typestatic ResizableIcon
getIconByStereotype
(Supplier<ResizableIcon> iconSupplier, Stereotype stereotype) Returns icon from stereotype or from iconSupplier if stereotype has no iconstatic ResizableIcon
getIconByType
(BaseElement element) Returns image, according element meta type.static ResizableIcon
getSVGIconByDiagramType
(String diagramType) Returns SVG icon by diagram typeMethods inherited from class com.nomagic.magicdraw.icons.ElementIconsRegistry
getIcon, internalGetIconByTypeMap, loadDoubleSizeIcon, putIcon
-
Field Details
-
SYMBOL_ADORNMENT
-
-
Constructor Details
-
ElementIcon
public ElementIcon()
-
-
Method Details
-
get16x16Icon
Return scaled down to 16x16 icon for a given icon- Parameters:
icon
- icon- Returns:
- scaled icon
-
getIcon
Returns icon for a given element- Parameters:
element
- the Element- Returns:
- icon
-
getIcon
@CheckForNull public static ResizableIcon getIcon(@CheckForNull BaseElement element, boolean hideCustomPathStyle) Returns icon for a given element- Parameters:
element
- the ElementhideCustomPathStyle
- if true custom path style icon is skipped and standard relationship icons is returned- Returns:
- icon
-
getIconByClassType
@CheckForNull public static ResizableIcon getIconByClassType(Class classType, @CheckForNull Stereotype stereotype) Returns icon by class type and stereotype.- Parameters:
classType
- class typestereotype
- given stereotype- Returns:
- icon
-
getIconByStereotype
@CheckForNull public static ResizableIcon getIconByStereotype(Supplier<ResizableIcon> iconSupplier, @CheckForNull Stereotype stereotype) Returns icon from stereotype or from iconSupplier if stereotype has no icon- Parameters:
iconSupplier
- icon supplierstereotype
- given stereotype- Returns:
- icon
-
getIconByClassType
@CheckForNull public static ResizableIcon getIconByClassType(Class classType, Collection<Stereotype> stereotypes) Returns icon, according class type and stereotypes.- Parameters:
classType
- class typestereotypes
- stereotypes- Returns:
- icon
-
getIconByClassType
Returns icon by class type of the element.- Parameters:
classType
- class type- Returns:
- icon
-
getIconByType
Returns image, according element meta type.- Parameters:
element
- element- Returns:
- icon
-
getIconByDiagramType
Returns icon by diagram type.- Parameters:
diagram
- the diagram- Returns:
- icon
-
getIconByDiagramType
Returns icon by diagram type- Parameters:
diagramType
- the diagram.- Returns:
- icon
-
getSVGIconByDiagramType
Returns SVG icon by diagram type- Parameters:
diagramType
- the diagram.- Returns:
- icon
-