Class PolylineAutoScaling
- java.lang.Object
-
- org.mapsforge.map.layer.Layer
-
- org.mapsforge.map.layer.overlay.Polyline
-
- org.insa.graphs.gui.drawing.overlays.PolylineAutoScaling
-
public class PolylineAutoScaling extends org.mapsforge.map.layer.overlay.Polyline
Class extending the default Mapsforge'sPolyline
with auto-scaling. Mapsforge's Polylines do not scale with zoom level, this class aims at correcting this. When a redraw is requested, the width of the line is recomputed for the current zoom level.- See Also:
PaintUtils.getStrokeWidth(int, byte)
-
-
Constructor Summary
Constructors Constructor Description PolylineAutoScaling(int width, java.awt.Color color)
Create a new PolylineAutoScaling with the given width and color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Point point)
void
addAll(java.util.Collection<? extends Point> points)
void
draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
java.awt.Color
getColor()
void
setColor(java.awt.Color color)
Set the color for this polyline.-
Methods inherited from class org.mapsforge.map.layer.overlay.Polyline
addPoint, addPoints, clear, contains, getLatLongs, getPaintStroke, getStrokeIncrease, isKeepAligned, setPaintStroke, setPoints, setStrokeIncrease
-
-
-
-
Constructor Detail
-
PolylineAutoScaling
public PolylineAutoScaling(int width, java.awt.Color color)
Create a new PolylineAutoScaling with the given width and color.- Parameters:
width
- Original width of the line (independent of the zoom level).color
- Color of the line.- See Also:
PaintUtils.getStrokeWidth(int, byte)
-
-
Method Detail
-
setColor
public void setColor(java.awt.Color color)
Set the color for this polyline.- Parameters:
color
- New color for this polyline.
-
getColor
public java.awt.Color getColor()
- Returns:
- Color of this polyline.
-
add
public void add(Point point)
- Parameters:
point
- Point to add to this line.
-
addAll
public void addAll(java.util.Collection<? extends Point> points)
- Parameters:
points
- Points to add to this line.
-
draw
public void draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
- Overrides:
draw
in classorg.mapsforge.map.layer.overlay.Polyline
-
-