Package repast.simphony.ui
Class RSApplication
java.lang.Object
repast.simphony.ui.RSApplication
- All Implemented Interfaces:
TickListener
,RunListener
Main application mediator type object for Repast Simphony runtime.
- Author:
- Nick Collier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomUserPanel
(JPanel panel) boolean
close()
Closes the runtime application.void
createLayout
(saf.core.ui.dock.DockingManager manager) Creates the gui layout.void
Creates a new scenario through the new scenario wizard.Returns the current controller.Gets the error log.getGui()
Returns the application guistatic RSApplication
simphony.settings.SettingsRegistry
Gets the settings registry.boolean
void
initSim()
Initializes a simulation run.static boolean
isGui()
boolean
Checks to see the state of startSim.void
Loads and resets the current layout from a user selected file.void
open()
Opens a scenario via a directory chooser dialog.void
pause()
Pauses the simulation run.void
paused()
Invoked when the current run has been paused.void
void
reset()
Resets the gui and runtime infrastructure for another simulation run.void
Resets the layout to the initial layout.void
Invoked when the current run has been restarted after a pause.void
save()
Saves the current scenario.void
saveAs()
Saves the current scenario into a user specified scenario directory.void
Saves the current view layout as the default layout for the current scenario.Saves the current parameters to a parameters.xml file in the current scenario directory.void
Saves the current layout to a user selected file.void
start()
Starts a simulation run.void
started()
Invoked when the current run has been started.void
step()
Steps a simulation run forward a single step.void
stop()
Stops the simulation run.void
stopped()
Invoked when the current run has been stopped.protected void
void
tickCountUpdated
(double newTick) Called when the schedule increments the tick count.updateGuiParamsManager
(Parameters params, ParametersUI pui)
-
Constructor Details
-
RSApplication
-
-
Method Details
-
getProbeManager
-
isGui
public static boolean isGui() -
getRSApplicationInstance
-
addCustomUserPanel
-
hasCustomUserPanelDefined
public boolean hasCustomUserPanelDefined() -
removeCustomUserPanel
public void removeCustomUserPanel() -
initSim
public void initSim()Initializes a simulation run. This initializes both the run mechanism and the gui. -
isStartSim
public boolean isStartSim()Checks to see the state of startSim. Should be called from Event Dispatch Thread. -
start
public void start()Starts a simulation run. Initializes the run if necessary. -
step
public void step()Steps a simulation run forward a single step. -
pause
public void pause()Pauses the simulation run. -
stop
public void stop()Stops the simulation run. -
resetLayout
public void resetLayout()Resets the layout to the initial layout. -
saveLayout
public void saveLayout()Saves the current layout to a user selected file. -
saveAsDefaultLayout
public void saveAsDefaultLayout()Saves the current view layout as the default layout for the current scenario. -
loadLayout
public void loadLayout()Loads and resets the current layout from a user selected file. -
createNewScenario
public void createNewScenario()Creates a new scenario through the new scenario wizard. -
open
public void open()Opens a scenario via a directory chooser dialog. -
updateGuiParamsManager
-
reset
public void reset()Resets the gui and runtime infrastructure for another simulation run. -
saveAs
public void saveAs()Saves the current scenario into a user specified scenario directory. The directory itself is selected via directory chooser widget. -
saveCurrentParameters
Saves the current parameters to a parameters.xml file in the current scenario directory. -
save
public void save()Saves the current scenario. If the current scenario has not been saved, this is the equivalent of save as. -
close
public boolean close()Closes the runtime application.- Returns:
- true
-
storeSettings
protected void storeSettings() -
createLayout
public void createLayout(saf.core.ui.dock.DockingManager manager) Creates the gui layout.- Parameters:
manager
-
-
tickCountUpdated
public void tickCountUpdated(double newTick) Called when the schedule increments the tick count.- Specified by:
tickCountUpdated
in interfaceTickListener
- Parameters:
newTick
- the new tick value.
-
getController
Returns the current controller.- Returns:
- the current controller.
-
getGui
Returns the application gui- Returns:
- the application gui
-
getSettingsRegistry
public simphony.settings.SettingsRegistry getSettingsRegistry()Gets the settings registry.- Returns:
- the settings registry.
-
getCurrentScenario
-
paused
public void paused()Invoked when the current run has been paused.- Specified by:
paused
in interfaceRunListener
-
restarted
public void restarted()Invoked when the current run has been restarted after a pause.- Specified by:
restarted
in interfaceRunListener
-
started
public void started()Invoked when the current run has been started.- Specified by:
started
in interfaceRunListener
-
stopped
public void stopped()Invoked when the current run has been stopped.- Specified by:
stopped
in interfaceRunListener
-
getErrorLog
Gets the error log.- Returns:
-