This method gives the values in the combobox.once you selected a value in the combo,the left value will be calculated
EventHandler:
if (selectedValue != null) {
ThresholdStatistics stat = new ThresholdStatistics(detailedThreshold, selectedValue); /* detailedThreshold - value from the bean file,selectedValue - value selected from the combo */
getStatisticsTableModel().addStatistics(stat);/* Add a new row */
}
}
TableModel:
public void addStatistics(ThresholdStatistics stat) {
rows.addElement(stat);
count++;
fireModelChanged(new TableModelEvent(this,
rows.size()-1,
rows.size()-1,
TableModelEvent.ALL_COLUMNS,
TableModelEvent.INSERT));
}
ModelFile:
public static
String[] getStatsLeftForThreshold(ThresholdDetailData threshold) {
Vector stats = null;
for (int i=0; i<StatsByThresholdTypes.length; i++) { /* StatsByThresholdTypes - dynamic values in the combobox
if (StatsByThresholdTypes[i][0].equals(threshold.getTypeCode())) {
stats = new Vector(StatsByThresholdTypes[i].length);
for (int j=1; j<StatsByThresholdTypes[i].length; j++) {
if (!isStatPresentInThreahold(threshold, StatsByThresholdTypes[i][j])) {
stats.addElement(StatsByThresholdTypes[i][j]);
}
}
i = StatsByThresholdTypes.length;
}
}
if (stats == null || stats.size() == 0) {
return null;
}
else {
String statStrings[] = new String[stats.size()];
for (int i=0; i<statStrings.length; i++) {
statStrings[i] = (String)stats.elementAt(i);
}
return statStrings;
}
}