Package rma.swing

Class RmaJTable

All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, MouseListener, TextListener, ImageObserver, MenuContainer, Printable, Serializable, EventListener, Accessible, CellEditorListener, DocumentListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable, Modifiable, TimeZoneComponent, UnitsComponent, EditableComponent, FormManagementListener, RmaValidComponent
Direct Known Subclasses:
AccessTable, ColorTable, HecDataTable

extension of the swing JTable that includes specialized editors/renderers popup menu, row and column headers etc. example of use:

JFrame frame = new JFrame(); Object[][] data = { {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)}, {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)}, {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)}, {"Mark", "Andrews", "Speed reading", new Integer(20), new Boolean(true)}, {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)} }; String[] columnNames = {"First\nName", "Last\nName", "Sport", "# of Years", "Vegetarian"}; String[] columnNames2 = {"Name\nFirst", "Name\nLast", "Sport", "# of Years", "Vegetarian"}; boolean[] enabled = { true, true, true, true, true }; //RmaJTable tbl = new RmaJTable(frame, data, columnNames); RmaJTable tbl = new RmaJTable(frame, columnNames); tbl.setCellRenderer(); tbl.setMlHeaderRenderer(); tbl.setCells(data); // to enable row headers //tbl.setRowHeaderEnabled(true); // to enable auto row headers //tbl.setAutoRowHeaders(true); tbl.setCellSelectionEnabled(false); tbl.setRowSelectionAllowed(true); tbl.setColumnSelectionAllowed(false); Vector v = new Vector(); for (int i = 0; i < data.length; i++ ) v.addElement(data[i][2]); tbl.setComboBoxEditor(2, v); frame.getContentPane().add(tbl.getScrollPane(), BorderLayout.NORTH); frame.setSize(300,600); frame.setVisible(true); //tbl.setNumRows(2); //tbl.displayNumCol(3); //tbl.displayNumCol(4); tbl.setColumnLabels(columnNames2); //tbl.setColumnEnabled(false, 1);

See Also:
  • Field Details

  • Constructor Details

    • RmaJTable

      public RmaJTable()
    • RmaJTable

      public RmaJTable(Component parent)
      create RmaJTable with default data model
      Parameters:
      parent - Description
    • RmaJTable

      public RmaJTable(RmaTableModelInterface dm)
    • RmaJTable

      public RmaJTable(Component parent, RmaTableModelInterface dm)
    • RmaJTable

      public RmaJTable(Component parent, Object[] columnNames)
      create RmaJTable with column title array
      Parameters:
      parent - Description
      columnNames - Description
    • RmaJTable

      public RmaJTable(Component parent, Object[][] rowData, Object[] columnNames)
      create RmaJTable with rowdata array and columntitles array
      Parameters:
      parent - Description
      rowData - Description
      columnNames - Description
    • RmaJTable

      public RmaJTable(Component parent, Vector rowData, Vector columnNames)
      create new RmaJTable with rowData vector and ColumnNames vector
      Parameters:
      parent - Description
      rowData - Description
      columnNames - Description
  • Method Details

    • getDisplayScaleMap

      public Map<Integer,rma.swing.RmaJTable.ParameterScale> getDisplayScaleMap()
    • setDisplayScaleFactor

      public void setDisplayScaleFactor(int paramId, double scaleFactor)
      Sets the DisplayScaleFactor attribute of the RmaJTable object
      Specified by:
      setDisplayScaleFactor in interface UnitsComponent
      Parameters:
      paramId - The new DisplayScaleFactor value
      scaleFactor - The new DisplayScaleFactor value
    • setDisplayUnitsSystem

      public void setDisplayUnitsSystem(int unitSystem)
      Sets the DisplayUnitsSystem attribute of the RmaJTable object
      Specified by:
      setDisplayUnitsSystem in interface UnitsComponent
      Parameters:
      unitSystem - The new DisplayUnitsSystem value
    • getDisplayUnitSystem

      public int getDisplayUnitSystem()
      Gets the DisplayUnitSystem attribute of the RmaJTable object
      Returns:
      The DisplayUnitSystem value
    • setTimeZone

      public void setTimeZone(TimeZone tz)
      Sets the TimeZone attribute of the RmaJTable object
      Specified by:
      setTimeZone in interface TimeZoneComponent
      Parameters:
      tz - The new TimeZone value
    • getTimeZone

      public TimeZone getTimeZone()
      Gets the TimeZone attribute of the RmaJTable object
      Specified by:
      getTimeZone in interface TimeZoneComponent
      Returns:
      The TimeZone value
    • setColumnParameters

      public void setColumnParameters(int[] params)
      Sets the ColumnParameters attribute of the RmaJTable object
      Parameters:
      params - The new ColumnParameters value
    • getDisplayUnitsString

      public String getDisplayUnitsString(int system)
      Gets the DisplayUnitsString attribute of the RmaJTable object
      Specified by:
      getDisplayUnitsString in interface UnitsComponent
      Parameters:
      system - Description
      Returns:
      The DisplayUnitsString value
      See Also:
    • getDisplayUnitsString

      public String getDisplayUnitsString(int system, int column)
      Gets the DisplayUnitsString attribute of the RmaJTable object
      Parameters:
      system - Description
      column - Description
      Returns:
      The DisplayUnitsString value
    • createRmaCellRenderer

      public RmaCellRenderer createRmaCellRenderer()
      Create a cell renderer for general use in the table. This method was added so that it can be overridden in in subclasses of RmaJTable to use customized cell renderers.
    • setCellRenderer

      public void setCellRenderer()
      set the table cell renderer with an RmaCellRenderer
    • getDefaultRenderer

      public TableCellRenderer getDefaultRenderer(Class<?> columnClass)
      Overrides:
      getDefaultRenderer in class JTable
      Parameters:
      columnClass - Description
      Returns:
      The DefaultRenderer value
    • createDefaultDataModel

      protected TableModel createDefaultDataModel()
      create the default table model, initialize the table sets the table up : setCellSelectionEnabled(true); setRowSelectionAllowed(false); setColumnSelectionAllowed(false);
      Overrides:
      createDefaultDataModel in class JTable
      Returns:
      Description
    • createDefaultEditors

      public void createDefaultEditors()
      Method Description
      Overrides:
      createDefaultEditors in class JTable
    • createDefaultRenderers

      protected void createDefaultRenderers()
      Method Description
      Overrides:
      createDefaultRenderers in class JTable
    • createDefaultTableHeader

      protected JTableHeader createDefaultTableHeader()
      Overrides:
      createDefaultTableHeader in class JTable
    • createDefaultBorder

      protected void createDefaultBorder()
      Method Description
    • buildControls

      protected void buildControls()
      build the table controls, setup the default cell editor
    • createScrollPane

      protected JScrollPane createScrollPane()
    • setPopupMenu

      public void setPopupMenu(JPopupMenu popup)
      allow the user to set their own popup menu
      Parameters:
      popup - The new PopupMenu value
    • buildPopup

      protected void buildPopup()
      build the popup menu
    • getPopupMenuItemFont

      protected Font getPopupMenuItemFont()
    • setUpTabKeys

      protected void setUpTabKeys()
      set up so that the TAB and SHIFT-TAB are managed by the table.
    • tabBackAction

      protected void tabBackAction(int ancRow, int ancCol)
      Parameters:
      ancRow -
      ancCol -
    • tabForwardAction

      protected void tabForwardAction(int ancRow, int ancCol)
      Parameters:
      ancRow -
      ancCol -
    • findInTableAction

      protected void findInTableAction()
    • processComponentKeyEvent

      protected void processComponentKeyEvent(KeyEvent e)
      Method Description
      Overrides:
      processComponentKeyEvent in class JComponent
      Parameters:
      e - Description
    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      add a table model listener to the table model
      Parameters:
      l - The feature to be added to the TableModelListener attribute
    • addTableChangeListener

      public void addTableChangeListener(TableChangeListener t)
      add a table change listener
      Parameters:
      t - The feature to be added to the TableChangeListener attribute
    • removeTableChangeListener

      public void removeTableChangeListener(TableChangeListener t)
      Method Description
      Parameters:
      t - Description
    • addTableMinMaxTracker

      public void addTableMinMaxTracker(int col)
      add a TableMinMaxTracker for column col
      Parameters:
      col - The feature to be added to the TableMinMaxTracker attribute
    • removeCellEditorListener

      public void removeCellEditorListener(TableChangeListener l)
      Parameters:
      l - Description
    • addCellEditorListener

      public void addCellEditorListener(CellEditorListener l)
      add a cell editor listener
      Parameters:
      l - The feature to be added to the CellEditorListener attribute
    • removeCellEditorListener

      public void removeCellEditorListener(CellEditorListener l)
      remove a cell editor listener
      Parameters:
      l - Description
    • removeEditorListeners

      protected void removeEditorListeners()
      Method Description
    • editingCanceled

      public void editingCanceled(ChangeEvent e)
      called when editing has been canceled. Pass on this call to any registered listeners.
      Specified by:
      editingCanceled in interface CellEditorListener
      Overrides:
      editingCanceled in class JTable
      Parameters:
      e - Description
    • _editingStopped

      public boolean _editingStopped(ChangeEvent e)
      Checks to see if editing should be stopped. Returns true if editing has been stopped otherwise false. This method check to see if the edited field is valid and if the whole table is valid. If both are true, editing is stopped and the editor is removed.
      Parameters:
      e - Description
      Returns:
      Description
    • editingStopped

      public void editingStopped(ChangeEvent e)
      called when editing has stopped. Pass on call to any registered listeners.
      Specified by:
      editingStopped in interface CellEditorListener
      Overrides:
      editingStopped in class JTable
      Parameters:
      e - Description
    • editCellAt

      public boolean editCellAt(int row, int column, EventObject e)
      Method Description
      Overrides:
      editCellAt in class JTable
      Parameters:
      row - Description
      column - Description
      e - Description
      Returns:
      Description
    • tableChanged

      public void tableChanged(TableModelEvent e)
      table model data has changed
      Specified by:
      tableChanged in interface TableModelListener
      Overrides:
      tableChanged in class JTable
      Parameters:
      e - Description
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      editor listener methods
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      e - Description
    • changedUpdate

      public void changedUpdate(DocumentEvent e)
      Method Description
      Specified by:
      changedUpdate in interface DocumentListener
      Parameters:
      e - Description
    • insertUpdate

      public void insertUpdate(DocumentEvent e)
      Method Description
      Specified by:
      insertUpdate in interface DocumentListener
      Parameters:
      e - Description
    • removeUpdate

      public void removeUpdate(DocumentEvent e)
      Method Description
      Specified by:
      removeUpdate in interface DocumentListener
      Parameters:
      e - Description
    • getMinMax

      public Object[] getMinMax(int col)
      get the min and max values for a column
      Parameters:
      col - Description
      Returns:
      The MinMax value
    • prepareEditor

      public Component prepareEditor(TableCellEditor editor, int row, int column)
      private void setUpDecimalEditor(JTable table) { /Set up the editor for the integer cells. final RMADecimalField decimalField = new RMADecimalField(0, 5); decimalField.setHorizontalAlignment(decimalField.RIGHT); DefaultCellEditor decimalEditor = new DefaultCellEditor(decimalField) { /Override DefaultCellEditor's getCellEditorValue method /to return an Integer, not a String: public Object getCellEditorValue() { return new Double(decimalField.getValue()); } }; table.setDefaultEditor(Double.class, decimalEditor); } Prepares the specified editor using the value at the specified cell.
      Overrides:
      prepareEditor in class JTable
      Parameters:
      editor - Description
      row - Description
      column - Description
      Returns:
      Description
    • getNumRows

      public int getNumRows()
      return the number of rows in the table model
      Returns:
      The NumRows value
    • getRow

      public Vector<?> getRow(int rowNum)
      return a Vector from the table model for row rowNum
      Parameters:
      rowNum - Description
      Returns:
      The Row value
    • getScrollPane

      public JScrollPane getScrollPane()
      return the scroll pane that this table is residing in this is the component that needs added to the screen
      Returns:
      The ScrollPane value
    • setRowSelectionInterval

      public void setRowSelectionInterval(int index0, int index1, boolean scrollToSelection)
    • isModified

      public boolean isModified()
      returns whether this table has been modified
      Specified by:
      isModified in interface Modifiable
      Returns:
      The Modified value
    • setModified

      public void setModified(boolean modified)
      sets whether this table has been modified
      Specified by:
      setModified in interface Modifiable
      Parameters:
      modified - The new Modified value
    • setParent

      public void setParent(Component parent)
      sets the parent for this dialog
      Parameters:
      parent - The new Parent value
    • setColumnWidths

      public void setColumnWidths(int... widths)
      set the column widths to the array of widths.
      Parameters:
      widths - The new ColumnWidths value
    • setDefaultHeaderToolTipText

      public void setDefaultHeaderToolTipText()
      set tooltips for the headers to display whats in the header cell
    • setColumnWidth

      public void setColumnWidth(int colNum, int width)
      set the column width for a given column
      Parameters:
      colNum - The new ColumnWidth value
      width - The new ColumnWidth value
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      popup mouse selection has occurred
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - Description
    • getSelectedRowsVector

      public Vector getSelectedRowsVector()
      when RowSelectionAllowed is set it will return a vector of vectors that contain the selected rows
      Returns:
      The SelectedRowsVector value
    • getSelectedCellData

      public Object getSelectedCellData()
      returns the first selected cell's data
      Returns:
      The SelectedCellData value
    • setNumColumns

      public void setNumColumns(int columns)
      set the number of columns
      Parameters:
      columns - The new NumColumns value
    • getClickCountToStart

      public int getClickCountToStart()
    • setRowForeground

      public void setRowForeground(int rowNum, Color rfColor)
      set the foreground color for the row at rowNum
      Parameters:
      rowNum - The new RowForeground value
      rfColor - The new RowForeground value
    • setRowBackground

      public void setRowBackground(int rowNum, Color rbColor)
      set the background color for the row at rowNum
      Parameters:
      rowNum - The new RowBackground value
      rbColor - The new RowBackground value
    • clearRowBackgrounds

      public void clearRowBackgrounds()
      Clears all Row backgrounds set by setRowBackground()
    • getRowBackground

      public Color getRowBackground(int rowNum)
      get the background color for the row at rowNum
      Parameters:
      rowNum - Description
      Returns:
      The RowBackground value
    • getRowBackground

      public Color getRowBackground(int rowNum, int colNum)
      Gets the RowBackground attribute of the RmaJTable object
      Parameters:
      rowNum - Description
      colNum - Description
      Returns:
      The RowBackground value
    • setColumnBackground

      public void setColumnBackground(int colNum, Color color)
      Sets the ColumnBackground attribute of the RmaJTable object
      Parameters:
      colNum - The new ColumnBackground value
      color - The new ColumnBackground value
    • setColumnForeground

      public void setColumnForeground(int colNum, Color color)
      Sets the ColumnForeground attribute of the RmaJTable object
      Parameters:
      colNum - The new ColumnForeground value
      color - The new ColumnForeground value
    • getColumnBackground

      public Color getColumnBackground(int colNum)
      get the background color for the
      Parameters:
      colNum - Description
      Returns:
      The ColumnBackground value
    • getColumnForeground

      public Color getColumnForeground(int colNum)
      Gets the ColumnForeground attribute of the RmaJTable object
      Parameters:
      colNum - Description
      Returns:
      The ColumnForeground value
    • setModifiedForegroundColor

      public void setModifiedForegroundColor(Color color)
      Sets the ModifiedForegroundColor attribute of the RmaJTable object
      Parameters:
      color - The new ModifiedForegroundColor value
    • getModifiedForegroundColor

      public Color getModifiedForegroundColor()
      Gets the ModifiedForegroundColor attribute of the RmaJTable object
      Returns:
      The ModifiedForegroundColor value
    • setPasteBackground

      public void setPasteBackground(Color color)
      set the background for cells that get pasted into
      Parameters:
      color - The new PasteBackground value
    • setPasteForeground

      public void setPasteForeground(Color color)
      set the foreground for cells that get pasted into
      Parameters:
      color - The new PasteForeground value
    • getPasteBackground

      public Color getPasteBackground()
      Returns:
      The PasteBackground value
    • getPasteForeground

      public Color getPasteForeground()
      Returns:
      The PasteForeground value
    • setCellBackground

      public void setCellBackground(int row, int column, Color rbColor)
      Parameters:
      row - The new CellBackground value
      column - The new CellBackground value
      rbColor - The new CellBackground value
    • setCellForeground

      public void setCellForeground(int row, int column, Color rfColor)
      Parameters:
      row - The new CellForeground value
      column - The new CellForeground value
      rfColor - The new CellForeground value
    • setCellFont

      public void setCellFont(int row, int column, Font font)
      Parameters:
      row - The new CellBackground value
      column - The new CellBackground value
      font - The new CellBackground value
    • getCellFont

      public Font getCellFont(int row, int column)
    • getCellBackground

      public Color getCellBackground(int row, int column)
      Parameters:
      row - Description
      column - Description
      Returns:
      The CellBackground value
    • getDisabledBackground

      public Color getDisabledBackground(int row, int col)
      get the Color to use for disabled cell backgrounds
      Parameters:
      row - the cell's row
      col - the cell's column
      Returns:
      UIManager's TextField.disabledBackground color by default
    • getCellForeground

      public Color getCellForeground(int row, int column)
      Gets the CellForeground attribute of the RmaJTable object
      Parameters:
      row - Description
      column - Description
      Returns:
      The CellForeground value
    • getRowForeground

      public Color getRowForeground(int rowNum)
      get the foreground color for the row at rowNum
      Parameters:
      rowNum - Description
      Returns:
      The RowForeground value
    • getRowForeground

      public Color getRowForeground(int rowNum, int colNum)
      Parameters:
      rowNum - Description
      colNum - Description
      Returns:
      The RowForeground value
    • setPrecision

      public void setPrecision(int p)
      Sets the Precision attribute of the RmaJTable object
      Parameters:
      p - The new Precision value
    • setAlternatingReportBackground

      public void setAlternatingReportBackground(boolean b)
    • getAlternatingReportBackground

      public boolean getAlternatingReportBackground()
    • setAlternatingReportBackgroundColor

      public void setAlternatingReportBackgroundColor(Color color)
    • getAlternatingReportBackgroundColor

      public Color getAlternatingReportBackgroundColor()
    • getPrecision

      public int getPrecision()
      Gets the Precision attribute of the RmaJTable object
      Returns:
      The Precision value
    • getColumnLabel

      public String getColumnLabel(int colNum)
      Gets a column label (header).
      Parameters:
      colNum - The column for which to retrieve the label.
      Returns:
      The column label.
    • getColumnLabels

      public String[] getColumnLabels()
      Gets the column headers
      Returns:
      The ColumnLabels value
    • setColumnLabel

      public void setColumnLabel(int colNum, String label)
      Sets a column label (header).
      Parameters:
      colNum - The column for which to set the label.
      label - The label text.
    • setColumnLabels

      public void setColumnLabels(String[] colNames)
      sets the column headers
      Parameters:
      colNames - The new ColumnLabels value
    • getColumnHeaderForeground

      public Color getColumnHeaderForeground(int colNum)
      Gets the foreground color for a column header.
      Parameters:
      colNum - The column number.
      Returns:
      The foreground color of the column header.
    • setColumnHeaderForeground

      public void setColumnHeaderForeground(int colNum, Color color)
      Sets the foreground color for a column header.
      Parameters:
      colNum - The column number.
      color - The foreground color.
    • getColumnHeaderBackground

      public Color getColumnHeaderBackground(int colNum)
      Gets the background color for a column header.
      Parameters:
      colNum - The column number.
      Returns:
      The background color of the column header.
    • setColumnHeaderBackground

      public void setColumnHeaderBackground(int colNum, Color color)
      Sets the background color for a column header.
      Parameters:
      colNum - The column number.
      color - The background color.
    • getColumnHeaderFont

      public Font getColumnHeaderFont(int colNum)
      Gets the font for a column header.
      Parameters:
      colNum - The column number.
      Returns:
      The font of the column header.
    • setColumnHeaderFont

      public void setColumnHeaderFont(int colNum, Font font)
      Sets the foreground color for a column header.
      Parameters:
      colNum - The column number.
      font - The font.
    • setColumnVisible

      public TableColumn setColumnVisible(int colNum, boolean show, int preferedWidth) throws IllegalArgumentException
      show or hide column colNum. If showing set the column width to preferred size hiding a column is based on the TableColumnModel showing a column is based on the TableModel
      Parameters:
      colNum - The new ColumnVisible value
      show - The new ColumnVisible value
      preferedWidth - The new ColumnVisible value
      Returns:
      Description
      Throws:
      IllegalArgumentException - Description
    • setColumnVisible

      public TableColumn setColumnVisible(int tmColNum, int tcmColNum, boolean show, int preferedWidth) throws IllegalArgumentException
      show or hide a column.
      Parameters:
      tmColNum - The new ColumnVisible value
      tcmColNum - The new ColumnVisible value
      show - The new ColumnVisible value
      preferedWidth - The new ColumnVisible value
      Returns:
      Description
      Throws:
      IllegalArgumentException - Description
    • displayNumCol

      public void displayNumCol(int colNum)
      change the column model to display colNum number of columns
      Parameters:
      colNum - Description
    • getHorizontalAlignment

      public int getHorizontalAlignment(int col)
    • createAlignTableCellRenderer

      public AlignTableCellRenderer createAlignTableCellRenderer(int align)
      Creates an AlignTableCellRenderer. Method used to allow subclasses of RmaJTable to override the cell renderer.
      Parameters:
      align -
      Returns:
    • setHorizontalAlignment

      public void setHorizontalAlignment(int align)
      sets the horizontal alignment for all table columns
      Parameters:
      align - The new HorizontalAlignment value
    • setHorizontalAlignment

      public void setHorizontalAlignment(int align, int col)
      sets the horizontal alignment for a given table column
      Parameters:
      align - The new HorizontalAlignment value
      col - The column
    • setTabToEditCell

      public void setTabToEditCell(boolean tabToEditCell)
      Set if a tab key should select the next editable cell in the row (if no more editable cells, the tab just moves to the next cell)
      Parameters:
      tabToEditCell - The new TabToEditCell value
    • setCurrencyCellEditor

      public RmaJDecimalField setCurrencyCellEditor(int col)
    • setTextAreaCellEditor

      public JTextArea setTextAreaCellEditor(int col, boolean addSrcollPane)
      set the cell editor and renderer for multiple lines of text
      Parameters:
      col - The new TextAreaCellEditor value
      Returns:
      Description
    • setTextAreaCellEditor

      public JTextArea setTextAreaCellEditor(int col)
    • setToggleCellEditor

      public void setToggleCellEditor(int col, char key1, char key2, char toggleKey)
      set the editor to toggle between 2 key values.
      Parameters:
      col - The new ToggleCellEditor value
      key1 - The new ToggleCellEditor value
      key2 - The new ToggleCellEditor value
      toggleKey - The new ToggleCellEditor value
    • setButtonCellEditor

      public JButton setButtonCellEditor(int col)
      Sets a button editor on the specified column. The button is returned to add ActionListeners or change its appearance.
    • setDoubleCellEditor

      public void setDoubleCellEditor()
      set the cell editor for all the columns to be a RMADecimalField
    • setDoubleCellEditor

      public void setDoubleCellEditor(boolean showFormatting)
      set the cell editor for all the columns to be a RMADecimalField specifying whether to show commas.
      Parameters:
      showFormatting - The new DoubleCellEditor value
    • setDoubleCellEditor

      public void setDoubleCellEditor(int beginCol, int endCol)
      set the cell editor from beginCol to EndCol to be a RMADecimalField
      Parameters:
      beginCol - The new DoubleCellEditor value
      endCol - The new DoubleCellEditor value
    • setDoubleCellEditor

      public void setDoubleCellEditor(int beginCol, int endCol, boolean showFormatting)
      set the double cell editor from beginCol to endCol to be a RMADecimalField if showFormatting is true then show with embedded commas.
      Parameters:
      beginCol - The new DoubleCellEditor value
      endCol - The new DoubleCellEditor value
      showFormatting - The new DoubleCellEditor value
    • setDoubleCellEditor

      public RmaJDecimalField setDoubleCellEditor(int col)
      set a cell editor for column col to be a RMADecimalField
      Parameters:
      col - The new DoubleCellEditor value
      Returns:
      Description
    • setDoubleCellEditor

      public RmaJDecimalField setDoubleCellEditor(int col, boolean showFormatting)
      set a cell editor for column col to be a RMADecimalField
      Parameters:
      col - The new DoubleCellEditor value
      showFormatting - The new DoubleCellEditor value
      Returns:
      Description
    • setDoubleEditorForCell

      public RmaJDecimalField setDoubleEditorForCell(int row, int col)
      Sets an integer editor for a specific row in a column
      Parameters:
      row - the table row for the editor
      col - the table column for the editor
    • setEditorForCell

      protected JTextField setEditorForCell(int row, int col, JTextField fld)
      Parameters:
      row -
      col -
      fld -
      Returns:
    • createDecimalField

      protected RmaJDecimalField createDecimalField(int col, int precision)
    • setIntegerCellEditor

      public RmaJIntegerField setIntegerCellEditor(int col)
    • setIntegerEditorForCell

      public RmaJIntegerField setIntegerEditorForCell(int row, int col)
      Sets an integer editor for a specific row in a column
      Parameters:
      row - the table row for the editor
      col - the table column for the editor
    • setLongCellEditor

      public RmaJLongField setLongCellEditor(int col)
      Parameters:
      col -
      Returns:
    • setDescriptionCellEditor

      public RmaJDescriptionField setDescriptionCellEditor(int col)
      set the editor to be a RmaJDescriptionField which has elipsis button to display the entire contents of the text
      Parameters:
      col - the table column
      Returns:
      the editor component
    • setTimeCellEditor

      public RmaJ24HourTimeField setTimeCellEditor(int col)
      set the cell editor to be Military time
      Parameters:
      col - The new TimeCellEditor value
      Returns:
      Description
    • setTimeEditorForCell

      public RmaJ24HourTimeField setTimeEditorForCell(int row, int col)
      set a time editor for a table cell
      Parameters:
      row - the editor row
      col - the editor column
      Returns:
      the editor
    • setDateEditorForCell

      public RmaJDateField setDateEditorForCell(int row, int col, String format, boolean showCalendar)
      set a date editor for a cell
      Parameters:
      row - row for the editor
      col - column for the editor
      format - the format of the text to enter. @see rma.swing.text.DateDocument for formats
      Returns:
      the editor
    • setDateCellEditor

      public RmaJCalendarField setDateCellEditor(int col, String format)
      set the cell editor to be a date
      Parameters:
      col - The new DateCellEditor value
      format - The new DateCellEditor value
      Returns:
      Description
    • setDateCellEditor

      public RmaJDateField setDateCellEditor(int col, String format, boolean showCalendar)
    • setDateTimeCellEditor

      public RmaJDateTimeField setDateTimeCellEditor(int col)
    • setDateTimeEditorForCell

      public RmaJDateTimeField setDateTimeEditorForCell(int row, int col)
      set a date time editor for a cell
      Parameters:
      row - row for the editor
      col - column for the editor
      Returns:
      the editor
    • setDssPathPartCellEditor

      public RmaJDssPathPartField setDssPathPartCellEditor(int col)
      set the cell editor to be a date
      Parameters:
      col - The new DssPathPartCellEditor value
      Returns:
      Description
    • clearAllComboBoxRowEditorValues

      public void clearAllComboBoxRowEditorValues(int col)
      clear out all the values in the JComboBoxes for the column col
      Parameters:
      col - the table column
    • setComboBoxRowEditor

      public RmaJComboBox setComboBoxRowEditor(int row, int col, Vector data)
      Sets the component Editor for a specific row in a column
      Parameters:
      row - The new ComboBoxRowEditor value
      col - The new ComboBoxRowEditor value
      data - The new ComboBoxRowEditor value
    • setComboBoxCellEditor

      public RmaJComboBox setComboBoxCellEditor(int row, int col, RmaJComboBox comboBox)
      Sets the RmaJComboBox component Editor for a specific row and column
      Parameters:
      row - The new ComboBoxRowEditor value
      col - The new ComboBoxRowEditor value
      comboBox - The new ComboBoxRowEditor
      Returns:
      void
    • setTextFieldRowEditor

      public void setTextFieldRowEditor(int row, int col, String value)
    • setColorComboBoxEditor

      public RmaJColorComboBox setColorComboBoxEditor(int col)
      set the column col to have a Color combo box editor
      Parameters:
      col - The new ColorComboBoxEditor value
      Returns:
      Description
    • setComboBoxEditor

      public JComboBox setComboBoxEditor(int col, Object[] data)
      set the column col to have a combo box editor with the dropdown filled with sorted data
      Parameters:
      col - The new ComboBoxEditor value
      data - The new ComboBoxEditor value
      Returns:
      Description
    • setComboBoxEditor

      public JComboBox setComboBoxEditor(int col, Object[] data, boolean sortData)
      set the column col to have a combo box editor with the dropdown filled with data
      Parameters:
      col - The new ComboBoxEditor value
      data - The new ComboBoxEditor value
      sortData - The new ComboBoxEditor value
      Returns:
      Description
    • createComboBoxEditor

      protected RmaJComboBox createComboBoxEditor(int col, Object[] data, boolean sortData)
      Parameters:
      col -
      data -
      Returns:
    • setComboBoxEditor

      public JComboBox setComboBoxEditor(int col, Vector data)
      set the column col to have a combo box editor with the dropdown filled with data
      Parameters:
      col - The new ComboBoxEditor value
      data - The new ComboBoxEditor value
      Returns:
      Description
    • setColumnEditor

      public void setColumnEditor(int col, RmaCellEditor editor)
      set the column col to have the arg editor.
      Parameters:
      col - The new ColumnEditor value
      editor - The new ColumnEditor value
    • setColumnEditor

      public void setColumnEditor(int col, RmaCellEditor editor, TableCellRenderer renderer)
    • setFixedLengthCellEditor

      public void setFixedLengthCellEditor(int col, int length, int Case)
      set a cell editor for a column to be a fixed length field if case == 1 then the field will be all uppercase case == -1 then the field will be all lowercase
      Parameters:
      col - The new FixedLengthCellEditor value
      length - The new FixedLengthCellEditor value
      Case - The new FixedLengthCellEditor value
    • setUnitsHeaderRenderer

      public void setUnitsHeaderRenderer()
      Sets the UnitsHeaderRenderer attribute of the RmaJTable object
    • setUnitsHeaderRenderer

      public void setUnitsHeaderRenderer(boolean useDefaultRenderer)
      Parameters:
      useDefaultRenderer -
    • setMlHeaderRenderer

      public MleHeadRenderer setMlHeaderRenderer()
      sets table up to display multi line headers
    • setCheckBoxCellEditor

      public JCheckBox setCheckBoxCellEditor(int col)
      sets a TextArea editor for column number col
      Parameters:
      col - The new CheckBoxCellEditor value
      Returns:
      Description
    • setCheckBoxCellEditor

      public JCheckBox setCheckBoxCellEditor(int col, boolean useSelectionBackground)
      sets a TextArea editor for column number col sets a checkbox editor for column number col
      Parameters:
      col - The new CheckBoxCellEditor value
      useSelectionBackground - true for the CellRenderer to render the selection background when the cell is selection
      Returns:
      Description
    • createBooleanRenderer

      protected TableCellRenderer createBooleanRenderer(boolean useSelectionBackground)
    • setAllColumnsEnabled

      public void setAllColumnsEnabled(boolean enable)
      enables or disables all columns
      Parameters:
      enable - The new AllColumnsEnabled value
    • setIsEditable

      public void setIsEditable(boolean b)
      for EditableComponent interface
      Specified by:
      setIsEditable in interface EditableComponent
      Parameters:
      b - The new IsEditable value
    • setEnabled

      public void setEnabled(boolean enable)
      Sets the Enabled attribute of the RmaJTable object
      Overrides:
      setEnabled in class JComponent
      Parameters:
      enable - The new Enabled value
    • setUseNonContiguousSelection

      public final void setUseNonContiguousSelection(boolean useNonContiguousSelection)
      Option to turn on/ off non contiguous selection in a table.
      Parameters:
      useNonContiguousSelection -
    • changeSelection

      public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
      Overrides:
      changeSelection in class JTable
    • isCellSelected

      public boolean isCellSelected(int row, int column)
      Overrides:
      isCellSelected in class JTable
    • clearSelection

      public void clearSelection()
      Overrides:
      clearSelection in class JTable
    • getSelectedRows

      public int[] getSelectedRows()
      if useNonContiguousSelection is set: Normally, for default tables, if user selected (1,1) and (1,2), getSelectedRow and getSelectedColumn would return: rows = [1] and columns = [1,2]. However, since we are dealing with noncontiguous cells, these two methods return instead: rows = [1, 1] and columns = [1, 2].
      Overrides:
      getSelectedRows in class JTable
    • getSelectedColumns

      public int[] getSelectedColumns()
      Overrides:
      getSelectedColumns in class JTable
    • setMenusEnabled

      protected void setMenusEnabled(boolean editable)
      Sets the MenusEnabled attribute of the RmaJTable object
      Parameters:
      editable - The new MenusEnabled value
    • setEditable

      public void setEditable(boolean editable)
      set whether this table is editable or not
      Parameters:
      editable - The new Editable value
    • isEditable

      public boolean isEditable()
      get whether this table is editable or not
      Returns:
      The Editable value
    • setRowEnabled

      public void setRowEnabled(boolean enable, int row)
      Sets the RowEnabled attribute of the RmaJTable object
      Parameters:
      enable - The new RowEnabled value
      row - The new RowEnabled value
    • resetRowEnabled

      public void resetRowEnabled()
      Method Description
    • setColumnsEnabled

      public void setColumnsEnabled(boolean enabled, int... cols)
      enable or disable column a set of columns
      Parameters:
      enabled - true to enable the column, false to disable
      cols - The columns to set enabled or disabled
    • setColumnEnabled

      public void setColumnEnabled(boolean enable, int col)
      enable or disable column col
      Parameters:
      enable - The new ColumnEnabled value
      col - The new ColumnEnabled value
    • setCellEnabled

      public void setCellEnabled(boolean enable, int row, int col)
      Sets the CellEnabled attribute of the RmaJTable object
      Parameters:
      enable - The new CellEnabled value
      row - The new CellEnabled value
      col - The new CellEnabled value
    • setColumnsEnabled

      public void setColumnsEnabled(boolean[] enabled)
      given an array of booleans set the columns to be enabled/disabled according to the array
      Parameters:
      enabled - The new ColumnsEnabled value
    • setNumRows

      public void setNumRows(int rows)
      set the number of rows in the table model
      Parameters:
      rows - The new NumRows value
    • getSelectedCells

      public Vector getSelectedCells()
      get a vector of the selected cell data
      Returns:
      The SelectedCells value
    • getFirstSelectedCell

      public CellLocation getFirstSelectedCell()
      returns the first selected cell
      Returns:
      The FirstSelectedCell value
    • getLastSelectedCell

      public CellLocation getLastSelectedCell()
      return the last selected cell
      Returns:
      The LastSelectedCell value
    • getSelectedCellRange

      public Vector<CellLocation> getSelectedCellRange()
      return a vector of CellLocations for the selected cells this functionality isn't implemented if getColumnSelectionAllowed(true) is set
      Returns:
      The SelectedCellRange value
    • getSelectedCellRangeVector

      public Vector<Vector<CellLocation>> getSelectedCellRangeVector()
      returns a vector of vectors which contain CellLocations
      Returns:
      The SelectedCellRangeVector value
    • getFillToEndCellRangeVector

      protected Vector<Vector<CellLocation>> getFillToEndCellRangeVector()
    • getColumnCellRangeVector

      public Vector<Vector<CellLocation>> getColumnCellRangeVector()
      returns a vector of vectors which contain CellLocations for the selected columns
      Returns:
      The Selected column CellRangeVector value
    • getCell

      public Object getCell(int row, int col)
      get a cell in the table model. Unlike the getValueAt() in the JTable this does not try to map the col to the Column Model.
      Parameters:
      row - Description
      col - Description
      Returns:
      The Cell value
    • setCell

      public void setCell(Object obj, int row, int col)
      set a cell in the table model. Unlike the setValueAt() in the JTable this does not try to map the col to the Column Model or view. So any table sorting or filtering will result in the wrong cell being set.

      Normally setValueAt() should be used not this method.

      Parameters:
      obj - The new Cell value
      row - The new Cell value
      col - The new Cell value
    • setModel

      public void setModel(TableModel tableModel)
      Overrides:
      setModel in class JTable
    • setCells

      public void setCells(Object[][] data)
      set the table model data
      Parameters:
      data - The new Cells value
    • setCells

      public void setCells(Vector data)
      Sets the Cells attribute of the RmaJTable object
      Parameters:
      data - The new Cells value
    • setRow

      public boolean setRow(int rowNum, Object[] rowData)
      set the row rowNum in the table model to the object array rowData
      Parameters:
      rowNum - The new Row value
      rowData - The new Row value
      Returns:
      Description
    • setRow

      public boolean setRow(int rowNum, Vector rowData)
      set the row rowNum in the table model to the vector rowData
      Parameters:
      rowNum - The new Row value
      rowData - The new Row value
      Returns:
      Description
    • getCells

      public Vector getCells()
      return the data models data. A vector of vectors
      Returns:
      The Cells value
    • clearAll

      public void clearAll()
      Method Description
    • clearColors

      public void clearColors()
      clear out the foreground and background colors
    • clearCells

      public void clearCells()
      clear all the cells, leaving cells visible on screen
    • getClearedCellValue

      protected Object getClearedCellValue(int col)
      get the default value to be used when a cell is cleared.
      Returns:
    • deleteCells

      public void deleteCells()
      remove all data from the table model and remove from display
    • commitEdit

      public boolean commitEdit(boolean commit)
      if editing is occurring, either commit or cancel it
      Parameters:
      commit - Description
      Returns:
      Description
    • textValueChanged

      public void textValueChanged(TextEvent event)
      Specified by:
      textValueChanged in interface TextListener
      Parameters:
      event - Description
    • keyTyped

      public void keyTyped(KeyEvent ke)
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      ke - Description
    • keyPressed

      public void keyPressed(KeyEvent ke)
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      ke - Description
    • keyReleased

      public void keyReleased(KeyEvent ke)
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      ke - Description
    • mouseReleased

      public void mouseReleased(MouseEvent event)
      process mouse clicks for the popup menu don't override this method. its public as an implementation side-effect. override handlePopupMenu insead
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      event - the mouse event
    • handlePopupMenu

      protected void handlePopupMenu(MouseEvent event)
      handle the popup menu
      Parameters:
      event - the mouse event
    • shouldShowPopup

      protected boolean shouldShowPopup(Point popupPoint)
    • mousePressed

      public void mousePressed(MouseEvent event)
      does nothing
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      event - Description
    • mouseClicked

      public void mouseClicked(MouseEvent event)
      does nothing
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      event - Description
    • mouseEntered

      public void mouseEntered(MouseEvent event)
      does nothing
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      event - Description
    • mouseExited

      public void mouseExited(MouseEvent event)
      does nothing
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      event - Description
    • mouseDown

      public boolean mouseDown(Event event, int x, int y)
      does nothing
      Overrides:
      mouseDown in class Component
      Parameters:
      event - Description
      x - Description
      y - Description
      Returns:
      Description
    • fireTableChangeEvent

      protected void fireTableChangeEvent(int changeType, int startRow, int startCol, int endRow, int endCol)
      first off that the table has changed from a menu command
      Parameters:
      changeType - Description
      startRow - Description
      startCol - Description
      endRow - Description
      endCol - Description
    • clearPerformed

      public void clearPerformed()
      Gets called when the form decides to clear itself
      Specified by:
      clearPerformed in interface FormManagementListener
    • selectAll

      public void selectAll()
      select all the cells
      Overrides:
      selectAll in class JTable
    • undo

      public void undo()
      does nothing
    • cut

      public void cut()
      cut the data from the screen. Uses a mix of copy and clear
    • fillColumn

      public void fillColumn(int[] values, int col)
      fill a column with an integer array
      Parameters:
      values - Description
      col - Description
    • fillColumn

      public void fillColumn(Object[] values, int col)
      fill a the column num col with the object array values
      Parameters:
      values - Description
      col - Description
    • getFillDialog

      protected RmaJTableFillDialog getFillDialog(RmaJTable table)
    • fill

      public void fill()
      Method Description
    • reverseSelectionContents

      public void reverseSelectionContents()
      reverse the cells of the selection row 1 becomes the last row and the last row becomes the first
    • linearFill

      public void linearFill()
      take the first cell selected and the last cell selected and fill the cells inbetween with linear values
    • linearFill

      public void linearFill(CellLocation firstCell, CellLocation lastCell)
      Method Description
      Parameters:
      firstCell - Description
      lastCell - Description
    • constantFill

      public void constantFill(double constantValue)
      take the selected cells and add the constantValue to them
      Parameters:
      constantValue - Description
    • factorFill

      public void factorFill(double factorValue)
      Method Description
      Parameters:
      factorValue - Description
    • valueFill

      protected void valueFill(double fillValue, boolean addIt)
      Method Description
      Parameters:
      fillValue - Description
      addIt - Description
    • fillToEnd

      public void fillToEnd()
      take the first cell selected and fill all cells in that column with that value
    • repeatFill

      public void repeatFill()
      take the first cell selected and fill all cells in that column with that value
    • repeatFill

      protected void repeatFill(Vector<Vector<CellLocation>> cellTable, CellLocation firstCell, CellLocation lastCell)
    • sumColumn

      public void sumColumn(boolean entireColumn)
    • paste

      public void paste()
      paste implementation
    • pasteCell

      protected int pasteCell(String str, int r, int c)
      Method Description
      Parameters:
      str - Description
      r - Description
      c - Description
      Returns:
      Description
    • copyall

      public void copyall()
      copyall copies the whole table and puts it in the system clipboard not yet implemented
    • copy

      public void copy()
      Method Description
    • clear

      public void clear()
      Method Description
    • insertRow

      public void insertRow()
      insert a row at the current row ask user how many rows to insert.
    • getRowsToInsert

      protected int getRowsToInsert()
      Returns:
    • insertRow

      public void insertRow(Vector rowData, int row)
      insert a row of data at the specified row
      Parameters:
      rowData - data to insert
      row - place to insert it
    • appendRows

      public void appendRows()
      asks the user how many rows they want to append to the end of the table
    • appendRow

      public void appendRow()
      Appends a row to the end of the table
    • appendRow

      public void appendRow(Vector data)
      append a row of data to the end of the table
      Parameters:
      data - Description
    • appendRow

      public void appendRow(Vector data, boolean reval)
      append a row to the table. allow user to pick whether they want to revalidate the table.
      Parameters:
      data - Description
      reval - Description
    • appendRow

      public void appendRow(Vector data, boolean reval, Color bcolor, Color fcolor)
      append a row of data to the table
      Parameters:
      data - Description
      reval - Description
      bcolor - Description
      fcolor - Description
    • appendRows

      public void appendRows(int rows)
      append rows number of rows to the table
      Parameters:
      rows - Description
    • deleteRow

      public void deleteRow()
      delete the selected rows from the table
    • deleteRow

      public void deleteRow(int rowNum)
      delete the specified row from the table
      Parameters:
      rowNum -
    • removeLastRow

      public void removeLastRow()
      remove the last row from the table
    • traverseCellLeft

      public void traverseCellLeft()
      does nothing
    • traverseCellUp

      public void traverseCellUp()
      does nothing
    • traverseCellDown

      public void traverseCellDown()
      does nothing
    • traverseCellRight

      public void traverseCellRight()
      does nothing
    • setAddRemoveEnabled

      public void setAddRemoveEnabled(boolean enable)
      Sometime you don't want the user to be able to add/delete/append rows this turns off that capability. Also turns on/off pasting appending rows if more rows are in the cut buffer than the table has.
      Parameters:
      enable - false to turn off add/delete/append rows and pasting appending rows
    • setFirstFixedRow

      public void setFirstFixedRow(boolean fixed)
      set the first row fixed. This disallows inserting before the first row
      Parameters:
      fixed -
    • isFirstFixedRow

      public boolean isFirstFixedRow()
      Returns:
    • setProcessKeyEvents

      public void setProcessKeyEvents(boolean process)
      whether to process key events which causes the Enter and Escape key to be consumed.
      Parameters:
      process - true to process key events
    • getAddRemoveEnabled

      public boolean getAddRemoveEnabled()
      get the status of the append/insert/delete functionality is turned on/off
      Returns:
      The AddRemoveEnabled value
    • setPopupMenuEnabled

      public void setPopupMenuEnabled(boolean enable)
      set the popup menu enabled or not
      Parameters:
      enable - The new PopupMenuEnabled value
    • getPopupMenuEnabled

      public boolean getPopupMenuEnabled()
      get whether the popup menu is enabled
      Returns:
      The PopupMenuEnabled value
    • getPopupMenu

      public JPopupMenu getPopupMenu()
      Gets the PopupMenu attribute of the RmaJTable object
      Returns:
      The PopupMenu value
    • removePopupMenuSumOptions

      public void removePopupMenuSumOptions()
      Removes the two Sum options on the default Popup Menu Sum Selected Cells Sum Entire Column Are removed if the poup menu is defined
    • removePopupMenuPrintOptions

      public void removePopupMenuPrintOptions()
      Removes the two Print options on the default Popup Menu Print and Print Preview Are removed if the poup menu is defined
    • removePopuMenuExportOptions

      public void removePopuMenuExportOptions()
      Removes the Import option on the default Popup Menu Import is removed if the poup menu is defined
    • removePopuMenuFillOptions

      public void removePopuMenuFillOptions()
      Removes the Fill option on the default Popup Menu Import is removed if the poup menu is defined
    • removePopupMenuRowEditingOptions

      public void removePopupMenuRowEditingOptions()
      Removes the three Row Editing options on the default Popup Menu Insert Row Append Row Delete Row Are removed if the poup menu is defined This is useful when the table is non-editable
    • removePopupMenuInsertAppendOnly

      public void removePopupMenuInsertAppendOnly()
      Removes the Insert and Append row options on the default Popup Menu Insert Row Append Row Are removed if the poup menu is defined This is useful when the table is editable but doesn't allow inserting rows in between existing elements
    • setRowHeaderEnabled

      public void setRowHeaderEnabled(boolean enable)
      set the table to have row headers. This only works if the cell renderer is an RmaCellRenderer. The first row of the table model becomes the row headers
      Parameters:
      enable - The new RowHeaderEnabled value
    • setRowHeaderRenderer

      public void setRowHeaderRenderer(int column)
    • getRowHeaderEnabled

      public boolean getRowHeaderEnabled()
      get whether row headers are enabled
      Returns:
      The RowHeaderEnabled value
    • setAutoRowHeaders

      public void setAutoRowHeaders(boolean enable)
      if row headers are enabled and the cell renderer is an RmaCellRenderer make the row headers the same as the row number + 1.
      Parameters:
      enable - The new AutoRowHeaders value
    • setAutoRowHeaders

      public void setAutoRowHeaders(boolean enable, int offset)
      Sets the AutoRowHeaders attribute of the RmaJTable object
      Parameters:
      enable - The new AutoRowHeaders value
      offset - The new AutoRowHeaders value
    • getAutoRowHeaderOffset

      public int getAutoRowHeaderOffset()
      Gets the AutoRowHeaderOffset attribute of the RmaJTable object
      Returns:
      The AutoRowHeaderOffset value
    • getAutoRowHeaders

      public boolean getAutoRowHeaders()
      get whether auto row headers are enabled
      Returns:
      The AutoRowHeaders value
    • columnSizes

      public void columnSizes()
      prints out the current widths of all the columns useful for setting up the table
    • getToolTipText

      public String getToolTipText(MouseEvent event)
      returns the tooltip text for a given cell converts the mouse event to a row/column position
      Overrides:
      getToolTipText in class JTable
      Parameters:
      event - Description
      Returns:
      The ToolTipText value
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Returns true if the cell at row and column is editable. Otherwise, invoking setValueAt on the cell will have no effect.

      Note: The column is specified in the table view's display order, and not in the TableModel's column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change. Meanwhile the user's actions never affect the model's column ordering.

      Overrides:
      isCellEditable in class JTable
      Parameters:
      row - the row whose value is to be queried
      column - the column whose value is to be queried
      Returns:
      true if the cell is editable
      See Also:
    • isManagingFocus

      public boolean isManagingFocus()
      Gets the ManagingFocus attribute of the RmaJTable object
      Overrides:
      isManagingFocus in class JComponent
      Returns:
      The ManagingFocus value
    • getCellRect

      public Rectangle getCellRect(int row, int column, boolean includeSpacing)
      Overrides:
      getCellRect in class JTable
    • getColumnWidth

      public int getColumnWidth(int col)
    • getColumnWidths

      public int[] getColumnWidths()
    • setColumnPrecision

      public void setColumnPrecision(int colNum, int precision)
    • getRowHeight

      public int getRowHeight(int row)
      Overrides:
      getRowHeight in class JTable
    • getPreferredLineHeight

      public int getPreferredLineHeight(String str, int width)
    • rowAtPoint

      public int rowAtPoint(Point point)
      Overrides:
      rowAtPoint in class JTable
    • setViewportRowHeader

      public RmaJTable setViewportRowHeader(TableModel model, ColumnGroup[] groups, int[][] columns, int width)
      add a row header to the JScrollPane
      Parameters:
      model - The new ViewportRowHeader value
      groups - use this if you need to add column groups to the row headers, otherwise null.
      columns - A list of columns to add to each group. The rows of the array correspond to each group in the group array, i.e row 1 is the first column group in the group array, and all items in row one represent column numbers of the columns to add to that group. If grououps are null then columns is ignored.
      width - The preferred width of the row headers
    • setViewportRowHeader

      public RmaJTable setViewportRowHeader(String[] headers, Object[][] data, ColumnGroup[] groups, int[][] columns, int width)
      add a row header to the JScrollPane
      Parameters:
      data - The data to display in the table row header
      groups - use this if you need to add column groups to the row headers, otherwise null.
      columns - A list of columns to add to each group. The rows of the array correspond to each group in the group array, i.e row 1 is the first column group in the group array, and all items in row one represent column numbers of the columns to add to that group. If grououps are null then columns is ignored.
      width - The preferred width of the row headers
    • updateSelectionModel

      protected void updateSelectionModel(ListSelectionModel sm, int index, boolean toggle, boolean extend)
      Method Description
      Parameters:
      sm - Description
      index - Description
      toggle - Description
      extend - Description
    • updateSelection

      public void updateSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
      update the cell selection. will use the selection model to determine if the entire row/column should select.
      Parameters:
      rowIndex - - the row to select
      columnIndex - - the column to select
      toggle - - if the selection is currently selected then deselect
      extend - - extend to the current select to the new selection.
    • getViewportRowHeader

      public JTable getViewportRowHeader()
      Gets the ViewportRowHeader attribute of the RmaJTable object
      Returns:
      The ViewportRowHeader value
    • getClassForName

      protected Class getClassForName(String className)
      Gets the ClassForName attribute of the RmaJTable object
      Parameters:
      className - Description
      Returns:
      The ClassForName value
    • getPrintManager

      public TablePrintManager getPrintManager()
      Returns a reference to the print manager for this table.
    • printData

      public void printData()
      create the printjob and tell it to print.
    • print

      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
      print this table This method is public as an implementation side effect. do not call.
      Specified by:
      print in interface Printable
      Parameters:
      g - Description
      pageFormat - Description
      pageIndex - Description
      Returns:
      Description
      Throws:
      PrinterException - Description
    • printPreview

      public void printPreview()
      Method Description
    • setPrintTitle

      public void setPrintTitle(PageText titleInfo)
      title for 1st page of printing
      Parameters:
      titleInfo - The new PrintTitle value
    • setPrintOtherInfo

      public void setPrintOtherInfo(PageText otherInfo)
      Parameters:
      otherInfo - The new PrintOtherInfo value
    • getPrintTitle

      public PageText getPrintTitle()
      return the title for 1st page of printing
      Returns:
      The PrintTitle value
    • getPrintOtherInfo

      public PageText getPrintOtherInfo()
      return other info for printing before table
      Returns:
      The PrintOtherInfo value
    • exportData

      public void exportData()
      export the table to file in tab delimited format
    • exportData

      public void exportData(BufferedWriter writer, char delimiterChar, boolean writeColumnHeaders)
      export the table to file in delimiterChar delimited format . if writeHeaders is true write the table headers. no rowheaders, no fixed width columns, no quoted strings, no grid lines, no title
      Parameters:
      writer - Description
      delimiterChar - Description
      writeColumnHeaders - Description
    • exportData

      public void exportData(String fileName, TableExportOptions options)
      export the table to file in user specified format format Used mainly for scripting
    • exportData

      protected void exportData(File file, TableExportOptions options) throws IOException
      Throws:
      IOException
    • exportData

      public void exportData(BufferedWriter writer, TableExportOptions options)
      export the table to file in specified by writer with the export options specified by options.
      Parameters:
      writer - Description
      options - Description
    • getExportString

      public String getExportString(TableExportOptions options)
    • exportAsXML

      public void exportAsXML(String fileName)
    • exportAsXML

      public void exportAsXML(String fileName, String title, String indent)
    • exportAsXML

      public void exportAsXML(BufferedWriter writer)
    • exportAsXML

      public void exportAsXML(BufferedWriter writer, String title, String indent)
    • getXMLExportString

      public String getXMLExportString()
    • getXMLExportString

      public String getXMLExportString(String title, String indent)
    • exportAsHTML

      public void exportAsHTML(String fileName)
    • exportAsHTML

      public void exportAsHTML(String fileName, String title, String indent)
    • exportAsHTML

      public void exportAsHTML(BufferedWriter writer)
    • exportAsHTML

      public void exportAsHTML(BufferedWriter writer, String title, String indent)
    • getHTMLExportString

      public String getHTMLExportString()
    • getHTMLExportString

      public String getHTMLExportString(String title, String indent)
    • isValid

      public boolean isValid(boolean showError)
      Called to check to see if this table has valid data. This method should be overridden to provide a more generalized implemenation.
      Specified by:
      isValid in interface RmaValidComponent
      Parameters:
      showError - Description
      Returns:
      The Valid value
    • setPasteAddsRows

      public void setPasteAddsRows(boolean addRows)
    • getPasteAddsRows

      public boolean getPasteAddsRows()
    • main

      public static void main(String[] args)
      The main program for the RmaJTable class
      Parameters:
      args - The command line arguments
    • useDefaultPrintHeader

      public boolean useDefaultPrintHeader()
      Returns:
      Returns the useDefaultPrintHeader.
    • setUseDefaultPrintHeader

      public void setUseDefaultPrintHeader(boolean useDefaultPrintHeader)
      Parameters:
      useDefaultPrintHeader - The useDefaultPrintHeader to set.
    • getColumnWidthFromData

      public int getColumnWidthFromData(int colNum)
      return the width that the column should be based on the data in the column
      Parameters:
      colNum - the column index. zero based.
      Returns:
      the width of the column
    • adjustAllColumnsWidthToFitData

      public void adjustAllColumnsWidthToFitData(int margin)
      Adjust all column widths to fit data Takes one argument: margin
    • adjustColumnWidthtoFitData

      public void adjustColumnWidthtoFitData(int column, int margin)
      Adjust one column width to fit data Takes two arguments: column index and margin
    • getPopupPoint

      public Point getPopupPoint()
    • setAllowsFontResizing

      public void setAllowsFontResizing(boolean allowResizing)
    • setSelectedIndices

      public void setSelectedIndices(int... indices)
    • setTableHeader

      public void setTableHeader(JTableHeader header)
      Overriding the default operation in setTableHeader to call configureEnclosingScrollPane() if the header is an instance of GroupableTableHeader.
      Overrides:
      setTableHeader in class JTable
    • setRowSorter

      public void setRowSorter(RowSorter<? extends TableModel> sorter)
      Overrides:
      setRowSorter in class JTable
    • addPopupItem

      public void addPopupItem(JComponent menuItem, int i)