|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.osm.visitor.paint.AbstractMapRenderer
public abstract class AbstractMapRenderer
Abstract common superclass for Rendering
implementations.
Field Summary | |
---|---|
protected java.awt.Color |
backgroundColor
Color Preference for background |
protected java.awt.Graphics2D |
g
the graphics context to which the visitor renders OSM objects |
protected java.awt.Color |
highlightColor
Color Preference for hightlighted objects |
protected java.awt.Color |
inactiveColor
Color Preference for inactive objects |
protected boolean |
isInactiveMode
if true, the paint visitor shall render OSM objects such that they look inactive. |
protected NavigatableComponent |
nc
the map viewport - provides projection and hit detection functionality |
protected java.awt.Color |
nodeColor
Color Preference for nodes |
protected int |
segmentNumberSpace
Preference: minimum space (displayed way length) to display segment numbers |
protected java.awt.Color |
selectedColor
Color Preference for selected objects |
protected int |
virtualNodeSize
Preference: size of virtual nodes (0 displayes display) |
protected int |
virtualNodeSpace
Preference: minimum space (displayed way length) to display virtual nodes |
Constructor Summary | |
---|---|
AbstractMapRenderer(java.awt.Graphics2D g,
NavigatableComponent nc,
boolean isInactiveMode)
Creates an abstract paint visitor |
Method Summary | |
---|---|
abstract void |
drawNode(Node n,
java.awt.Color color,
int size,
boolean fill)
Draw the node as small rectangle with the given color. |
protected void |
drawOrderNumber(java.awt.Point p1,
java.awt.Point p2,
int orderNumber,
java.awt.Color clr)
Draw an number of the order of the two consecutive nodes within the parents way |
void |
drawVirtualNodes(DataSet data,
BBox bbox)
Draws virtual nodes. |
void |
getColors()
Reads the color definitions from preferences. |
protected void |
getSettings(boolean virtual)
Reads all the settings from preferences. |
static boolean |
isLargeSegment(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
int space)
Checks if a way segemnt is large enough for additional information display. |
protected boolean |
isSegmentVisible(java.awt.Point p1,
java.awt.Point p2)
Checks if segment is visible in display. |
void |
visitVirtual(java.awt.geom.GeneralPath path,
Way w)
Creates path for drawing virtual nodes for one way. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openstreetmap.josm.data.osm.visitor.paint.Rendering |
---|
render |
Field Detail |
---|
protected java.awt.Graphics2D g
protected NavigatableComponent nc
protected boolean isInactiveMode
protected java.awt.Color backgroundColor
protected java.awt.Color inactiveColor
protected java.awt.Color selectedColor
protected java.awt.Color nodeColor
protected java.awt.Color highlightColor
protected int virtualNodeSize
protected int virtualNodeSpace
protected int segmentNumberSpace
Constructor Detail |
---|
public AbstractMapRenderer(java.awt.Graphics2D g, NavigatableComponent nc, boolean isInactiveMode) throws java.lang.IllegalArgumentException
Creates an abstract paint visitor
g
- the graphics context. Must not be null.nc
- the map viewport. Must not be null.isInactiveMode
- if true, the paint visitor shall render OSM objects such that they
look inactive. Example: rendering of data in an inactive layer using light gray as color only.
java.lang.IllegalArgumentException
- thrown if g
is null
java.lang.IllegalArgumentException
- thrown if nc
is nullMethod Detail |
---|
public abstract void drawNode(Node n, java.awt.Color color, int size, boolean fill)
n
- The node to draw.color
- The color of the node.protected void drawOrderNumber(java.awt.Point p1, java.awt.Point p2, int orderNumber, java.awt.Color clr)
p1
- First point of the way segment.p2
- Second point of the way segment.orderNumber
- The number of the segment in the way.public void drawVirtualNodes(DataSet data, BBox bbox)
data
- The data set being rendered.bbox
- The bounding box being displayed.public void getColors()
public
, so that
color names in preferences can be displayed even without calling the wireframe display before.
protected void getSettings(boolean virtual)
virtual
- true
if virtual nodes are usedpublic static boolean isLargeSegment(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, int space)
p1
- First point of the way segment.p2
- Second point of the way segment.space
- The free space to check against.
true
if segment is larger than required spaceprotected boolean isSegmentVisible(java.awt.Point p1, java.awt.Point p2)
p1
- First point of the way segment.p2
- Second point of the way segment.
true
if segment is visible.public void visitVirtual(java.awt.geom.GeneralPath path, Way w)
path
- The path to append drawing to.w
- The ways to draw node for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |