Package com.nomagic.uml2.ext.jmi.helpers
Class ElementImageHelper
- java.lang.Object
-
- com.nomagic.uml2.ext.jmi.helpers.ElementImageHelper
-
@OpenApiAll public class ElementImageHelper extends java.lang.ObjectUtility class to work with 'Image' property, which is contained by all elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElementImageHelper.ImageInformationStructure, which contains information of image: content, format and location.
-
Constructor Summary
Constructors Constructor Description ElementImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ElementImageHelper.ImageInformationgetCustomImageInformation(Element element)Gets image information by element if image is set.static ElementImageHelper.ImageInformationgetCustomImageInformation(Element element, Stereotype stereotype)Deprecated.private static TaggedValuegetCustomImageTaggedValue(Element element, java.lang.String propertyName, Stereotype stereotype)private static java.lang.StringgetCustomImageTaggedValueValue(Element element, java.lang.String propertyName, Stereotype stereotype)static ElementgetElementToSetImage(ModelElementProvider pElement)Returns element to set image propertystatic ResizableIcongetIconFromCustomImageProperty(ElementImageHelper.ImageInformation imageInformation)A helper method to create resizable icon from image information.static ResizableIcongetIconFromCustomImageProperty(Element element)Gets 'ResizableIcon', which is created from the image information.static StereotypegetImageHolderStereotype(Project project)Return image holder stereotype from a given project.static ElementImageHelper.ImageInformationgetProvidedElementImageInformation(ModelElementProvider pElement)Returns image information of provided elementstatic voidsetCustomImageInformation(Element element, ElementImageHelper.ImageInformation imageInformation)Set image information to given element: stereotype 'CustomImageHolder' is applied on element and image information are saved to the tags of this stereotype.static voidsetCustomImageInformation(Element element, Image image)Set image information to given element: stereotype 'CustomImageHolder' is applied on element and image information are saved to the tags of this stereotype.
-
-
-
Method Detail
-
getCustomImageInformation
@CheckForNull public static ElementImageHelper.ImageInformation getCustomImageInformation(Element element)
Gets image information by element if image is set.- Parameters:
element- element, which contains image property.- Returns:
- image information if image to element is set, otherwise null.
-
getCustomImageInformation
@Deprecated @CheckForNull public static ElementImageHelper.ImageInformation getCustomImageInformation(Element element, Stereotype stereotype)
Deprecated.Gets image information by element if image is set.- Parameters:
element- element, which contains image property.- Returns:
- image information if image to element is set, otherwise null.
-
getCustomImageTaggedValue
@CheckForNull private static TaggedValue getCustomImageTaggedValue(Element element, java.lang.String propertyName, Stereotype stereotype)
-
getCustomImageTaggedValueValue
@CheckForNull private static java.lang.String getCustomImageTaggedValueValue(Element element, java.lang.String propertyName, Stereotype stereotype)
-
setCustomImageInformation
public static void setCustomImageInformation(Element element, Image image)
Set image information to given element: stereotype 'CustomImageHolder' is applied on element and image information are saved to the tags of this stereotype.- Parameters:
element- element, which contains image propertyimage- information source used to set image
-
setCustomImageInformation
public static void setCustomImageInformation(Element element, @CheckForNull ElementImageHelper.ImageInformation imageInformation)
Set image information to given element: stereotype 'CustomImageHolder' is applied on element and image information are saved to the tags of this stereotype. If image is removed, stereotype is removed too.- Parameters:
element- element, which contains image propertyimageInformation- structure, which contains information of image: content, format and location
-
getImageHolderStereotype
public static Stereotype getImageHolderStereotype(Project project)
Return image holder stereotype from a given project.- Parameters:
project- project- Returns:
- image holder stereotype
-
getIconFromCustomImageProperty
@CheckForNull public static ResizableIcon getIconFromCustomImageProperty(@CheckForNull Element element)
Gets 'ResizableIcon', which is created from the image information.- Parameters:
element- element, which contains image property- Returns:
- 'ResizableIcon' if image is set to element's 'Image' property, otherwise null
-
getIconFromCustomImageProperty
@CheckForNull public static ResizableIcon getIconFromCustomImageProperty(@CheckForNull ElementImageHelper.ImageInformation imageInformation)
A helper method to create resizable icon from image information.- Parameters:
imageInformation- image info- Returns:
- icon
-
getElementToSetImage
@CheckForNull public static Element getElementToSetImage(ModelElementProvider pElement)
Returns element to set image property- Parameters:
pElement- presentation element- Returns:
- element to which image should be set
-
getProvidedElementImageInformation
@CheckForNull public static ElementImageHelper.ImageInformation getProvidedElementImageInformation(ModelElementProvider pElement)
Returns image information of provided element- Parameters:
pElement- presentation element- Returns:
- element to which image should be set
-
-