ru.igis.omtab
Class RuNA

java.lang.Object
  extended by com.bbn.openmap.MapHandlerChild
      extended by com.bbn.openmap.OMComponent
          extended by com.bbn.openmap.graphicLoader.AbstractGraphicLoader
              extended by com.bbn.openmap.graphicLoader.MMLGraphicLoader
                  extended by ru.igis.omtab.RuNA
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.graphicLoader.GraphicLoader, com.bbn.openmap.LightMapHandlerChild, com.bbn.openmap.PropertyConsumer, java.awt.event.ActionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener

public class RuNA
extends com.bbn.openmap.graphicLoader.MMLGraphicLoader

Class supporting simulation

Author:
Ru

Field Summary
 
Fields inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
NameProperty, TimerCmd
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
RuNA()
          Default constructor
 
Method Summary
 void addHourAction(RepeatAction ra)
          Register new Repeat Action for executing every hour
 MapOb addMapOb(edu.stanford.smi.protege.model.Instance inst)
          Create from Instance and add to RuNA Map Object
 void addMapOb(MapOb mo)
          Add to RuNA new Map Object.
 void addMapObs()
          Add Map Obs with picking Instances by user Dialog
 void addMapObs(java.util.Collection<?> inss)
          Add Map obs from the collection of Instances
 void addMinuteAction(RepeatAction ra)
          Register new Repeat Action for executing every minute
 void addSecondAction(RepeatAction ra)
          Register new Repeat Action for executing every second
 void addTaskExecutor(TaskExecutor ta)
          Registering new Task Executor
 void clearHourActions()
          Remove at once all existing Repeat Actions for every hour
 void clearMapObs(java.util.Collection<edu.stanford.smi.protege.model.Instance> col, boolean kbdelete)
          Delete from RuNA Map Objects corresponding to Instances from Collection.
 void clearMinuteActions()
          Remove at once all existing Repeat Actions for every minute
 void clearSecondActions()
          Remove at once all existing Repeat Actions for every second
 void clearTaskExecutors()
          Remove all registered Task Executors atonce
 void cmdAddObsToMap()
          Handler of button AddObsToMap click
 void cmdControlObject()
          Handler of button Control Object
 void cmdMapBackObjects()
          Handler of button MapBackObjects
 void cmdRemObsFromMap()
          Handler of button RemObsFromMap click
 void cmdRemoveRepeatActions()
          Handler of Menu Item Remove Repeat Actions click
 void cmdStartRepeatActions()
          Handler of Menu Item Start Repeat Actions click
 void controlObject(edu.stanford.smi.protege.model.Instance inst)
          Search for the Navigating Object corresponding to this Instance and call method control on it
 void findAndInit(java.lang.Object obj)
          Standard OpenMap interface LightMapHandlerChild method.
 void findAndUndo(java.lang.Object obj)
          Standard OpenMap interface LightMapHandlerChild method.
 Clock getClock()
          Return Clock object
 java.lang.String getCommand()
          Return contains of slot scenario of picked by user Instanse of class Command or its subclass that is a value of slot commandSubclass of first instance of class RuNA in Protege
 java.awt.Component getGUI()
          Return Runa Panel
 java.util.Collection<edu.stanford.smi.protege.model.Instance> getKbObs()
           
 com.bbn.openmap.event.MapMouseListener getMapMouseListener()
           
 MapOb getMapOb(edu.stanford.smi.protege.model.Instance instance)
          Search Map Object for Instance
 MapOb getMapOb(java.lang.String label)
          Search Map Object by name
 com.bbn.openmap.omGraphics.OMGraphicList getMapObs()
           
 java.lang.Object[] getMovingNavObs(java.lang.String[] typs)
          Gives an array of mooving Map Objects for the array of their names
 MultiUser getMultiUser()
           
 java.lang.Object[] getNavObs(java.lang.String[] typs)
          Gives an array of Map Objects for the array of their types.
 RuMapMouseAdapter getRuMapMouseAdapter()
           
 com.bbn.openmap.plugin.PlugInLayer getRuNAPlugInLayer()
           
 java.lang.String getScenario()
          Method that return contains of scenario slot of the first instance of class RuNA in Protege
 java.lang.String getTimeScale()
           
 java.util.Collection<MapOb> inOMTPolies(MapOb mo)
          Search polygons containing Map Object
 boolean isTimerRunning()
           
 void manageGraphics()
          Standard OpenMap method
 void mapBackMapObs(java.util.Collection<edu.stanford.smi.protege.model.Instance> col)
          Write back to Protege changed attributies of Map Objects into slots of corresponding Instances
 boolean mouseClicked(java.awt.event.MouseEvent e)
          Called whenever the mouse is clicked by the user and one of the requested mouse modes is active.
 void mouseMoved()
          Called whenever the mouse is moved on this layer and one of the requested mouse modes is active, and the gesture is consumed by another active layer.
 boolean mouseMoved(java.awt.event.MouseEvent e)
          Called whenever the mouse is moved on this layer and one of the requested mouse modes is active.
 void removeHourAction(RepeatAction ra)
          Remove existing Repeat Action calling every second
 void removeMapOb(MapOb mo, boolean kbdelete)
          Remove from RuNA existing Map Object
 void removeMinuteAction(RepeatAction ra)
          Remove existing Repeat Action calling every second
 boolean removeRepeatAction(edu.stanford.smi.protege.model.Instance inst)
          Remove RepeatAction from Instance return false if RA was not started
 void removeRepeatActions(java.util.Collection<edu.stanford.smi.protege.model.Instance> inss)
          Remove RepeatActions from the collection of Instances
 void removeSecondAction(RepeatAction ra)
          Remove existing Repeat Action calling every second
 void removeTaskExecutor(TaskExecutor ta)
          Remove existing Task Executor
 void setMultiUser(MultiUser multiUser)
           
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Standard OpenMap Component method
 void setReflectNavOb(boolean flag)
           
 void setRuMapMouseAdapter(RuMapMouseAdapter ruMMAdapter)
           
 void setTimerRunning(boolean timerRunning)
           
 void setTimeScale(java.lang.String timeScale)
          Set new time scale
 boolean startRepeatAction(edu.stanford.smi.protege.model.Instance inst)
          Start RepeatAction from Instance return false if it is already started or of error
 void startRepeatActions(java.util.Collection<?> inss)
          Start RepeatActions from the collection of Instances
 
Methods inherited from class com.bbn.openmap.graphicLoader.MMLGraphicLoader
getMouseModeServiceList, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
actionPerformed, createTimer, getName, getProjection, getProperties, getPropertyInfo, 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, firePropertyChange, fireVetoableChange, getBeanContext, isIsolated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setIsolated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuNA

public RuNA()
Default constructor

Method Detail

getRuNAPlugInLayer

public com.bbn.openmap.plugin.PlugInLayer getRuNAPlugInLayer()

manageGraphics

public void manageGraphics()
Standard OpenMap method

Specified by:
manageGraphics in class com.bbn.openmap.graphicLoader.AbstractGraphicLoader

addTaskExecutor

public void addTaskExecutor(TaskExecutor ta)
Registering new Task Executor

Parameters:
ta - - program called on button Task on NavOb Form click

removeTaskExecutor

public void removeTaskExecutor(TaskExecutor ta)
Remove existing Task Executor

Parameters:
ta - - program called on button Task on NavOb Form click

clearTaskExecutors

public void clearTaskExecutors()
Remove all registered Task Executors atonce


addSecondAction

public void addSecondAction(RepeatAction ra)
Register new Repeat Action for executing every second

Parameters:
ra - - class incapsulating the program called periodically

addMinuteAction

public void addMinuteAction(RepeatAction ra)
Register new Repeat Action for executing every minute

Parameters:
ra - - class incapsulating the program called periodically

addHourAction

public void addHourAction(RepeatAction ra)
Register new Repeat Action for executing every hour

Parameters:
ra - - class incapsulating the program called periodically

removeSecondAction

public void removeSecondAction(RepeatAction ra)
Remove existing Repeat Action calling every second

Parameters:
ra - - class incapsulating the program called periodically

removeMinuteAction

public void removeMinuteAction(RepeatAction ra)
Remove existing Repeat Action calling every second

Parameters:
ra - - class incapsulating the program called periodically

removeHourAction

public void removeHourAction(RepeatAction ra)
Remove existing Repeat Action calling every second

Parameters:
ra - - class incapsulating the program called periodically

clearSecondActions

public void clearSecondActions()
Remove at once all existing Repeat Actions for every second


clearMinuteActions

public void clearMinuteActions()
Remove at once all existing Repeat Actions for every minute


clearHourActions

public void clearHourActions()
Remove at once all existing Repeat Actions for every hour


addMapObs

public void addMapObs()
Add Map Obs with picking Instances by user Dialog


addMapObs

public void addMapObs(java.util.Collection<?> inss)
Add Map obs from the collection of Instances

Parameters:
inss - - collection of Instances representing Map Obs in Protege

addMapOb

public MapOb addMapOb(edu.stanford.smi.protege.model.Instance inst)
Create from Instance and add to RuNA Map Object

Parameters:
inst - - Intstance representing Map Object in Protege
Returns:
Map Object

clearMapObs

public void clearMapObs(java.util.Collection<edu.stanford.smi.protege.model.Instance> col,
                        boolean kbdelete)
Delete from RuNA Map Objects corresponding to Instances from Collection. If Collection is nil then delete all Map Objects from RuNA. Simalteniously with Map Objects can delete Instances corresponding them from Protege

Parameters:
col - - Instances corresponding to Map Objects
kbdelete - - should Instances be deleted

mapBackMapObs

public void mapBackMapObs(java.util.Collection<edu.stanford.smi.protege.model.Instance> col)
                   throws java.lang.Exception
Write back to Protege changed attributies of Map Objects into slots of corresponding Instances

Parameters:
col - - Instances corresponding existing in RuNA Map Objects
Throws:
java.lang.Exception - -

getGUI

public java.awt.Component getGUI()
Return Runa Panel

Specified by:
getGUI in interface com.bbn.openmap.graphicLoader.GraphicLoader
Overrides:
getGUI in class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
Returns:
Runa Panel

cmdAddObsToMap

public void cmdAddObsToMap()
Handler of button AddObsToMap click


cmdRemObsFromMap

public void cmdRemObsFromMap()
Handler of button RemObsFromMap click


setTimeScale

public void setTimeScale(java.lang.String timeScale)
Set new time scale

Parameters:
timeScale - - new time scale

getTimeScale

public java.lang.String getTimeScale()
Returns:
Returns the timeScale.

cmdControlObject

public void cmdControlObject()
Handler of button Control Object


cmdMapBackObjects

public void cmdMapBackObjects()
Handler of button MapBackObjects


cmdStartRepeatActions

public void cmdStartRepeatActions()
Handler of Menu Item Start Repeat Actions click


startRepeatActions

public void startRepeatActions(java.util.Collection<?> inss)
Start RepeatActions from the collection of Instances

Parameters:
inss - - collection of Instances of class RepeatAction in Protege

startRepeatAction

public boolean startRepeatAction(edu.stanford.smi.protege.model.Instance inst)
Start RepeatAction from Instance return false if it is already started or of error

Parameters:
inst - - Intstance of class RepeatAction in Protege

cmdRemoveRepeatActions

public void cmdRemoveRepeatActions()
Handler of Menu Item Remove Repeat Actions click


removeRepeatAction

public boolean removeRepeatAction(edu.stanford.smi.protege.model.Instance inst)
Remove RepeatAction from Instance return false if RA was not started

Parameters:
inst - - Intstance of class RepeatAction in Protege

removeRepeatActions

public void removeRepeatActions(java.util.Collection<edu.stanford.smi.protege.model.Instance> inss)
Remove RepeatActions from the collection of Instances

Parameters:
inss - - collection of Instances of class RepeatAction in Protege

controlObject

public void controlObject(edu.stanford.smi.protege.model.Instance inst)
Search for the Navigating Object corresponding to this Instance and call method control on it

Parameters:
inst - - Instance corresponding to Navigating Object

getMapOb

public MapOb getMapOb(java.lang.String label)
Search Map Object by name

Parameters:
label - - name of Map Object
Returns:
Map Object

inOMTPolies

public java.util.Collection<MapOb> inOMTPolies(MapOb mo)
Search polygons containing Map Object

Parameters:
mo - - Map Object
Returns:
collection of OMTPoly objects

getMapOb

public MapOb getMapOb(edu.stanford.smi.protege.model.Instance instance)
Search Map Object for Instance

Parameters:
instance - - Protege Instance corresponding this Map Object
Returns:
Map Object

getNavObs

public java.lang.Object[] getNavObs(java.lang.String[] typs)
Gives an array of Map Objects for the array of their types. If array of types is empty return all Map Objects

Parameters:
typs - - array of Map Object names
Returns:
Array of Map Objects

getMovingNavObs

public java.lang.Object[] getMovingNavObs(java.lang.String[] typs)
Gives an array of mooving Map Objects for the array of their names

Parameters:
typs - - array of Map Object names
Returns:
Array of Map Objects

addMapOb

public void addMapOb(MapOb mo)
Add to RuNA new Map Object. If Map Object with the same name exists then it is removed first

Parameters:
mo - - new Map Object

removeMapOb

public void removeMapOb(MapOb mo,
                        boolean kbdelete)
Remove from RuNA existing Map Object

Parameters:
mo - - Map Object to remove
kbdelete - Should corresponding Protege Instance be removed too

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties props)
Standard OpenMap Component method

Specified by:
setProperties in interface com.bbn.openmap.PropertyConsumer
Overrides:
setProperties in class com.bbn.openmap.graphicLoader.AbstractGraphicLoader
Parameters:
prefix - - propery prefix
props - - OpenMap properties object

getScenario

public java.lang.String getScenario()
Method that return contains of scenario slot of the first instance of class RuNA in Protege

Returns:
- contains of scenario slot

getCommand

public java.lang.String getCommand()
Return contains of slot scenario of picked by user Instanse of class Command or its subclass that is a value of slot commandSubclass of first instance of class RuNA in Protege

Returns:
- command String

getClock

public Clock getClock()
Return Clock object

Returns:
- Clock object

findAndInit

public void findAndInit(java.lang.Object obj)
Standard OpenMap interface LightMapHandlerChild method. Search for RunaControlPanel and set it for this RuNA object and also send it to Clock object

Specified by:
findAndInit in interface com.bbn.openmap.LightMapHandlerChild
Overrides:
findAndInit in class com.bbn.openmap.MapHandlerChild
Parameters:
obj - - serched object

findAndUndo

public void findAndUndo(java.lang.Object obj)
Standard OpenMap interface LightMapHandlerChild method. Set to null links to RunaControlPanel in this object and in Clock object

Specified by:
findAndUndo in interface com.bbn.openmap.LightMapHandlerChild
Overrides:
findAndUndo in class com.bbn.openmap.MapHandlerChild
Parameters:
obj - - searched object

setReflectNavOb

public void setReflectNavOb(boolean flag)

getMapObs

public com.bbn.openmap.omGraphics.OMGraphicList getMapObs()
Returns:
Returns the mapObs.

isTimerRunning

public boolean isTimerRunning()
Returns:
Returns the timerRunning.

setTimerRunning

public void setTimerRunning(boolean timerRunning)
Parameters:
timerRunning - The timerRunning to set.

getMultiUser

public MultiUser getMultiUser()
Returns:
Returns the multiUser.

setMultiUser

public void setMultiUser(MultiUser multiUser)
Parameters:
multiUser - The multiUser to set.

getKbObs

public java.util.Collection<edu.stanford.smi.protege.model.Instance> getKbObs()
Returns:
Returns collection of instances corresponding to list of mapObs.

getMapMouseListener

public com.bbn.openmap.event.MapMouseListener getMapMouseListener()

mouseMoved

public boolean mouseMoved(java.awt.event.MouseEvent e)
Called whenever the mouse is moved on this layer and one of the requested mouse modes is active.

Tries to locate a graphic near the mouse, and if it is found, it selected.

Specified by:
mouseMoved in interface com.bbn.openmap.event.MapMouseListener
Overrides:
mouseMoved in class com.bbn.openmap.graphicLoader.MMLGraphicLoader
Parameters:
e - the move event
Returns:
true if event was consumed (handled), false otherwise
See Also:
MMLGraphicLoader.getMouseModeServiceList()

mouseMoved

public void mouseMoved()
Called whenever the mouse is moved on this layer and one of the requested mouse modes is active, and the gesture is consumed by another active layer. We need to deselect anything that may be selected.

Specified by:
mouseMoved in interface com.bbn.openmap.event.MapMouseListener
Overrides:
mouseMoved in class com.bbn.openmap.graphicLoader.MMLGraphicLoader
See Also:
MMLGraphicLoader.getMouseModeServiceList()

mouseClicked

public boolean mouseClicked(java.awt.event.MouseEvent e)
Called whenever the mouse is clicked by the user and one of the requested mouse modes is active.

Specified by:
mouseClicked in interface com.bbn.openmap.event.MapMouseListener
Overrides:
mouseClicked in class com.bbn.openmap.graphicLoader.MMLGraphicLoader
Parameters:
e - the click event
Returns:
true if event was consumed (handled), false otherwise
See Also:
MMLGraphicLoader.getMouseModeServiceList()

getRuMapMouseAdapter

public RuMapMouseAdapter getRuMapMouseAdapter()

setRuMapMouseAdapter

public void setRuMapMouseAdapter(RuMapMouseAdapter ruMMAdapter)