org.placelab.demo.apviewer
Class BeaconTableController

java.lang.Object
  extended byorg.placelab.demo.apviewer.BeaconTableController
Direct Known Subclasses:
APViewerTableController, BluetoothTableController, GSMTableController, WiFiTableController

public class BeaconTableController
extends java.lang.Object

A BeaconTableController is displays a table where the history of beacons seen is shown. In a departure from the old style, there is now a single table where active readings are shown in a different colour at the top. The PlacelabStumblerGUI will offer the BeaconTableController measurements for the StumblerSpotter it is displaying info for every update, and the BeaconTableController will collate that data and display it in the tables that it manages.


Field Summary
 java.util.Hashtable active
           
 org.eclipse.swt.graphics.Image activeIcon
           
 long activeThresholdTime
           
 org.eclipse.swt.widgets.Composite body
           
 org.eclipse.swt.widgets.TableColumn[] cols
           
 HashtableSet expanded
           
 java.util.Hashtable history
           
 org.eclipse.swt.graphics.Image inactiveIcon
           
 org.eclipse.swt.widgets.Label label
           
 org.eclipse.swt.graphics.Font labelFont
           
 Mapper mapper
           
 java.lang.String name
           
 int numNew
           
 org.eclipse.swt.widgets.Composite parent
           
 org.eclipse.swt.widgets.Label seenLabel
           
 boolean showGPS
           
 org.eclipse.swt.custom.TableTree table
           
 org.eclipse.swt.graphics.Font tableFont
           
 org.eclipse.jface.viewers.TableTreeViewer viewer
           
 
Constructor Summary
BeaconTableController(java.lang.String name, org.eclipse.swt.graphics.Font labelFont, org.eclipse.swt.graphics.Font tableFont, org.eclipse.swt.widgets.Composite parent, Mapper mapper, long activeThresholdTime)
           
BeaconTableController(java.lang.String name, org.eclipse.swt.graphics.Font labelFont, org.eclipse.swt.graphics.Font tableFont, org.eclipse.swt.widgets.Composite parent, Mapper mapper, long activeThresholdTime, boolean shouldShowGPS)
           
 
Method Summary
 void addMeasurement(BeaconMeasurement meas, GPSMeasurement gps)
           
protected  void addReadingToHistory(BeaconHistory.BeaconHistoryHelper reading)
           
protected  void build()
           
protected  void buildColumns()
           
protected  void buildColumns(java.lang.String[] names)
           
 void expandHistoryPackage(org.eclipse.swt.custom.TableTreeItem item)
           
protected  org.eclipse.swt.graphics.Image getActiveIcon()
           
protected  org.eclipse.swt.graphics.Image getInactiveIcon()
           
static java.lang.String humanReadableTime(long timestamp)
           
protected  java.lang.Class minimumBeaconClass()
           
protected  void setHistoryTableItemText(org.eclipse.swt.custom.TableTreeItem item, BeaconHistory.BeaconHistoryHelper h)
           
protected  void updateHistoryTable()
           
protected  void updateSeenLabel()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

public org.eclipse.swt.widgets.Label label

table

public org.eclipse.swt.custom.TableTree table

cols

public org.eclipse.swt.widgets.TableColumn[] cols

parent

public org.eclipse.swt.widgets.Composite parent

name

public java.lang.String name

labelFont

public org.eclipse.swt.graphics.Font labelFont

tableFont

public org.eclipse.swt.graphics.Font tableFont

mapper

public Mapper mapper

body

public org.eclipse.swt.widgets.Composite body

activeIcon

public org.eclipse.swt.graphics.Image activeIcon

inactiveIcon

public org.eclipse.swt.graphics.Image inactiveIcon

viewer

public org.eclipse.jface.viewers.TableTreeViewer viewer

showGPS

public boolean showGPS

active

public java.util.Hashtable active

history

public java.util.Hashtable history

expanded

public HashtableSet expanded

seenLabel

public org.eclipse.swt.widgets.Label seenLabel

activeThresholdTime

public long activeThresholdTime

numNew

public int numNew
Constructor Detail

BeaconTableController

public BeaconTableController(java.lang.String name,
                             org.eclipse.swt.graphics.Font labelFont,
                             org.eclipse.swt.graphics.Font tableFont,
                             org.eclipse.swt.widgets.Composite parent,
                             Mapper mapper,
                             long activeThresholdTime)

BeaconTableController

public BeaconTableController(java.lang.String name,
                             org.eclipse.swt.graphics.Font labelFont,
                             org.eclipse.swt.graphics.Font tableFont,
                             org.eclipse.swt.widgets.Composite parent,
                             Mapper mapper,
                             long activeThresholdTime,
                             boolean shouldShowGPS)
Method Detail

build

protected void build()

buildColumns

protected void buildColumns()

buildColumns

protected void buildColumns(java.lang.String[] names)

expandHistoryPackage

public void expandHistoryPackage(org.eclipse.swt.custom.TableTreeItem item)

setHistoryTableItemText

protected void setHistoryTableItemText(org.eclipse.swt.custom.TableTreeItem item,
                                       BeaconHistory.BeaconHistoryHelper h)

addMeasurement

public void addMeasurement(BeaconMeasurement meas,
                           GPSMeasurement gps)

addReadingToHistory

protected void addReadingToHistory(BeaconHistory.BeaconHistoryHelper reading)

humanReadableTime

public static java.lang.String humanReadableTime(long timestamp)

updateHistoryTable

protected void updateHistoryTable()

getActiveIcon

protected org.eclipse.swt.graphics.Image getActiveIcon()

getInactiveIcon

protected org.eclipse.swt.graphics.Image getInactiveIcon()

updateSeenLabel

protected void updateSeenLabel()

minimumBeaconClass

protected java.lang.Class minimumBeaconClass()