Package ucar.ui.table

Class JTreeTableSorted

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class JTreeTableSorted
    extends JPanel
    JTreeTableSorted adds sorting functionality to a JTreeTable. JTreeTable is a class that combines a JTable with a JTree. Note that JTreeTableSorted is a JPanel, and has-a JTreeTable. It throws ListSelectionEvent events when the selection changes. It throws a UIChangeEvent, property = "sort" just before a sort is going to happen.
    See Also:
    Serialized Form
    • Constructor Detail

      • JTreeTableSorted

        public JTreeTableSorted​(TreeTableModelSorted m,
                                boolean allowSortColChange)
        Constructor.
        Parameters:
        m - TreeTableModelSorted m
    • Method Detail

      • addListSelectionListener

        public void addListSelectionListener​(ListSelectionListener l)
        add ListSelectionEvent listener
      • removeListSelectionListener

        public void removeListSelectionListener​(ListSelectionListener l)
        remove ListSelectionEvent listener
      • allowSortColChange

        public void allowSortColChange​(boolean allow)
      • getTable

        public JTable getTable()
      • getRow

        public TableRow getRow​(int row)
      • restoreState

        public void restoreState​(PreferencesExt store)
        Set the state from the last saved in the PreferencesExt.
        Parameters:
        store - ok if null or empty
      • setColOn

        public void setColOn​(int colno,
                             boolean state,
                             int pos)
      • setFontSize

        public void setFontSize​(int size)
      • saveState

        public void saveState​(PreferencesExt store)
        Save state to the PreferencesExt.
      • setRows

        public void setRows​(ArrayList rows)
        Replace the rowList with this one.
        Parameters:
        rows - list of rows
      • getSelectedRow

        public TableRow getSelectedRow()
        Get the currently selected row.
        Returns:
        selected TableRow
      • getSelectedRows

        public Iterator getSelectedRows()
        Get the currently selected rows.
        Returns:
        an Iterator whose objects are TableRow
      • setSelectedRow

        public void setSelectedRow​(int rowno)
        Set the current selection to this row.
        Parameters:
        rowno - index into rowList
      • incrSelected

        public void incrSelected​(boolean increment)
        Increment or decrement the current selection by one row.
        Parameters:
        increment - true=increment, false=decrement
      • getModelIndex

        public int[] getModelIndex()
        this array translates the column index to the model index
      • setSortCol

        public void setSortCol​(int sortCol,
                               boolean reverse)