|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--torero.gui.NodeWrapper
Node Objects used by and with MyTreeUI. It encapsulates the TreeNode Object for compatability with the standard JTree class. Note that there are many protected methods wbich are designed to do the communication with the MyTreeUI. Caution: it does not make sense to call them from another place! The actual implementation assumes, that the TreeModel contains only GrammarNode objects.
MyTreeUI
,
TreeUI
,
JTree
Method Summary | |
protected void |
calcLineCache()
Calls the the attribute-routing algorithm recursively on all nodes beyound this node. |
Dimension |
calcPrefSize(TreeCellRenderer tcr,
JTree tree)
Calculates and sets the prefered size of this node and all it's children, by calling calcPrefSizeX() on itself. |
protected int |
calcTree()
Calculates the x and y position for nodes and the needed height for the whole tree, this value is returned. |
protected void |
collapse()
Set the nodes expanded flag to false. |
protected void |
expand()
Set's the node's expanded flag. |
NodeWrapper |
getChild(int pos)
The child at positions pos is returned. |
Iterator |
getChildList()
The children of this node are returned. |
int |
getChildPos(NodeWrapper child)
The child's positions is returned. |
int |
getChildSize()
The number of children is returned. |
TreeNode |
getInner()
Get the encapsulated TreeNode object. |
NodeWrapper |
getNodeAt(int mx,
int my)
Returns the NodeWrapper at the position mx, my [absolute screen coordinates]. |
NodeWrapper |
getParent()
|
Dimension |
getpSize()
Get the preferred size of this node. |
static TreePath |
getWrapperTreePath(TreePath tp,
NodeWrapper root)
Compute the Treepath consisting of NodeWrappers for a given TreePath of TreeNodes. |
int |
getX()
Get the x coordinate of this node. |
int |
getY()
Get the y coordinate of this node. |
boolean |
isexpanded()
See if the node is expanded. |
static NodeWrapper |
mkRootNodeWrapper(TreeNode nodeNchilds)
A tree of TreeNodes is given - it generates a encapsulating tree (of NodeWrappers) for it. |
static NodeWrapper |
mkSubTree(TreeNode nodeNchilds,
NodeWrapper subroot)
Same as mkRootNodeWrapper - only for subtrees that do not start from the root. |
protected void |
paintTree(Graphics g,
JTree tree,
CellRendererPane crp,
TreeCellRenderer tcr,
TreeSelectionModel tsm)
Paints this node and (recursively) all nodes beyound this node. |
protected void |
resetline()
Only for testing, not used, |
protected void |
RouteSimple2(Attribute destAttrib,
SrcAtt source)
A attributeconnection - routingalgorithm, only for testing, it is not used. |
protected void |
RouteSimple3(Attribute destAttrib,
SrcAtt source)
A attributeconnection - routingalgorithm, only for testing, it is not used. |
protected void |
RouteSimple4(Attribute destAttrib,
SrcAtt source)
A attributeconnection - routingalgorithm, only for testing, it is not used. |
protected void |
RouteSimple5(Attribute destAttrib,
SrcAtt source)
The attributeconnection - routingalgorithm used. |
protected void |
RouteTrivial(Attribute destAttrib,
SrcAtt source)
A attributeconnection - routingalgorithm, only for testing, it is not used. |
void |
testcalcPrefSize()
Only for testing, never used. |
protected void |
toggleEvent()
If the node was expanded it is collapsed and vice versa. |
String |
toString()
Only for testing an debugging purpose. |
static void |
treeNodesChanged(TreeModelEvent e,
NodeWrapper root)
Not implememted. |
protected static void |
treeNodesInserted(TreeModelEvent e,
NodeWrapper root)
Tell the NodeWrapper that a TreeNode was inserted. |
protected static void |
treeNodesRemoved(TreeModelEvent e,
NodeWrapper root)
Tell the NodeWrapper that a TreeNode was removed. |
protected static void |
treeStructureChanged(TreeModelEvent e,
NodeWrapper root)
Tell the NodeWrapper that the tree has completeley changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
protected void resetline()
public static NodeWrapper mkRootNodeWrapper(TreeNode nodeNchilds)
nodeNchilds
- root node of the given tree with childs.public static NodeWrapper mkSubTree(TreeNode nodeNchilds, NodeWrapper subroot)
public static void treeNodesChanged(TreeModelEvent e, NodeWrapper root)
protected static void treeNodesInserted(TreeModelEvent e, NodeWrapper root)
e
- the TreeNodeEvent that occurred, exact position (and other info) can be derived from it.root
- node of the tree.protected static void treeNodesRemoved(TreeModelEvent e, NodeWrapper root)
e
- the TreeNodeEvent that occurred, exact position (and other info) can be derived from it.root
- node of the tree.protected static void treeStructureChanged(TreeModelEvent e, NodeWrapper root)
e
- the TreeNodeEvent that occurred, exact position (and other info) can be derived from it.root
- the root node (unchanged) of the changed subtree.public Iterator getChildList()
public NodeWrapper getChild(int pos)
pos
- LinkedList
public int getChildPos(NodeWrapper child)
child
- LinkedList
public int getChildSize()
LinkedList
public NodeWrapper getParent()
public static TreePath getWrapperTreePath(TreePath tp, NodeWrapper root)
tp
- given treepathroot
- of NodeWrapper TreeLinkedList
public Dimension calcPrefSize(TreeCellRenderer tcr, JTree tree)
protected void calcLineCache()
protected void RouteTrivial(Attribute destAttrib, SrcAtt source)
protected void RouteSimple2(Attribute destAttrib, SrcAtt source)
protected void RouteSimple3(Attribute destAttrib, SrcAtt source)
protected void RouteSimple4(Attribute destAttrib, SrcAtt source)
protected void RouteSimple5(Attribute destAttrib, SrcAtt source)
public void testcalcPrefSize()
protected void paintTree(Graphics g, JTree tree, CellRendererPane crp, TreeCellRenderer tcr, TreeSelectionModel tsm)
g
- the graphics object of the JTree.tree
- the JTreecrp
- the CellRendererPane of the MyTreeUI.tcr
- the TreeCellRenderer to be used.tsm
- the TreeSelectionModel of the JtreeJTree
protected int calcTree()
public NodeWrapper getNodeAt(int mx, int my)
mx,
- my coordinatespublic int getX()
public int getY()
public Dimension getpSize()
public String toString()
toString
in class Object
public TreeNode getInner()
protected void expand()
public boolean isexpanded()
protected void collapse()
protected void toggleEvent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |