public class SwingTreeModelFillState extends AbstractSwingState implements State, TreeModelListener
mSilent
mIsEnabled, mIsInitialized, mListenerList, mName, mReason
Constructor and Description |
---|
SwingTreeModelFillState(JTree pTree)
Creates a new state, using the model of the handed tree as its state source.
|
SwingTreeModelFillState(JTree pTree,
boolean pCountRootAsContent)
Creates a new state, using the model of the handed tree as its state source.
|
SwingTreeModelFillState(TreeModel pModel,
boolean pCountRootAsContent,
int pThreshold)
Creates a new state, using the handed model as its state source.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
getInternalState()
Check if our model contains at least our threshold number of items.
|
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.
|
void |
treeNodesChanged(TreeModelEvent pEvent)
Callback method for our tree model.
|
void |
treeNodesInserted(TreeModelEvent pEvent)
Callback method for our tree model.
|
void |
treeNodesRemoved(TreeModelEvent pEvent)
Callback method for our tree model.
|
void |
treeStructureChanged(TreeModelEvent pEvent)
Callback method for our tree model.
|
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 SwingTreeModelFillState(JTree pTree)
pTree
- tree we take the model from, must not be nullpublic SwingTreeModelFillState(JTree pTree, boolean pCountRootAsContent)
pTree
- tree we take the model from, must not be nullpCountRootAsContent
- indicates whether the root-node is counted as
content or notpublic SwingTreeModelFillState(TreeModel pModel, boolean pCountRootAsContent, int pThreshold)
pModel
- the model we monitor, must not be nullpCountRootAsContent
- indicates whether the root-node is counted as
content or notpThreshold
- threshold of items in the treepublic void setCompareContent(int pThreshold)
pThreshold
- threshold of items in the treepublic void treeNodesChanged(TreeModelEvent pEvent)
treeNodesChanged
in interface TreeModelListener
pEvent
- not usedpublic void treeNodesInserted(TreeModelEvent pEvent)
treeNodesInserted
in interface TreeModelListener
pEvent
- not usedpublic void treeNodesRemoved(TreeModelEvent pEvent)
treeNodesRemoved
in interface TreeModelListener
pEvent
- not usedpublic void treeStructureChanged(TreeModelEvent pEvent)
treeStructureChanged
in interface TreeModelListener
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.