Class ElementIcon


  • @OpenApiAll
    public class ElementIcon
    extends ElementIconsRegistry
    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.
    • Constructor Detail

      • ElementIcon

        public ElementIcon()
    • Method Detail

      • loadIconForElement

        private static void loadIconForElement​(java.lang.Class<? extends PresentationElement> 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
      • internalGetIcon

        @CheckForNull
        private static ResizableIcon internalGetIcon​(@CheckForNull
                                                     BaseElement element,
                                                     boolean hideCustomPathStyle)
        Returns icon, according the given element type. It will return correct icon for all kinds of elements, but symbol (PresentationElement).
        Parameters:
        element - the Element
        hideCustomPathStyle - if true custom path style icon is skipped in icon searching process
        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 - 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
      • internalGetIconForSymbol

        @CheckForNull
        private static ResizableIcon internalGetIconForSymbol​(PresentationElement presentationElement,
                                                              boolean hideCustomPathStyle)