/// <summary> /// Processes a table selection (either via a mouse press or programmatically /// from selectTableIndex() by writing the old data back to the data set component /// and getting the next selection's data out of the data and displaying it on the form. </summary> /// <param name="index"> the index of the reservoir to display on the form. </param> private void processTableSelection(int index) { /* * Message.printStatus(1, "", "Current: " + __currentStationIndex); * Message.printStatus(1, "", "Last: " + __lastStationIndex); * Message.printStatus(1, "", "Orig: " + __worksheet.getOriginalRowNumber(index)); * Message.printStatus(1, "", "Index: " + index); */ __lastStationIndex = __currentStationIndex; __currentStationIndex = __worksheet.getOriginalRowNumber(index); saveLastRecord(); if (__worksheet.getSelectedRow() == -1) { JGUIUtil.disableComponents(__disables, true); return; } JGUIUtil.enableComponents(__disables, __textUneditables, __editable); StateMod_RiverNetworkNode rnn = (StateMod_RiverNetworkNode)__riverNetworkNodesVector[__currentStationIndex]; __idJTextField.setText(rnn.getID()); __nameJTextField.setText(rnn.getName()); __nodeJTextField.setText(rnn.getCstadn()); __commentJTextField.setText(rnn.getComment()); checkViewButtonState(); }
/// <summary> /// Called by JFrames when nothing is selected from the table of ids and names. /// This disables all the JComponents on the form that are only relevant if a data object is selected </summary> /// <param name="components"> an array of all the JComponents on the form which can be /// disabled when nothing is selected. </param> /// @deprecated Use JGUIUtil.disableComponents public static void nothingSelected(JComponent[] components) { JGUIUtil.disableComponents(components, true); }