# Class ViewHugeSelectionModel

java.lang.Object
uk.ac.starlink.table.gui.ViewHugeSelectionModel

All Implemented Interfaces:
  `ListSelectionModel`

public class ViewHugeSelectionModel extends Object implements ListSelectionModel
ListSelectionModel to use in conjunction with a ViewHugeTableModel for tracking row selection of very large tables. Since the rows of the ViewHugeTableModel keep changing which rows of the underlying huge model they are talking about, the selection model has to understand how that happens if you want to have row selection that persists as the scroll bar is moved around. This is the model which should be installed on the JTable.

Since:
  16 Jul 2014
Author:
  Mark Taylor
See Also:
  - `ViewHugeTableModel`

## Field Summary

### Fields inherited from interface ListSelectionModel

`MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION`

## Constructor Summary

Constructors
Constructor
Description
`ViewHugeSelectionModel(ListSelectionModel hugeModel, ViewHugeTableModel tmodel)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addListSelectionListener(ListSelectionListener viewLnr)`
`void`
`addSelectionInterval(int index0, int index1)`
`void`
`clearSelection()`
`int`
`getAnchorSelectionIndex()`
`int`
`getLeadSelectionIndex()`
`int`
`getMaxSelectionIndex()`
`int`
`getMinSelectionIndex()`
`int`
`getSelectionMode()`
`boolean`
`getValueIsAdjusting()`
`void`
`insertIndexInterval(int index, int length, boolean before)`
`boolean`
`isSelectedIndex(int index)`
`boolean`
`isSelectionEmpty()`
`void`
`removeIndexInterval(int index0, int index1)`
`void`
`removeListSelectionListener(ListSelectionListener viewLnr)`
`void`
`removeSelectionInterval(int index0, int index1)`
`void`
`setAnchorSelectionIndex(int index)`
`void`
`setLeadSelectionIndex(int index)`
`void`
`setSelectionInterval(int index0, int index1)`
`void`
`setSelectionMode(int selectionMode)`
`void`
`setValueIsAdjusting(boolean valueIsAdjusting)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface ListSelectionModel

`getSelectedIndices, getSelectedItemsCount`

## Constructor Details

### ViewHugeSelectionModel

public ViewHugeSelectionModel(ListSelectionModel hugeModel, ViewHugeTableModel tmodel)
Constructor.

Parameters:
  `hugeModel` - list selection model corresonding to the table model underlying the supplied `tmodel`
  `tmodel` - ViewHugeTableModel presenting an underlying huge table to a JTable

## Method Details

### 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`

### getMinSelectionIndex

public int getMinSelectionIndex()

Specified by:
  `getMinSelectionIndex` in interface `ListSelectionModel`

### getMaxSelectionIndex

public int getMaxSelectionIndex()

Specified by:
  `getMaxSelectionIndex` in interface `ListSelectionModel`

### isSelectedIndex

public boolean isSelectedIndex(int index)

Specified by:
  `isSelectedIndex` in interface `ListSelectionModel`

### getAnchorSelectionIndex

public int getAnchorSelectionIndex()

Specified by:
  `getAnchorSelectionIndex` in interface `ListSelectionModel`

### setAnchorSelectionIndex

public void setAnchorSelectionIndex(int index)

Specified by:
  `setAnchorSelectionIndex` in interface `ListSelectionModel`

### getLeadSelectionIndex

public int getLeadSelectionIndex()

Specified by:
  `getLeadSelectionIndex` in interface `ListSelectionModel`

### setLeadSelectionIndex

public void setLeadSelectionIndex(int index)

Specified by:
  `setLeadSelectionIndex` in interface `ListSelectionModel`

### clearSelection

public void clearSelection()

Specified by:
  `clearSelection` in interface `ListSelectionModel`

### isSelectionEmpty

public boolean isSelectionEmpty()

Specified by:
  `isSelectionEmpty` 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`

### setValueIsAdjusting

public void setValueIsAdjusting(boolean valueIsAdjusting)

Specified by:
  `setValueIsAdjusting` in interface `ListSelectionModel`

### getValueIsAdjusting

public boolean getValueIsAdjusting()

Specified by:
  `getValueIsAdjusting` in interface `ListSelectionModel`

### setSelectionMode

public void setSelectionMode(int selectionMode)

Specified by:
  `setSelectionMode` in interface `ListSelectionModel`

### getSelectionMode

public int getSelectionMode()

Specified by:
  `getSelectionMode` in interface `ListSelectionModel`

### addListSelectionListener

public void addListSelectionListener(ListSelectionListener viewLnr)

Specified by:
  `addListSelectionListener` in interface `ListSelectionModel`

### removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener viewLnr)

Specified by:
  `removeListSelectionListener` in interface `ListSelectionModel`