Class ViewPort

java.lang.Object
org.gvsig.fmap.mapcontext.ViewPort
All Implemented Interfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public class ViewPort extends Object implements org.gvsig.tools.persistence.Persistent, org.gvsig.tools.lang.Cloneable

ViewPort class represents the logic needed to transform a rectangular area of a map to the available area in screen to display it.

Includes an affine transformation, between the rectangular area selected of the external map, in its own map coordinates, to the rectangular area available of a view in screen coordinates.

Elements:

  • extent: the area selected of the map, in map coordinates.
  • imageSize: width and height in pixels (screen coordinates) of the area available in screen to display the area selected of the map.
  • adjustedExtent: the area selected must be an scale of imageSize.
    This implies adapt the extent, preserving and centering it, and adding around the needed area to fill all the image size. That added area will be extracted from the original map, wherever exists, and filled with the background color wherever not.
  • scale: the scale between the adjusted extent and the image size.
  • backColor: the default background color in the view, if there is no map.
  • trans: the affine transformation.
  • proj: map projection used in this view.
  • distanceUnits: distance measurement units, of data in screen.
  • mapUnits: measurement units, of data in map.
  • extents: an ExtentHistory with the last previous extents.
  • offset: position in pixels of the available rectangular area, where start drawing the map.
  • dist1pixel: the distance in world coordinates equivalent to 1 pixel in the view with the current extent.
  • dist3pixel: the distance in world coordinates equivalent to 3 pixels in the view with the current extent.
  • listeners: list with the ViewPortListener registered.

Author:
Vicente Caballero Navarro
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Rectangle2D
    Location and dimensions of the extent adjusted to the image size.
    protected Rectangle2D
    Area selected by user using some tool.
    protected ExtentHistory
    History with the last extents of the view.
    protected org.gvsig.timesupport.Time
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ViewPort(org.gvsig.crs.projection.lib.Projection proj)
    Creates a new view port with the information of the projection in proj argument, and default configuration:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Appends the specified ViewPortListener listener if weren't.
    protected void
    callExtentChanged(org.gvsig.fmap.geom.primitive.Envelope newRect)
    Notifies to all view port listeners registered, that the adjusted extent of this view port has changed.
    protected void
    callTimeChanged(org.gvsig.timesupport.Time newTime)
    Notifies to all view port listeners registered, that the time of this view port has changed.
    Clone the view port without clone the listeners nor the extent history.
    org.gvsig.fmap.geom.primitive.Point
    convertToMapPoint(int x, int y)
     
    org.gvsig.fmap.geom.primitive.Point
     
    double
    Returns the real distance (in world coordinates) at the graphic layers of two 2D points (in map coordinates) of the plane where is selected the extent.
    int
    fromMapDistance(double d)
    Converts and returns the distance d, that is in map coordinates to screen coordinates using a delta transform with the transformation affine information in the #trans attribute.
    fromMapPoint(double x, double y)
    Converts and returns the 2D point (x,y), that is in map coordinates to screen coordinates (pixels) using the affine transformation in the #trans attribute.
    Converts and returns the 2D point argument, that is in map coordinates to screen coordinates (pixels) using the affine transformation in the #trans attribute.
    Converts and returns the Rectangle2D, that is in map coordinates to screen coordinates (pixels) using an inverse transform with the transformation affine information in the #trans attribute.
    org.gvsig.fmap.geom.primitive.Envelope
    Returns the envelope currently covered by the view adjusted (scaled) to the image size aspect.
    org.gvsig.fmap.geom.primitive.Envelope
    Returns the extent currently covered by the view adjusted (scaled) to the image size aspect.
    Affine transformation between map 2D coordinates to screen 2D coordinates (pixels), preserving the "straightness" and "parallelism" of the lines.
    Gets the background color.
    double
    Gets the distance in world coordinates equivalent to 1 pixel in the view with the current extent.
    double
    Gets the distance in world coordinates equivalent to 3 pixels in the view with the current extent.
    int
    Returns the measurement unit of this view port used for measuring areas and displaying information.
    int
    Returns the measurement unit of this view port used for measuring distances and displaying information.
    double
     
    long
     
    org.gvsig.fmap.geom.primitive.Envelope
    Gets the envelope selected by user using some tool.
    Returns the last previous extents of this view port.
    Gets the area selected by user using some tool.
    Returns the last previous extents of this view port.
    int
    Gets the height in screen coordinates of the rectangle where the image is displayed.
    Returns the size of the image projected.
    int
    Gets the width in screen coordinates of the rectangle where the image is displayed.
    int
    Gets the measurement unit used by this view port for the map.
    Gets the offset.
    org.gvsig.crs.projection.lib.Projection
    Gets the projection used in this view port.
    Gets the selection color.
    org.gvsig.timesupport.Time
     
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    Changes the extent and adjusted extent of this view port:
    Executes calculateAffineTransform(): getting the new scale, adjusted extent, affine transformation between map and screen coordinates, the real world coordinates equivalent to 1 pixel, and the real world coordinates equivalent to 3 pixels.
    boolean
    Removes the specified ViewPortListener listener, if existed.
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
    Returns an XML entity that represents this view port instance:
    Properties: className: name of this class.
    void
    setAdjustable(boolean adjustable)
    Changes the status of the "adjustable extent" option to enabled or disabled.
    void
    Sets only the affine transform to this view port, without updating dependent attributes.
    void
    Sets the background color.
    void
    Sets the position and size of the clipping rectangle.
    void
    setDist1pixel(double dist1pixel)
    Sets the distance in world coordinates equivalent to 1 pixel in the view with the current extent.
    void
    setDist3pixel(double dist3pixel)
    Sets the distance in world coordinates equivalent to 3 pixels in the view with the current extent.
    void
    setDistanceArea(int distanceArea)
    Sets the measurement unit of this view port used for measuring areas and displaying information.
    void
    setDistanceUnits(int distanceUnits)
    Sets the measurement unit of this view port used for measuring distances and displaying information.
    void
    setDPI(double dpi)
     
    void
     
    void
    setEnvelope(org.gvsig.fmap.geom.primitive.Envelope r)
    Changes the extent and adjusted extent of this view port:
    Stores the previous extent.
    void
    Sets the size of the image projected, recalculating the parameters of this view port.
    void
    setMapUnits(int mapUnits)
    Sets the measurement unit used by this view port for the map.
    void
    Sets as envelope and adjusted envelope of this view port, the next.
    void
    Sets the offset.
    void
    Sets as envelope and adjusted envelope of this view port, the previous.
    void
    Sets as extent and adjusted extent of this view port, the previous.
    void
    setProjection(org.gvsig.crs.projection.lib.Projection proj)
    Sets the projection to this view port.
    void
    setScale(long s)
    Recalculates the current extent using an scale.
    void
    Sets the selection color.
    void
    setTime(org.gvsig.timesupport.Time time)
     
    double
    Converts and returns the distance d, that is in screen coordinates to map coordinates using the transformation affine information in the #trans attribute.
    toMapPoint(int x, int y)
    Converts and returns the 2D point (x,y), that is in screen coordinates (pixels) to map coordinates using the affine transformation in the #trans attribute.
    Converts and returns the 2D point argument, that is in screen coordinates (pixels) to map coordinates using the inverse affine transformation of the #trans attribute.
    Converts and returns the Rectangle2D, that is in screen coordinates (pixels) to map coordinates using toMapDistance(int), and toMapPoint(int, int).
    Returns a String representation of the main values of this view port: extent, adjustedExtent, imageSize, scale, and trans.
    protected void
     

    Methods inherited from class java.lang.Object

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

    • extent

      protected Rectangle2D extent

      Area selected by user using some tool.

      When the zoom changes (for instance when using the zoom in or zoom out tools, but also zooming to a selected feature or shape) the extent that covers that area is the value returned by this method. It is not the actual area shown in the view because it does not care about the aspect ratio of the available area. However, any part of the real world contained in this extent is shown in the view.

      Probably this is not what you are looking for. If you are looking for the complete extent currently shown, you must use getAdjustedExtent() method which returns the extent that contains this one but regarding the current view's aspect ratio.

      See Also:
    • time

      protected org.gvsig.timesupport.Time time
    • adjustedExtent

      protected Rectangle2D adjustedExtent

      Location and dimensions of the extent adjusted to the image size.

      See Also:
    • extentsHistory

      protected ExtentHistory extentsHistory

      History with the last extents of the view.

      See Also:
  • Constructor Details

    • ViewPort

      public ViewPort()
    • ViewPort

      public ViewPort(org.gvsig.crs.projection.lib.Projection proj)

      Creates a new view port with the information of the projection in proj argument, and default configuration:

      • distanceUnits = meters
      • mapUnits = meters
      • backColor = undefined
      • offset = new Point2D.Double(0, 0);

      Parameters:
      proj - information of the projection for this view port
  • Method Details

    • setAdjustable

      public void setAdjustable(boolean adjustable)

      Changes the status of the "adjustable extent" option to enabled or disabled.

      If view port isn't adjustable, won't bear in mind the aspect ratio of the available rectangular area to calculate the affine transform from the original map in real coordinates. (Won't scale the image to adapt it to the available rectangular area).

      Parameters:
      boolean - the boolean to be set
    • addViewPortListener

      public boolean addViewPortListener(ViewPortListener listener)

      Appends the specified ViewPortListener listener if weren't.

      Parameters:
      listener - the listener to add
      Returns:
      true if has been added successfully
      See Also:
    • removeViewPortListener

      public boolean removeViewPortListener(ViewPortListener listener)

      Removes the specified ViewPortListener listener, if existed.

      Parameters:
      listener - the listener to remove
      Returns:
      true if the contained the specified listener.
      See Also:
    • fromMapDistance

      public int fromMapDistance(double d)

      Converts and returns the distance d, that is in map coordinates to screen coordinates using a delta transform with the transformation affine information in the #trans attribute.

      Parameters:
      d - distance in map coordinates
      Returns:
      distance equivalent in screen coordinates
      See Also:
    • fromMapPoint

      public Point2D fromMapPoint(double x, double y)

      Converts and returns the 2D point (x,y), that is in map coordinates to screen coordinates (pixels) using the affine transformation in the #trans attribute.

      Parameters:
      x - the x map coordinate of a 2D point
      y - the y map coordinate of a 2D point
      Returns:
      2D point equivalent in screen coordinates (pixels)
      See Also:
    • fromMapPoint

      public Point2D fromMapPoint(Point2D point)

      Converts and returns the 2D point argument, that is in map coordinates to screen coordinates (pixels) using the affine transformation in the #trans attribute.

      Parameters:
      point - the 2D point in map coordinates
      Returns:
      2D point equivalent in screen coordinates (pixels)
      See Also:
    • toMapPoint

      public Point2D toMapPoint(int x, int y)

      Converts and returns the 2D point (x,y), that is in screen coordinates (pixels) to map coordinates using the affine transformation in the #trans attribute.

      Parameters:
      x - the x screen coordinate of a 2D point
      y - the y screen coordinate of a 2D point
      Returns:
      2D point equivalent in map coordinates
      See Also:
    • toMapRectangle

      public Rectangle2D toMapRectangle(Rectangle2D r)

      Converts and returns the Rectangle2D, that is in screen coordinates (pixels) to map coordinates using toMapDistance(int), and toMapPoint(int, int).

      Parameters:
      r - the 2D rectangle in screen coordinates (pixels)
      Returns:
      2D rectangle equivalent in map coordinates
      See Also:
    • toMapDistance

      public double toMapDistance(int d)

      Converts and returns the distance d, that is in screen coordinates to map coordinates using the transformation affine information in the #trans attribute.

      Parameters:
      d - distance in pixels
      Returns:
      distance equivalent in map coordinates
      See Also:
    • toMapPoint

      public Point2D toMapPoint(Point2D pScreen)

      Converts and returns the 2D point argument, that is in screen coordinates (pixels) to map coordinates using the inverse affine transformation of the #trans attribute.

      Parameters:
      pScreen - the 2D point in screen coordinates (pixels)
      Returns:
      2D point equivalent in map coordinates
      See Also:
    • convertToMapPoint

      public org.gvsig.fmap.geom.primitive.Point convertToMapPoint(Point2D pScreen)
    • convertToMapPoint

      public org.gvsig.fmap.geom.primitive.Point convertToMapPoint(int x, int y)
    • distanceWorld

      public double distanceWorld(Point2D pt1, Point2D pt2)

      Returns the real distance (in world coordinates) at the graphic layers of two 2D points (in map coordinates) of the plane where is selected the extent.

      If the projection of this view is UTM, considers the Earth curvature.

      Parameters:
      pt1 - a 2D point in map coordinates
      pt2 - another 2D point in map coordinates
      Returns:
      the distance in meters between the two points 2D
      See Also:
      • invalid reference
        GeoCalcImpl#distanceVincenty(Point2D, Point2D)
    • setPreviousExtent

      public void setPreviousExtent()

      Sets as extent and adjusted extent of this view port, the previous. Recalculating its parameters.

      See Also:
    • setPreviousEnvelope

      public void setPreviousEnvelope()

      Sets as envelope and adjusted envelope of this view port, the previous. Recalculating its parameters. Stores the current extent in the next extents of the history.

      See Also:
    • setNextEnvelope

      public void setNextEnvelope()

      Sets as envelope and adjusted envelope of this view port, the next. Recalculating its parameters. Stores the current extent in the previous extents of the history.

      See Also:
    • getExtent

      public Rectangle2D getExtent()

      Gets the area selected by user using some tool.

      When the zoom changes (for instance using the zoom in or zoom out tools, but also zooming to a selected feature or shape) the extent that covers that area is the value returned by this method. It is not the actual area shown because it doesn't care about the aspect ratio of the image size of the view. However, any part of the real world contained in this extent is shown in the view.

      If you are looking for the complete extent currently shown, you must use the getAdjustedExtent() method.

      Returns:
      the current extent
      See Also:
    • getEnvelope

      public org.gvsig.fmap.geom.primitive.Envelope getEnvelope()

      Gets the envelope selected by user using some tool.

      When the zoom changes (for instance using the zoom in or zoom out tools, but also zooming to a selected feature or shape) the envelope that covers that area is the value returned by this method. It is not the actual envelope shown because it doesn't care about the aspect ratio of the image size of the view. However, any part of the real world contained in this envelope is shown in the view.

      If you are looking for the complete extent currently shown, you must use the getAdjustedEnvelope() method.

      Returns:
      the current envelope
      See Also:
    • setEnvelope

      public void setEnvelope(org.gvsig.fmap.geom.primitive.Envelope r)

      Changes the extent and adjusted extent of this view port:

      • Stores the previous extent.
      • Calculates the new extent using r:
         extent = new Rectangle2D.Double(r.getMinX() - 0.1, r.getMinY() - 0.1,
             r.getWidth() + 0.2, r.getHeight() + 0.2);
         
      • Executes calculateAffineTransform(): getting the new scale, adjusted extent, affine transformation between map and screen coordinates, the real world coordinates equivalent to 1 pixel, and the real world coordinates equivalent to 3 pixels.
      • Notifies all ViewPortListener registered that the extent has changed.

      Parameters:
      r - the new extent
      See Also:
    • refreshExtent

      public void refreshExtent()

      Changes the extent and adjusted extent of this view port:

      • Executes calculateAffineTransform(): getting the new scale, adjusted extent, affine transformation between map and screen coordinates, the real world coordinates equivalent to 1 pixel, and the real world coordinates equivalent to 3 pixels.
      • Notifies to all ViewPortListener registered that the extent has changed.

      See Also:
    • getAffineTransform

      public AffineTransform getAffineTransform()

      Affine transformation between map 2D coordinates to screen 2D coordinates (pixels), preserving the "straightness" and "parallelism" of the lines.

      Returns:
      the affine transformation
      See Also:
    • getImageSize

      public Dimension getImageSize()

      Returns the size of the image projected.

      Returns:
      the image size
      See Also:
    • setImageSize

      public void setImageSize(Dimension imageSize)

      Sets the size of the image projected, recalculating the parameters of this view port.

      Parameters:
      imageSize - the image size
      See Also:
    • callExtentChanged

      protected void callExtentChanged(org.gvsig.fmap.geom.primitive.Envelope newRect)

      Notifies to all view port listeners registered, that the adjusted extent of this view port has changed.

      Parameters:
      newRect - the new adjusted extend
      See Also:
    • callTimeChanged

      protected void callTimeChanged(org.gvsig.timesupport.Time newTime)

      Notifies to all view port listeners registered, that the time of this view port has changed.

      Parameters:
      newTime - the new time
      See Also:
    • setOffset

      public void setOffset(Point2D p)

      Sets the offset.

      The offset is the position where start drawing the map.

      Parameters:
      p - 2D point that represents the offset in pixels
      See Also:
    • getOffset

      public Point2D getOffset()

      Gets the offset.

      The offset is the position where start drawing the map.

      Returns:
      2D point that represents the offset in pixels
      See Also:
    • setBackColor

      public void setBackColor(Color c)

      Sets the background color.

      Parameters:
      c - the new background color
      See Also:
    • setSelectionColor

      public void setSelectionColor(Color c)

      Sets the selection color.

      Parameters:
      c - the new selection color
      See Also:
    • getBackColor

      public Color getBackColor()

      Gets the background color.

      Returns:
      the background color of the view
      See Also:
    • getSelectionColor

      public Color getSelectionColor()

      Gets the selection color.

      Returns:
      the selection color of the view
      See Also:
    • getAdjustedExtent

      public org.gvsig.fmap.geom.primitive.Envelope getAdjustedExtent()

      Returns the extent currently covered by the view adjusted (scaled) to the image size aspect.

      Returns:
      extent of the view adjusted to the image size aspect
      See Also:
    • getAdjustedEnvelope

      public org.gvsig.fmap.geom.primitive.Envelope getAdjustedEnvelope()

      Returns the envelope currently covered by the view adjusted (scaled) to the image size aspect.

      Returns:
      envelope of the view adjusted to the image size aspect
      See Also:
    • getDistanceUnits

      public int getDistanceUnits()

      Returns the measurement unit of this view port used for measuring distances and displaying information.

      Returns:
      the measurement unit of this view used for measuring distances and displaying information
      See Also:
    • getDistanceArea

      public int getDistanceArea()

      Returns the measurement unit of this view port used for measuring areas and displaying information.

      Returns:
      the measurement unit of this view used for measuring areas and displaying information
      See Also:
    • setDistanceUnits

      public void setDistanceUnits(int distanceUnits)

      Sets the measurement unit of this view port used for measuring distances and displaying information.

      Parameters:
      distanceUnits - the measurement unit of this view used for measuring distances and displaying information
      See Also:
    • setDistanceArea

      public void setDistanceArea(int distanceArea)

      Sets the measurement unit of this view port used for measuring areas and displaying information.

      Parameters:
      distanceUnits - the measurement unit of this view used for measuring areas and displaying information
      See Also:
    • getMapUnits

      public int getMapUnits()

      Gets the measurement unit used by this view port for the map.

      Returns:
      Returns the current map measure unit
      See Also:
    • setMapUnits

      public void setMapUnits(int mapUnits)

      Sets the measurement unit used by this view port for the map.

      Parameters:
      mapUnits - the new map measure unit
      See Also:
    • getImageWidth

      public int getImageWidth()

      Gets the width in screen coordinates of the rectangle where the image is displayed.

      Used by calculateAffineTransform() to calculate:

      • The new scale .
      • The new adjustableExtent .
      • The new trans .
      • The new real world coordinates equivalent to 1 pixel ( dist1pixel) .
      • The new real world coordinates equivalent to 3 pixels ( dist3pixel) .

      See Also:
    • getImageHeight

      public int getImageHeight()

      Gets the height in screen coordinates of the rectangle where the image is displayed.

      Used by calculateAffineTransform() to calculate:

      • The new scale .
      • The new adjustableExtent .
      • The new trans .
      • The new real world coordinates equivalent to 1 pixel ( dist1pixel) .
      • The new real world coordinates equivalent to 3 pixels ( dist3pixel) .

      See Also:
    • getDist1pixel

      public double getDist1pixel()

      Gets the distance in world coordinates equivalent to 1 pixel in the view with the current extent.

      Returns:
      the distance
      See Also:
    • setDist1pixel

      public void setDist1pixel(double dist1pixel)

      Sets the distance in world coordinates equivalent to 1 pixel in the view with the current extent.

      Parameters:
      dist1pixel - the distance
      See Also:
    • getDist3pixel

      public double getDist3pixel()

      Gets the distance in world coordinates equivalent to 3 pixels in the view with the current extent.

      Returns:
      the distance
      See Also:
    • setDist3pixel

      public void setDist3pixel(double dist3pixel)

      Sets the distance in world coordinates equivalent to 3 pixels in the view with the current extent.

      Parameters:
      dist3pixel - the distance
      See Also:
    • getExtents

      public ExtentHistory getExtents()

      Returns the last previous extents of this view port.

      Returns:
      the last previous extents of this view port
      See Also:
    • getEnvelopes

      public ExtentHistory getEnvelopes()

      Returns the last previous extents of this view port.

      Returns:
      the last previous extents of this view port
      See Also:
    • getProjection

      public org.gvsig.crs.projection.lib.Projection getProjection()

      Gets the projection used in this view port.

      Returns:
      projection used in this view port
      See Also:
    • setProjection

      public void setProjection(org.gvsig.crs.projection.lib.Projection proj)

      Sets the projection to this view port.

      Parameters:
      proj - the new projection
      See Also:
    • setAffineTransform

      public void setAffineTransform(AffineTransform at)

      Sets only the affine transform to this view port, without updating dependent attributes.

      This method could be problematic!

      Parameters:
      at - the affine transform to set
      See Also:
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException

      Returns an XML entity that represents this view port instance:

      • Properties:
        • className: name of this class.
        • If defined, the adjusted extent:
          • adjustedExtentX: X coordinate of the adjusted extent.
          • adjustedExtentY: Y coordinate of the adjusted extent.
          • adjustedExtentW: width of the adjusted extent.
          • adjustedExtentH: height of the adjusted extent.
        • If defined, the background color:
          • backColor: background color.
        • If defined, the clip:
          • clipX: X coordinate of the clip.
          • clipY: Y coordinate of clip.
          • clipW: width of the clip.
          • clipH: height of the clip.
        • dist1pixel: the distance in world coordinates equivalent to 1 pixel in the view.
        • dist3pixel: the distance in world coordinates equivalent to 3 pixels in the view.
        • distanceUnits: the distance measurement unit.
        • If defined, the extent:
          • extentX: X coordinate of the extent.
          • extentY: Y coordinate of the extent.
          • extentW: width of the extent.
          • extentH: height of the extent.
        • mapUnits: the map measurement unit.
        • offsetX: X coordinate of the offset.
        • offsetY: Y coordinate of the offset.
        • If defined, the projection:
          • If its defined, the projection:
            • proj: the projection.
        • scale: ratio between the size of imageSize and extent.
      • Child branches:
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
      See Also:
      • invalid reference
        #createFromXML(XMLEntity)
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • clone

      public Object clone() throws CloneNotSupportedException
      Clone the view port without clone the listeners nor the extent history.
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class Object
      Returns:
      the cloned view port
      Throws:
      CloneNotSupportedException
    • toString

      public String toString()

      Returns a String representation of the main values of this view port: extent, adjustedExtent, imageSize, scale, and trans.

      Overrides:
      toString in class Object
      Returns:
      a string representation of the main values of this view port
    • setClipRect

      public void setClipRect(Rectangle2D rectView)

      Sets the position and size of the clipping rectangle.

      Parameters:
      rectView - the clipping rectangle to set
    • fromMapRectangle

      public Rectangle2D fromMapRectangle(Rectangle2D r)

      Converts and returns the Rectangle2D, that is in map coordinates to screen coordinates (pixels) using an inverse transform with the transformation affine information in the #trans attribute.

      Parameters:
      r - the 2D rectangle in map coordinates
      Returns:
      2D rectangle equivalent in screen coordinates (pixels)
      See Also:
    • setScale

      public void setScale(long s)

      Recalculates the current extent using an scale. It's necessary execute refreshExtent() after.

      Parameters:
      s - the scale to set
    • getDrawVersion

      public long getDrawVersion()
    • updateDrawVersion

      protected void updateDrawVersion()
    • getTime

      public org.gvsig.timesupport.Time getTime()
    • setTime

      public void setTime(org.gvsig.timesupport.Time time)
    • getDPI

      public double getDPI()
    • setDPI

      public void setDPI(double dpi)
    • setDPIToScreenDPI

      public void setDPIToScreenDPI()