public class SwingListModelFillState extends AbstractSwingState implements State, ListDataListener
mSilent
mIsEnabled, mIsInitialized, mListenerList, mName, mReason
Constructor and Description |
---|
SwingListModelFillState(JList pList)
Creates a new state, using the model of the handed list as its state source.
|
SwingListModelFillState(JList pList,
int pThreshold)
Creates a new state, using the model of the handed list as its state source.
|
SwingListModelFillState(ListModel pModel,
int pThreshold)
Creates a new state, using the handed model as its state source.
|
Modifier and Type | Method and Description |
---|---|
void |
contentsChanged(ListDataEvent pEvent)
Callback method for our list model.
|
protected boolean |
getInternalState()
Check if our model contains at least our threshold number of items.
|
void |
intervalAdded(ListDataEvent pEvent)
Callback method for our list model.
|
void |
intervalRemoved(ListDataEvent pEvent)
Callback method for our list model.
|
void |
setCompareContent(int pThreshold)
Sets the threshold we compare again.
|
protected void |
setReason()
Set the source of the state as the reason for a change.
|
checkStateChange, isSilent, setSilent
addChangeListener, checkDisposed, dispose, fireStateChanged, getChangeReason, getDependents, getName, isDisposed, isEnabled, isInitialized, removeChangeListener, setName, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addChangeListener, dispose, getChangeReason, getDependents, getName, isDisposed, isEnabled, isInitialized, removeChangeListener, setName
public SwingListModelFillState(JList pList)
pList
- list we take the model from, must not be nullpublic SwingListModelFillState(JList pList, int pThreshold)
pList
- list we take the model from, must not be nullpThreshold
- threshold of items in the listpublic SwingListModelFillState(ListModel pModel, int pThreshold)
pThreshold
- threshold of items in the listpModel
- the model we monitor, must not be nullpublic void setCompareContent(int pThreshold)
pThreshold
- threshold of items in the listpublic void contentsChanged(ListDataEvent pEvent)
contentsChanged
in interface ListDataListener
pEvent
- not usedpublic void intervalAdded(ListDataEvent pEvent)
intervalAdded
in interface ListDataListener
pEvent
- not usedpublic void intervalRemoved(ListDataEvent pEvent)
intervalRemoved
in interface ListDataListener
pEvent
- not usedprotected boolean getInternalState()
getInternalState
in class AbstractSwingState
protected void setReason()
setReason
in class AbstractSwingState
Copyright © 2017 Jürgen Zeller (privat). All rights reserved.