org.placelab.stumbler.gui
Class PlacelabStumblerGUI

java.lang.Object
  extended byorg.placelab.stumbler.gui.PlacelabStumblerGUI
All Implemented Interfaces:
EstimateListener, StumblerFunnelUpdateListener

public class PlacelabStumblerGUI
extends java.lang.Object
implements StumblerFunnelUpdateListener, EstimateListener

The gui for the PlacelabStumbler application. This gui is only intended for laptops or other devices with a standard sized display and a full swt and jface implementation. The pocket pc will have to use the text based version or a scaled down ui.


Nested Class Summary
protected  class PlacelabStumblerGUI.BeaconIcons
           
 
Field Summary
protected  org.eclipse.swt.widgets.Menu bar
           
protected  java.util.Hashtable beaconIcons
           
protected  BluetoothSpotter bluetooth
           
protected  SpotterExtension bluetoothExtension
           
protected  BluetoothTableController bluetoothTableController
           
protected  boolean boolAutoScroll
           
protected  boolean boolStumbleOnOff
           
protected  org.eclipse.swt.widgets.Display display
           
protected  java.util.Vector eventQueue
           
protected  StumblerFunnel funnel
           
protected  int gap
           
protected  NMEAGPSSpotter gps
           
protected  org.eclipse.swt.widgets.Label gpsEstimateText
           
protected  SpotterExtension gpsExtension
           
protected  PositionTracker gpsThinks
           
protected  RemoteGSMSpotter gsm
           
protected  SpotterExtension gsmExtension
           
protected  GSMTableController gsmTableController
           
protected  org.eclipse.swt.widgets.TabItem item1
           
protected  org.eclipse.swt.widgets.Composite item1Comp
           
protected  org.eclipse.swt.widgets.TabItem item2
           
protected  org.eclipse.swt.widgets.Composite item2Comp
           
protected  java.util.Hashtable lastActiveBeaconIcons
           
protected  java.lang.String lastSavePath
           
protected static long lastStumblerUpdate
           
protected static long lastUpdate
           
protected  GPSMeasurement latestGPSMeasurement
           
protected  java.util.Hashtable latestMeasurements
           
protected  LogWriter logWriter
           
protected  org.eclipse.swt.widgets.Composite mainComposite
           
protected  org.eclipse.swt.widgets.TabFolder mainTabFolder
           
protected  org.eclipse.swt.widgets.Group mapHolderGroup
           
protected  Mapper mapper
           
protected  TrackedMapView mapView1
           
protected  TrackedMapView mapView2
           
protected  PhantomView phantom
           
protected  org.eclipse.swt.widgets.Composite phantomHolder
           
protected  java.util.Vector placeItems
           
protected  Tracker placelabThinks
           
protected  org.eclipse.swt.widgets.Label plEstimateText
           
protected  org.eclipse.swt.custom.SashForm sash
           
protected  org.eclipse.swt.widgets.Shell shell
           
protected  boolean shutdown
           
protected static java.lang.String sp
           
protected  int tableCount
           
protected  org.eclipse.swt.widgets.Label tmvBigLabel
           
protected  org.eclipse.swt.widgets.Button tmvBtnBigMap
           
protected  org.eclipse.swt.widgets.Button tmvBtnPosition
           
protected  org.eclipse.swt.widgets.Button tmvBtnScroll
           
protected  org.eclipse.swt.widgets.Button tmvBtnTrack
           
protected  org.eclipse.swt.widgets.Group tmvGroup
           
protected  org.eclipse.swt.widgets.Label tmvLabel
           
protected  org.eclipse.swt.widgets.Scale tmvZoomScale
           
protected  CompoundTracker tracker
           
protected  WadData wad1
           
protected  WadData wad2
           
protected  WiFiSpotter wifi
           
protected  SpotterExtension wifiExtension
           
protected  WiFiTableController wifiTableController
           
 
Constructor Summary
PlacelabStumblerGUI(java.lang.String mapArchive, java.lang.String mapName, Mapper m)
           
 
Method Summary
protected  java.lang.String askUserForFile()
           
protected  java.lang.String askUserForNewFile()
           
protected  void beginStumbling()
           
protected  void buildMapMenus()
           
protected  void buildMapViews()
           
protected  void buildMenu()
           
protected  void buildShell()
           
 void checkZoomLevel()
           
protected  void createBeaconIcons(MapView onView)
          When a mapview is first loaded, all beacons to date must be plotted on it.
protected  void displayPlacelabReticle()
           
protected  void doEventLoop()
           
protected  boolean doGPSPref()
           
protected  void doMapZoomIn()
           
protected  void doMapZoomOut()
           
protected  void doSaveAs()
           
protected  void doSubmitLog()
           
protected  void errorDialog(java.lang.String msg)
           
protected  void errorDialog(java.lang.String msg, java.lang.Throwable e)
           
 void estimateUpdated(Tracker t, Estimate e, Measurement m)
          Implement this method to respond to updates from the Tracker(s) you are registered with.
protected  void fixZoomSlider()
           
 org.eclipse.swt.widgets.Display getDisplay()
           
protected  boolean isGPSStale()
           
protected  void loadWad()
           
protected  void loadWad(java.lang.String path, java.lang.String mapName, TrackedMapView view)
           
static void main(java.lang.String[] args)
           
protected  void mapAction(org.eclipse.swt.events.SelectionEvent e)
           
protected  void placeAction(org.eclipse.swt.events.SelectionEvent e)
           
protected  void resetGPS()
           
 void run()
           
 void setShellSize(org.eclipse.swt.widgets.Shell s, org.eclipse.swt.widgets.Display d)
           
protected  void setupGPS()
           
protected  void shutdown()
           
 void stumblerUpdated(java.util.Hashtable measurements)
          This message is sent after every StumblerFunnel has new data available Note that this callback is sent in the thread that the StumblerUpdateListener used to subscribe itself to the StumblerFunnel.
protected  void toggleAutoScroll()
           
protected  void toggleAutoZoom()
           
protected  void toggleBeacons()
           
protected  void toggleParticles()
           
protected  void updateAllBeaconIcons()
          When the map is changed for a mapview, all of the BeaconPlace glyphs to be updated to move to their proper locations
protected  void updateBeaconIcons()
           
protected  void updateGPSText()
           
protected  void updatePositionTracker()
           
protected  void updateTrackers()
           
protected  void updateUI()
           
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent ee)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracker

protected CompoundTracker tracker

placelabThinks

protected Tracker placelabThinks

gpsThinks

protected PositionTracker gpsThinks

display

protected org.eclipse.swt.widgets.Display display

shell

protected org.eclipse.swt.widgets.Shell shell

phantom

protected PhantomView phantom

phantomHolder

protected org.eclipse.swt.widgets.Composite phantomHolder

mapView1

protected TrackedMapView mapView1

mapView2

protected TrackedMapView mapView2

wad1

protected WadData wad1

wad2

protected WadData wad2

placeItems

protected java.util.Vector placeItems

bar

protected org.eclipse.swt.widgets.Menu bar

mainTabFolder

protected org.eclipse.swt.widgets.TabFolder mainTabFolder

item1

protected org.eclipse.swt.widgets.TabItem item1

item2

protected org.eclipse.swt.widgets.TabItem item2

mainComposite

protected org.eclipse.swt.widgets.Composite mainComposite

item1Comp

protected org.eclipse.swt.widgets.Composite item1Comp

item2Comp

protected org.eclipse.swt.widgets.Composite item2Comp

tmvZoomScale

protected org.eclipse.swt.widgets.Scale tmvZoomScale

tmvGroup

protected org.eclipse.swt.widgets.Group tmvGroup

mapHolderGroup

protected org.eclipse.swt.widgets.Group mapHolderGroup

tmvLabel

protected org.eclipse.swt.widgets.Label tmvLabel

tmvBigLabel

protected org.eclipse.swt.widgets.Label tmvBigLabel

plEstimateText

protected org.eclipse.swt.widgets.Label plEstimateText

gpsEstimateText

protected org.eclipse.swt.widgets.Label gpsEstimateText

sash

protected org.eclipse.swt.custom.SashForm sash

wifiTableController

protected WiFiTableController wifiTableController

bluetoothTableController

protected BluetoothTableController bluetoothTableController

gsmTableController

protected GSMTableController gsmTableController

beaconIcons

protected java.util.Hashtable beaconIcons

lastActiveBeaconIcons

protected java.util.Hashtable lastActiveBeaconIcons

tableCount

protected int tableCount

funnel

protected StumblerFunnel funnel

gps

protected NMEAGPSSpotter gps

wifi

protected WiFiSpotter wifi

bluetooth

protected BluetoothSpotter bluetooth

gsm

protected RemoteGSMSpotter gsm

gpsExtension

protected SpotterExtension gpsExtension

wifiExtension

protected SpotterExtension wifiExtension

bluetoothExtension

protected SpotterExtension bluetoothExtension

gsmExtension

protected SpotterExtension gsmExtension

logWriter

protected LogWriter logWriter

eventQueue

protected java.util.Vector eventQueue

latestMeasurements

protected java.util.Hashtable latestMeasurements

latestGPSMeasurement

protected GPSMeasurement latestGPSMeasurement

tmvBtnPosition

protected org.eclipse.swt.widgets.Button tmvBtnPosition

tmvBtnTrack

protected org.eclipse.swt.widgets.Button tmvBtnTrack

tmvBtnBigMap

protected org.eclipse.swt.widgets.Button tmvBtnBigMap

tmvBtnScroll

protected org.eclipse.swt.widgets.Button tmvBtnScroll

gap

protected int gap

boolStumbleOnOff

protected boolean boolStumbleOnOff

boolAutoScroll

protected boolean boolAutoScroll

lastSavePath

protected java.lang.String lastSavePath

mapper

protected Mapper mapper

sp

protected static java.lang.String sp

shutdown

protected volatile boolean shutdown

lastStumblerUpdate

protected static long lastStumblerUpdate

lastUpdate

protected static long lastUpdate
Constructor Detail

PlacelabStumblerGUI

public PlacelabStumblerGUI(java.lang.String mapArchive,
                           java.lang.String mapName,
                           Mapper m)
                    throws java.io.IOException
Method Detail

main

public static void main(java.lang.String[] args)

buildShell

protected void buildShell()

askUserForFile

protected java.lang.String askUserForFile()

askUserForNewFile

protected java.lang.String askUserForNewFile()

errorDialog

protected void errorDialog(java.lang.String msg)

errorDialog

protected void errorDialog(java.lang.String msg,
                           java.lang.Throwable e)

getDisplay

public org.eclipse.swt.widgets.Display getDisplay()

checkZoomLevel

public void checkZoomLevel()

fixZoomSlider

protected void fixZoomSlider()

doMapZoomIn

protected void doMapZoomIn()

doMapZoomOut

protected void doMapZoomOut()

displayPlacelabReticle

protected void displayPlacelabReticle()

buildMapViews

protected void buildMapViews()

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent ee)

beginStumbling

protected void beginStumbling()
                       throws java.io.IOException
Throws:
java.io.IOException

resetGPS

protected void resetGPS()

setupGPS

protected void setupGPS()

doGPSPref

protected boolean doGPSPref()

doSaveAs

protected void doSaveAs()

doSubmitLog

protected void doSubmitLog()

run

public void run()

stumblerUpdated

public void stumblerUpdated(java.util.Hashtable measurements)
Description copied from interface: StumblerFunnelUpdateListener
This message is sent after every StumblerFunnel has new data available Note that this callback is sent in the thread that the StumblerUpdateListener used to subscribe itself to the StumblerFunnel.

Specified by:
stumblerUpdated in interface StumblerFunnelUpdateListener
Parameters:
measurements - updates each StumblerSpotter keys to its MeasurementPackages for this update.

doEventLoop

protected void doEventLoop()

updateTrackers

protected void updateTrackers()

setShellSize

public void setShellSize(org.eclipse.swt.widgets.Shell s,
                         org.eclipse.swt.widgets.Display d)

estimateUpdated

public void estimateUpdated(Tracker t,
                            Estimate e,
                            Measurement m)
Description copied from interface: EstimateListener
Implement this method to respond to updates from the Tracker(s) you are registered with.

Specified by:
estimateUpdated in interface EstimateListener
Parameters:
t - the Tracker producing the Estimate
e - the Estimate produced by the Tracker
m - the latest Measurement used by the Tracker to produce the Estimate

updateUI

protected void updateUI()

isGPSStale

protected boolean isGPSStale()

updatePositionTracker

protected void updatePositionTracker()

updateBeaconIcons

protected void updateBeaconIcons()

updateAllBeaconIcons

protected void updateAllBeaconIcons()
When the map is changed for a mapview, all of the BeaconPlace glyphs to be updated to move to their proper locations


createBeaconIcons

protected void createBeaconIcons(MapView onView)
When a mapview is first loaded, all beacons to date must be plotted on it. They cannot be made in advance, because swt does not support making a widget without a parent.


updateGPSText

protected void updateGPSText()

buildMenu

protected void buildMenu()

buildMapMenus

protected void buildMapMenus()

mapAction

protected void mapAction(org.eclipse.swt.events.SelectionEvent e)

placeAction

protected void placeAction(org.eclipse.swt.events.SelectionEvent e)

toggleBeacons

protected void toggleBeacons()

toggleAutoScroll

protected void toggleAutoScroll()

toggleAutoZoom

protected void toggleAutoZoom()

toggleParticles

protected void toggleParticles()

loadWad

protected void loadWad()

loadWad

protected void loadWad(java.lang.String path,
                       java.lang.String mapName,
                       TrackedMapView view)

shutdown

protected void shutdown()