public class GpxDrawHelper extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GpxDrawHelper.ColorMode
Different color modes
|
Modifier and Type | Field and Description |
---|---|
private boolean |
alternateDirection
paint direction arrow with alternate math.
|
private GpxDrawHelper.ColorMode |
colored
Mode of the line coloring
|
private boolean |
colorModeDynamic |
private int |
colorTracksTune
max speed for coloring - allows to tweak line coloring for different speed levels.
|
private boolean |
computeCacheColorDynamic |
private GpxDrawHelper.ColorMode |
computeCacheColored |
private int |
computeCacheColorTracksTune |
private java.awt.Color |
computeCacheColorUsed |
private boolean |
computeCacheInSync |
private int |
computeCacheMaxLineLengthUsed |
private GpxData |
data |
private ColorScale |
dateScale |
private static java.awt.Color |
DEFAULT_COLOR |
private int |
delta
don't draw arrows nearer to each other than this
|
private static int[][] |
dir |
private boolean |
direction |
private ColorScale |
directionScale |
private boolean |
forceLines |
private int |
hdopAlpha
Opacity for hdop points
|
private boolean |
hdopCircle |
private int |
hdopfactor |
private ColorScale |
hdopScale
Colors (without custom alpha channel, if given) for HDOP painting.
|
private boolean |
large
paint large dots for points
|
private int |
largePointAlpha |
private int |
largesize |
private boolean |
lines |
private int |
lineWidth
don't draw lines if longer than x meters
|
private static int |
ll0 |
private int |
maxLineLength |
private double |
minTrackDurationForTimeColoring |
private java.awt.Color |
neutralColor |
private static double |
PHI |
private static int |
sl4 |
private static int |
sl9 |
private ColorScale |
velocityScale |
Constructor and Description |
---|
GpxDrawHelper(GpxData gpxData)
Constructs a new
GpxDrawHelper . |
Modifier and Type | Method and Description |
---|---|
void |
calculateColors() |
private void |
checkCache()
Check cache validity set necessary flags
|
void |
dataChanged() |
void |
drawAll(java.awt.Graphics2D g,
MapView mv,
java.util.List<WayPoint> visibleSegments) |
private void |
drawArrows(java.awt.Graphics2D g,
MapView mv,
java.util.List<WayPoint> visibleSegments) |
void |
drawColorBar(java.awt.Graphics2D g,
MapView mv) |
private void |
drawLines(java.awt.Graphics2D g,
MapView mv,
java.util.List<WayPoint> visibleSegments) |
private void |
drawPoints(java.awt.Graphics2D g,
MapView mv,
java.util.List<WayPoint> visibleSegments) |
private void |
fixColors(java.util.List<WayPoint> visibleSegments) |
java.awt.Color |
getColor(java.lang.String layerName,
boolean ignoreCustom)
Get the default color for gps tracks for specified layer
|
GpxDrawHelper.ColorMode |
getColorMode(java.lang.String layerName)
Read coloring mode for specified layer from preferences
|
static java.awt.Color |
getGenericColor()
Reads generic color from preferences (usually gray)
|
void |
readPreferences(java.lang.String layerName)
Read all drawing-related settings from preferences
|
private void |
setupColors() |
private static java.lang.String |
specName(java.lang.String layerName) |
private boolean forceLines
private boolean direction
private int lineWidth
private int maxLineLength
private boolean lines
private boolean large
private int largesize
private boolean hdopCircle
private boolean alternateDirection
private int delta
private double minTrackDurationForTimeColoring
private int hdopfactor
private static final double PHI
private boolean computeCacheInSync
private int computeCacheMaxLineLengthUsed
private java.awt.Color computeCacheColorUsed
private boolean computeCacheColorDynamic
private GpxDrawHelper.ColorMode computeCacheColored
private int computeCacheColorTracksTune
private GpxDrawHelper.ColorMode colored
private int colorTracksTune
private boolean colorModeDynamic
private java.awt.Color neutralColor
private int largePointAlpha
private ColorScale velocityScale
private ColorScale hdopScale
private ColorScale dateScale
private ColorScale directionScale
private int hdopAlpha
private static final java.awt.Color DEFAULT_COLOR
private static final int ll0
private static final int sl4
private static final int sl9
private static final int[][] dir
public GpxDrawHelper(GpxData gpxData)
GpxDrawHelper
.gpxData
- GPX dataprivate void setupColors()
private static java.lang.String specName(java.lang.String layerName)
public java.awt.Color getColor(java.lang.String layerName, boolean ignoreCustom)
layerName
- name of the GpxLayerignoreCustom
- do not use preferencespublic GpxDrawHelper.ColorMode getColorMode(java.lang.String layerName)
layerName
- name of the GpxLayerpublic static java.awt.Color getGenericColor()
public void readPreferences(java.lang.String layerName)
layerName
- layer name used to access its specific preferencespublic void drawAll(java.awt.Graphics2D g, MapView mv, java.util.List<WayPoint> visibleSegments)
public void calculateColors()
private void drawLines(java.awt.Graphics2D g, MapView mv, java.util.List<WayPoint> visibleSegments)
private void drawArrows(java.awt.Graphics2D g, MapView mv, java.util.List<WayPoint> visibleSegments)
private void drawPoints(java.awt.Graphics2D g, MapView mv, java.util.List<WayPoint> visibleSegments)
private void checkCache()
public void dataChanged()
public void drawColorBar(java.awt.Graphics2D g, MapView mv)