Class RuntimeController
java.lang.Object
org.moeaframework.util.mvc.Controller
org.moeaframework.analysis.viewer.RuntimeController
- All Implemented Interfaces:
EventListener
,SettingChangedListener
Controller for the
RuntimeViewer
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of plot fit options. -
Constructor Summary
ConstructorDescriptionRuntimeController
(RuntimeViewer viewer) Constructs a new controller with no data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSeries
(String name, ResultSeries series) Adds a series to the plot.int
Returns the current index being displayed.int
Returns the ending or maximum index value.Returns the setting for the chart's fit or scaling mode.Returns the index type.Returns the setting for the chart's point size, a value greater than0
.Returns the setting for the chart's transparency, a value between0
and100
.org.moeaframework.analysis.viewer.RuntimeViewer.PlotSeries
Returns the reference set.List<org.moeaframework.analysis.viewer.RuntimeViewer.PlotSeries>
Returns all series included in the plot.Returns the toggle for optionally displaying the reference set.int
Returns the starting or minimum index value.int
Returns the step size for iterating over indices.boolean
Returnstrue
if playback is running;false
otherwise.void
play()
Starts the playback timer, which iterates through the indices displayed in the plot.void
removeSeries
(int index) Removes a series from the plot.void
setCurrentIndex
(int index) Sets the current index to display.void
setReferenceSet
(NondominatedPopulation population) Sets or updates the reference set displayed in the plot.void
Called when the value of a setting changed.void
stop()
Stops the playback timer.void
Updates the derived values and triggers a"modelChanged"
event.Methods inherited from class org.moeaframework.util.mvc.Controller
addControllerListener, addShutdownHook, displayError, fireEvent, handleException, loadPreferences, removeControllerListener, savePreferences, shutdown, startup
-
Constructor Details
-
RuntimeController
Constructs a new controller with no data.- Parameters:
viewer
- the viewer
-
-
Method Details
-
getPointSize
Returns the setting for the chart's point size, a value greater than0
.- Returns:
- the point size setting
-
getPointTransparency
Returns the setting for the chart's transparency, a value between0
and100
.- Returns:
- the point transparency setting
-
getFitMode
Returns the setting for the chart's fit or scaling mode.- Returns:
- the fit mode setting
-
getShowReferenceSet
Returns the toggle for optionally displaying the reference set.- Returns:
- the reference set toggle
-
setReferenceSet
Sets or updates the reference set displayed in the plot.- Parameters:
population
- the reference set population
-
getReferenceSet
public org.moeaframework.analysis.viewer.RuntimeViewer.PlotSeries getReferenceSet()Returns the reference set.- Returns:
- the reference set
-
addSeries
Adds a series to the plot.- Parameters:
name
- the name of the seriesseries
- the series itself
-
removeSeries
public void removeSeries(int index) Removes a series from the plot.- Parameters:
index
- the index of the series to remove
-
getSeries
Returns all series included in the plot.- Returns:
- all series
-
getStartingIndex
public int getStartingIndex()Returns the starting or minimum index value. This value is derived from the individual series and can change when the model is updated.- Returns:
- the starting index
-
getEndingIndex
public int getEndingIndex()Returns the ending or maximum index value. This value is derived from the individual series and can change when the model is updated.- Returns:
- the starting index
-
getStepSize
public int getStepSize()Returns the step size for iterating over indices. This value is derived from the individual series and can change when the model is updated.- Returns:
- the step size
-
getIndexType
Returns the index type. This value is derived from the individual series and can change when the model is updated.- Returns:
- the index type
-
getCurrentIndex
public int getCurrentIndex()Returns the current index being displayed.- Returns:
- the current index
-
setCurrentIndex
public void setCurrentIndex(int index) Sets the current index to display.- Parameters:
index
- the new index
-
updateModel
public void updateModel()Updates the derived values and triggers a"modelChanged"
event. -
play
public void play()Starts the playback timer, which iterates through the indices displayed in the plot. Has no effect if playback is already started. -
stop
public void stop()Stops the playback timer. -
isRunning
public boolean isRunning()Returnstrue
if playback is running;false
otherwise.- Returns:
true
if playback is running;false
otherwise
-
settingChanged
Description copied from interface:SettingChangedListener
Called when the value of a setting changed.- Specified by:
settingChanged
in interfaceSettingChangedListener
- Parameters:
event
- details of the change
-