|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.bbn.openmap.MapHandlerChild
|
+--com.bbn.openmap.OMComponent
|
+--com.bbn.openmap.graphicLoader.AbstractGraphicLoader
|
+--com.bbn.openmap.graphicLoader.MMLGraphicLoader
|
+--com.bbn.openmap.graphicLoader.scenario.ScenarioGraphicLoader
The ScenarioGraphicLoader contains all the ScenarioGraphics and manages the time for the scenario. The different organization objects are represented in a location file that lists a name and an icon URL. An activities file lists the different steps for the organizations - where they are (lat/lon) and when. A timer in the loader positions the organizations for that time, interpolating location for times between time/location definitions. If an organization stops to wait in a position, two activity locations should be defined for that stop, for when the organization arrived to that spot and when then left. Different properties need to be set for the ScenarioGraphicLoader to let it know how the files, Comma Separated Value (CSV) files, should be interpreted.
The ScenarioGraphicLoader also lets you define different steps for how to control the time, i.e. the timer rate. The clock interval for the timer rate is measured in milliseconds, specifying how often the map should be updated. Note that the more often the map is updated, the more unresponsive the map can become. The pace for the timer rate is how much 'senario time' passes for each time the clock updates. You can define those steps in different formats, but the default format for the pace is hh:mm:ss for hours:minutes:seconds.
Sample properties:
scenario.class=com.bbn.openmap.graphicLoader.scenario.ScenarioGraphicLoader scenario.prettyName=Test Scenario scenario.locationFile=org-list.csv scenario.locationFileHasHeader=true scenario.nameIndex=0 scenario.iconIndex=5 scenario.activityFile=org-activities.csv scenario.activityFileHasHeader=true scenario.activityNameIndex=1 scenario.latIndex=9 scenario.lonIndex=10 scenario.timeFormat=d-MMM-yyyy HH:mm scenario.timeIndex=7 # If no icon defined, used for org. location markers edge. scenario.lineColor=aaaaaa33 # If no icon defined, used for org. location markers fill. scenario.fillColor=aaaaaa33 # Used for lines for total scenario paths scenario.selectColor=aaaa0000 scenario.timerRates=vs s m a q f vf scenario.vs.prettyName=Very Slow scenario.vs.clockIntervalMillis=2000 scenario.vs.pace=00:06:00 scenario.s.prettyName=Slow scenario.s.clockIntervalMillis=1000 scenario.s.pace=00:06:00 scenario.m.prettyName=Moderate scenario.m.clockIntervalMillis=400 scenario.m.pace=00:06:00 scenario.a.prettyName=Average scenario.a.clockIntervalMillis=200 scenario.a.pace=00:06:00 scenario.q.prettyName=Quick scenario.q.clockIntervalMillis=100 scenario.q.pace=00:06:00 scenario.f.prettyName=Fast scenario.f.clockIntervalMillis=40 scenario.f.pace=00:06:00 scenario.vf.prettyName=Very Fast scenario.vf.clockIntervalMillis=10 scenario.vf.pace=01:00:00
| Nested Class Summary | |
class |
ScenarioGraphicLoader.ScenarioGraphicList
An OMGraphicList that knows what a ScenarioGraphic is, and knows when to tell it to draw itself at a particular time, or if it should draw its entire scenario path. |
class |
ScenarioGraphicLoader.TimerRateHolder
A convenience class that keeps track of a relationship between real-time changes and scenario-time changes. |
| Field Summary | |
protected java.lang.String |
activityFile
|
static java.lang.String |
ActivityFileProperty
activityFile |
protected boolean |
activityHeader
|
static java.lang.String |
ActivityHeaderProperty
activityFileHasHeader |
protected int |
activityNameIndex
|
static java.lang.String |
ActivityNameIndexProperty
activityNameIndex |
protected int |
clockDirection
|
static java.lang.String |
ClockIntervalProperty
clockIntervalMillis |
protected DataBounds |
dataBounds
|
protected java.lang.String |
defaultIconURL
Icon URL for points to use as default. |
static java.lang.String |
DefaultIconURLProperty
defaultURL |
static java.lang.String |
DefaultPaceBaselineString
|
static java.lang.String |
DefaultTimerIntervalFormat
|
protected DrawingAttributes |
drawingAttributes
|
protected boolean |
eastIsNeg
|
static java.lang.String |
EastIsNegProperty
eastIsNeg |
protected long |
endTime
|
protected int |
iconIndex
|
static java.lang.String |
IconIndexProperty
iconIndex |
protected int |
latIndex
|
static java.lang.String |
LatIndexProperty
latIndex |
protected java.lang.String |
locationFile
|
static java.lang.String |
LocationFileProperty
locationFile |
protected boolean |
locationHeader
|
static java.lang.String |
LocationHeaderProperty
locationFileHasHeader |
protected int |
lonIndex
|
static java.lang.String |
LonIndexProperty
lonIndex |
protected java.lang.String |
mode
|
protected int |
nameIndex
|
static java.lang.String |
NameIndexProperty
nameIndex |
static java.lang.String |
PaceProperty
pace |
protected java.beans.PropertyChangeSupport |
pcs
|
static java.lang.String |
SCENARIO_MODE_CMD
|
protected ScenarioGraphicLoader.ScenarioGraphicList |
scenarioGraphics
|
protected boolean |
showNames
|
static java.lang.String |
ShowNamesProperty
showNames |
static java.lang.String |
SNAPSHOT_SCENARIO_MODE
|
protected java.lang.String |
snapshotIconName
|
protected long |
startTime
|
protected long |
time
|
protected java.util.Date |
timeDate
|
protected java.text.SimpleDateFormat |
timeFormat
TimeFormat default is similar to IETF standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT" represented by (EEE, d MMM yyyy HH:mm:ss z), except for the local timezone. |
static java.lang.String |
TimeFormatProperty
timeFormat |
protected int |
timeIncrement
|
protected int |
timeIndex
|
static java.lang.String |
TimeIndexProperty
timeIndex |
protected javax.swing.JLabel |
timeLabel
|
protected TimerControlButtonPanel |
timerControl
|
protected java.text.SimpleDateFormat |
timerIntervalFormat
The TimerIntervalFormat controls how the pace can be specified for the rate settings. |
static java.lang.String |
TimerIntervalFormatProperty
timerInvervalFormat |
static java.lang.String |
TimerPaceBaselineProperty
timerPaceBaseline |
protected java.lang.String |
timerPaceBaselineString
|
protected TimerRateComboBox |
timerRateControl
|
protected java.util.LinkedList |
timerRates
|
static java.lang.String |
TimerRatesProperty
timerRates |
protected javax.swing.JSlider |
timeSlider
|
protected TimeSliderSupport |
timeSliderSupport
|
protected boolean |
timeWrap
|
protected javax.swing.JToggleButton |
timeWrapToggle
|
static java.lang.String |
TOTAL_SCENARIO_MODE
|
protected java.lang.String |
totalScenarioIconName
|
| Fields inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader |
DO_NOT_UPDATE_TIMER, name, NameProperty, proj, receiver, timer, TimerCmd, updateInterval |
| Fields inherited from class com.bbn.openmap.OMComponent |
i18n, propertyPrefix |
| Fields inherited from class com.bbn.openmap.MapHandlerChild |
beanContextChildSupport |
| Fields inherited from interface com.bbn.openmap.gui.time.TimeConstants |
TIMER_BACKWARD, TIMER_FORWARD, TIMER_INACTIVE, TIMER_RUNNING_STATUS, TIMER_STEP_BACKWARD, TIMER_STEP_FORWARD, TIMER_STOPPED, TIMER_TIME_STATUS |
| Fields inherited from interface com.bbn.openmap.PropertyConsumer |
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty |
| Constructor Summary | |
ScenarioGraphicLoader()
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent ae)
ActionListener interface, gets called when the timer goes ping if their isn't a command with the ActionEvent. |
protected void |
changeTimeBy(long amount)
Call setTime with the amount given added to the current time. |
protected void |
changeTimeBy(long amount,
boolean wrapAroundTimeLimits)
Call setTime with the amount given added to the current time. |
void |
componentHidden(java.awt.event.ComponentEvent ce)
|
void |
componentMoved(java.awt.event.ComponentEvent ce)
|
void |
componentResized(java.awt.event.ComponentEvent ce)
|
void |
componentShown(java.awt.event.ComponentEvent ce)
|
ScenarioGraphicLoader.ScenarioGraphicList |
createData()
Read the data files and construct the ScenarioPoints. |
int |
getClockDirection()
Get whether time increases or decreases when the clock is run. |
DataBounds |
getDataBounds()
DataBoundsProvider method. |
java.awt.Container |
getFace()
Tool Method. |
java.lang.String |
getKey()
Tool Method. |
int |
getPace()
Get the number of scenario units that pass when the timer updates within its interval. |
java.util.Properties |
getProperties(java.util.Properties props)
PropertyConsumer method, to fill in a Properties object, reflecting the current values of the layer. |
java.util.Properties |
getPropertyInfo(java.util.Properties list)
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. |
long |
getTime()
Get the current time value for the timer. |
void |
manageGraphics()
The main method call in the ScenarioGraphicLoader that actually modifies the OMGraphics and updates the map. |
void |
setClockDirection(int direction)
Set whether time increases or decreases when the clock is run. |
void |
setKey(java.lang.String aKey)
Tool Method. |
void |
setPace(int pace)
Set the number of scenario units that pass when the timer updates within its interval. |
void |
setProperties(java.lang.String prefix,
java.util.Properties properties)
The properties and prefix are managed and decoded here, for the standard uses of the ScenarioGraphicLoader. |
void |
setTime(long t)
Set the current time value for the timer. |
void |
startClock()
Start the timer. |
void |
stepBackward()
Move the clock back one clock interval. |
void |
stepForward()
Move the clock forward one clock interval. |
void |
stopClock()
Stop the timer. |
| Methods inherited from class com.bbn.openmap.graphicLoader.MMLGraphicLoader |
getMouseModeServiceList, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased |
| Methods inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader |
createTimer, getGUI, getName, getProjection, getReceiver, getTimer, getUpdateInterval, setName, setProjection, setReceiver, setTimer, setUpdateInterval |
| Methods inherited from class com.bbn.openmap.OMComponent |
getPropertyPrefix, setProperties, setPropertyPrefix |
| Methods inherited from class com.bbn.openmap.MapHandlerChild |
addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bbn.openmap.util.DataBoundsProvider |
getName |
| Methods inherited from interface com.bbn.openmap.gui.time.RealTimeHandler |
getUpdateInterval, setUpdateInterval |
| Field Detail |
public static final java.lang.String TOTAL_SCENARIO_MODE
public static final java.lang.String SNAPSHOT_SCENARIO_MODE
public static final java.lang.String SCENARIO_MODE_CMD
public static final java.lang.String DefaultTimerIntervalFormat
public static final java.lang.String DefaultPaceBaselineString
protected java.lang.String totalScenarioIconName
protected java.lang.String snapshotIconName
public static final java.lang.String LocationFileProperty
public static final java.lang.String LocationHeaderProperty
public static final java.lang.String IconIndexProperty
public static final java.lang.String NameIndexProperty
public static final java.lang.String ActivityFileProperty
public static final java.lang.String ActivityNameIndexProperty
public static final java.lang.String ActivityHeaderProperty
public static final java.lang.String LatIndexProperty
public static final java.lang.String LonIndexProperty
public static final java.lang.String TimeIndexProperty
public static final java.lang.String EastIsNegProperty
public static final java.lang.String ShowNamesProperty
public static final java.lang.String DefaultIconURLProperty
public static final java.lang.String TimeFormatProperty
public static final java.lang.String TimerIntervalFormatProperty
public static final java.lang.String TimerPaceBaselineProperty
public static final java.lang.String ClockIntervalProperty
public static final java.lang.String PaceProperty
public static final java.lang.String TimerRatesProperty
protected java.lang.String locationFile
protected boolean locationHeader
protected int nameIndex
protected int iconIndex
protected java.lang.String activityFile
protected boolean activityHeader
protected int activityNameIndex
protected int latIndex
protected int lonIndex
protected int timeIndex
protected boolean eastIsNeg
protected java.text.SimpleDateFormat timeFormat
protected java.text.SimpleDateFormat timerIntervalFormat
protected java.lang.String timerPaceBaselineString
protected long startTime
protected long endTime
protected long time
protected int timeIncrement
protected java.lang.String mode
protected boolean timeWrap
protected int clockDirection
protected java.lang.String defaultIconURL
protected boolean showNames
protected java.beans.PropertyChangeSupport pcs
protected ScenarioGraphicLoader.ScenarioGraphicList scenarioGraphics
protected java.util.LinkedList timerRates
protected DrawingAttributes drawingAttributes
protected DataBounds dataBounds
protected java.util.Date timeDate
protected javax.swing.JToggleButton timeWrapToggle
protected javax.swing.JLabel timeLabel
protected TimerControlButtonPanel timerControl
protected TimerRateComboBox timerRateControl
protected javax.swing.JSlider timeSlider
protected TimeSliderSupport timeSliderSupport
| Constructor Detail |
public ScenarioGraphicLoader()
| Method Detail |
public void manageGraphics()
manageGraphics in class AbstractGraphicLoaderOMGraphicHandler.setList(OMGraphicList)public void setPace(int pace)
RealTimeHandler
setPace in interface RealTimeHandlerpace - a number that means something to the
RealTimeHandler.public int getPace()
RealTimeHandler
getPace in interface RealTimeHandlerpublic long getTime()
RealTimeHandler
getTime in interface RealTimeHandlerpublic void setTime(long t)
RealTimeHandler
setTime in interface RealTimeHandlert - public void startClock()
RealTimeHandler
startClock in interface RealTimeHandlerpublic void stopClock()
RealTimeHandler
stopClock in interface RealTimeHandlerpublic void setClockDirection(int direction)
setClockDirection in interface RealTimeHandlerpublic int getClockDirection()
getClockDirection in interface RealTimeHandlerprotected void changeTimeBy(long amount)
This method calls changeTimeBy(amount, wrapAroundTimeLimits), with wrapAroundTimeLimits being true of the mode of the ScenarioGraphicLoader is SNAPSHOT_SCENARIO_MODE.
amount - to change the current time by, in milliseconds.
protected void changeTimeBy(long amount,
boolean wrapAroundTimeLimits)
amount - to change the current time by, in milliseconds.wrapAroundTimeLimits - if true, the time will be set as if
the start and end times ofthe scenario are connected, so
that moving the time past the time scale in either
direction will put the time at the other end of the
scale.public void stepForward()
stepForward in interface RealTimeHandlerpublic void stepBackward()
stepBackward in interface RealTimeHandlerpublic void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed in interface java.awt.event.ActionListeneractionPerformed in class AbstractGraphicLoaderpublic ScenarioGraphicLoader.ScenarioGraphicList createData()
public void setProperties(java.lang.String prefix,
java.util.Properties properties)
setProperties in interface PropertyConsumersetProperties in class AbstractGraphicLoaderprefix - string prefix used in the properties file for
this layer.properties - the properties set in the properties file.public java.util.Properties getProperties(java.util.Properties props)
getProperties in interface PropertyConsumergetProperties in class AbstractGraphicLoaderprops - a Properties object to load the PropertyConsumer
properties into.
public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo in interface PropertyConsumergetPropertyInfo in class AbstractGraphicLoaderlist - a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public java.awt.Container getFace()
getFace in interface Toolpublic java.lang.String getKey()
getKey in interface Toolpublic void setKey(java.lang.String aKey)
setKey in interface ToolaKey - The key for this tool.public DataBounds getDataBounds()
getDataBounds in interface DataBoundsProviderpublic void componentResized(java.awt.event.ComponentEvent ce)
componentResized in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent ce)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentHidden(java.awt.event.ComponentEvent ce)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent ce)
componentShown in interface java.awt.event.ComponentListener
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||