This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(inti = 0; i < mainInterface.getMainExecution().getPanelMonitoringSystem().getMonitoringUnits().size(); i++) {
if (nameField.getText().equals(mainInterface.getMainExecution().getPanelMonitoringSystem().getMonitoringUnits().get(i).getName()) && !nameField.getText().equals(monitoringUnit.getName())) {
JOptionPane.showMessageDialog(this, "There is another panel with this name, please change it and try again.", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, "The type of the variables desn't mismatch, the panel can only be created from same type variables.", "Error", JOptionPane.ERROR_MESSAGE);
sucess = false;
break;
JOptionPane.showMessageDialog(this, "The type of the variables doesn't mismatch, the panel can only be created from same type variables.", "Error", JOptionPane.ERROR_MESSAGE);
returnfalse;
}
}
if (nameField.equals("")) {
sucess = false;
JOptionPane.showMessageDialog(this, "You cannot create a new panel without a name.", "Error", JOptionPane.ERROR_MESSAGE);
if ((variables.get(0).getType() == 'i') || (variables.get(0).getType() == 'n')) {
JOptionPane.showMessageDialog(this, "The panel can only be created from categoric or numeric variables, any other type is not allowed.", "Error", JOptionPane.ERROR_MESSAGE);
returnfalse;
}
for(inti = 0; i < mainInterface.getMainExecution().getPanelMonitoringSystem().getMonitoringUnits().size(); i++) {
if (nameField.getText().equals(mainInterface.getMainExecution().getPanelMonitoringSystem().getMonitoringUnits().get(i).getName())) {
sucess = false;
JOptionPane.showMessageDialog(this, "There is another panel with this name, please change it and try again.", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
}
if(sucess) {
if ((variables.get(0).getType() == 'i') || (variables.get(0).getType() == 'n')) {
JOptionPane.showMessageDialog(this, "The panel can only be created from categoric or numeric variables, any other type is not allowed.", "Error", JOptionPane.ERROR_MESSAGE);
sucess = false;
}
if ((chartTypeCombobox.getSelectedItem().equals("LineChart")) || (chartTypeCombobox.getSelectedItem().equals("AreaChart")) || (chartTypeCombobox.getSelectedItem().equals("2DLineChart"))) {
if(variables.get(0).getType() == 'c') {
JOptionPane.showMessageDialog(this, "You cannot use this type of chart for categoric variables, please select the StepLineChart chartType.", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, "You cannot use this type of chart for numeric variables, please select the LineChart or AreaChart chartType.", "Error", JOptionPane.ERROR_MESSAGE);
sucess = false;
}
}
else {
JOptionPane.showMessageDialog(this, "ChartType cannot be identified by the application.", "Error", JOptionPane.ERROR_MESSAGE);
sucess = false;
}
}
if(sucess) {
if ((secondField.getValue().equals(0))&&(minuteField.getValue().equals(0))&&(hourField.getValue().equals(0))) {
sucess = false;
JOptionPane.showMessageDialog(this, "Invalid Time Range, it cannot be zero.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
if (nameField.equals("")) {
JOptionPane.showMessageDialog(this, "You cannot create a new panel without a name.", "Error", JOptionPane.ERROR_MESSAGE);
returnfalse;
}
if ((chartTypeCombobox.getSelectedItem().equals("LineChart")) || (chartTypeCombobox.getSelectedItem().equals("AreaChart")) || (chartTypeCombobox.getSelectedItem().equals("2DLineChart"))) {
if(variables.get(0).getType() == 'c') {
JOptionPane.showMessageDialog(this, "You cannot use this type of chart for categoric variables, please select the StepLineChart chartType.", "Error", JOptionPane.ERROR_MESSAGE);
returnfalse;
}
if (chartTypeCombobox.getSelectedItem().equals("2DLineChart")) {
JOptionPane.showMessageDialog(this, "You cannot use this type of chart for numeric variables, please select the LineChart or AreaChart chartType.", "Error", JOptionPane.ERROR_MESSAGE);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters