|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlapisx.util.History
lapisx.swing.HistoryComboBoxModel
An adapter for lapisx.util.History that allows a history to be used as the model for a JComboBox.
Example of use:
// make a history with room for 10 elements HistoryComboBoxModel history = new HistoryComboBoxModel (10); // make a combo box that displays the history in its drop-down list JComboBox combobox = new JComboBox (history);
Field Summary | |
protected EventListenerList |
listenerList
Listeners on this object. |
Fields inherited from class lapisx.util.History |
curr, end, history, start |
Constructor Summary | |
HistoryComboBoxModel(History h)
Make a duplicate of another History. |
|
HistoryComboBoxModel(int max)
Make a HistoryComboBoxModel. |
Method Summary | |
void |
addListDataListener(ListDataListener l)
|
protected void |
fire(int eventType,
int start,
int end)
|
protected void |
fireAdded(int i,
int j)
Called when new elements are added at history[i..j]. |
protected void |
fireChanged(int i,
int j)
Called when elements at history[i..j] are replaced. |
protected void |
fireRemoved(int i,
int j)
Called when history[i..j] is removed. |
Object |
getElementAt(int index)
|
Object |
getSelectedItem()
|
int |
getSize()
|
void |
removeListDataListener(ListDataListener l)
|
void |
setSelectedItem(Object obj)
|
Methods inherited from class lapisx.util.History |
add, back, backElements, canBack, canForward, clear, contains, elements, expand, forward, forwardElements, get, isEmpty, isFull, jumpTo, peekBack, peekForward, put, replace, size, toEnd, toStart |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EventListenerList listenerList
Constructor Detail |
public HistoryComboBoxModel(int max)
max
- Maximum length of historypublic HistoryComboBoxModel(History h)
h
- History to copyMethod Detail |
public void addListDataListener(ListDataListener l)
addListDataListener
in interface ListModel
public void removeListDataListener(ListDataListener l)
removeListDataListener
in interface ListModel
public int getSize()
getSize
in interface ListModel
public Object getElementAt(int index)
getElementAt
in interface ListModel
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
public void setSelectedItem(Object obj)
setSelectedItem
in interface ComboBoxModel
protected void fireRemoved(int i, int j)
History
fireRemoved
in class History
i
- index of first removed elementj
- index of last removed elementprotected void fireAdded(int i, int j)
History
fireAdded
in class History
i
- index of first added elementj
- index of last added elementprotected void fireChanged(int i, int j)
History
fireChanged
in class History
i
- index of first changed elementj
- index of last changed elementprotected void fire(int eventType, int start, int end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |