Class MapImageResponse

java.lang.Object
com.kheops.jmap.metadata.MapImageResponse
All Implemented Interfaces:
Serializable

public class MapImageResponse extends Object implements Serializable
The MapImageResponse is returned by the JMSImageProducer when a MapImageRequest is processed. If no error occurred during the request, it contains the produced image encoded as a byte array using the image format that was specified in the request.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
    This constant means that an unspecified error occurred.
    static final short
    This constant which means that the image producer is disabled for the specified project.
    static final short
    This constant means that no error occurred.
    static final short
    This constant means that the specified user doesn't have the permissions to view data from this project.
    static final short
    This constant means that an invalid project id was specified.
    short
    The error id returned by the server.
    The image format that was used to encode the image.
    String[][]
    The HTML image map that was created by the server using the mouseover and the url of all shown elements.
    byte[]
    The encoded image created by the image producer.
    If an error occurred, message contains the message returned by the server.
    The affine transformation that was used to create the image.
    The image view bounds in world coordinates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    This constructor is used internally.
    MapImageResponse(byte[] mapImage, String imageFormat, String message, short errorId)
    Creates a new MapImageResponse instance using the specified arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addData(Class key, Object value)
     
     
    short
    Returns the error Id if an error occurred, otherwise -1 will be returned.
    Returns the format of the image that was specified in the MapImageRequest.
    String[][]
    Returns a formatted HTML ImageMap prepared using the information returned by the mouseover configured in all used themes if the MapImageRequest.OPTION_GET_IMAGEMAP option was set in the MapImageRequest.
    byte[]
    Returns an encoded image as a byte array.
    Returns the error message that was sent by the server.
    Returns the K2DTransform of the view that was used to make to produce the image if the MapImageRequest.OPTION_GET_TRANSFORM option was set in the MapImageRequest.
    Returns the bounding box of the view if the MapImageRequest.OPTION_GET_BOUNDS option was set in the MapImageRequest.
     
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ERROR_NONE

      public static final short ERROR_NONE
      This constant means that no error occurred.
      See Also:
    • ERROR_IMAGE_PROD_DISABLED

      public static final short ERROR_IMAGE_PROD_DISABLED
      This constant which means that the image producer is disabled for the specified project.
      See Also:
    • ERROR

      public static final short ERROR
      This constant means that an unspecified error occurred.
      See Also:
    • ERROR_PROJECT

      public static final short ERROR_PROJECT
      This constant means that an invalid project id was specified.
      See Also:
    • ERROR_PERMISSIONS

      public static final short ERROR_PERMISSIONS
      This constant means that the specified user doesn't have the permissions to view data from this project.
      See Also:
    • mapImage

      public byte[] mapImage
      The encoded image created by the image producer.
    • imageFormat

      public String imageFormat
      The image format that was used to encode the image.
    • transform

      public K2DTransform transform
      The affine transformation that was used to create the image. The transformation is only returned when requested.
    • viewBounds

      public OrientedRectangle viewBounds
      The image view bounds in world coordinates. The view bounds is only returned when requested.
    • imageMap

      public String[][] imageMap
      The HTML image map that was created by the server using the mouseover and the url of all shown elements. It is only returned when requested.
    • errorId

      public short errorId
      The error id returned by the server. If nothing wrong happened, errorId equals ERROR_NONE.
    • message

      public String message
      If an error occurred, message contains the message returned by the server.
  • Constructor Details

    • MapImageResponse

      public MapImageResponse()
      This constructor is used internally.
    • MapImageResponse

      public MapImageResponse(byte[] mapImage, String imageFormat, String message, short errorId)
      Creates a new MapImageResponse instance using the specified arguments.
      Parameters:
      mapImage - the encoded map image.
      imageFormat - the image format that was used to encode the image.
      message - the error message, null if errorId equals -1 (ERROR_NONE).
      errorId - the error id, or -1 (ERROR_NONE) if there is no reported error.
  • Method Details

    • getErrorId

      public short getErrorId()
      Returns the error Id if an error occurred, otherwise -1 will be returned.
      Returns:
      the error Id if an error occurred, otherwise -1.
    • getMapImage

      public byte[] getMapImage()
      Returns an encoded image as a byte array. The image is encoded in the format that was specified in the MapImageRequest. If no format was specified, the GIF image format was used to encode the image.
      Returns:
      an encoded image as a byte array.
    • getMessage

      public String getMessage()
      Returns the error message that was sent by the server. Can return null.
      Returns:
      the error message that was sent by the server.
    • getTransform

      public K2DTransform getTransform()
      Returns the K2DTransform of the view that was used to make to produce the image if the MapImageRequest.OPTION_GET_TRANSFORM option was set in the MapImageRequest.
      Returns:
      the K2DTransform of the view that was used to make to produce the image.
    • getViewBounds

      public OrientedRectangle getViewBounds()
      Returns the bounding box of the view if the MapImageRequest.OPTION_GET_BOUNDS option was set in the MapImageRequest.
      Returns:
      the bounding box of the view that was used to make to produce the image.
    • getImageFormat

      public String getImageFormat()
      Returns the format of the image that was specified in the MapImageRequest. If no format was specified, the GIF image format will be returned.
      Returns:
      format of the image.
    • getViewState

      public ViewState getViewState()
    • setViewState

      public void setViewState(ViewState viewState)
    • getImageMap

      public String[][] getImageMap()
      Returns a formatted HTML ImageMap prepared using the information returned by the mouseover configured in all used themes if the MapImageRequest.OPTION_GET_IMAGEMAP option was set in the MapImageRequest.
      Returns:
      a formatted HTML ImageMap.
    • getData

      public Object getData(Class key)
    • addData

      public void addData(Class key, Object value)
    • removeData

      public void removeData(Class key)