org.opt4j.viewer
Class ArchiveWidget

java.lang.Object
  extended by org.opt4j.viewer.ArchiveWidget
All Implemented Interfaces:
org.opt4j.core.IndividualSetListener, org.opt4j.core.optimizer.OptimizerIterationListener, ObjectivesMonitor.ObjectivesListener, Widget

public class ArchiveWidget
extends java.lang.Object
implements org.opt4j.core.optimizer.OptimizerIterationListener, org.opt4j.core.IndividualSetListener, Widget, ObjectivesMonitor.ObjectivesListener

A widget that monitors the archive.


Nested Class Summary
protected  class ArchiveWidget.Comp
           
protected  class ArchiveWidget.Model
          The model of the table.
 
Field Summary
protected  org.opt4j.viewer.SynchronizedIndividualSet archive
           
protected  javax.swing.JCheckBox autoUpdate
           
protected  boolean changed
           
protected static java.lang.String INDEX
           
protected  java.util.List<IndividualMouseListener> individualMouseListeners
           
protected  java.util.List<org.opt4j.core.Objective> objectives
           
protected static int OFFSET
           
protected  java.util.List<org.opt4j.core.Objective> order
           
protected  javax.swing.JPanel panel
           
protected  javax.swing.JLabel sizeLabel
           
protected  java.util.List<org.opt4j.core.Individual> swtIndividuals
           
protected  javax.swing.JTable table
           
protected  org.opt4j.core.config.visualization.DelayTask task
           
 
Constructor Summary
ArchiveWidget(org.opt4j.core.optimizer.Archive archive)
          Constructs an ArchiveWidget.
 
Method Summary
 void addIndividualMouseListener(IndividualMouseListener listener)
          Adds a IndividualMouseListener.
 void addMouseListeners(java.util.Set<IndividualMouseListener> mouseListeners)
          Set the IndividualMouseListeners to inform.
 javax.swing.JPanel getPanel()
          Returns the panel with the content.
protected  javax.swing.JTable getTable()
           
 void individualAdded(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
           
 void individualRemoved(org.opt4j.core.IndividualSet collection, org.opt4j.core.Individual individual)
           
 void init(Viewport viewport)
          Called once after the widget is added to the Viewport.
 void iterationComplete(int iteration)
           
 void objectives(java.util.Collection<org.opt4j.core.Objective> obj)
          Callback method that passes the objectives of the optimization problem.
protected  void paint()
          Repaints the table.
 void registerAtObjectivesMonitor(ObjectivesMonitor objectivesMonitor)
          Register at the ObjectivesMonitor.
 void registerAtOptimizer(org.opt4j.core.optimizer.Optimizer optimizer)
          Register at the Optimizer.
 void removeIndivdiualMouseListener(IndividualMouseListener listener)
          Removes a IndividualMouseListener.
protected  void sortIndividiualMouseListeners()
           
protected  boolean updateOrder()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET

protected static final int OFFSET
See Also:
Constant Field Values

archive

protected final org.opt4j.viewer.SynchronizedIndividualSet archive

swtIndividuals

protected java.util.List<org.opt4j.core.Individual> swtIndividuals

objectives

protected final java.util.List<org.opt4j.core.Objective> objectives

order

protected final java.util.List<org.opt4j.core.Objective> order

panel

protected final javax.swing.JPanel panel

table

protected final javax.swing.JTable table

autoUpdate

protected final javax.swing.JCheckBox autoUpdate

sizeLabel

protected final javax.swing.JLabel sizeLabel

changed

protected boolean changed

individualMouseListeners

protected final java.util.List<IndividualMouseListener> individualMouseListeners

task

protected final org.opt4j.core.config.visualization.DelayTask task

INDEX

protected static final java.lang.String INDEX
See Also:
Constant Field Values
Constructor Detail

ArchiveWidget

@Inject
public ArchiveWidget(org.opt4j.core.optimizer.Archive archive)
Constructs an ArchiveWidget.

Parameters:
archive - the archive
Method Detail

registerAtOptimizer

@Inject(optional=true)
public void registerAtOptimizer(org.opt4j.core.optimizer.Optimizer optimizer)
Register at the Optimizer.

Parameters:
optimizer - the optimizer

registerAtObjectivesMonitor

@Inject(optional=true)
public void registerAtObjectivesMonitor(ObjectivesMonitor objectivesMonitor)
Register at the ObjectivesMonitor.

Parameters:
objectivesMonitor - the objectives monitor

addMouseListeners

@Inject(optional=true)
public void addMouseListeners(java.util.Set<IndividualMouseListener> mouseListeners)
Set the IndividualMouseListeners to inform.

Parameters:
mouseListeners - the mouse listeners

getTable

protected final javax.swing.JTable getTable()

sortIndividiualMouseListeners

protected void sortIndividiualMouseListeners()

init

public void init(Viewport viewport)
Description copied from interface: Widget
Called once after the widget is added to the Viewport.

Specified by:
init in interface Widget
Parameters:
viewport - the base viewport

updateOrder

protected boolean updateOrder()

paint

protected void paint()
Repaints the table.


addIndividualMouseListener

public void addIndividualMouseListener(IndividualMouseListener listener)
Adds a IndividualMouseListener.

Parameters:
listener - the individual mouse listener to be added

removeIndivdiualMouseListener

public void removeIndivdiualMouseListener(IndividualMouseListener listener)
Removes a IndividualMouseListener.

Parameters:
listener - the individual mouse listener to be removed

iterationComplete

public void iterationComplete(int iteration)
Specified by:
iterationComplete in interface org.opt4j.core.optimizer.OptimizerIterationListener

individualAdded

public void individualAdded(org.opt4j.core.IndividualSet collection,
                            org.opt4j.core.Individual individual)
Specified by:
individualAdded in interface org.opt4j.core.IndividualSetListener

individualRemoved

public void individualRemoved(org.opt4j.core.IndividualSet collection,
                              org.opt4j.core.Individual individual)
Specified by:
individualRemoved in interface org.opt4j.core.IndividualSetListener

getPanel

public javax.swing.JPanel getPanel()
Description copied from interface: Widget
Returns the panel with the content.

Specified by:
getPanel in interface Widget
Returns:
the panel with the content

objectives

public void objectives(java.util.Collection<org.opt4j.core.Objective> obj)
Description copied from interface: ObjectivesMonitor.ObjectivesListener
Callback method that passes the objectives of the optimization problem.

Specified by:
objectives in interface ObjectivesMonitor.ObjectivesListener
Parameters:
obj - the objectives