12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- package psoAlgoCode;
- import java.awt.BorderLayout;
- import java.awt.FlowLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.util.Vector;
- import javax.swing.JButton;
- import javax.swing.JDialog;
- import javax.swing.JPanel;
- /**
- * COmpletely unnecessary if not used anymore in the new Version
- * @author egert.rolf
- *
- */
- public class LineChart extends JDialog {
- private static final long serialVersionUID = 1L;
- // XYSeriesCollection collections = new XYSeriesCollection();
- /*public LineChart(String applicationTitle, String chartTitle) {
- JPanel chartPanel = plotStuff(chartTitle);
- JPanel bottomPanel = new JPanel();
- setTitle(applicationTitle);
- setBounds(400, 100, 800, 800);
- setModal(true);
- getContentPane().setLayout(new BorderLayout());
- getContentPane().add(chartPanel, BorderLayout.CENTER);
- chartPanel.setLayout(null);
- bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
- getContentPane().add(bottomPanel, BorderLayout.SOUTH);
- JButton close = new JButton("Close");
- close.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- });
- bottomPanel.add(close);
- }
- */
- /* public JPanel plotStuff(String chartTitle) {
- XYDataset dataset = collections;
- JFreeChart lineChart = ChartFactory.createXYLineChart(chartTitle, "Iterations", "Global Best", dataset,
- PlotOrientation.VERTICAL, false, true, false);
- return new ChartPanel(lineChart);
- }
- public void createDataSet(Vector<Double> data, int round) {
- final XYSeries series = new XYSeries("Round " + (round), false);
- int steps = Constants.MAX_ITERATION;
- for (int i = 0; i < steps; i++) {
- double temp = data.get(i);
- series.add(i + 1, temp);
- }
- collections.addSeries(series);
- }
- */
- }
|