Class IrisTableSelectionModel

java.lang.Object
com.illumon.iris.gui.table.IrisTableSelectionModel
All Implemented Interfaces:
Serializable, Cloneable, ListSelectionModel
Direct Known Subclasses:
DbKeyedTableSelectionModel

public class IrisTableSelectionModel extends Object implements ListSelectionModel, Cloneable, Serializable
A ListSelectionModel that maintains selection as as snapshot of the underlying Key Columns. This implementation is largely derived from DefaultListSelectionModel with changes to facilitate the snapshot method.
See Also:
  • Field Details

    • model

      protected IrisTableModel model
    • selectedKeyValues

      protected HashSet<com.fishlib.datastructures.util.SmartKey> selectedKeyValues
    • keys

      protected int[] keys
    • anchorIndex

      protected int anchorIndex
    • leadIndex

      protected int leadIndex
    • listenerList

      protected EventListenerList listenerList
    • leadAnchorNotificationEnabled

      protected boolean leadAnchorNotificationEnabled
  • Constructor Details

    • IrisTableSelectionModel

      public IrisTableSelectionModel(IrisTableModel model)
  • Method Details

    • setKeys

      public void setKeys(String[] keyStrings)
    • getValueIsAdjusting

      public boolean getValueIsAdjusting()
      Specified by:
      getValueIsAdjusting in interface ListSelectionModel
    • addListSelectionListener

      public void addListSelectionListener(ListSelectionListener l)
      Specified by:
      addListSelectionListener in interface ListSelectionModel
    • removeListSelectionListener

      public void removeListSelectionListener(ListSelectionListener l)
      Specified by:
      removeListSelectionListener in interface ListSelectionModel
    • getListSelectionListeners

      public ListSelectionListener[] getListSelectionListeners()
    • getListeners

      public <T extends EventListener> T[] getListeners(Class<T> listenerType)
    • setValueIsAdjusting

      public void setValueIsAdjusting(boolean isAdjusting)
      Specified by:
      setValueIsAdjusting in interface ListSelectionModel
    • getAnchorSelectionIndex

      public int getAnchorSelectionIndex()
      Specified by:
      getAnchorSelectionIndex in interface ListSelectionModel
    • getLeadSelectionIndex

      public int getLeadSelectionIndex()
      Specified by:
      getLeadSelectionIndex in interface ListSelectionModel
    • fireValueChanged

      protected void fireValueChanged(boolean isAdjusting)
    • fireValueChanged

      protected void fireValueChanged(int firstIndex, int lastIndex)
    • fireValueChanged

      protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
    • fireValueChanged

      protected void fireValueChanged()
    • setLeadAnchorNotificationEnabled

      public void setLeadAnchorNotificationEnabled(boolean flag)
    • isLeadAnchorNotificationEnabled

      public boolean isLeadAnchorNotificationEnabled()
    • contains

      protected boolean contains(int a, int b, int i)
    • changeSelection

      protected void changeSelection(int clearMin, int clearMax, int setMin, int setMax, boolean clearFirst)
    • getMinSelectionIndex

      public int getMinSelectionIndex()
      Specified by:
      getMinSelectionIndex in interface ListSelectionModel
    • getMaxSelectionIndex

      public int getMaxSelectionIndex()
      Specified by:
      getMaxSelectionIndex in interface ListSelectionModel
    • getSelectionMode

      public int getSelectionMode()
      Always returns MULTIPLE_INTERVAL_SELECTION since we can't predict where rows will appear after a table ticks.
      Specified by:
      getSelectionMode in interface ListSelectionModel
      Returns:
      MULTIPLE_INTERVAL_SELECTION
    • setSelectionMode

      public void setSelectionMode(int selectionMode)
      Does nothing. This Model is always MULTIPLE_INTERVAL_SELECTION
      Specified by:
      setSelectionMode in interface ListSelectionModel
    • isSelectedIndex

      public boolean isSelectedIndex(int position)
      Specified by:
      isSelectedIndex in interface ListSelectionModel
      Parameters:
      position - the position of the selection to search for.
      Returns:
      ImplNote:
      the parameter is renamed 'position' to remove any confusion between Deephaven Table's concept of 'key' space and 'position' space.
    • isSelectionEmpty

      public boolean isSelectionEmpty()
      Returns if the selection is empty.
      Specified by:
      isSelectionEmpty in interface ListSelectionModel
      Returns:
      true if the selection is empty, false otherwise
      ImplNote:
      If the selection is actually empty, this method is guaranteed to be correct, however there is a chance that there may be keys in the selection without the corresponding rows present in the table. In this situation, this method will return false but when the table is searched for selected rows the user may get an empty set.
    • clearSelection

      public void clearSelection()
      Specified by:
      clearSelection in interface ListSelectionModel
    • setSelectionInterval

      public void setSelectionInterval(int index0, int index1)
      Specified by:
      setSelectionInterval in interface ListSelectionModel
    • addSelectionInterval

      public void addSelectionInterval(int index0, int index1)
      Specified by:
      addSelectionInterval in interface ListSelectionModel
    • removeSelectionInterval

      public void removeSelectionInterval(int index0, int index1)
      Specified by:
      removeSelectionInterval in interface ListSelectionModel
    • insertIndexInterval

      public void insertIndexInterval(int index, int length, boolean before)
      Specified by:
      insertIndexInterval in interface ListSelectionModel
    • removeIndexInterval

      public void removeIndexInterval(int index0, int index1)
      Specified by:
      removeIndexInterval in interface ListSelectionModel
    • setAnchorSelectionIndex

      public void setAnchorSelectionIndex(int anchorIndex)
      Specified by:
      setAnchorSelectionIndex in interface ListSelectionModel
    • setLeadSelectionIndex

      public void setLeadSelectionIndex(int leadIndex)
      Specified by:
      setLeadSelectionIndex in interface ListSelectionModel
    • getKeys

      public int[] getKeys()
      Get the current set of key column indices
    • markAsDirty

      protected void markAsDirty(int r)
    • set

      protected void set(int r)
    • clear

      protected void clear(int r)
    • updateLeadAnchorIndices

      protected void updateLeadAnchorIndices(int anchorIndex, int leadIndex)
    • getKeyCount

      public int getKeyCount()
    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getSelectionKey

      protected com.fishlib.datastructures.util.SmartKey getSelectionKey(int position)
      Get the SmartKey associated with a particular row position.
      Parameters:
      position - the position of the row in the table.