String portString;
Vector<CustomOID> oids;
CustomOIDSNMP snmp;
CustomOIDCollector collector;
DataSets data;
TimeSeriesContext context;
DataGraph graphFrame;
if ( oidTable.getRowCount() == 0 ) {
ErrorHandler.modalError(this, "Please add at least one OID to the table",
"No OIDs added");
return;
}
deviceName = deviceField.getText();
oids = ((CustomOIDTableModel)oidTable.getModel()).getCustomOIDVector();
try {
device = new Device(deviceName, communityField.getText(), null, false);
snmp = new CustomOIDSNMP(device);
collector = new CustomOIDCollector(snmp, Integer.parseInt(pollField.getText()), unitsField.getText(), ((CustomOIDTableModel) oidTable.getModel()).getCustomOIDVector());
data = new DataSets(DataType.OID, collector, device, Integer.parseInt(pollField.getText()), null, 0, null, storeDataCheckBox.isSelected());
for (int i = 0; i < oids.size(); i++) {
data.addSet(oids.elementAt(i).label);
}
context = new TimeSeriesContext(data);
graphFrame = new DataGraph(context);
} catch (DBException e) {
ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
"Error opening database connection", e);
} catch (UnknownHostException e) {