|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
gov.nasa.worldwind.layers.ScalebarLayer
public class ScalebarLayer
Renders a scalebar graphic in a screen corner.
Field Summary | |
---|---|
static String |
UNIT_IMPERIAL
|
static String |
UNIT_METRIC
|
Constructor Summary | |
---|---|
ScalebarLayer()
Renders a scalebar graphic in a screen corner |
Method Summary | |
---|---|
void |
doPick(DrawContext dc,
Point pickPoint)
|
void |
doRender(DrawContext dc)
|
void |
draw(DrawContext dc)
|
int |
getBorderWidth()
|
Color |
getColor()
Get the scalebar color |
Font |
getFont()
Get the scalebar legend Fon |
Vec4 |
getLocationCenter()
Returns the current scalebar center location. |
Vec4 |
getLocationOffset()
Returns the current location offset. |
double |
getPixelSize()
Get the apparent pixel size in meter at the reference position. |
String |
getPosition()
|
String |
getResizeBehavior()
Returns the layer's resize behavior. |
Dimension |
getSize()
Get the scalebar graphic Dimension (in pixels) |
double |
getToViewportScale()
Returns the scalebar-to-viewport scale factor. |
String |
getUnit()
|
void |
setBorderWidth(int borderWidth)
Sets the scalebar offset from the viewport border. |
void |
setColor(Color color)
Set the scalbar Color |
void |
setFont(Font font)
Set the scalebar legend Fon |
void |
setLocationCenter(Vec4 locationCenter)
Specifies the screen location of the scalebar center. |
void |
setLocationOffset(Vec4 locationOffset)
Specifies a placement offset from the scalebar's position on the screen. |
void |
setPosition(String position)
Sets the relative viewport location to display the scalebar. |
void |
setResizeBehavior(String resizeBehavior)
Sets the behavior the layer uses to size the scalebar when the viewport size changes, typically when the World Wind window is resized. |
void |
setSize(Dimension size)
Set the scalebar graphic Dimenion (in pixels) |
void |
setToViewportScale(double toViewportScale)
Sets the scale factor applied to the viewport size to determine the displayed size of the scalebar. |
void |
setUnit(String unit)
Sets the unit the scalebar uses to display distances. |
String |
toString()
|
Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
---|
onMessage, propertyChange |
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
Methods inherited from interface java.beans.PropertyChangeListener |
---|
propertyChange |
Methods inherited from interface gov.nasa.worldwind.event.MessageListener |
---|
onMessage |
Field Detail |
---|
public static final String UNIT_IMPERIAL
public static final String UNIT_METRIC
Constructor Detail |
---|
public ScalebarLayer()
Method Detail |
---|
public void doPick(DrawContext dc, Point pickPoint)
doPick
in class AbstractLayer
public void doRender(DrawContext dc)
doRender
in class AbstractLayer
public void draw(DrawContext dc)
public int getBorderWidth()
public Color getColor()
public Font getFont()
public Vec4 getLocationCenter()
public Vec4 getLocationOffset()
public double getPixelSize()
public String getPosition()
public String getResizeBehavior()
public Dimension getSize()
public double getToViewportScale()
public String getUnit()
public void setBorderWidth(int borderWidth)
borderWidth
- the number of pixels to offset the scalebar from the borders indicated by setPosition(String)
.public void setColor(Color color)
color
- the scalebar Colorpublic void setFont(Font font)
font
- the scalebar legend Fontpublic void setLocationCenter(Vec4 locationCenter)
locationCenter
- the scalebar center. May be null.setPosition(java.lang.String)
,
setLocationOffset(gov.nasa.worldwind.geom.Vec4)
public void setLocationOffset(Vec4 locationOffset)
locationOffset
- the number of pixels to shift the scalebar from its specified screen position. A
positive X value shifts the image to the right. A positive Y value shifts the image up. If
null, no offset is applied. The default offset is null.setLocationCenter(gov.nasa.worldwind.geom.Vec4)
,
setPosition(java.lang.String)
public void setPosition(String position)
position
- the desired scalebar positionpublic void setResizeBehavior(String resizeBehavior)
resizeBehavior
- the desired resize behaviorpublic void setSize(Dimension size)
size
- the scalebar graphic Dimensionpublic void setToViewportScale(double toViewportScale)
toViewportScale
- the scalebar to viewport scale factorpublic void setUnit(String unit)
UNIT_METRIC
(the default),
or UNIT_IMPERIAL
.
unit
- the desired unitpublic String toString()
toString
in class AbstractLayer
|
NASA World Wind | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |