Package com.kheops.jmap.metadata
Class MapImageResponse
java.lang.Object
com.kheops.jmap.metadata.MapImageResponse
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionstatic 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
ConstructorDescriptionThis 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 TypeMethodDescriptionvoid
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 theMapImageRequest.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 theMapImageRequest.OPTION_GET_TRANSFORM
option was set in the MapImageRequest.Returns the bounding box of the view if theMapImageRequest.OPTION_GET_BOUNDS
option was set in the MapImageRequest.void
removeData
(Class key) void
setViewState
(ViewState viewState)
-
Field Details
-
ERROR_NONE
public static final short ERROR_NONEThis constant means that no error occurred.- See Also:
-
ERROR_IMAGE_PROD_DISABLED
public static final short ERROR_IMAGE_PROD_DISABLEDThis constant which means that the image producer is disabled for the specified project.- See Also:
-
ERROR
public static final short ERRORThis constant means that an unspecified error occurred.- See Also:
-
ERROR_PROJECT
public static final short ERROR_PROJECTThis constant means that an invalid project id was specified.- See Also:
-
ERROR_PERMISSIONS
public static final short ERROR_PERMISSIONSThis constant means that the specified user doesn't have the permissions to view data from this project.- See Also:
-
mapImage
public byte[] mapImageThe encoded image created by the image producer. -
imageFormat
The image format that was used to encode the image. -
transform
The affine transformation that was used to create the image. The transformation is only returned when requested. -
viewBounds
The image view bounds in world coordinates. The view bounds is only returned when requested. -
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 errorIdThe error id returned by the server. If nothing wrong happened, errorId equalsERROR_NONE
. -
message
If an error occurred, message contains the message returned by the server.
-
-
Constructor Details
-
MapImageResponse
public MapImageResponse()This constructor is used internally. -
MapImageResponse
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
Returns the error message that was sent by the server. Can returnnull
.- Returns:
- the error message that was sent by the server.
-
getTransform
Returns the K2DTransform of the view that was used to make to produce the image if theMapImageRequest.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
Returns the bounding box of the view if theMapImageRequest.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
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
-
setViewState
-
getImageMap
Returns a formatted HTML ImageMap prepared using the information returned by the mouseover configured in all used themes if theMapImageRequest.OPTION_GET_IMAGEMAP
option was set in the MapImageRequest.- Returns:
- a formatted HTML ImageMap.
-
getData
-
addData
-
removeData
-