allClass.setSelected(true);
radioButtonsPanel.add(allClass);
radioButtonsPanel.add(singleClass);
radioButtonsPanel.setBorder(new EmptyBorder(5, 20, 0, 20));
JPanel edit = new JPanel(new GridLayout(5, 1, 0, 5));
ParametricAnalysisChecker checker = new ParametricAnalysisChecker(cd, sd, simd);
Vector<Object> avaibleS = checker.checkForServiceTimesParametricAnalysisAvaibleStations();
String[] stationNames = new String[avaibleS.size()];
for (int i = 0; i < avaibleS.size(); i++) {
stationNames[i] = sd.getStationName(avaibleS.get(i));
}
classChooserLabel = new JLabel("Class:");
classChooser = new JComboBox();
classChooser.setToolTipText("Choose the class whose service time mean value inside the selected station will change");
stationChooser = new JComboBox(stationNames);
stationChooser.setToolTipText("Choose the station whose service time mean value will be change");
description = new JTextArea();
description.setOpaque(false);
description.setEditable(false);
description.setLineWrap(true);
description.setWrapStyleWord(true);
descrPane = new JScrollPane(description);
descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
descrPane.setBorder(descriptionTitle);
descrPane.setMinimumSize(new Dimension(80, 0));
//if the reference station of the STPA is still avaible
if (avaibleS.contains(STPA.getReferenceStation())) {
stationChooser.setSelectedItem(sd.getStationName(STPA.getReferenceStation()));
}
//else select another one
else {
STPA.setReferenceStation(avaibleS.get(0));
stationChooser.setSelectedIndex(0);
}
if (STPA.isSingleClass()) {
fromLabel = new JLabel("From (s):");
from = new JTextField();
from.setEnabled(false);
from.setText(Double.toString(STPA.getInitialValue()));
toLabel = new JLabel("To (s):");
to = new JSpinner(new SpinnerNumberModel(STPA.getFinalValue(), 0.001, Double.MAX_VALUE, 0.001));
to.setToolTipText("Sets the final service time mean value expressed in seconds");
stepsLabel = new JLabel("Steps (n. of exec.): ");
steps = new JSpinner(new SpinnerNumberModel(STPA.getNumberOfSteps(), 2, ParametricAnalysis.MAX_STEP_NUMBER, 1));
steps.setToolTipText("Sets the number of steps to be performed");
//get the vector containing the keys of the class that can be used to do this type of parametric analysis
Vector<Object> validC = checker.checkForServiceTimesParametricSimulationAvaibleClasses(STPA.getReferenceStation());
String[] classeNames = new String[validC.size()];
for (int i = 0; i < validC.size(); i++) {
classeNames[i] = cd.getClassName(validC.get(i));
}
classChooser.removeAllItems();