public class BarScaleUI
extends java.lang.Object
Constructor and Description |
---|
BarScaleUI(processing.core.PApplet p,
UnfoldingMap map) |
BarScaleUI(processing.core.PApplet p,
UnfoldingMap map,
float x,
float y) |
Modifier and Type | Method and Description |
---|---|
protected float |
closest(float of,
java.util.List<java.lang.Float> in) |
void |
draw()
Draws a bar scale at given position according to current zoom level.
|
protected float |
getClosestDistance(float distance)
Returns the nearest distance to display as well as to use for
calculation.
|
boolean |
isAutoAlignment() |
void |
setAutoAlignment(boolean autoAlignment) |
void |
setStyle(int color,
int barWeight,
int barCapOffset,
processing.core.PFont font)
Set the style of the bar scale.
|
public BarScaleUI(processing.core.PApplet p, UnfoldingMap map, float x, float y)
public BarScaleUI(processing.core.PApplet p, UnfoldingMap map)
public void draw()
public void setStyle(int color, int barWeight, int barCapOffset, processing.core.PFont font)
color
- the color of the scale.barWeight
- the weight of the scale.barCapOffset
- the offset of the scale.font
- the font to use for the bar scale.protected float getClosestDistance(float distance)
distance
- The original distanceDISPLAY_DISTANCES
protected float closest(float of, java.util.List<java.lang.Float> in)
public boolean isAutoAlignment()
public void setAutoAlignment(boolean autoAlignment)