NASA World Wind

gov.nasa.worldwind.examples.applet
Class WWJApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by gov.nasa.worldwind.examples.applet.WWJApplet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer

public class WWJApplet
extends javax.swing.JApplet

Provides a base application framework for simple WorldWind applets. A simple applet which runs World Wind with a StatusBar at the bottom and lets javascript set some view attributes.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WWJApplet()
           
 
Method Summary
 void addLabel(java.lang.String text, double lat, double lon, java.lang.String font, java.lang.String color)
          Add a text label at a position on the globe.
 Layer getLayerByName(java.lang.String layerName)
          Get a reference to a layer with part of its name
 OrbitView getOrbitView()
          Get the current OrbitView
 WorldWindowGLCanvas getWW()
          Get the WorldWindowGLCanvas
 void gotoLatLon(double lat, double lon)
          Move the current view position
 void gotoLatLon(double lat, double lon, double zoom, double heading, double pitch)
          Move the current view position, zoom, heading and pitch
 void init()
           
static void insertBeforeLayerName(WorldWindow wwd, Layer layer, java.lang.String targetName)
          Adds a layer to WW current layerlist, before a named layer.
 void setHeadingAndPitch(double heading, double pitch)
          Set the current view heading and pitch
 void setZoom(double zoom)
          Set the current view zoom
 void start()
           
 void stop()
           
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WWJApplet

public WWJApplet()
Method Detail

addLabel

public void addLabel(java.lang.String text,
                     double lat,
                     double lon,
                     java.lang.String font,
                     java.lang.String color)
Add a text label at a position on the globe.

Parameters:
text - the text to be displayed.
lat - the latitude in decimal degrees.
lon - the longitude in decimal degrees.
font - a string describing the font to be used.
color - the color to be used as an hexadecimal coded string.

getLayerByName

public Layer getLayerByName(java.lang.String layerName)
Get a reference to a layer with part of its name

Parameters:
layerName - part of the layer name to match.
Returns:
the corresponding layer or null if not found.

getOrbitView

public OrbitView getOrbitView()
Get the current OrbitView

Returns:
the current OrbitView

getWW

public WorldWindowGLCanvas getWW()
Get the WorldWindowGLCanvas

Returns:
the current WorldWindowGLCanvas

gotoLatLon

public void gotoLatLon(double lat,
                       double lon)
Move the current view position

Parameters:
lat - the target latitude in decimal degrees
lon - the target longitude in decimal degrees

gotoLatLon

public void gotoLatLon(double lat,
                       double lon,
                       double zoom,
                       double heading,
                       double pitch)
Move the current view position, zoom, heading and pitch

Parameters:
lat - the target latitude in decimal degrees
lon - the target longitude in decimal degrees
zoom - the target eye distance in meters
heading - the target heading in decimal degrees
pitch - the target pitch in decimal degrees

init

public void init()
Overrides:
init in class java.applet.Applet

insertBeforeLayerName

public static void insertBeforeLayerName(WorldWindow wwd,
                                         Layer layer,
                                         java.lang.String targetName)
Adds a layer to WW current layerlist, before a named layer. Target name can be a part of the layer name

Parameters:
wwd - the WorldWindow reference.
layer - the layer to be added.
targetName - the partial layer name to be matched - case sensitive.

setHeadingAndPitch

public void setHeadingAndPitch(double heading,
                               double pitch)
Set the current view heading and pitch

Parameters:
heading - the traget heading in decimal degrees
pitch - the target pitch in decimal degrees

setZoom

public void setZoom(double zoom)
Set the current view zoom

Parameters:
zoom - the target eye distance in meters

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

NASA World Wind