Class PaintUtils
- java.lang.Object
-
- org.insa.graphs.gui.drawing.overlays.PaintUtils
-
public class PaintUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PaintUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Color
convertColor(int color)
Convert the given mapsforge color to an AWT Color.static int
convertColor(java.awt.Color color)
Convert the given AWT color to a mapsforge compatible color.static float
getStrokeWidth(int width, byte zoomLevel)
Compute an updated value for the given width at the given zoom level.
-
-
-
Method Detail
-
convertColor
public static int convertColor(java.awt.Color color)
Convert the given AWT color to a mapsforge compatible color.- Parameters:
color
- AWT color to convert.- Returns:
- Integer value representing a corresponding mapsforge color.
-
convertColor
public static java.awt.Color convertColor(int color)
Convert the given mapsforge color to an AWT Color.- Parameters:
color
- Integer value representing a mapsforge color.- Returns:
- AWT color corresponding to the given value.
-
getStrokeWidth
public static float getStrokeWidth(int width, byte zoomLevel)
Compute an updated value for the given width at the given zoom level. This function can be used to automatically scalePolyline
orMarker
when zooming (which is not done by default in Mapsforge).- Parameters:
width
- Original width to convert.zoomLevel
- Zoom level for which the width should be computed.- Returns:
- Actual width at the given zoom level.
-
-