Package org.openstreetmap.josm.gui
Class MapViewState.MapViewRectangle
java.lang.Object
org.openstreetmap.josm.gui.MapViewState.MapViewRectangle
- Enclosing class:
- MapViewState
A rectangle on the MapView. It is rectangular in screen / EastNorth space.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MapViewState.MapViewPointprivate final MapViewState.MapViewPoint -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new MapViewRectangle -
Method Summary
Modifier and TypeMethodDescriptionGets a rough estimate of the bounds by assuming lat/lon are parallel to x/y.Gets this rectangle on the screen.(package private) double(package private) double(package private) double(package private) doubleGets the real bounds that enclose this rectangle.Gets the entry point at which a line between start and end enters the current view.Gets the projection bounds for this rectangle.booleanisInView()Check if the rectangle intersects the map view area.toString()
-
Field Details
-
p1
-
p2
-
-
Constructor Details
-
MapViewRectangle
Create a new MapViewRectangle- Parameters:
p1- The first point to usep2- The second point to use.
-
-
Method Details
-
getProjectionBounds
Gets the projection bounds for this rectangle.- Returns:
- The projection 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
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
Gets this rectangle on the screen.- Returns:
- The rectangle.
- Since:
- 10651
-
getInViewMinX
double getInViewMinX() -
getInViewMaxX
double getInViewMaxX() -
getInViewMinY
double getInViewMinY() -
getInViewMaxY
double getInViewMaxY() -
isInView
Check if the rectangle intersects the map view area.- Returns:
trueif 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
nullif the line does not intersect this view.
-
toString
-