/// <summary> /// Sets up the GUI. /// </summary> private void setupGUI() { string routine = "StateMod_QueryTool_JFrame.setupGUI"; addWindowListener(this); GridBagLayout gb = new GridBagLayout(); JPanel main_JPanel = new JPanel(); main_JPanel.setLayout(gb); JGUIUtil.addComponent(main_JPanel, new JLabel("Component:"), 0, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST); __component_JComboBox = new SimpleJComboBox(false); __component_JComboBox.add("Diversion Stations"); JGUIUtil.addComponent(main_JPanel, __component_JComboBox, 1, 0, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); try { __input_filter_diversion_JPanel = new StateMod_Diversion_InputFilter_JPanel(__dataset); JGUIUtil.addComponent(main_JPanel, __input_filter_diversion_JPanel, 0, 1, 4, 4, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); } catch (Exception) { Message.printWarning(1, routine, "Unable to initialize input filter for diversion stations."); } getContentPane().add(main_JPanel); // add bottom buttons FlowLayout fl = new FlowLayout(FlowLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(fl); __query_JButton = new SimpleJButton(__Query_String, this); __query_JButton.setToolTipText("Query the data set using specified criteria."); __display_JButton = new SimpleJButton(__Display_String, this); __display_JButton.setToolTipText("Display the results of the query."); __display_JButton.setEnabled(false); // Enable after query. __cancel_JButton = new SimpleJButton(__Cancel_String, this); __cancel_JButton.setToolTipText("Cancel query and close window."); buttonPanel.add(__query_JButton); buttonPanel.add(__display_JButton); buttonPanel.add(__cancel_JButton); JPanel bottomJPanel = new JPanel(); bottomJPanel.setLayout(gb); JGUIUtil.addComponent(bottomJPanel, buttonPanel, 0, 0, 8, 1, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER); __message_JTextField = new JTextField(); __message_JTextField.setText("Select filter criteria and then press Query"); __message_JTextField.setEditable(false); JGUIUtil.addComponent(bottomJPanel, __message_JTextField, 0, 1, 7, 1, 1.0, 0.0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); __status_JTextField = new JTextField(5); __status_JTextField.setEditable(false); JGUIUtil.addComponent(bottomJPanel, __status_JTextField, 7, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NONE, GridBagConstraints.WEST); getContentPane().add("South", bottomJPanel); if (__dataset_wm != null) { __dataset_wm.setWindowOpen(StateMod_DataSet_WindowManager.WINDOW_CONTROL, this); } pack(); setSize(550, 190); // Allows replacement res option to display JGUIUtil.center(this); setResizable(true); setVisible(true); }
/// <summary> /// Sets up the GUI. /// </summary> private void setupGUI() { string routine = "StateMod_Save_JDialog.setupGUI"; addWindowListener(this); PropList p = new PropList("StateMod_Save_JDialog.JWorksheet"); /* * p.add("JWorksheet.CellFont=Courier"); * p.add("JWorksheet.CellStyle=Plain"); * p.add("JWorksheet.CellSize=11"); * p.add("JWorksheet.HeaderFont=Arial"); * p.add("JWorksheet.HeaderStyle=Plain"); * p.add("JWorksheet.HeaderSize=11"); * p.add("JWorksheet.HeaderBackground=LightGray"); * p.add("JWorksheet.RowColumnPresent=false"); */ p.add("JWorksheet.ShowPopupMenu=true"); p.add("JWorksheet.SelectionMode=MultipleDiscontinuousRowSelection"); int[] widths = null; JScrollWorksheet jsw = null; try { __tableModel = new StateMod_Save_TableModel(__dataset); StateMod_Save_CellRenderer crr = new StateMod_Save_CellRenderer(__tableModel); jsw = new JScrollWorksheet(crr, __tableModel, p); __worksheet = jsw.getJWorksheet(); widths = crr.getColumnWidths(); // Select all the rows initially... __worksheet.selectAllRows(); } catch (Exception e) { Message.printWarning(1, routine, "Error building worksheet."); Message.printWarning(2, routine, e); jsw = new JScrollWorksheet(0, 0, p); __worksheet = jsw.getJWorksheet(); } __worksheet.setPreferredScrollableViewportSize(null); __worksheet.setHourglassJFrame(__parent); __helpButton = new SimpleJButton(__BUTTON_HELP, this); __helpButton.setEnabled(false); __saveButton = new SimpleJButton(__BUTTON_SAVE, this); __saveButton.setToolTipText("Save data to file(s)."); __cancelButton = new SimpleJButton(__BUTTON_CANCEL, this); __cancelButton.setToolTipText("Cancel without saving data to file(s)."); JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); JGUIUtil.addComponent(panel, new JLabel("Data from the following files have been modified."), 0, 0, 2, 1, 1, 1, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(panel, new JLabel("Select files to be saved and press the \"Save Selected Files\" button."), 0, 1, 2, 1, 1, 1, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(panel, new JLabel("To change the filenames, use the Data...Control...Response menu"), 0, 2, 2, 1, 1, 1, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(panel, new JLabel("Data set base name (from *.rsp): "), 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHEAST); JGUIUtil.addComponent(panel, new JLabel(__dataset.getBaseName()), 1, 3, 1, 1, 1, 1, 0, 0, 0, 0, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(panel, new JLabel("Data set directory: "), 0, 4, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHEAST); JGUIUtil.addComponent(panel, new JLabel(__dataset.getDataSetDirectory()), 1, 4, 1, 1, 1, 1, 0, 0, 0, 0, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST); __updateCheckbox = new JCheckBox((string)null, true); JGUIUtil.addComponent(panel, __updateCheckbox, 0, 6, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHEAST); JGUIUtil.addComponent(panel, new JLabel("Carry forward old file comments?"), 1, 6, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); getContentPane().add("North", panel); getContentPane().add("Center", jsw); JPanel button_panel = new JPanel(); button_panel.add(__saveButton); button_panel.add(__cancelButton); // button_panel.add(__helpButton); JPanel bottom_panel = new JPanel(); bottom_panel.setLayout(new BorderLayout()); getContentPane().add("South", bottom_panel); bottom_panel.add("South", button_panel); pack(); setSize(700, 500); JGUIUtil.center(this); if (widths != null) { __worksheet.setColumnWidths(widths, __parent.getGraphics()); } setVisible(true); }
/// <summary> /// Sets up the GUI. /// </summary> private void setupGUI() { string routine = "setupGUI"; addWindowListener(this); __addRowButton = new SimpleJButton(__BUTTON_ADD_ROW, this); __deleteRowButton = new SimpleJButton(__BUTTON_DELETE_ROW, this); __saveTemplateButton = new SimpleJButton(__BUTTON_SAVE_FILE, this); __clearWorksheetButton = new SimpleJButton(__BUTTON_CLEAR_LIST, this); __loadTemplateButton = new SimpleJButton(__BUTTON_LOAD_FILE, this); __helpButton = new SimpleJButton(__BUTTON_HELP, this); __helpButton.setEnabled(false); __closeButton = new SimpleJButton(__BUTTON_CLOSE, this); __useAllJCheckBox = new JCheckBox(__CHECKBOX_USE_ALL, false); __useAllJCheckBox.addActionListener(this); // Make a main panel to be the resizable body of the frame... JPanel main_JPanel = new JPanel(); GridBagLayout gb = new GridBagLayout(); main_JPanel.setLayout(gb); GridLayout gl = new GridLayout(2, 2, 2, 2); JPanel top_panel = new JPanel(); top_panel.setLayout(gl); JPanel radio_panel = new JPanel(); radio_panel.setLayout(gb); GridLayout gl2 = new GridLayout(1, 0, 2, 0); JPanel bottom_JPanel = new JPanel(); bottom_JPanel.setLayout(gl2); FlowLayout fl = new FlowLayout(FlowLayout.CENTER); JPanel final_button_JPanel = new JPanel(); final_button_JPanel.setLayout(fl); JPanel grid_JPanel = new JPanel(); grid_JPanel.setLayout(gb); // add add a row, delete selected rows, clear spreadsheet, // select template, save template buttons top_panel.add(__addRowButton); top_panel.add(__deleteRowButton); top_panel.add(__clearWorksheetButton); top_panel.add(__loadTemplateButton); int y = 0; JGUIUtil.addComponent(main_JPanel, top_panel, 0, y, 10, 3, 0, 0, 10, 10, 10, 10, GridBagConstraints.NONE, GridBagConstraints.NORTH); y += 3; JGUIUtil.addComponent(main_JPanel, __useAllJCheckBox, 0, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); PropList p = new PropList("StateMod_OutputControl_JFrame.JWorksheet"); p.add("JWorksheet.ShowRowHeader=true"); p.add("JWorksheet.AllowCopy=true"); p.add("JWorksheet.ShowPopupMenu=true"); int[] widths = null; JScrollWorksheet jsw = null; try { __tableModel = new StateMod_OutputControl_TableModel(this, new List <object>(), (System.Collections.IList)__riverNetworkComp.getData()); StateMod_OutputControl_CellRenderer cro = new StateMod_OutputControl_CellRenderer(__tableModel); jsw = new JScrollWorksheet(cro, __tableModel, p); __worksheet = jsw.getJWorksheet(); System.Collections.IList v = StateMod_Util.arrayToList(StateMod_GraphNode.node_types); v.Add("Other"); __worksheet.setColumnJComboBoxValues(0, v); __worksheet.setCellSpecificJComboBoxColumn(1, false); System.Collections.IList offOn = new List <object>(); offOn.Add("Off"); offOn.Add("On"); __worksheet.setColumnJComboBoxValues(2, offOn); __tableModel.setWorksheet(__worksheet); widths = cro.getColumnWidths(); } catch (Exception e) { Message.printWarning(1, routine, "Error building worksheet."); Message.printWarning(2, routine, e); jsw = new JScrollWorksheet(0, 0, p); __worksheet = jsw.getJWorksheet(); } __worksheet.setPreferredScrollableViewportSize(null); __worksheet.setHourglassJFrame(this); JGUIUtil.addComponent(grid_JPanel, jsw, 0, 0, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.CENTER); JGUIUtil.addComponent(main_JPanel, grid_JPanel, 0, ++y, 10, 12, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.CENTER); y += 11; // To account for grid height // Add bottom buttons - these are alphabetical so be // careful if you add more ... final_button_JPanel.add(__closeButton); // REVISIT SAM 2006-03-04 // Help is not currently enabled //final_button_JPanel.add(__helpButton); final_button_JPanel.add(__saveTemplateButton); // Add the final buttons on the bottom to the bottom panel... bottom_JPanel.add(final_button_JPanel); // Add the button panel to the frame... JGUIUtil.addComponent(main_JPanel, bottom_JPanel, 0, ++y, 10, 1, 0, 0, GridBagConstraints.VERTICAL, GridBagConstraints.SOUTH); // Add the main panel as the resizable content... getContentPane().add("Center", main_JPanel); // Add JTextFields for messages... JPanel message_JPanel = new JPanel(); message_JPanel.setLayout(gb); __messageJTextField = new JTextField(); __messageJTextField.setEditable(false); __statusJTextField = new JTextField(" "); __statusJTextField.setEditable(false); JGUIUtil.addComponent(message_JPanel, __messageJTextField, 0, 0, 9, 1, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); JGUIUtil.addComponent(message_JPanel, __statusJTextField, 9, 0, 1, 1, 0, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.SOUTH); getContentPane().add("South", message_JPanel); pack(); setSize(670, 500); JGUIUtil.center(this); setVisible(true); if (widths != null) { __worksheet.setColumnWidths(widths); } }
/// <summary> /// Sets up the GUI. /// </summary> private void setupGUI() { string routine = "StateMod_Response_JFrame.setupGUI"; addWindowListener(this); PropList p = new PropList("StateMod_Response_JFrame.JWorksheet"); p.add("JWorksheet.ShowPopupMenu=true"); p.add("JWorksheet.AllowCopy=true"); p.add("JWorksheet.SelectionMode=SingleRowSelection"); int[] widths = null; JScrollWorksheet jsw = null; try { // Operate on a copy of the table model... __tableModel = new StateMod_Response_TableModel(__dataset_copy); StateMod_Response_CellRenderer crr = new StateMod_Response_CellRenderer(__tableModel); jsw = new JScrollWorksheet(crr, __tableModel, p); __worksheet = jsw.getJWorksheet(); __tableModel.setWorksheet(__worksheet); widths = crr.getColumnWidths(); } catch (Exception e) { Message.printWarning(1, routine, "Error building worksheet."); Message.printWarning(2, routine, e); jsw = new JScrollWorksheet(0, 0, p); __worksheet = jsw.getJWorksheet(); } __worksheet.setPreferredScrollableViewportSize(null); __worksheet.addMouseListener(this); __worksheet.addKeyListener(this); __worksheet.setHourglassJFrame(this); /* TODO SAM 2007-03-01 Evaluate logic * boolean renameAllowed = false; * if (__tableModel != null) { * renameAllowed = true; * } */ JPanel top_panel = new JPanel(); top_panel.setLayout(new GridBagLayout()); int y = 0; JGUIUtil.addComponent(top_panel, new JLabel("To rename a data set component, select a row and " + "either type a new file name or use the Browse button."), 0, y++, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(top_panel, new JLabel("If ARE DATA MODIFIED? is YES, data for the " + "component have been modified by the GUI but the file has not been written."), 0, y++, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(top_panel, new JLabel("Consequently, StateMod will not recognize the " + "changes until the data are saved with File...Save."), 0, y++, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(top_panel, new JLabel("If a filename is changed, the file with the original filename will remain " + "even after the new file is saved."), 0, y++, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(top_panel, new JLabel("Data set base name (from *.rsp): "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHEAST); JGUIUtil.addComponent(top_panel, new JLabel(__dataset.getBaseName()), 1, y++, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST); JGUIUtil.addComponent(top_panel, new JLabel("Data set directory: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHEAST); JGUIUtil.addComponent(top_panel, new JLabel(__dataset.getDataSetDirectory()), 1, y++, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST); getContentPane().add("North", top_panel); getContentPane().add("Center", jsw); JPanel button_panel = new JPanel(); __browse_JButton = new SimpleJButton(__BUTTON_BROWSE, this); __browse_JButton.setEnabled(false); __browse_JButton.setToolTipText("Select an existing file."); button_panel.add(__browse_JButton); __apply_JButton = new SimpleJButton(__BUTTON_APPLY, this); //__apply_JButton.setEnabled(false); __apply_JButton.setToolTipText("Set the file names. File...Save is still required to save files."); button_panel.add(__apply_JButton); __cancel_JButton = new SimpleJButton(__BUTTON_CANCEL, this); __cancel_JButton.setToolTipText("Cancel file name changes."); button_panel.add(__cancel_JButton); __close_JButton = new SimpleJButton(__BUTTON_CLOSE, this); __close_JButton.setToolTipText("Apply file name changes and close " + "window. File...Save is still required to save files."); //__close_JButton.setEnabled (false); button_panel.add(__close_JButton); //__help_JButton = new SimpleJButton(__BUTTON_HELP, this); //__help_JButton.setEnabled(false); //button_panel.add(__help_JButton); JPanel bottom_panel = new JPanel(); bottom_panel.setLayout(new BorderLayout()); getContentPane().add("South", bottom_panel); bottom_panel.add("South", button_panel); pack(); if (__dataset_wm != null) { __dataset_wm.setWindowOpen(StateMod_DataSet_WindowManager.WINDOW_RESPONSE, this); } setSize(700, 500); JGUIUtil.center(this); setVisible(true); if (widths != null) { __worksheet.setColumnWidths(widths); } }
/// <summary> /// Responds to action performed events. </summary> /// <param name="ae"> the ActionEvent that happened. </param> public virtual void actionPerformed(ActionEvent ae) { string routine = "StateMod_OutputControl_JFrame.actionPerformed"; string action = ae.getActionCommand(); if (action.Equals(__BUTTON_ADD_ROW)) { if (!__tableModel.canAddNewRow()) { return; } __dirty = true; int row = __worksheet.getRowCount(); StateMod_GraphNode n = new StateMod_GraphNode(); __worksheet.addRow(n); n.setType(""); n.setID(""); n.setSwitch(-1); __tableModel.setDirty(true); // when a row is added, mark the second and third columns // as uneditable. They will be set to editable as soon as // the user enters a value in the first column __worksheet.setCellEditable(row, 1, false); __worksheet.setCellEditable(row, 2, false); } else if (action.Equals(__BUTTON_CLEAR_LIST)) { __dirty = true; __worksheet.clear(); setMessages("Add station to list.", "Ready"); __tableModel.setDirty(true); } else if (action.Equals(__BUTTON_CLOSE)) { closeWindow(); } else if (action.Equals(__BUTTON_DELETE_ROW)) { int[] rows = __worksheet.getSelectedRows(); int length = rows.Length; __tableModel.setDirty(true); if (length == 0) { return; } for (int i = (length - 1); i >= 0; i--) { __worksheet.deleteRow(rows[i]); } __dirty = true; setMessages("Time series list has changed.", "Ready"); } else if (action.Equals(__BUTTON_HELP)) { // REVISIT HELP (JTS - 2003-07-09) } else if (action.Equals(__BUTTON_SAVE_FILE)) { JGUIUtil.setWaitCursor(this, true); string lastDirectorySelected = JGUIUtil.getLastFileDialogDirectory(); JFileChooser fc = null; if (!string.ReferenceEquals(lastDirectorySelected, null)) { fc = new JFileChooser(lastDirectorySelected); } else { fc = new JFileChooser(); } fc.setDialogTitle("Select Output Control File"); SimpleFileFilter @out = new SimpleFileFilter("out", "StateMod Output Control Files"); fc.addChoosableFileFilter(@out); SimpleFileFilter tpl = new SimpleFileFilter("tpo", "StateMod Output Control Files"); fc.addChoosableFileFilter(tpl); SimpleFileFilter xou = new SimpleFileFilter("xou", "StateMod Output Control Files"); fc.addChoosableFileFilter(xou); fc.setAcceptAllFileFilterUsed(false); fc.setFileFilter(tpl); fc.setDialogType(JFileChooser.SAVE_DIALOG); JGUIUtil.setWaitCursor(this, false); int retVal = fc.showSaveDialog(this); if (retVal != JFileChooser.APPROVE_OPTION) { return; } string currDir = (fc.getCurrentDirectory()).ToString(); if (!currDir.Equals(lastDirectorySelected, StringComparison.OrdinalIgnoreCase)) { JGUIUtil.setLastFileDialogDirectory(currDir); } string filename = fc.getSelectedFile().getName(); FileFilter ff = fc.getFileFilter(); if (ff == @out) { filename = IOUtil.enforceFileExtension(filename, "out"); } else if (ff == tpl) { filename = IOUtil.enforceFileExtension(filename, "tpo"); } else if (ff == xou) { filename = IOUtil.enforceFileExtension(filename, "xou"); } __dirty = false; __tableModel.setDirty(false); System.Collections.IList theGraphNodes = __worksheet.getAllData(); try { StateMod_GraphNode.writeStateModOutputControlFile(null, currDir + File.separator + filename, theGraphNodes, null); } catch (Exception e) { Message.printWarning(1, routine, "Error saving output control file\n" + "\"" + currDir + File.separator + filename + "\"", this); Message.printWarning(2, routine, e); } } else if (action.Equals(__BUTTON_LOAD_FILE)) { JGUIUtil.setWaitCursor(this, true); string lastDirectorySelected = JGUIUtil.getLastFileDialogDirectory(); JFileChooser fc = null; if (!string.ReferenceEquals(lastDirectorySelected, null)) { fc = new JFileChooser(lastDirectorySelected); } else { fc = new JFileChooser(); } fc.setDialogTitle("Select Output Control File"); SimpleFileFilter @out = new SimpleFileFilter("out", "StateMod Output Control Files"); fc.addChoosableFileFilter(@out); SimpleFileFilter tpl = new SimpleFileFilter("tpo", "StateMod Output Control Files"); fc.addChoosableFileFilter(tpl); SimpleFileFilter xou = new SimpleFileFilter("xou", "StateMod Output Control Files"); fc.addChoosableFileFilter(xou); fc.setAcceptAllFileFilterUsed(false); fc.setFileFilter(tpl); fc.setDialogType(JFileChooser.OPEN_DIALOG); JGUIUtil.setWaitCursor(this, false); int retVal = fc.showOpenDialog(this); if (retVal != JFileChooser.APPROVE_OPTION) { return; } string currDir = (fc.getCurrentDirectory()).ToString(); if (!currDir.Equals(lastDirectorySelected, StringComparison.OrdinalIgnoreCase)) { JGUIUtil.setLastFileDialogDirectory(currDir); } string filename = fc.getSelectedFile().getName(); JGUIUtil.setWaitCursor(this, true); __dirty = false; System.Collections.IList theGraphNodes = new List <object>(20, 1); try { __worksheet.clear(); __tableModel.setDirty(false); StateMod_GraphNode.readStateModOutputControlFile(theGraphNodes, currDir + File.separator + filename); int size = theGraphNodes.Count; StateMod_GraphNode g = null; int row = 0; for (int i = 0; i < size; i++) { row = __worksheet.getRowCount(); g = (StateMod_GraphNode)theGraphNodes[i]; if (i == 0) { if (g.getID().Equals("All")) { __useAllJCheckBox.setSelected(true); } else { __useAllJCheckBox.setSelected(false); } } __worksheet.addRow(g); __tableModel.fillIDColumn(row, g.getType()); } __worksheet.setData(theGraphNodes); } catch (Exception e) { Message.printWarning(1, routine, "Error loading output control file\n" + "\"" + currDir + File.separator + filename + "\"", this); Message.printWarning(2, routine, e); } JGUIUtil.setWaitCursor(this, false); } else if (action.Equals(__CHECKBOX_USE_ALL)) { // if the use all checkbox is selected, subtle changes from the // default functionality are made. The buttons to add and // delete rows are disabled, and the ID of the only record // in the worksheet is set to "All". This ID value is used // in the table model to determine when the checkbox is // selected. In addition, the ComboBox functionality of the // first and third data columns is turned off. if (__useAllJCheckBox.isSelected()) { __addRowButton.setEnabled(false); __deleteRowButton.setEnabled(false); __worksheet.setColumnJComboBoxValues(0, null); __worksheet.setColumnJComboBoxValues(2, null); __worksheet.clear(); StateMod_GraphNode g = new StateMod_GraphNode(); g.setID("All"); __worksheet.setCellEditable(0, 0, false); __worksheet.setCellEditable(0, 1, false); __worksheet.setCellEditable(0, 2, false); __worksheet.addRow(g); } else { __addRowButton.setEnabled(true); __deleteRowButton.setEnabled(true); System.Collections.IList v = StateMod_Util.arrayToList(StateMod_GraphNode.node_types); v.Add("Other"); __worksheet.setColumnJComboBoxValues(0, v); __worksheet.clear(); System.Collections.IList offOn = new List <object>(); offOn.Add("Off"); offOn.Add("On"); __worksheet.setCellEditable(0, 0, true); __worksheet.setColumnJComboBoxValues(2, offOn); } } }