Jeospace API

org.jeospace.ui.swt.widgets
Class NavigationControl

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.jeospace.ui.swt.widgets.NavigationControl
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, java.util.EventListener, org.eclipse.swt.events.MouseListener, Orientation, OrientationControl, Position, PositionControl, java.lang.Runnable, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class NavigationControl
extends org.eclipse.swt.widgets.Composite
implements java.lang.Runnable, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.events.MouseListener, PositionControl, OrientationControl

A consolidated concrete implementation of PositionControl and OrientationControl provides a ui for navigation.

Version:
$Revision: 1.1 $
Author:
Rex Melton

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
NavigationControl(org.eclipse.swt.widgets.Composite parent)
          Constructor.
 
Method Summary
 void enableOrientation(boolean enabled)
          Set the enabled state of the control and it's ui elements.
 void enablePosition(boolean enabled)
          Set the enabled state of the control and it's ui elements.
 void get(Attitude attitude)
          Return the orientation data in the argument object.
 void get(Cartesian cartesian)
          Return the positioning data in the argument object.
 void get(Quaternion quat)
          Return the orientation data in the argument object.
 Polar getPolar()
          Return the position coordinate object.
static void main(java.lang.String[] arg)
          Create a Shell with the control inside.
 void mouseDoubleClick(org.eclipse.swt.events.MouseEvent me)
          Ignored.
 void mouseDown(org.eclipse.swt.events.MouseEvent me)
          Ignored.
 void mouseUp(org.eclipse.swt.events.MouseEvent me)
          Process a mouse release event.
 void run()
          Update the state of the ui elements - called by the display thread
 void set(Attitude attitude)
          Set the working coordinate.
 void set(Polar polar)
          Set the working coordinate.
 void setMinimumElevation(Length min)
          Set the minimum elevation allowed
 void updateOrientation(double timeValue)
          Update the orientation for the next simulation frame.
 void updatePosition(double timeValue)
          Update the position and orientation for the next simulation frame.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent se)
          Ignored.
 void widgetSelected(org.eclipse.swt.events.SelectionEvent se)
          Handler for selection events.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NavigationControl

public NavigationControl(org.eclipse.swt.widgets.Composite parent)
Constructor.

Parameters:
parent - The parent Composite object that this control will be added to.
Method Detail

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent se)
Handler for selection events. This gets the scale values.

Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
Parameters:
se - the event descriptor generated by the selected widget

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent se)
Ignored.

Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener

mouseDown

public void mouseDown(org.eclipse.swt.events.MouseEvent me)
Ignored. Process a mouse press event.

Specified by:
mouseDown in interface org.eclipse.swt.events.MouseListener
Parameters:
me - The event that caused this method to be called

mouseUp

public void mouseUp(org.eclipse.swt.events.MouseEvent me)
Process a mouse release event. This resets the scale controls.

Specified by:
mouseUp in interface org.eclipse.swt.events.MouseListener
Parameters:
me - The event that caused this method to be called

mouseDoubleClick

public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent me)
Ignored. Process a mouse double click event.

Specified by:
mouseDoubleClick in interface org.eclipse.swt.events.MouseListener
Parameters:
me - The event that caused this method to be called

set

public void set(Polar polar)
Set the working coordinate. If the argument coordinate is null, then the control is disabled.

Specified by:
set in interface PositionControl
Parameters:
polar - The working coordinate

get

public void get(Cartesian cartesian)
Return the positioning data in the argument object.

Specified by:
get in interface Position
Parameters:
cartesian - The Cartesian coordinate object to initialize with the current positioning data.

getPolar

public Polar getPolar()
Return the position coordinate object.

Specified by:
getPolar in interface Position
Returns:
the position coordinate object.

enablePosition

public void enablePosition(boolean enabled)
Set the enabled state of the control and it's ui elements.

Specified by:
enablePosition in interface Position
Parameters:
enabled - The state of the control

updatePosition

public void updatePosition(double timeValue)
Update the position and orientation for the next simulation frame. Note that the timeValue is ignored. The control updates based on user input through the ui.

Specified by:
updatePosition in interface Position
Parameters:
timeValue - The timeValue is ignored.

set

public void set(Attitude attitude)
Set the working coordinate. If the argument coordinate is null, then the control is disabled.

Specified by:
set in interface OrientationControl
Parameters:
attitude - The working coordinate

get

public void get(Attitude attitude)
Return the orientation data in the argument object.

Specified by:
get in interface Orientation
Parameters:
attitude - The Attitude coordinate object to initialize with the current positioning data.

get

public void get(Quaternion quat)
Return the orientation data in the argument object.

Specified by:
get in interface Orientation
Parameters:
quat - The Quaternion coordinate object to initialize with the current positioning data.

enableOrientation

public void enableOrientation(boolean enabled)
Set the enabled state of the control and it's ui elements.

Specified by:
enableOrientation in interface Orientation
Parameters:
enabled - The state of the control

updateOrientation

public void updateOrientation(double timeValue)
Update the orientation for the next simulation frame. Note that the timeValue is ignored. The control updates based on user input through the ui.

Specified by:
updateOrientation in interface Orientation
Parameters:
timeValue - The timeValue is ignored.

run

public void run()
Update the state of the ui elements - called by the display thread

Specified by:
run in interface java.lang.Runnable

setMinimumElevation

public void setMinimumElevation(Length min)
Set the minimum elevation allowed

Parameters:
min - The minimum elevation allowed. If null, the minimum will be set to a default value of 1km.

main

public static void main(java.lang.String[] arg)
Create a Shell with the control inside. Can be used for testing.

Parameters:
arg - Command line arguments, none necessary.

Jeospace API

Copyright © 2006 - jeospace.org