|
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
| Nested Class Summary | |
|---|---|
protected class |
CompassLayer.OrderedIcon
|
| Field Summary | |
|---|---|
protected int |
borderWidth
|
protected double |
compassToViewportScale
|
protected String |
iconFilePath
|
protected int |
iconHeight
|
protected double |
iconScale
|
protected int |
iconWidth
|
protected Vec4 |
locationCenter
|
protected Vec4 |
locationOffset
|
protected CompassLayer.OrderedIcon |
orderedImage
|
protected PickSupport |
pickSupport
|
protected String |
position
|
protected String |
resizeBehavior
|
protected boolean |
showTilt
|
| Constructor Summary | |
|---|---|
CompassLayer()
|
|
CompassLayer(String iconFilePath)
|
|
| Method Summary | |
|---|---|
protected double |
computeHeading(View view)
|
protected Vec4 |
computeLocation(Rectangle viewport,
double scale)
|
protected double |
computePitch(View view)
|
protected double |
computeScale(Rectangle viewport)
|
protected void |
doPick(DrawContext dc,
Point pickPoint)
|
protected void |
doRender(DrawContext dc)
|
protected void |
draw(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()
Returns the current compass image location. |
Vec4 |
getLocationOffset()
Returns the current location offset. |
String |
getPosition()
Returns the current relative compass icon position. |
String |
getResizeBehavior()
Returns the compass icon's resize behavior. |
protected double |
getScaledIconHeight()
|
protected double |
getScaledIconWidth()
|
protected void |
initializeTexture(DrawContext dc)
|
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)
Specifies the screen location of the compass image, relative to the image's center. |
void |
setLocationOffset(Vec4 locationOffset)
Specifies a placement offset from the compass' position on the screen. |
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.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 |
|---|
protected int borderWidth
protected double compassToViewportScale
protected String iconFilePath
protected int iconHeight
protected double iconScale
protected int iconWidth
protected Vec4 locationCenter
protected Vec4 locationOffset
protected CompassLayer.OrderedIcon orderedImage
protected PickSupport pickSupport
protected String position
protected String resizeBehavior
protected boolean showTilt
| Constructor Detail |
|---|
public CompassLayer()
public CompassLayer(String iconFilePath)
| Method Detail |
|---|
protected double computeHeading(View view)
protected Vec4 computeLocation(Rectangle viewport,
double scale)
protected double computePitch(View view)
protected double computeScale(Rectangle viewport)
protected void doPick(DrawContext dc,
Point pickPoint)
doPick in class AbstractLayerprotected void doRender(DrawContext dc)
doRender in class AbstractLayerprotected void draw(DrawContext dc)
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 Vec4 getLocationOffset()
public String getPosition()
public String getResizeBehavior()
protected double getScaledIconHeight()
protected double getScaledIconWidth()
protected void initializeTexture(DrawContext dc)
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)
compassToViewportScale - the compass to viewport scale factorpublic void setIconFilePath(String iconFilePath)
iconFilePath - the path to the icon's image filepublic void setIconScale(double iconScale)
setCompassToViewportScale(double) and the current viewport size.
The default icon scale is 0.5.
iconScale - the icon scale factorpublic void setLocationCenter(Vec4 locationCenter)
setPosition(String). The location is specified in
pixels. The origin is the window's lower left corner. Positive X values are to the right of the origin, positive
Y values are upwards from the origin. The final image location will be affected by the currently specified
location offset if a non-null location offset has been specified (see setLocationOffset(gov.nasa.worldwind.geom.Vec4)).
locationCenter - the location center. May be null.setPosition(String),
setLocationOffset(gov.nasa.worldwind.geom.Vec4)public void setLocationOffset(Vec4 locationOffset)
locationOffset - the number of pixels to shift the compass image 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(String)public void setPosition(String position)
position - the desired compass positionpublic void setResizeBehavior(String resizeBehavior)
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 | ||||||||