Package ca.spatial.table
Class SorterSelectionModel
java.lang.Object
javax.swing.DefaultListSelectionModel
ca.spatial.table.SorterSelectionModel
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,ListSelectionListener
,ListSelectionModel
public class SorterSelectionModel
extends DefaultListSelectionModel
implements ListSelectionListener
This class implements a selection model that remaps the sorted rows
back on to the original ListSelectionModel.
This appears to work, however it is a bit of a hack. It would have been cleaner to override some of the implementation classes within DefaultListSelectionModel, however, these have private access.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListSelectionListener(ListSelectionListener listener)
void
addSelectionInterval(int index0, int index1)
void
void
close()
int
boolean
isSelectedIndex(int index)
boolean
void
removeSelectionInterval(int index0, int index1)
void
setLeadSelectionIndex(int leadIndex)
Must implement this in order to propogate changes to parent.void
setSelectionInterval(int index0, int index1)
void
setValueIsAdjusting(boolean value)
void
Must be called on the Event Dispatch Threadvoid
Methods inherited from class javax.swing.DefaultListSelectionModel
clone, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setSelectionMode, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.swing.ListSelectionModel
getSelectedIndices, getSelectedItemsCount
-
Constructor Details
-
SorterSelectionModel
-
-
Method Details
-
close
public void close() -
getParentModel
-
addListSelectionListener
- Specified by:
addListSelectionListener
in interfaceListSelectionModel
- Overrides:
addListSelectionListener
in classDefaultListSelectionModel
-
valueChanged
- Specified by:
valueChanged
in interfaceListSelectionListener
-
addSelectionInterval
public void addSelectionInterval(int index0, int index1)- Specified by:
addSelectionInterval
in interfaceListSelectionModel
- Overrides:
addSelectionInterval
in classDefaultListSelectionModel
-
switchSelection
public void switchSelection()Must be called on the Event Dispatch Thread -
clearSelection
public void clearSelection()- Specified by:
clearSelection
in interfaceListSelectionModel
- Overrides:
clearSelection
in classDefaultListSelectionModel
-
isSelectedIndex
public boolean isSelectedIndex(int index)- Specified by:
isSelectedIndex
in interfaceListSelectionModel
- Overrides:
isSelectedIndex
in classDefaultListSelectionModel
-
isSelectionEmpty
public boolean isSelectionEmpty()- Specified by:
isSelectionEmpty
in interfaceListSelectionModel
- Overrides:
isSelectionEmpty
in classDefaultListSelectionModel
-
removeSelectionInterval
public void removeSelectionInterval(int index0, int index1)- Specified by:
removeSelectionInterval
in interfaceListSelectionModel
- Overrides:
removeSelectionInterval
in classDefaultListSelectionModel
-
setLeadSelectionIndex
public void setLeadSelectionIndex(int leadIndex)Must implement this in order to propogate changes to parent.- Specified by:
setLeadSelectionIndex
in interfaceListSelectionModel
- Overrides:
setLeadSelectionIndex
in classDefaultListSelectionModel
-
setSelectionInterval
public void setSelectionInterval(int index0, int index1)- Specified by:
setSelectionInterval
in interfaceListSelectionModel
- Overrides:
setSelectionInterval
in classDefaultListSelectionModel
-
setValueIsAdjusting
public void setValueIsAdjusting(boolean value)- Specified by:
setValueIsAdjusting
in interfaceListSelectionModel
- Overrides:
setValueIsAdjusting
in classDefaultListSelectionModel
-
getSelectedRowCount
public int getSelectedRowCount()
-