Package repast.simphony.ui
Class RSGui
- java.lang.Object
-
- repast.simphony.ui.RSGui
-
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,saf.core.ui.event.DockableFrameListener
public class RSGui extends Object implements saf.core.ui.event.DockableFrameListener, PropertyChangeListener
Mediator for gui manipulation.- Version:
- $Revision: 1.2 $ $Date: 2006/01/03 15:24:30 $
- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description RSGui(saf.core.ui.dock.DockingManager dockingManager, ScenarioTree tree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCustomUserPanel(JPanel panel)
saf.core.ui.dock.DockableFrame
addLogView(String id, String title, JComponent comp)
ParametersUI
addParameterView(Parameters params, File currentDirectory, RSApplication rsApp)
void
addPlaceHolderUserPanel()
saf.core.ui.dock.DockableFrame
addProbeView(String id, String title, JPanel panel)
void
addRunOptionsView(RunOptionsModel model)
void
addViewListener(saf.core.ui.event.DockableFrameListener listener)
Adds the specified listener as a listener for view events.void
addViewsFromRegistry(GUIRegistry registry, ProbeManager probeManager)
saf.core.ui.dock.DockableFrame
addVizualization(String name, JComponent component)
void
dockableClosed(saf.core.ui.event.DockableFrameEvent viewEvent)
void
dockableClosing(saf.core.ui.event.DockableFrameEvent arg0)
void
dockableFloated(saf.core.ui.event.DockableFrameEvent viewEvent)
void
dockableFloating(saf.core.ui.event.DockableFrameEvent arg0)
void
dockableMaximized(saf.core.ui.event.DockableFrameEvent viewEvent)
void
dockableMaximizing(saf.core.ui.event.DockableFrameEvent evt)
void
dockableMinimized(saf.core.ui.event.DockableFrameEvent viewEvent)
void
dockableMinimizing(saf.core.ui.event.DockableFrameEvent evt)
void
dockableRestored(saf.core.ui.event.DockableFrameEvent viewEvent)
void
dockableRestoring(saf.core.ui.event.DockableFrameEvent arg0)
saf.core.ui.dock.DockableFrame
getDockable(String id)
JFrame
getFrame()
Gets the main application frame.TickCountFormatter
getTickCountFormatter()
Gets the current TickCountFormatter that is used to format the text in the tick label.JToolBar
getToolBar(JComponent comp)
boolean
hasCustomUserPanelDefined()
void
init(ErrorLog log)
void
propertyChange(PropertyChangeEvent evt)
Called when probed properties are updated.void
removeCustomUserPanel()
void
removeParameterViews()
void
removeViewListener(saf.core.ui.event.DockableFrameListener listener)
Removes the specified listener as a listener for view events.void
reset()
void
resetLayout(InputStream stream)
Resets the layout using a layout file that defines the initial state.void
saveLayout(File file)
Saves the current frame layout to the specified file.void
setActiveView(saf.core.ui.dock.DockableFrame dockable)
void
setGUIForModelLoaded()
void
setGUIForPaused()
void
setGUIForPostSimInit()
void
setGUIForStarted()
void
setGUIForStepped()
void
setGUIForStopped()
void
setStatusBarText(Color color, String text)
Sets the status bar to the specified text and text color.void
setStatusBarText(Font font, Color color, String text)
Sets the status bar to the specified text and text color.void
setStatusBarText(String text)
Sets the status bar to the specified text..void
setTickCountFormatter(TickCountFormatter formatter)
Sets the current TickCountFormatter that is used to format the text in the tick label.void
setTitle(String title)
void
showError(String title, String message)
Probe
updateProbePanel(Probe probe, MutableParameters params)
void
updateTickCountLabel(double newTick)
-
-
-
Constructor Detail
-
RSGui
public RSGui(saf.core.ui.dock.DockingManager dockingManager, ScenarioTree tree)
-
-
Method Detail
-
getDockable
public saf.core.ui.dock.DockableFrame getDockable(String id)
-
addLogView
public saf.core.ui.dock.DockableFrame addLogView(String id, String title, JComponent comp)
-
resetLayout
public void resetLayout(InputStream stream)
Resets the layout using a layout file that defines the initial state.
-
saveLayout
public void saveLayout(File file)
Saves the current frame layout to the specified file.- Parameters:
file
- the file to save the layout to
-
addVizualization
public saf.core.ui.dock.DockableFrame addVizualization(String name, JComponent component)
-
addViewListener
public void addViewListener(saf.core.ui.event.DockableFrameListener listener)
Adds the specified listener as a listener for view events. View events are such things as view closed, iconified, etc.- Parameters:
listener
- the listener to add
-
removeViewListener
public void removeViewListener(saf.core.ui.event.DockableFrameListener listener)
Removes the specified listener as a listener for view events. View events are such things as view closed, iconified, etc.- Parameters:
listener
- the listener to remove
-
addViewsFromRegistry
public void addViewsFromRegistry(GUIRegistry registry, ProbeManager probeManager)
-
reset
public void reset()
-
removeParameterViews
public void removeParameterViews()
-
updateProbePanel
public Probe updateProbePanel(Probe probe, MutableParameters params)
-
addPlaceHolderUserPanel
public void addPlaceHolderUserPanel()
-
addCustomUserPanel
public void addCustomUserPanel(JPanel panel)
-
hasCustomUserPanelDefined
public boolean hasCustomUserPanelDefined()
-
removeCustomUserPanel
public void removeCustomUserPanel()
-
addRunOptionsView
public void addRunOptionsView(RunOptionsModel model)
-
addParameterView
public ParametersUI addParameterView(Parameters params, File currentDirectory, RSApplication rsApp) throws FileNotFoundException, XMLStreamException
-
setGUIForStarted
public void setGUIForStarted()
-
setGUIForStepped
public void setGUIForStepped()
-
setGUIForPaused
public void setGUIForPaused()
-
setGUIForStopped
public void setGUIForStopped()
-
setGUIForPostSimInit
public void setGUIForPostSimInit()
-
setGUIForModelLoaded
public void setGUIForModelLoaded()
-
init
public void init(ErrorLog log)
-
getTickCountFormatter
public TickCountFormatter getTickCountFormatter()
Gets the current TickCountFormatter that is used to format the text in the tick label.- Returns:
- the current TickCountFormatter that is used to format the text in the tick label.
-
setTickCountFormatter
public void setTickCountFormatter(TickCountFormatter formatter)
Sets the current TickCountFormatter that is used to format the text in the tick label.- Parameters:
formatter
- the formatter to use
-
updateTickCountLabel
public void updateTickCountLabel(double newTick)
-
setStatusBarText
public void setStatusBarText(String text)
Sets the status bar to the specified text..- Parameters:
text
- the new status bar text
-
setStatusBarText
public void setStatusBarText(Color color, String text)
Sets the status bar to the specified text and text color.- Parameters:
color
- the new colortext
- the new text
-
setStatusBarText
public void setStatusBarText(Font font, Color color, String text)
Sets the status bar to the specified text and text color.- Parameters:
font
- the new fontcolor
- the new colortext
- the new text
-
setTitle
public void setTitle(String title)
-
getFrame
public JFrame getFrame()
Gets the main application frame.- Returns:
- the main application frame.
-
getToolBar
public JToolBar getToolBar(JComponent comp)
-
dockableClosed
public void dockableClosed(saf.core.ui.event.DockableFrameEvent viewEvent)
- Specified by:
dockableClosed
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableFloated
public void dockableFloated(saf.core.ui.event.DockableFrameEvent viewEvent)
- Specified by:
dockableFloated
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableMaximized
public void dockableMaximized(saf.core.ui.event.DockableFrameEvent viewEvent)
- Specified by:
dockableMaximized
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableMinimized
public void dockableMinimized(saf.core.ui.event.DockableFrameEvent viewEvent)
- Specified by:
dockableMinimized
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableRestored
public void dockableRestored(saf.core.ui.event.DockableFrameEvent viewEvent)
- Specified by:
dockableRestored
in interfacesaf.core.ui.event.DockableFrameListener
-
setActiveView
public void setActiveView(saf.core.ui.dock.DockableFrame dockable)
-
addProbeView
public saf.core.ui.dock.DockableFrame addProbeView(String id, String title, JPanel panel)
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
Called when probed properties are updated.- Specified by:
propertyChange
in interfacePropertyChangeListener
-
dockableClosing
public void dockableClosing(saf.core.ui.event.DockableFrameEvent arg0)
- Specified by:
dockableClosing
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableFloating
public void dockableFloating(saf.core.ui.event.DockableFrameEvent arg0)
- Specified by:
dockableFloating
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableRestoring
public void dockableRestoring(saf.core.ui.event.DockableFrameEvent arg0)
- Specified by:
dockableRestoring
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableMaximizing
public void dockableMaximizing(saf.core.ui.event.DockableFrameEvent evt)
- Specified by:
dockableMaximizing
in interfacesaf.core.ui.event.DockableFrameListener
-
dockableMinimizing
public void dockableMinimizing(saf.core.ui.event.DockableFrameEvent evt)
- Specified by:
dockableMinimizing
in interfacesaf.core.ui.event.DockableFrameListener
-
-