/** Saves event into the list. */ public synchronized void save() { myEvent.setNEID(myNE.getId()); myEvent.setEnabled(true); myEvent.setDescription(desc.getText()); int h = (Integer) hh.getValue(); int m = (Integer) mm.getValue(); double s = (Double) ss.getValue(); myEvent.setTime(h + (m / 60.0) + (s / 3600.0)); myEventManager.clearEvent(myEvent); myEventManager.addEvent(myEvent); if (eventTable != null) eventTable.updateData(); return; }
/** Reaction to value changes in the form. */ public void stateChanged(ChangeEvent e) { String nm = ((JComponent) e.getSource()).getName(); double x; if (nm.equals(nmSpinMaxFlow)) { x = (Double) spinMaxFlow.getValue(); mf = x; } if (nm.equals(nmSpinCapDrop)) { x = (Double) spinCapDrop.getValue(); drp = x; } if (nm.equals(nmSpinCritDen)) { x = (Double) spinCritDen.getValue(); if (x <= jd) cd = x; } if (nm.equals(nmSpinJamDen)) { x = (Double) spinJamDen.getValue(); if (x >= cd) jd = x; } if (nm.equals(nmSpinVff)) { x = (Double) spinVff.getValue(); if (x > 0.0) cd = mf / x; double xx = (Double) spinWc.getValue(); if (xx > 0.0) jd = cd + (mf / xx); } if (nm.equals(nmSpinWc)) { x = (Double) spinWc.getValue(); if (x > 0.0) jd = cd + (mf / x); } updateSpinners(); updateFDSeries(); return; }