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.MapViewRectangleclipBoundsprivate java.awt.Graphics2Dgraphicsprivate MapViewmapView
-
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.MapViewRectanglegetClipBounds()Gets the clip bounds for this graphics instance.java.awt.Graphics2DgetDefaultGraphics()Gets theGraphics2Dyou should use to paint on this graphics object.MapViewgetMapView()Gets theMapViewthat is the base to this draw call.java.lang.StringtoString()
-
-
-
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 theGraphics2Dyou 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
Graphics2Dinstance.
-
getMapView
public MapView getMapView()
Gets theMapViewthat 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:
toStringin classjava.lang.Object
-
-