TMComputeDraw
| Kind of class: | public interface |
|---|---|
| Package: | treemap |
| Inherits from: | none |
| Implemented by: | |
| Version: | 2.5 |
| Author: | Christophe Bouthier [bouthier@loria.fr], Vesselin Markovsky [markovsky@semantec.bg] |
| Package classpath: | treemap.TMComputeDraw |
| File last modified: | Thursday, 27 December 2001, 19:19:38 |
The TMDrawManager interface should be implemented
by every class that implements algorithms for drawing
TMNode.
by every class that implements algorithms for drawing
TMNode.
The methods to implements are :
- getFilling(), to compute and return the filling of a node
- getTooltip(), to compute and return the tooltip of a node
- getTitle(), to compute and return the title (name) of a node
- getTitleColor(), to compute and return the color of the title
As the filling and tooltip of a node could depends of its size,
methods get a TMNodeAdapter reference and not directly a TMNode.
To get the TMNode, call nodeAdapter.getNode().
To get the size of the TMNode, call nodeAdapter.getSize().
To pass information from filling to tooltip, use setUserData() and
getUserData() methods.
As computing the drawing of a node is dependant of the kind of
TMNode, a TMComputeDraw should test the kind of TMNode returned by
nodeAdapter.getNode(), and throw an TMExceptionBadTMNodeKind
if there is incompatibility.
The isCompatibleWith method should test the kind of TMNode
passed in parameter and return true if this TMComputeDraw
is compatible with it.
Summary
Instance methods
- isCompatibleWith
- Test if this TMComputeDraw could be used
- getFilling
- Returns the filling of the node.
- getTooltip
- Returns the tooltip of the node.
- getTitle
- Returns the title of the node.
- getTitleColor
- Returns the color of the title of the node.
Instance methods
getFilling
public Paint getFilling(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind
Returns the filling of the node.
Parameters:
nodeAdapter:
the node which we will draw
Returns:
- the filling of the node
Throws:
- TMExceptionBadTMNodeKind If the kind of TMNode returned is
incompatible with this TMComputeDraw.
getTitle
public String getTitle(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind
Returns the title of the node.
Parameters:
nodeAdapter:
the node for which we want the title
Returns:
- the title of the node
Throws:
- TMExceptionBadTMNodeKind if the kind of TMNode returned is
incompatible with this TMComputeDraw.
getTitleColor
public Paint getTitleColor(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind
Returns the color of the title of the node.
Parameters:
nodeAdapter:
the node for which we want the title
Returns:
- the title of the node
Throws:
- TMExceptionBadTMNodeKind if the kind of TMNode returned is
incompatible with this TMComputeDraw.
getTooltip
public String getTooltip(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind
Returns the tooltip of the node.
Parameters:
nodeAdapter:
the node for which we want the tooltip
Returns:
- the tooltip of the node
Throws:
- TMExceptionBadTMNodeKind If the kind of TMNode returned is
incompatible with this TMComputeDraw.
isCompatibleWith
Test if this TMComputeDraw could be used
with the kind of TMNode passed in parameter.
with the kind of TMNode passed in parameter.
Parameters:
node:
the TMNode to test the compatibility with
Returns:
-
trueif this kind of node is compatible;
falseotherwise