|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.problets.lib.conceptmap.view.TreeView
public abstract class TreeView
Performs the painting of the tree model.
Constructor Summary | |
---|---|
TreeView(TreeModel inTreeModel)
Creates a TreeView object using the tree model as argument. |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics g)
Performs the painting of the tree view. |
NodeView |
findNode(java.util.Vector fullName)
Attempts to recursively locate an node given a full name in vector format. |
int |
getColumnsInTree()
Returns the number of columns the tree has. |
int |
getLeftColumn()
Returns the x-coordinate of the upper left corner of the tree view. |
NodeView |
getMouseoverVisibleNode()
Returns the node view whose mouseover is visible. |
NodeView |
getRoot()
Returns the root of the tree. |
int |
getRowsInTree()
Returns the number of rows the tree has. |
int |
getTopRow()
Returns the y-coordinate of the upper left corner of the tree view. |
TreeModel |
getTreeModel()
Returns the tree model which this tree view represents. |
MouseClickedInfo |
handleMouseClicked(int xCoord,
int yCoord)
Handles the mouseClicked event. |
boolean |
handleMouseDragged(int xCoord,
int yCoord)
Handles the mouseDragged event for a user-built tree. |
boolean |
handleMouseMoved(int xCoord,
int yCoord)
Handles the mouseMoved event. |
MousePressedInfo |
handleMousePressed(java.awt.event.MouseEvent e)
Handles the mousePressed event. |
boolean |
handleMouseReleased(int xCoord,
int yCoord)
Handles the mouseReleased event for a user-built tree. |
boolean |
highlightNode(java.lang.String textName,
boolean highlighted)
Sets the highlighting status (highlighted or not highlighted, based on the specified parameter) given the name of the node in text format. |
boolean |
highlightNode(java.util.Vector fullName,
boolean highlighted)
Sets the highlighting status of the node (highlighted or not highlighted, based on the specified parameter) given the name of the node in vector format. |
boolean |
highlightPath(java.lang.String textName,
boolean highlighted)
Sets the highlighting status of the node and all its ancestors (highlighted or not highlighted, based on the specified parameter) given the name of the node in text format. |
boolean |
highlightPath(java.util.Vector fullName,
boolean highlighted)
Sets the highlighting status of the node and all its ancestors (highlighted or not highlighted, based on the specified parameter) given the name of the node in vector format. |
void |
layout()
Determines the layout of the panel by recursively asking the nodes to determine their own layout. |
static void |
main(java.lang.String[] args)
|
void |
setColumnsInTree(int inColumnsInTree)
Sets the number of columns the tree has. |
void |
setCoord(int inWidth,
int inHeight,
int horizSpacing,
int verticalSpacing)
Sets the coordinates of each node view in the tree. |
void |
setExpandedUpToDepth(int depth)
Sets the tree expanded up to the specified depth |
void |
setLeftColumn(int inLeftColumn)
Sets the number of the leftmost column in the tree view . |
void |
setRowsInTree(int inRowsInTree)
Sets the number of rows the tree has. |
void |
setTextFont(java.awt.Font font)
Sets the font used when displaying the names of the nodes in the tree. |
void |
setTopRow(int inTopRow)
Sets the number of the upper row in the tree view. |
void |
updateSize()
Updates the number of rows and columns of the tree. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeView(TreeModel inTreeModel)
inTreeModel
- the model for this viewMethod Detail |
---|
public void draw(java.awt.Graphics g)
g
- the graphics contextpublic void layout()
public NodeView getRoot()
public TreeModel getTreeModel()
public NodeView findNode(java.util.Vector fullName)
fullName
- the full name of the node in vector format
public NodeView getMouseoverVisibleNode()
public int getRowsInTree()
public int getColumnsInTree()
public int getLeftColumn()
public int getTopRow()
public void setTextFont(java.awt.Font font)
font
- the font used when displaying the names of the fonts in the treepublic void setExpandedUpToDepth(int depth)
the
- depth up to which the tree is expandedpublic void updateSize()
public boolean highlightNode(java.lang.String textName, boolean highlighted)
textName
- the name of the node to be highlighted in vector formathighlighted
- the highlighting status of the node
public boolean highlightNode(java.util.Vector fullName, boolean highlighted)
fullName
- the name of the node to be highlighted in vector formathighlighted
- the highlighting status of the node
public boolean highlightPath(java.lang.String textName, boolean highlighted)
textName
- the name of the node to be highlighted in vector formathighlighted
- the highlighting status of the node
public boolean highlightPath(java.util.Vector fullName, boolean highlighted)
fullName
- the name of the node to be highlighted in vector formathighlighted
- the highlighting status of the node
public void setRowsInTree(int inRowsInTree)
inRowsInTree
- the number of rows the tree haspublic void setColumnsInTree(int inColumnsInTree)
inColumnsInTree
- the number of columns the tree haspublic void setLeftColumn(int inLeftColumn)
inLeftColumn
- the number of the leftmost column in the tree view
corner of the tree viewpublic void setTopRow(int inTopRow)
inTopRow
- the number of the upper row in the tree view
corner of the tree viewpublic void setCoord(int inWidth, int inHeight, int horizSpacing, int verticalSpacing)
width
- the width of one node viewheight
- the height of one node viewhorizSpacing
- the width of one cell in the gridverticalSpacing
- the height of one cell in the gridpublic MouseClickedInfo handleMouseClicked(int xCoord, int yCoord)
xCoord
- the x-coordinate of the mouse eventyCoord
- the y-coordinate of the mouse event
public boolean handleMouseMoved(int xCoord, int yCoord)
xCoord
- the x-coordinate of the mouse eventyCoord
- the y-coordinate of the mouse event
public MousePressedInfo handleMousePressed(java.awt.event.MouseEvent e)
e
- the mousePressed event
public boolean handleMouseReleased(int xCoord, int yCoord)
xCoord
- the x-coordinate of the mouse eventyCoord
- the y-coordinate of the mouse event
public boolean handleMouseDragged(int xCoord, int yCoord)
xCoord
- the x-coordinate of the mouse eventyCoord
- the y-coordinate of the mouse event
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |