public class ViewUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ViewUtil.SaveFileFilter |
Constructor and Description |
---|
ViewUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
copyToClipboard(View view)
Copy the image of the specified View into the clipboard.
|
static boolean |
mailMap(View view,
JMapSrvConnection conn,
int imageWidth,
MailMessage message)
Mails the current view image using the specified MailMessage configuration.
|
static boolean |
mailMap(View view,
JMapSrvConnection conn,
MapImageEncoder encoder,
java.lang.String imageFormat,
java.lang.String imageParams,
int imageWidth,
MailMessage message)
Mails the current view image using the specified MailMessage configuration.
|
static void |
makeImage(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 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.
|
static java.awt.Image |
makeImage(View view,
int w)
Creates an image of the view with the specified width and a proportional
height.
|
static boolean |
redrawDisplayBounds(View view,
VectorLayer vectorLayer,
java.util.Collection<K2DElement> elements,
boolean onlyIfVisible) |
static boolean |
redrawExtent(View view,
VectorLayer vectorLayer,
java.util.Collection<K2DElement> elements,
boolean onlyIfVisible) |
static void |
saveAs(View view)
Saves the specified View image to a specified File using the PNG image
format.
|
static void |
saveAs(View view,
MapImageEncoder encoder)
Saves the specified View image to a specified File.
|
static void |
saveAs(View view,
MapImageEncoder[] encoders)
Saves the specified View image to a specified File.
|
static boolean |
zoomDisplayBounds(View view,
VectorLayer vectorLayer,
java.util.Collection<K2DElement> elements) |
static boolean |
zoomDisplayBounds(View view,
VectorLayer vectorLayer,
java.util.Collection<K2DElement> elements,
boolean onlyIfVisible) |
public static void saveAs(View view) throws java.lang.Exception
view
- the view to save the image from.java.lang.Exception
- if an error occurs.public static void saveAs(View view, MapImageEncoder encoder) throws java.lang.Exception
view
- the view to save the image from.encoder
- the MapImageEncoder to use when encoding the View image.java.lang.Exception
- if an error occurs.public static void saveAs(View view, MapImageEncoder[] encoders) throws java.lang.Exception
view
- the view to save the image from.encoders
- a list of MapImageEncoder to use when encoding the View image.java.lang.Exception
- if an error occurs.public static void copyToClipboard(View view)
public static boolean mailMap(View view, JMapSrvConnection conn, int imageWidth, MailMessage message) throws java.lang.Exception
view
- the view to use.conn
- a connection to JMapServer.imageWidth
- the width of the image to send.message
- the MailMessage object to use.java.lang.Exception
- if an error occurs.public static boolean mailMap(View view, JMapSrvConnection conn, MapImageEncoder encoder, java.lang.String imageFormat, java.lang.String imageParams, int imageWidth, MailMessage message) throws java.lang.Exception
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.java.lang.Exception
- if an error occurs.public static java.awt.Image makeImage(View view, int w)
w
- the width in pixels of the resulting imagepublic static void makeImage(View view, GraphicsRef gr, int w, int drawOptions)
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.public static void makeImage(View view, GraphicsRef gr, OrientedRectangle region, int w, int h, int drawOptions)
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.public static boolean zoomDisplayBounds(View view, VectorLayer vectorLayer, java.util.Collection<K2DElement> elements)
public static boolean zoomDisplayBounds(View view, VectorLayer vectorLayer, java.util.Collection<K2DElement> elements, boolean onlyIfVisible)
public static boolean redrawDisplayBounds(View view, VectorLayer vectorLayer, java.util.Collection<K2DElement> elements, boolean onlyIfVisible)
public static boolean redrawExtent(View view, VectorLayer vectorLayer, java.util.Collection<K2DElement> elements, boolean onlyIfVisible)