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
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classThe model of the table. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.opt4j.viewer.SynchronizedIndividualSetprotected final JCheckBoxprotected booleanprotected static final Stringprotected final List<IndividualMouseListener>protected static final intprotected final JPanelprotected final JLabelprotected List<Individual>protected final JTableprotected final DelayTask -
Constructor Summary
ConstructorsConstructorDescriptionArchiveWidget(Archive archive, Optimizer optimizer, Set<IndividualMouseListener> mouseListeners, ObjectivesMonitor objectivesMonitor) Constructs anArchiveWidget. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aIndividualMouseListener.getPanel()Returns the panel with the content.protected final JTablegetTable()voidindividualAdded(IndividualSet collection, Individual individual) Invoked if theIndividualis added to theIndividualSet.voidindividualRemoved(IndividualSet collection, Individual individual) Invoked if theIndividualis removed from theIndividualSet.voidCalled once after the widget is added to theViewport.voiditerationComplete(Optimizer optimizer, int iteration) Invoked if theOptimizercompletes an iteration.voidobjectives(Collection<Objective> obj) Callback method that passes the objectives of the optimization problem.protected voidpaint()Repaints the table.voidRemoves aIndividualMouseListener.protected voidprotected 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:WidgetCalled 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:OptimizerIterationListenerInvoked if theOptimizercompletes an iteration.- Specified by:
iterationCompletein interfaceOptimizerIterationListener- Parameters:
optimizer- the optimizeriteration- the completed iteration
-
individualAdded
Description copied from interface:IndividualSetListenerInvoked if theIndividualis added to theIndividualSet.- Specified by:
individualAddedin interfaceIndividualSetListener- Parameters:
collection- the observed collectionindividual- the added individual
-
individualRemoved
Description copied from interface:IndividualSetListenerInvoked if theIndividualis removed from theIndividualSet.- Specified by:
individualRemovedin interfaceIndividualSetListener- Parameters:
collection- the observed collectionindividual- the removed individual
-
getPanel
Description copied from interface:WidgetReturns the panel with the content. -
objectives
Description copied from interface:ObjectivesMonitor.ObjectivesListenerCallback method that passes the objectives of the optimization problem.- Specified by:
objectivesin interfaceObjectivesMonitor.ObjectivesListener- Parameters:
obj- the objectives
-