|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fri.gui.swing.polytreetable.AbstractPolyTreeTableModel
An abstract implementation of the PolyTreeTableModel interface that provides display methods (but no edit methods).
PolyTreeTableModel
,
DefaultPolyTreeTableModel
Field Summary | |
protected boolean |
asksAllowsChildren
If this is true, model.isChildLeaf() calls node.getAllowsChildren() instead of node.isChildLeaf() when isChildLeaf() is messaged. |
protected boolean |
asksAllowsParents
If this is true, model.isParentLeaf() calls node.getAllowsParents() instead of node.isParentLeaf() when isParentLeaf() is messaged. |
protected PolyTreeNode |
startNode
The start node that was passed to the constructor. |
Constructor Summary | |
AbstractPolyTreeTableModel(PolyTreeNode startNode)
Create a model with given start node and asking for allows parents/children. |
|
AbstractPolyTreeTableModel(PolyTreeNode startNode,
boolean asksAllowsParents,
boolean asksAllowsChildren)
Create a model with given start node and the parents/children properties. |
Method Summary | |
boolean |
getAsksAllowsChildren()
Returns true if this model calls node.getAllowsChildren() when isChildLeaf(node) is called. |
boolean |
getAsksAllowsParents()
Returns true if this model calls node.getAllowsParents() when isParentLeaf(node) is called. |
PolyTreeNode |
getChild(PolyTreeNode parent,
int index)
Returns the child of parent at index index. |
int |
getChildCount(PolyTreeNode parent)
Returns the number of children of parent. |
int |
getIndexOfChild(PolyTreeNode node,
PolyTreeNode child)
Returns the index of child in node. |
int |
getIndexOfParent(PolyTreeNode node,
PolyTreeNode parent)
Returns the index of parent in node. |
PolyTreeNode |
getParent(PolyTreeNode child,
int index)
Returns the parent of child at index index. |
int |
getParentCount(PolyTreeNode child)
Returns the number of parents of child. |
PolyTreeNode |
getStartNode()
Returns the start node that was set in constructor. |
boolean |
isCellEditable(PolyTreeNode node,
int column)
Delegates to node.isCellEditable() if node is instanceof DefaultPolyTreeNode, else returns always true. |
boolean |
isChildLeaf(PolyTreeNode node)
Returns true if the passed node has no children or does not allow children. |
boolean |
isParentLeaf(PolyTreeNode node)
Returns true if the passed node has no parents or does not allow parents. |
void |
setAsksAllowsChildren(boolean asksAllowsChildren)
If set to true, isChildLeaf() will call node.getAllowsChildren(), else node.isChildLeaf() is called. |
void |
setAsksAllowsParents(boolean asksAllowsParents)
If set to true, isParentLeaf() will call node.getAllowsParents(), else node.isParentLeaf() is called. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fri.gui.swing.polytreetable.PolyTreeTableModel |
getColumnClass, getColumnCount, getColumnName, getValueAt, setValueAt |
Field Detail |
protected boolean asksAllowsParents
protected boolean asksAllowsChildren
protected PolyTreeNode startNode
Constructor Detail |
public AbstractPolyTreeTableModel(PolyTreeNode startNode)
public AbstractPolyTreeTableModel(PolyTreeNode startNode, boolean asksAllowsParents, boolean asksAllowsChildren)
Method Detail |
public PolyTreeNode getStartNode()
getStartNode
in interface PolyTreeTableModel
public void setAsksAllowsParents(boolean asksAllowsParents)
public boolean getAsksAllowsParents()
public void setAsksAllowsChildren(boolean asksAllowsChildren)
public boolean getAsksAllowsChildren()
public boolean isCellEditable(PolyTreeNode node, int column)
isCellEditable
in interface PolyTreeTableModel
public PolyTreeNode getParent(PolyTreeNode child, int index)
getParent
in interface PolyTreeTableModel
child
- a node in the tree, obtained from this data source
public PolyTreeNode getChild(PolyTreeNode parent, int index)
getChild
in interface PolyTreeTableModel
parent
- a node in the tree, obtained from this data source
public int getParentCount(PolyTreeNode child)
getParentCount
in interface PolyTreeTableModel
child
- a node in the tree, obtained from this data source
public int getChildCount(PolyTreeNode parent)
getChildCount
in interface PolyTreeTableModel
parent
- a node in the tree, obtained from this data source
public int getIndexOfParent(PolyTreeNode node, PolyTreeNode parent)
getIndexOfParent
in interface PolyTreeTableModel
public int getIndexOfChild(PolyTreeNode node, PolyTreeNode child)
getIndexOfChild
in interface PolyTreeTableModel
public boolean isParentLeaf(PolyTreeNode node)
isParentLeaf
in interface PolyTreeTableModel
public boolean isChildLeaf(PolyTreeNode node)
isChildLeaf
in interface PolyTreeTableModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |