Browse Source

Code tidy.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@2239 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 15 years ago
parent
commit
489758c2ba
  1. 39
      prism/src/userinterface/properties/GUIGraphPicker.java

39
prism/src/userinterface/properties/GUIGraphPicker.java

@ -27,23 +27,18 @@
package userinterface.properties; package userinterface.properties;
import java.util.Vector;
import java.util.ArrayList;
import javax.swing.*;
import java.awt.*;
import org.jfree.data.xy.*;
import userinterface.*; import userinterface.*;
import userinterface.graph.Graph; import userinterface.graph.Graph;
import userinterface.graph.GraphResultListener; import userinterface.graph.GraphResultListener;
import javax.swing.*;
import java.awt.*;
import prism.*; import prism.*;
import parser.*; import parser.*;
import java.util.*;
import org.jfree.data.xy.*;
/**
*
* @author ug60axh
*/
public class GUIGraphPicker extends javax.swing.JDialog public class GUIGraphPicker extends javax.swing.JDialog
{ {
private GUIPrism gui; private GUIPrism gui;
@ -59,7 +54,7 @@ public class GUIGraphPicker extends javax.swing.JDialog
private DefinedConstant rangingConstant; private DefinedConstant rangingConstant;
private Values otherValues; private Values otherValues;
private java.util.Vector<DefinedConstant> multiSeries;
private Vector<DefinedConstant> multiSeries;
private userinterface.graph.Graph graphModel; private userinterface.graph.Graph graphModel;
private boolean graphCancelled; private boolean graphCancelled;
@ -72,9 +67,8 @@ public class GUIGraphPicker extends javax.swing.JDialog
* @param plugin The GUIPlugin (GUIMultiProperties) * @param plugin The GUIPlugin (GUIMultiProperties)
* @param experiment The experiment for which to plot a graph. * @param experiment The experiment for which to plot a graph.
* @param graphHandler The graph handler in which to display the graph. * @param graphHandler The graph handler in which to display the graph.
* @param useExistingResults If true, simply plot existing results (experiment has been done).
* If false, attach listeners to the results such that plot is made when results become
* available.
* @param resultsKnown If true, simply plot existing results (experiment has been done).
* If false, attach listeners to the results such that plot is made when results become available.
*/ */
public GUIGraphPicker(GUIPrism parent, GUIPlugin plugin, GUIExperiment experiment, GUIGraphHandler graphHandler, boolean resultsKnown) public GUIGraphPicker(GUIPrism parent, GUIPlugin plugin, GUIExperiment experiment, GUIGraphHandler graphHandler, boolean resultsKnown)
{ {
@ -88,11 +82,11 @@ public class GUIGraphPicker extends javax.swing.JDialog
this.graphHandler = graphHandler; this.graphHandler = graphHandler;
this.resultsCollection = experiment.getResults(); this.resultsCollection = experiment.getResults();
// graphCancelled will be set explictly to false when the OK button is pressed
// graphCancelled will be set explicitly to false when the OK button is pressed
// (this means if the user closes the dialog, this counts as a cancel) // (this means if the user closes the dialog, this counts as a cancel)
this.graphCancelled = true; this.graphCancelled = true;
this.multiSeries = new java.util.Vector<DefinedConstant>();
this.multiSeries = new Vector<DefinedConstant>();
initComponents(); initComponents();
setResizable(false); setResizable(false);
@ -108,7 +102,7 @@ public class GUIGraphPicker extends javax.swing.JDialog
if (!graphCancelled) if (!graphCancelled)
{ {
/* Collect series keys. */ /* Collect series keys. */
java.util.Vector<Graph.SeriesKey> seriesKeys = new java.util.Vector<Graph.SeriesKey>();
Vector<Graph.SeriesKey> seriesKeys = new Vector<Graph.SeriesKey>();
/* Collect series Values */ /* Collect series Values */
ArrayList<Values> seriesValues = new ArrayList<Values>(); ArrayList<Values> seriesValues = new ArrayList<Values>();
@ -156,8 +150,6 @@ public class GUIGraphPicker extends javax.swing.JDialog
Values values = seriesValues.get(series); Values values = seriesValues.get(series);
Graph.SeriesKey seriesKey = seriesKeys.get(series); Graph.SeriesKey seriesKey = seriesKeys.get(series);
int nrSeries = -1;
/** Range over x-axis. */ /** Range over x-axis. */
for(int i = 0; i < rangingConstant.getNumSteps(); i++) for(int i = 0; i < rangingConstant.getNumSteps(); i++)
{ {
@ -191,8 +183,9 @@ public class GUIGraphPicker extends javax.swing.JDialog
else else
{ validY = false; } { validY = false; }
if (validX && validY)
if (validX && validY) {
graphModel.addPointToSeries(seriesKey, new XYDataItem(x,y)); graphModel.addPointToSeries(seriesKey, new XYDataItem(x,y));
}
} }
catch (PrismException pe) catch (PrismException pe)
{ {
@ -299,7 +292,7 @@ public class GUIGraphPicker extends javax.swing.JDialog
ranger = selectAxisConstantCombo.getSelectedItem().toString(); ranger = selectAxisConstantCombo.getSelectedItem().toString();
// init arrays // init arrays
otherValues = new Values(); otherValues = new Values();
multiSeries = new java.util.Vector<DefinedConstant>();
multiSeries = new Vector<DefinedConstant>();
// go through constants in picker list // go through constants in picker list
for(int j = 0; j < pickerList.getNumConstants(); j++) for(int j = 0; j < pickerList.getNumConstants(); j++)
{ {
@ -582,7 +575,7 @@ public class GUIGraphPicker extends javax.swing.JDialog
// init arrays // init arrays
otherValues = new Values(); otherValues = new Values();
multiSeries = new java.util.Vector<DefinedConstant>();
multiSeries = new Vector<DefinedConstant>();
// go through all constants in picker list // go through all constants in picker list
for(int j = 0; j < pickerList.getNumConstants(); j++) for(int j = 0; j < pickerList.getNumConstants(); j++)

Loading…
Cancel
Save