Package org.openstreetmap.josm.gui
Class MapViewState.MapViewRectangle
- java.lang.Object
-
- org.openstreetmap.josm.gui.MapViewState.MapViewRectangle
-
- Enclosing class:
- MapViewState
public class MapViewState.MapViewRectangle extends java.lang.Object
A rectangle on the MapView. It is rectangular in screen / EastNorth space.
-
-
Field Summary
Fields Modifier and Type Field Description private MapViewState.MapViewPoint
p1
private MapViewState.MapViewPoint
p2
-
Constructor Summary
Constructors Constructor Description MapViewRectangle(MapViewState.MapViewPoint p1, MapViewState.MapViewPoint p2)
Create a new MapViewRectangle
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds
getCornerBounds()
Gets a rough estimate of the bounds by assuming lat/lon are parallel to x/y.java.awt.geom.Rectangle2D
getInView()
Gets this rectangle on the screen.(package private) double
getInViewMaxX()
(package private) double
getInViewMaxY()
(package private) double
getInViewMinX()
(package private) double
getInViewMinY()
Bounds
getLatLonBoundsBox()
Gets the real bounds that enclose this rectangle.MapViewState.MapViewPoint
getLineEntry(MapViewState.MapViewPoint start, MapViewState.MapViewPoint end)
Gets the entry point at which a line between start and end enters the current view.ProjectionBounds
getProjectionBounds()
Gets the projection bounds for this rectangle.boolean
isInView()
Check if the rectangle intersects the map view area.java.lang.String
toString()
-
-
-
Field Detail
-
p1
private final MapViewState.MapViewPoint p1
-
p2
private final MapViewState.MapViewPoint p2
-
-
Constructor Detail
-
MapViewRectangle
MapViewRectangle(MapViewState.MapViewPoint p1, MapViewState.MapViewPoint p2)
Create a new MapViewRectangle- Parameters:
p1
- The first point to usep2
- The second point to use.
-
-
Method Detail
-
getProjectionBounds
public ProjectionBounds getProjectionBounds()
Gets the projection bounds for this rectangle.- Returns:
- The projection bounds.
-
getCornerBounds
public Bounds getCornerBounds()
Gets a rough estimate of the bounds by assuming lat/lon are parallel to x/y.- Returns:
- The bounds computed by converting the corners of this rectangle.
- See Also:
getLatLonBoundsBox()
-
getLatLonBoundsBox
public Bounds getLatLonBoundsBox()
Gets the real bounds that enclose this rectangle. This is computed respecting that the borders of this rectangle may not be a straight line in latlon coordinates.- Returns:
- The bounds.
- Since:
- 10458
-
getInView
public java.awt.geom.Rectangle2D getInView()
Gets this rectangle on the screen.- Returns:
- The rectangle.
- Since:
- 10651
-
getInViewMinX
double getInViewMinX()
-
getInViewMaxX
double getInViewMaxX()
-
getInViewMinY
double getInViewMinY()
-
getInViewMaxY
double getInViewMaxY()
-
isInView
public boolean isInView()
Check if the rectangle intersects the map view area.- Returns:
true
if it intersects.- Since:
- 10827
-
getLineEntry
public MapViewState.MapViewPoint getLineEntry(MapViewState.MapViewPoint start, MapViewState.MapViewPoint end)
Gets the entry point at which a line between start and end enters the current view.- Parameters:
start
- The startend
- The end- Returns:
- The entry point or
null
if the line does not intersect this view.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-