|
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.CompassLayer
public class CompassLayer
Field Summary | |
---|---|
static String |
NORTHEAST
|
static String |
NORTHWEST
|
static String |
RESIZE_KEEP_FIXED_SIZE
Does not modify the compass icon size when the window changes size. |
static String |
RESIZE_SHRINK_ONLY
On window resize, scales the compass icon to occupy a constant relative size of the viewport, but not larger than the icon's inherent size scaled by the layer's icon scale factor. |
static String |
RESIZE_STRETCH
On window resize, scales the compass icon to occupy a constant relative size of the viewport. |
static String |
SOUTHEAST
|
static String |
SOUTHWEST
|
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
changeSupport |
Constructor Summary | |
---|---|
CompassLayer()
|
|
CompassLayer(String iconFilePath)
|
Method Summary | |
---|---|
protected void |
doRender(DrawContext dc)
|
int |
getBorderWidth()
|
double |
getCompassToViewportScale()
Returns the layer's compass-to-viewport scale factor. |
String |
getIconFilePath()
Returns the layer's current icon file path. |
double |
getIconScale()
Returns the icon scale factor. |
Vec4 |
getLocationCenter()
|
String |
getPosition()
Returns the current relative compass icon position. |
String |
getResizeBehavior()
Returns the compass icon's resize behavior. |
boolean |
isShowTilt()
|
void |
setBorderWidth(int borderWidth)
Sets the compass icon offset from the viewport border. |
void |
setCompassToViewportScale(double compassToViewportScale)
Sets the scale factor applied to the viewport size to determine the displayed size of the compass icon. |
void |
setIconFilePath(String iconFilePath)
Sets the compass icon's image location. |
void |
setIconScale(double iconScale)
Sets the scale factor defining the displayed size of the compass icon relative to the icon's width and height in its image file. |
void |
setLocationCenter(Vec4 locationCenter)
|
void |
setPosition(String position)
Sets the relative viewport location to display the compass icon. |
void |
setResizeBehavior(String resizeBehavior)
Sets the behavior the layer uses to size the compass icon when the viewport size changes, typically when the World Wind window is resized. |
void |
setShowTilt(boolean showTilt)
|
String |
toString()
|
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer |
---|
dispose, doPick, getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, restoreState, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled |
Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
---|
propertyChange |
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, 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 |
Field Detail |
---|
public static final String NORTHEAST
public static final String NORTHWEST
public static final String RESIZE_KEEP_FIXED_SIZE
public static final String RESIZE_SHRINK_ONLY
public static final String RESIZE_STRETCH
public static final String SOUTHEAST
public static final String SOUTHWEST
Constructor Detail |
---|
public CompassLayer()
public CompassLayer(String iconFilePath)
Method Detail |
---|
protected void doRender(DrawContext dc)
doRender
in class AbstractLayer
public int getBorderWidth()
public double getCompassToViewportScale()
public String getIconFilePath()
public double getIconScale()
setIconScale(double)
for a description of the scale factor.
public Vec4 getLocationCenter()
public String getPosition()
public String getResizeBehavior()
public boolean isShowTilt()
public void setBorderWidth(int borderWidth)
borderWidth
- the number of pixels to offset the compass icon from the borders indicated by setPosition(String)
.public void setCompassToViewportScale(double compassToViewportScale)
RESIZE_STRETCH
or RESIZE_SHRINK_ONLY
. The icon's width is adjusted to occupy the proportion of the viewport's width indicated by
this factor. The icon's height is adjusted to maintain the compass image's native aspect ratio.
compassToViewportScale
- the compass to viewport scale factorpublic void setIconFilePath(String iconFilePath)
iconFilePath
- the path to the icon's image filepublic void setIconScale(double iconScale)
RESIZE_KEEP_FIXED_SIZE
, the icon's displayed sized is further affected by the
value specified by setCompassToViewportScale(double)
and the current viewport size.
iconScale
- the icon scale factorpublic void setLocationCenter(Vec4 locationCenter)
public void setPosition(String position)
NORTHEAST
(the default),
NORTHWEST
, SOUTHEAST
, or SOUTHWEST
. These indicate the corner of the viewport to place
the icon.
position
- the desired compass positionpublic void setResizeBehavior(String resizeBehavior)
RESIZE_KEEP_FIXED_SIZE
, the icon size is kept to the size
specified in its image file scaled by the layer's current icon scale. If the value is RESIZE_STRETCH
,
the icon is resized to have a constant size relative to the current viewport size. If the viewport shrinks the
icon size decreases; if it expands then the icon file enlarges. The relative size is determined by the current
compass-to-viewport scale and by the icon's image file size scaled by the current icon scale. If the value is
RESIZE_SHRINK_ONLY
(the default), icon sizing behaves as for RESIZE_STRETCH
but the icon will
not grow larger than the size specified in its image file scaled by the current icon scale.
resizeBehavior
- the desired resize behaviorpublic void setShowTilt(boolean showTilt)
public 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 |