|
||||||||||
| 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 copy| Method Detail |
public void addListDataListener(ListDataListener l)
addListDataListener in interface ListModelpublic void removeListDataListener(ListDataListener l)
removeListDataListener in interface ListModelpublic int getSize()
getSize in interface ListModelpublic Object getElementAt(int index)
getElementAt in interface ListModelpublic Object getSelectedItem()
getSelectedItem in interface ComboBoxModelpublic void setSelectedItem(Object obj)
setSelectedItem in interface ComboBoxModel
protected void fireRemoved(int i,
int j)
History
fireRemoved in class Historyi - index of first removed elementj - index of last removed element
protected void fireAdded(int i,
int j)
History
fireAdded in class Historyi - index of first added elementj - index of last added element
protected void fireChanged(int i,
int j)
History
fireChanged in class Historyi - index of first changed elementj - index of last changed element
protected void fire(int eventType,
int start,
int end)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||