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.
  • Field Details

    • SYMBOL_ADORNMENT

      public static final ResizableIcon SYMBOL_ADORNMENT
  • Constructor Details

    • ElementIcon

      public ElementIcon()
  • Method Details

    • 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
    • getIconByClassType

      @CheckForNull public static ResizableIcon getIconByClassType(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(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(Class classType, Collection<Stereotype> stereotypes)
      Returns icon, according class type and stereotypes.
      Parameters:
      classType - class type
      stereotypes - stereotypes
      Returns:
      icon
    • getIconByClassType

      @CheckForNull public static ResizableIcon getIconByClassType(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(String diagramType)
      Returns icon by diagram type
      Parameters:
      diagramType - the diagram.
      Returns:
      icon
    • getSVGIconByDiagramType

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