Package org.opt4j.viewer
Class ArchiveWidget
java.lang.Object
org.opt4j.viewer.ArchiveWidget
- All Implemented Interfaces:
IndividualSetListener
,OptimizerIterationListener
,ObjectivesMonitor.ObjectivesListener
,Widget
public class ArchiveWidget
extends Object
implements OptimizerIterationListener, IndividualSetListener, Widget, ObjectivesMonitor.ObjectivesListener
A widget that monitors the archive.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
The model of the table. -
Field Summary
Modifier and TypeFieldDescriptionprotected final org.opt4j.viewer.SynchronizedIndividualSet
protected final JCheckBox
protected boolean
protected static final String
protected final List<IndividualMouseListener>
protected static final int
protected final JPanel
protected final JLabel
protected List<Individual>
protected final JTable
protected final DelayTask
-
Constructor Summary
ConstructorDescriptionArchiveWidget
(Archive archive, Optimizer optimizer, Set<IndividualMouseListener> mouseListeners, ObjectivesMonitor objectivesMonitor) Constructs anArchiveWidget
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aIndividualMouseListener
.getPanel()
Returns the panel with the content.protected final JTable
getTable()
void
individualAdded
(IndividualSet collection, Individual individual) Invoked if theIndividual
is added to theIndividualSet
.void
individualRemoved
(IndividualSet collection, Individual individual) Invoked if theIndividual
is removed from theIndividualSet
.void
Called once after the widget is added to theViewport
.void
iterationComplete
(Optimizer optimizer, int iteration) Invoked if theOptimizer
completes an iteration.void
objectives
(Collection<Objective> obj) Callback method that passes the objectives of the optimization problem.protected void
paint()
Repaints the table.void
Removes aIndividualMouseListener
.protected void
protected boolean
-
Field Details
-
OFFSET
protected static final int OFFSET- See Also:
-
archive
protected final org.opt4j.viewer.SynchronizedIndividualSet archive -
swtIndividuals
-
objectives
-
order
-
panel
-
table
-
autoUpdate
-
sizeLabel
-
changed
protected boolean changed -
individualMouseListeners
-
task
-
INDEX
- See Also:
-
-
Constructor Details
-
ArchiveWidget
@Inject public ArchiveWidget(Archive archive, Optimizer optimizer, Set<IndividualMouseListener> mouseListeners, ObjectivesMonitor objectivesMonitor) Constructs anArchiveWidget
.- Parameters:
archive
- the archiveoptimizer
- the optimizermouseListeners
- listeners for mouse events on IndividualsobjectivesMonitor
- the objective monitor that determine the objective of the optimization problem
-
-
Method Details
-
getTable
-
sortIndividiualMouseListeners
protected void sortIndividiualMouseListeners() -
init
Description copied from interface:Widget
Called once after the widget is added to theViewport
. -
updateOrder
protected boolean updateOrder() -
paint
protected void paint()Repaints the table. -
addIndividualMouseListener
Adds aIndividualMouseListener
.- Parameters:
listener
- the individual mouse listener to be added
-
removeIndivdiualMouseListener
Removes aIndividualMouseListener
.- Parameters:
listener
- the individual mouse listener to be removed
-
iterationComplete
Description copied from interface:OptimizerIterationListener
Invoked if theOptimizer
completes an iteration.- Specified by:
iterationComplete
in interfaceOptimizerIterationListener
- Parameters:
optimizer
- the optimizeriteration
- the completed iteration
-
individualAdded
Description copied from interface:IndividualSetListener
Invoked if theIndividual
is added to theIndividualSet
.- Specified by:
individualAdded
in interfaceIndividualSetListener
- Parameters:
collection
- the observed collectionindividual
- the added individual
-
individualRemoved
Description copied from interface:IndividualSetListener
Invoked if theIndividual
is removed from theIndividualSet
.- Specified by:
individualRemoved
in interfaceIndividualSetListener
- Parameters:
collection
- the observed collectionindividual
- the removed individual
-
getPanel
Description copied from interface:Widget
Returns the panel with the content. -
objectives
Description copied from interface:ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.- Specified by:
objectives
in interfaceObjectivesMonitor.ObjectivesListener
- Parameters:
obj
- the objectives
-