public class SelectionModelAdapter<ItemType>
extends java.lang.Object
implements javax.swing.ListSelectionModel
SubsetSelectionModel
to a ListSelectionModel
.
The ListSelectionModel (jlist) supports quite complex selection modes:
ctrl-click , dragging, and combinations of these. We really only want to
support dragging so we ignore the ctrl- and removal stuff.Constructor and Description |
---|
SelectionModelAdapter(SubsetSelectionModel<ItemType> model) |
Modifier and Type | Method and Description |
---|---|
void |
addListSelectionListener(javax.swing.event.ListSelectionListener x) |
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(javax.swing.event.ListSelectionListener x) |
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) |
public SelectionModelAdapter(SubsetSelectionModel<ItemType> model)
public void setSelectionInterval(int index0, int index1)
setSelectionInterval
in interface javax.swing.ListSelectionModel
public void addSelectionInterval(int index0, int index1)
addSelectionInterval
in interface javax.swing.ListSelectionModel
public void removeSelectionInterval(int index0, int index1)
removeSelectionInterval
in interface javax.swing.ListSelectionModel
public int getMinSelectionIndex()
getMinSelectionIndex
in interface javax.swing.ListSelectionModel
public int getMaxSelectionIndex()
getMaxSelectionIndex
in interface javax.swing.ListSelectionModel
public boolean isSelectedIndex(int index)
isSelectedIndex
in interface javax.swing.ListSelectionModel
public int getAnchorSelectionIndex()
getAnchorSelectionIndex
in interface javax.swing.ListSelectionModel
public void setAnchorSelectionIndex(int index)
setAnchorSelectionIndex
in interface javax.swing.ListSelectionModel
public int getLeadSelectionIndex()
getLeadSelectionIndex
in interface javax.swing.ListSelectionModel
public void setLeadSelectionIndex(int index)
setLeadSelectionIndex
in interface javax.swing.ListSelectionModel
public void clearSelection()
clearSelection
in interface javax.swing.ListSelectionModel
public boolean isSelectionEmpty()
isSelectionEmpty
in interface javax.swing.ListSelectionModel
public void insertIndexInterval(int index, int length, boolean before)
insertIndexInterval
in interface javax.swing.ListSelectionModel
public void removeIndexInterval(int index0, int index1)
removeIndexInterval
in interface javax.swing.ListSelectionModel
public void setValueIsAdjusting(boolean valueIsAdjusting)
setValueIsAdjusting
in interface javax.swing.ListSelectionModel
public boolean getValueIsAdjusting()
getValueIsAdjusting
in interface javax.swing.ListSelectionModel
public void setSelectionMode(int selectionMode)
setSelectionMode
in interface javax.swing.ListSelectionModel
public int getSelectionMode()
getSelectionMode
in interface javax.swing.ListSelectionModel
public void addListSelectionListener(javax.swing.event.ListSelectionListener x)
addListSelectionListener
in interface javax.swing.ListSelectionModel
public void removeListSelectionListener(javax.swing.event.ListSelectionListener x)
removeListSelectionListener
in interface javax.swing.ListSelectionModel