Class TablePersister

java.lang.Object
org.ka2ddo.yaac.gui.TablePersister
All Implemented Interfaces:
PropertyChangeListener, EventListener, AncestorListener, TableColumnModelListener

public class TablePersister extends Object implements TableColumnModelListener, PropertyChangeListener, AncestorListener
This class persists changes made to JTable TableColumnModels by the user.
Author:
Andrew Pavlin, KA2DDO
  • Method Details

    • getInstance

      public static TablePersister getInstance()
      Get the TablePersister instance.
      Returns:
      singleton TablePersister
    • register

      public void register(JTable table, String name)
      Monitor a table for persisting any column changes.
      Parameters:
      table - JTable to monitor
      name - String name to use to remember the changes
    • columnAdded

      public void columnAdded(TableColumnModelEvent e)
      Tells listeners that a column was added to the model.
      Specified by:
      columnAdded in interface TableColumnModelListener
    • columnRemoved

      public void columnRemoved(TableColumnModelEvent e)
      Tells listeners that a column was removed from the model.
      Specified by:
      columnRemoved in interface TableColumnModelListener
    • columnMoved

      public void columnMoved(TableColumnModelEvent e)
      Tells listeners that a column was repositioned.
      Specified by:
      columnMoved in interface TableColumnModelListener
    • columnMarginChanged

      public void columnMarginChanged(ChangeEvent e)
      Tells listeners that a column was moved due to a margin change.
      Specified by:
      columnMarginChanged in interface TableColumnModelListener
    • columnSelectionChanged

      public void columnSelectionChanged(ListSelectionEvent e)
      Tells listeners that the selection model of the TableColumnModel changed.
      Specified by:
      columnSelectionChanged in interface TableColumnModelListener
    • ancestorAdded

      public void ancestorAdded(AncestorEvent event)
      Called when the source or one of its ancestors is made visible either by setVisible(true) being called or by its being added to the component hierarchy. The method is only called if the source has actually become visible. For this to be true all its parents must be visible and it must be in a hierarchy rooted at a Window
      Specified by:
      ancestorAdded in interface AncestorListener
    • ancestorRemoved

      public void ancestorRemoved(AncestorEvent event)
      Called when the source or one of its ancestors is made invisible either by setVisible(false) being called or by its being remove from the component hierarchy. The method is only called if the source has actually become invisible. For this to be true at least one of its parents must be invisible or it is not in a hierarchy rooted at a Window
      Specified by:
      ancestorRemoved in interface AncestorListener
    • ancestorMoved

      public void ancestorMoved(AncestorEvent event)
      Called when either the source or one of its ancestors is moved.
      Specified by:
      ancestorMoved in interface AncestorListener
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      This method gets called when a bound property is changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - A PropertyChangeEvent object describing the event source and the property that has changed.