Class ViewUtil

java.lang.Object
com.kheops.jmap.client.views.ViewUtil

public class ViewUtil extends Object
  • Constructor Details

    • ViewUtil

      public ViewUtil()
  • Method Details

    • saveAs

      public static void saveAs(View view) throws Exception
      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

      public static void saveAs(View view, MapImageEncoder encoder) throws Exception
      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

      public static void saveAs(View view, MapImageEncoder[] encoders) throws Exception
      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

      public static void copyToClipboard(View view)
      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 use
      imageParams - 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

      public static Image makeImage(View view, int w)
      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

      public 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.
      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 draw
      w - 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)