Package org.opt4j.viewer
Class PopulationWidget
- java.lang.Object
-
- org.opt4j.viewer.PopulationWidget
-
- All Implemented Interfaces:
IndividualSetListener
,IndividualStateListener
,ObjectivesMonitor.ObjectivesListener
,Widget
public class PopulationWidget extends Object implements IndividualStateListener, IndividualSetListener, Widget, ObjectivesMonitor.ObjectivesListener
A widget that monitors thePopulation
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
PopulationWidget.Model
protected class
PopulationWidget.Table
-
Field Summary
Fields Modifier and Type Field Description protected Archive
archive
protected List<Objective>
objectives
protected static int
OFFSET
protected JPanel
panel
protected org.opt4j.viewer.SynchronizedIndividualList
population
protected int
size
protected List<Individual>
swtIndividuals
protected JTable
table
protected DelayTask
task
-
Constructor Summary
Constructors Constructor Description PopulationWidget(Population population, Archive archive, IndividualFactory individualFactory, ObjectivesMonitor objectivesMonitor)
Constructs aPopulationWidget
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JPanel
getPanel()
Returns the panel with the content.protected 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
inidividualStateChanged(Individual individual)
Invoked if theIndividual
changes its state.void
init(Viewport viewport)
Called once after the widget is added to theViewport
.void
objectives(Collection<Objective> obj)
Callback method that passes the objectives of the optimization problem.protected void
paint()
-
-
-
Field Detail
-
OFFSET
protected static final int OFFSET
- See Also:
- Constant Field Values
-
archive
protected final Archive archive
-
population
protected final org.opt4j.viewer.SynchronizedIndividualList population
-
swtIndividuals
protected List<Individual> swtIndividuals
-
panel
protected final JPanel panel
-
table
protected final JTable table
-
size
protected int size
-
task
protected final DelayTask task
-
-
Constructor Detail
-
PopulationWidget
@Inject public PopulationWidget(Population population, Archive archive, IndividualFactory individualFactory, ObjectivesMonitor objectivesMonitor)
Constructs aPopulationWidget
.- Parameters:
population
- the populationarchive
- the archiveindividualFactory
- the individual creatorobjectivesMonitor
- the objective monitor that determine the objective of the optimization problem
-
-
Method Detail
-
getTable
protected final JTable getTable()
-
init
public void init(Viewport viewport)
Description copied from interface:Widget
Called once after the widget is added to theViewport
.
-
inidividualStateChanged
public void inidividualStateChanged(Individual individual)
Description copied from interface:IndividualStateListener
Invoked if theIndividual
changes its state.- Specified by:
inidividualStateChanged
in interfaceIndividualStateListener
- Parameters:
individual
- the individual that changes the state
-
individualAdded
public void individualAdded(IndividualSet collection, Individual individual)
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
public void individualRemoved(IndividualSet collection, Individual individual)
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
-
paint
protected void paint()
-
getPanel
public JPanel getPanel()
Description copied from interface:Widget
Returns the panel with the content.
-
objectives
public void objectives(Collection<Objective> obj)
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
-
-