Package hec.map

Class TransformMapScale

java.lang.Object
hec.map.MapScale
hec.map.TransformMapScale

public class TransformMapScale extends MapScale
  • Constructor Details

  • Method Details

    • contains

      public boolean contains(WorldPt wpt)
      Description copied from class: MapScale
      determines if the given point in world coordinates is in the current viewing area

      Overrides:
      contains in class MapScale
      Parameters:
      wpt - a point in world coordinates

      Returns:
      true if the current viewing area contains wpt
    • contains

      public boolean contains(LocalPt pt)
      Description copied from class: MapScale
      determines if the given point in local coordinates is in the current viewing area

      Overrides:
      contains in class MapScale
      Parameters:
      pt - a point in local coordinates

      Returns:
      true if the current viewing area contains pt
    • getAvgW2LScale

      public double getAvgW2LScale()
      Description copied from class: MapScale
      returns the average world to local scaling factor

      Overrides:
      getAvgW2LScale in class MapScale
      Returns:
      The average scaling factor
    • getOrigin

      public WorldPt getOrigin()
      Description copied from class: MapScale
      Get a copy of the current origin

      Overrides:
      getOrigin in class MapScale
      Returns:
      The current Origin
    • getRegionExtents

      public WorldRect getRegionExtents()
      Description copied from class: MapScale
      Get a copy of the current region extents

      Overrides:
      getRegionExtents in class MapScale
      Returns:
      The current Region Extents
    • getViewRect

      public LocalRect getViewRect()
      Description copied from class: MapScale
      Get a copy of the current view rectangle in local coodinates

      Overrides:
      getViewRect in class MapScale
      Returns:
      The current Viewport rectangle
    • getWorldRect

      public WorldRect getWorldRect()
      Description copied from class: MapScale
      Get a copy of the current view rectangle in world coordinates

      Overrides:
      getWorldRect in class MapScale
      Returns:
      The current Viewport rectangle
    • getXScale

      public double getXScale()
      Overrides:
      getXScale in class MapScale
    • getYScale

      public double getYScale()
      Overrides:
      getYScale in class MapScale
    • getZoom

      public double getZoom()
      Description copied from class: MapScale
      Get the current zoom factor

      Overrides:
      getZoom in class MapScale
      Returns:
      The current Zoom factor
    • growRegionExtents

      public void growRegionExtents(WorldRect rc)
      Description copied from class: MapScale
      grow the map reqion extents to rc

      Overrides:
      growRegionExtents in class MapScale
      Parameters:
      rc - extents to grow the map region to
    • local2WorldTransform

      public AffineTransform local2WorldTransform(AffineTransform transform)
      Description copied from class: MapScale
      Creates or updates an existing AffineTransform to change from local to world coordinates.

      Overrides:
      local2WorldTransform in class MapScale
      Parameters:
      transform - AffineTransform the transform to adjust. If null, a new transform is created.

      Returns:
      AffineTransform
    • lp2wp

      public void lp2wp(LocalPt lpt, WorldPt wpt)
      Description copied from class: MapScale
      Converts a point in local coordinates to world coordinates.

      Overrides:
      lp2wp in class MapScale
      Parameters:
      lpt - a point in local coordinates
      wpt - the world point set to the lpt coverted value
    • lr2wr

      public WorldRect lr2wr(LocalRect lr)
      Description copied from class: MapScale
      Converts a LocalRect to a WorldRect, returning a newly allocated WorldRect

      Overrides:
      lr2wr in class MapScale
      Parameters:
      lr - a rect in local coordinates

      Returns:
      a new WorldRect for lr
    • setOrigin

      public void setOrigin(WorldPt p)
      Description copied from class: MapScale
      Set the origin of the map view position

      Overrides:
      setOrigin in class MapScale
      Parameters:
      p - The new Origin value
    • setOrigin

      public void setOrigin(WorldPt p, boolean computeScaling)
      Description copied from class: MapScale
      Set the origin of the map view position

      Overrides:
      setOrigin in class MapScale
      Parameters:
      p - The new Origin value
      computeScaling - true to recompute scaling
    • setRegionExtents

      public void setRegionExtents(WorldRect rc)
      Description copied from class: MapScale
      Set the map region extents

      Overrides:
      setRegionExtents in class MapScale
      Parameters:
      rc - The new RegionExtents value
    • setViewRect

      public void setViewRect(LocalRect rc)
      Description copied from class: MapScale
      Set the viewport rectangle

      Overrides:
      setViewRect in class MapScale
      Parameters:
      rc - The new Viewport rectangle
    • setViewRect

      public void setViewRect(Dimension d)
      Description copied from class: MapScale
      set the viewport rectangle to d

      Overrides:
      setViewRect in class MapScale
      Parameters:
      d - the new viewport rectangle
    • setZoom

      public void setZoom(double z)
      Description copied from class: MapScale
      Set the zoom factor

      Overrides:
      setZoom in class MapScale
      Parameters:
      z - The new Zoom factor
    • showAll

      public void showAll()
      Description copied from class: MapScale
      zoom out to the world coordinates
      Overrides:
      showAll in class MapScale
    • world2LocalTransform

      public AffineTransform world2LocalTransform(AffineTransform transform)
      Description copied from class: MapScale
      Coordinate conversion routines Creates or updates an existing AffineTransform to change from world to local coordinates.

      Overrides:
      world2LocalTransform in class MapScale
      Parameters:
      transform - AffineTransform the transform to adjust. If null, a new transform is created.

      Returns:
      AffineTransform
    • wp2lp

      public void wp2lp(WorldPt wpt, LocalPt lpt)
      Description copied from class: MapScale
      Converts a point in world coordinates to local coordinates.

      Overrides:
      wp2lp in class MapScale
      Parameters:
      wpt - a point in world coordinates
      lpt - the local point for wpt
    • wr2lr

      public LocalRect wr2lr(WorldRect wr)
      Description copied from class: MapScale
      Converts a WorldRect to a LocalRect, returning a newly allocated LocalRect

      Overrides:
      wr2lr in class MapScale
      Parameters:
      wr - a rect in world coordinates

      Returns:
      a new LocalRect for wr
    • wr2lr

      public LocalRect wr2lr(WorldRect wr, LocalRect lr)
      Description copied from class: MapScale
      Converts a WorldRect to a LocalRect, returning a newly allocated LocalRect

      Overrides:
      wr2lr in class MapScale
      Parameters:
      wr - a rect in world coordinates
      lr - a rect in local coordinates to get filled in, or null and a new LocalRect will be created

      Returns:
      the LocalRect for wr
    • zoomByFactor

      public void zoomByFactor(double factor)
      Description copied from class: MapScale
      Change the zoom scaling by the given factor.

      Overrides:
      zoomByFactor in class MapScale
      Parameters:
      factor - the new zoom scaling factor
    • zoomIn

      public boolean zoomIn(WorldRect wc)
      Overrides:
      zoomIn in class MapScale
    • zoomIn

      public boolean zoomIn(LocalRect rc)
      Description copied from class: MapScale
      Zoom in to the given rectangle in local coordinates.

      Overrides:
      zoomIn in class MapScale
      Parameters:
      rc - the new viewport

      Returns:
      true if the viewport was zoomed to rc
    • transformPoint

      public WorldPt transformPoint(WorldPt pt)
    • transformRect

      public WorldRect transformRect(WorldRect bounds)
    • transformPoint

      protected WorldPt transformPoint(WorldPt pt, Transform transform)
    • transformRect

      protected WorldRect transformRect(WorldRect bounds, Transform transform)