Class EmbeddedImageHandle


public class EmbeddedImageHandle extends StructureHandle
Represents the handle of an embedded image. The class gives the name and type of the image. Used when an image element ImageItemgives a name. Each embedded image has the following properties:

Name
an embedded image has a unique and required name, so the image item can use the image name to identify an embedded image.
Type
an embedded image has a choice and required type: bmp, gif, png or x-png.
Data
value of the image data in Base64 encoding.
  • Constructor Details

    • EmbeddedImageHandle

      public EmbeddedImageHandle(SimpleValueHandle valueHandle, int index)
      Constructs the handle of embedded image.
      Parameters:
      valueHandle - the value handle for embedded image list of one property
      index - the position of this embedded image in the list
  • Method Details

    • getData

      public byte[] getData()
      Returns the byte array of image data.
      Returns:
      the byte array of image data
    • setData

      public void setData(byte[] data)
      Sets the byte array of image data.
      Parameters:
      data - the byte array to set
    • getName

      public String getName()
      Returns the embedded image name. This name is used to identify an embedded image by image item.
      Returns:
      the embedded image name
    • setName

      public void setName(String name) throws SemanticException
      Sets the embedded image name. This name is used to identify an embedded image by image item.
      Parameters:
      name - the embedded image name to set
      Throws:
      SemanticException - value required exception
    • getType

      public String getType()
      Returns the image type. The possible values are defined in DesignChoiceConstants, and they are:
      • IMAGE_TYPE_IMAGE_JPEG
      • IMAGE_TYPE_IMAGE_BMP
      • IMAGE_TYPE_IMAGE_GIF
      • IMAGE_TYPE_IMAGE_PNG
      • IMAGE_TYPE_IMAGE_X_PNG
      Returns:
      the image type
    • setType

      public void setType(String type) throws SemanticException
      Sets the image type. The allowed values are defined in DesignChoiceConstants, and they are:
      • IMAGE_TYPE_IMAGE_JPEG
      • IMAGE_TYPE_IMAGE_BMP
      • IMAGE_TYPE_IMAGE_GIF
      • IMAGE_TYPE_IMAGE_PNG
      • IMAGE_TYPE_IMAGE_X_PNG
      Parameters:
      type - the image type to set
      Throws:
      SemanticException - if the image type is not in the choice list.
    • getQualifiedName

      public String getQualifiedName()
      Returns the qualified name of this element. The qualified name is the name of this element if this element is in module user is editing.
      Returns:
      the qualified name of thie element.
    • isLibReference

      public boolean isLibReference()
      Checks whether EmbeddedImage has reference to library embedded image.
      Returns:
      if EmbeddedImage has reference to library image and the reference is resolved return true else return false