Class ApproximationSetViewer

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.moeaframework.analysis.diagnostics.ApproximationSetViewer
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, ListSelectionListener, RootPaneContainer, WindowConstants, org.jfree.chart.event.ChartChangeListener

public class ApproximationSetViewer extends JFrame implements ChangeListener, ActionListener, org.jfree.chart.event.ChartChangeListener, ListSelectionListener
Window for displaying approximation set dynamics.
See Also:
  • Constructor Details

    • ApproximationSetViewer

      public ApproximationSetViewer(String name, List<Observations> results, NondominatedPopulation referenceSet)
      Constructs a new window for displaying approximation set dynamics. This constructor must only be invoked on the event dispatch thread.
      Parameters:
      name - the name or title for the data
      results - the observations containing approximation set data
      referenceSet - the reference set for the problem
  • Method Details

    • show

      public static void show(String name, NondominatedPopulation referenceSet, Observations... observations)
      Displays the approximation sets contained in the observations. In addition to displaying the viewer, this method also configures the system look and feel. Therefore, prefer this static method when creating a standalone version of this window.
      Parameters:
      name - the name or title for the data
      referenceSet - the reference set for the problem
      observations - the observations containing approximation set data
    • initializeReferenceSetBounds

      protected void initializeReferenceSetBounds()
      Initializes the reference set bounds.
    • initialize

      protected void initialize()
      Initializes this window. This method is invoked in the constructor, and should not be invoked again.
    • layoutComponents

      protected void layoutComponents()
      Lays out the components on this window. This method is invoked by the constructor, and should not be invoked again.
    • getValue

      protected double getValue(Solution solution, int axis)
      Returns the x- or y-axis value for the specified solution. The returned value changes based on the user's preferences, and may return the value stored in an objective, constraint or variable. Returns 0.0 if the value could not be parsed.
      Parameters:
      solution - the solution whose x- or y-axis value is returned
      axis - 0 for x-axis, 1 for y-axis
      Returns:
      the x- or y-axis value for the specified solution
    • update

      protected void update()
      Updates the display. This method must only be invoked on the event dispatch thread.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Specified by:
      stateChanged in interface ChangeListener
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • chartChanged

      public void chartChanged(org.jfree.chart.event.ChartChangeEvent e)
      Specified by:
      chartChanged in interface org.jfree.chart.event.ChartChangeListener
    • valueChanged

      public void valueChanged(ListSelectionEvent e)
      Specified by:
      valueChanged in interface ListSelectionListener