Class ElementIcon


  • @OpenApiAll
    public class ElementIcon
    extends java.lang.Object
    Utility class for providing icons for Elements. Icon can be provided for Element 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 Detail

      • mIconsByType

        private static final java.util.Map<java.lang.Class,​ResizableIcon> mIconsByType
      • SYMBOL_ADORNMENT

        public static final ResizableIcon SYMBOL_ADORNMENT
      • ABSTRACT_CLASS

        public static final ResizableIcon ABSTRACT_CLASS
      • USECASE_INSTANCE

        public static final ResizableIcon USECASE_INSTANCE
      • SUBSYSTEM_INSTANCE

        public static final ResizableIcon SUBSYSTEM_INSTANCE
      • COMPONENT_INSTANCE

        public static final ResizableIcon COMPONENT_INSTANCE
      • ARTIFACT_INSTANCE

        public static final ResizableIcon ARTIFACT_INSTANCE
      • DEVICE_INSTANCE

        public static final ResizableIcon DEVICE_INSTANCE
      • EXECUTION_ENVIRONMENT_INSTANCE

        public static final ResizableIcon EXECUTION_ENVIRONMENT_INSTANCE
      • ARTIFACT_DEPLOYMENT_INSTANCE

        public static final ResizableIcon ARTIFACT_DEPLOYMENT_INSTANCE
      • CREATE_MESSAGE

        public static final ResizableIcon CREATE_MESSAGE
      • DESTROY_MESSAGE

        public static final ResizableIcon DESTROY_MESSAGE
      • ASSEMBLY_CONNECTOR

        public static final ResizableIcon ASSEMBLY_CONNECTOR
      • DELEGATION_CONNECTOR

        public static final ResizableIcon DELEGATION_CONNECTOR
      • PROFILE_MODEL_LIBRARY

        public static final ResizableIcon PROFILE_MODEL_LIBRARY
      • MODEL_MODEL_LIBRARY

        public static final ResizableIcon MODEL_MODEL_LIBRARY
      • PACKAGE_MODEL_LIBRARY

        public static final ResizableIcon PACKAGE_MODEL_LIBRARY
      • DIRECTED_ASSOCIATION

        public static final ResizableIcon DIRECTED_ASSOCIATION
      • DIRECTED_AGGREGATION

        public static final ResizableIcon DIRECTED_AGGREGATION
      • DIRECTED_COMPOSITION

        public static final ResizableIcon DIRECTED_COMPOSITION
      • NON_NAVIGABLE_ASSOCIATION

        public static final ResizableIcon NON_NAVIGABLE_ASSOCIATION
      • ACCEPT_TIME_EVENT_ACTION

        public static final ResizableIcon ACCEPT_TIME_EVENT_ACTION
      • COMPOSITE_STATE

        public static final ResizableIcon COMPOSITE_STATE
      • SUBMACHINE_STATE

        public static final ResizableIcon SUBMACHINE_STATE
      • CONCURRENT_STATE

        public static final ResizableIcon CONCURRENT_STATE
      • INITIAL_PSEUDO_STATE

        public static final ResizableIcon INITIAL_PSEUDO_STATE
      • DEEP_HISTORY_PSEUDO_STATE

        public static final ResizableIcon DEEP_HISTORY_PSEUDO_STATE
      • SHALLOW_HISTORY_PSEUDO_STATE

        public static final ResizableIcon SHALLOW_HISTORY_PSEUDO_STATE
      • JOIN_PSEUDO_STATE

        public static final ResizableIcon JOIN_PSEUDO_STATE
      • FORK_PSEUDO_STATE

        public static final ResizableIcon FORK_PSEUDO_STATE
      • JUNCTION_PSEUDO_STATE

        public static final ResizableIcon JUNCTION_PSEUDO_STATE
      • CHOICE_PSEUDO_STATE

        public static final ResizableIcon CHOICE_PSEUDO_STATE
      • ENTRY_POINT_PSEUDO_STATE

        public static final ResizableIcon ENTRY_POINT_PSEUDO_STATE
      • EXIT_POINT_PSEUDO_STATE

        public static final ResizableIcon EXIT_POINT_PSEUDO_STATE
      • TERMINATE_PSEUDO_STATE

        public static final ResizableIcon TERMINATE_PSEUDO_STATE
      • mSmallIconsByDiagramType

        private static final java.util.Map<java.lang.String,​ResizableIcon> mSmallIconsByDiagramType
      • mSVGIconsByDiagramType

        private static final java.util.Map<java.lang.String,​ResizableIcon> mSVGIconsByDiagramType
    • Constructor Detail

      • ElementIcon

        public ElementIcon()
    • Method Detail

      • internalGetIconByTypeMap

        public static java.util.Map<java.lang.Class,​ResizableIcon> internalGetIconByTypeMap()
      • loadDoubleSizeIcon

        private static ResizableIcon loadDoubleSizeIcon​(java.lang.String name)
      • loadIconForElement

        private static void loadIconForElement​(java.lang.Class<? extends BaseElement> elementClass,
                                               java.lang.String iconName)
      • get16x16Icon

        @CheckForNull
        public static ResizableIcon get16x16Icon​(@CheckForNull
                                                 ResizableIcon icon)
        Return scaled down to 16x16 icon for a given icon
        Parameters:
        icon - icon
        Returns:
        scaled icon
      • getIcon

        @CheckForNull
        public static ResizableIcon getIcon​(@CheckForNull
                                            BaseElement element)
        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 Element
        hideCustomPathStyle - if true custom path style icon is skipped and standard relationship icons is returned
        Returns:
        icon
      • internalGetIconForSymbol

        @CheckForNull
        private static ResizableIcon internalGetIconForSymbol​(PresentationElement presentationElement,
                                                              boolean hideCustomPathStyle)
        Gets symbol icon. It is usually an element icon adorned with the symbol "icon"
        Parameters:
        presentationElement - symbol
        hideCustomPathStyle - hide custom path icon if specified
        Returns:
        icon
      • getIconByClassType

        @CheckForNull
        public static ResizableIcon getIconByClassType​(java.lang.Class classType,
                                                       @CheckForNull
                                                       Stereotype stereotype)
        Returns icon by class type and stereotype.
        Parameters:
        classType - class type
        stereotype - given stereotype
        Returns:
        icon
      • getIconByStereotype

        @CheckForNull
        public static ResizableIcon getIconByStereotype​(java.util.function.Supplier<ResizableIcon> iconSupplier,
                                                        @CheckForNull
                                                        Stereotype stereotype)
        Returns icon from stereotype or from iconSupplier if stereotype has no icon
        Parameters:
        iconSupplier - icon supplier
        stereotype - given stereotype
        Returns:
        icon
      • getIconByClassType

        @CheckForNull
        public static ResizableIcon getIconByClassType​(java.lang.Class classType,
                                                       java.util.Collection<Stereotype> stereotypes)
        Returns icon, according class type and stereotypes.
        Parameters:
        classType - class type
        stereotypes - given stereotypes
        Returns:
        icon
      • getIconByClassType

        @CheckForNull
        public static ResizableIcon getIconByClassType​(java.lang.Class classType)
        Returns icon by class type of the element.
        Parameters:
        classType - class type.
        Returns:
        icon
      • getIconByType

        @CheckForNull
        public static ResizableIcon getIconByType​(@CheckForNull
                                                  BaseElement element)
        Returns image, according element meta type.
        Parameters:
        element - element
        Returns:
        icon
      • getIconByDiagramType

        @CheckForNull
        public static ResizableIcon getIconByDiagramType​(DiagramPresentationElement diagram)
        Returns icon by diagram type.
        Parameters:
        diagram - the diagram
        Returns:
        icon
      • getIconByDiagramType

        @CheckForNull
        public static ResizableIcon getIconByDiagramType​(java.lang.String diagramType)
        Returns icon by diagram type
        Parameters:
        diagramType - the diagram.
        Returns:
        icon
      • getSVGIconByDiagramType

        @CheckForNull
        public static ResizableIcon getSVGIconByDiagramType​(java.lang.String diagramType)
        Returns SVG icon by diagram type
        Parameters:
        diagramType - the diagram.
        Returns:
        icon