Package org.opt4j.viewer
Class ControlButtons
- java.lang.Object
-
- org.opt4j.viewer.ControlButtons
-
- All Implemented Interfaces:
ControlListener
,OptimizerStateListener
public class ControlButtons extends Object implements OptimizerStateListener, ControlListener
The
ControlButtons
containsJButton
s for the controls:- start
- pause
- stop
- terminate
- See Also:
Control
-
-
Constructor Summary
Constructors Constructor Description ControlButtons(Control control)
Constructs aControlButtons
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
construct()
Constructs the buttons.JButton
getPause()
Returns the pause button.JButton
getStart()
Returns the start button.JButton
getStop()
Returns the stop button.JButton
getTerminate()
Returns the terminate button.void
optimizationStarted(Optimizer optimizer)
Invoked if theOptimizer
starts the optimization process.void
optimizationStopped(Optimizer optimizer)
Invoked if theOptimizer
stops the optimization process.void
stateChanged(Control.State state)
Invoked if the state of theControl
changes.protected void
update(Optimizer optimizer)
Updates the view.
-
-
-
Constructor Detail
-
ControlButtons
@Inject public ControlButtons(Control control)
Constructs aControlButtons
.- Parameters:
control
- the control
-
-
Method Detail
-
construct
protected final void construct()
Constructs the buttons.
-
update
protected void update(Optimizer optimizer)
Updates the view.
-
optimizationStarted
public void optimizationStarted(Optimizer optimizer)
Description copied from interface:OptimizerStateListener
Invoked if theOptimizer
starts the optimization process.- Specified by:
optimizationStarted
in interfaceOptimizerStateListener
- Parameters:
optimizer
- the optimizer
-
optimizationStopped
public void optimizationStopped(Optimizer optimizer)
Description copied from interface:OptimizerStateListener
Invoked if theOptimizer
stops the optimization process.- Specified by:
optimizationStopped
in interfaceOptimizerStateListener
- Parameters:
optimizer
- the optimizer
-
getStart
public JButton getStart()
Returns the start button.- Returns:
- the start button
-
getPause
public JButton getPause()
Returns the pause button.- Returns:
- the pause button
-
getStop
public JButton getStop()
Returns the stop button.- Returns:
- the stop button
-
getTerminate
public JButton getTerminate()
Returns the terminate button.- Returns:
- the terminate button
-
stateChanged
public void stateChanged(Control.State state)
Description copied from interface:ControlListener
Invoked if the state of theControl
changes.- Specified by:
stateChanged
in interfaceControlListener
- Parameters:
state
- the current state of the optimization process
-
-