Package com.kheops.jmap.client.views
Class ViewUtil
java.lang.Object
com.kheops.jmap.client.views.ViewUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyToClipboard(View view) Copy the image of the specified View into the clipboard.static booleanmailMap(View view, JMapSrvConnection conn, int imageWidth, MailMessage message) Mails the current view image using the specified MailMessage configuration.static booleanmailMap(View view, JMapSrvConnection conn, MapImageEncoder encoder, String imageFormat, String imageParams, int imageWidth, MailMessage message) Mails the current view image using the specified MailMessage configuration.static ImageCreates an image of the view with the specified width and a proportional height.static voidmakeImage(View view, GraphicsRef gr, int w, int drawOptions) Draws the current view using the specified GraphicsRef instance, the specified width and a proportional height.static voidmakeImage(View view, GraphicsRef gr, OrientedRectangle region, int w, int h, int drawOptions) Draws a WC region using the specified GraphicsRef instance, the specified width and a proportional height.static booleanredrawDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible) static booleanredrawExtent(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible) static voidSaves the specified View image to a specified File using the PNG image format.static voidsaveAs(View view, MapImageEncoder encoder) Saves the specified View image to a specified File.static voidsaveAs(View view, MapImageEncoder[] encoders) Saves the specified View image to a specified File.static booleanzoomDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements) static booleanzoomDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible)
-
Constructor Details
-
ViewUtil
public ViewUtil()
-
-
Method Details
-
saveAs
Saves the specified View image to a specified File using the PNG image format.- Parameters:
view- the view to save the image from.- Throws:
Exception- if an error occurs.
-
saveAs
Saves the specified View image to a specified File.- Parameters:
view- the view to save the image from.encoder- the MapImageEncoder to use when encoding the View image.- Throws:
Exception- if an error occurs.
-
saveAs
Saves the specified View image to a specified File.- Parameters:
view- the view to save the image from.encoders- a list of MapImageEncoder to use when encoding the View image.- Throws:
Exception- if an error occurs.
-
copyToClipboard
Copy the image of the specified View into the clipboard. -
mailMap
public static boolean mailMap(View view, JMapSrvConnection conn, int imageWidth, MailMessage message) throws Exception Mails the current view image using the specified MailMessage configuration.- Parameters:
view- the view to use.conn- a connection to JMapServer.imageWidth- the width of the image to send.message- the MailMessage object to use.- Returns:
- whether the mail sending was successful.
- Throws:
Exception- if an error occurs.
-
mailMap
public static boolean mailMap(View view, JMapSrvConnection conn, MapImageEncoder encoder, String imageFormat, String imageParams, int imageWidth, MailMessage message) throws Exception Mails the current view image using the specified MailMessage configuration.- Parameters:
view- the view to use.conn- a connection to JMapServer.encoder- the MapImageEncoder to use.imageFormat- the image format to useimageParams- the image params to use.imageWidth- the width of the image to send.message- the MailMessage object to use.- Returns:
- whether the mail sending was successful.
- Throws:
Exception- if an error occurs.
-
makeImage
Creates an image of the view with the specified width and a proportional height.- Parameters:
w- the width in pixels of the resulting image- Returns:
- an image of the view
-
makeImage
Draws the current view using the specified GraphicsRef instance, the specified width and a proportional height.- Parameters:
gr- a GraphicsRef instance to draw on.w- the width in pixels of the resulting image.drawOptions- a bit field value that specifies what to draw.
-
makeImage
public static void makeImage(View view, GraphicsRef gr, OrientedRectangle region, int w, int h, int drawOptions) Draws a WC region using the specified GraphicsRef instance, the specified width and a proportional height.- Parameters:
gr- a GraphicsRef instance to draw on.region- the WC region to draww- the width in pixels of the resulting image.drawOptions- a bit field value that specifies what to draw.
-
zoomDisplayBounds
public static boolean zoomDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements) -
zoomDisplayBounds
public static boolean zoomDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible) -
redrawDisplayBounds
public static boolean redrawDisplayBounds(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible) -
redrawExtent
public static boolean redrawExtent(View view, VectorLayer vectorLayer, Collection<K2DElement> elements, boolean onlyIfVisible)
-