Package org.openstreetmap.josm.gui.layer
Class MapViewGraphics
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.MapViewGraphics
-
public class MapViewGraphics extends java.lang.Object
This class provides layers with access to drawing on the map view.It contains information about the state of the map view.
In the future, it may add support for parallel drawing or layer caching.
It is intended to be used during
MapView.paint(java.awt.Graphics)
- Since:
- 10458
-
-
Field Summary
Fields Modifier and Type Field Description private MapViewState.MapViewRectangle
clipBounds
private java.awt.Graphics2D
graphics
private MapView
mapView
-
Constructor Summary
Constructors Constructor Description MapViewGraphics(MapView mapView, java.awt.Graphics2D graphics, MapViewState.MapViewRectangle clipBounds)
Constructs a newMapViewGraphics
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapViewState.MapViewRectangle
getClipBounds()
Gets the clip bounds for this graphics instance.java.awt.Graphics2D
getDefaultGraphics()
Gets theGraphics2D
you should use to paint on this graphics object.MapView
getMapView()
Gets theMapView
that is the base to this draw call.java.lang.String
toString()
-
-
-
Field Detail
-
graphics
private final java.awt.Graphics2D graphics
-
clipBounds
private final MapViewState.MapViewRectangle clipBounds
-
-
Constructor Detail
-
MapViewGraphics
public MapViewGraphics(MapView mapView, java.awt.Graphics2D graphics, MapViewState.MapViewRectangle clipBounds)
Constructs a newMapViewGraphics
.- Parameters:
mapView
- map viewgraphics
- default graphicsclipBounds
- clip bounds for this graphics instance
-
-
Method Detail
-
getDefaultGraphics
public java.awt.Graphics2D getDefaultGraphics()
Gets theGraphics2D
you should use to paint on this graphics object. It may already have some data painted on it. You should paint your layer data on this graphics.- Returns:
- The
Graphics2D
instance.
-
getMapView
public MapView getMapView()
Gets theMapView
that is the base to this draw call.- Returns:
- The map view.
-
getClipBounds
public MapViewState.MapViewRectangle getClipBounds()
Gets the clip bounds for this graphics instance.- Returns:
- The clip bounds.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-