TreeMap Java Library

treemap
Interface TMComputeDraw

All Known Implementing Classes:
TMComputeDrawAdapter, TMFileDraw, TMFileDrawPattern, TMFileModelDraw

public interface TMComputeDraw

The TMDrawManager interface should be implemented by every class that implements algorithms for drawing TMNode.

The methods to implements are :

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.

Version:
2.5
Author:
Christophe Bouthier [bouthier@loria.fr], Vesselin Markovsky [markovsky@semantec.bg]

Method Summary
 java.awt.Paint getFilling(TMNodeAdapter nodeAdapter)
          Returns the filling of the node.
 java.lang.String getTitle(TMNodeAdapter nodeAdapter)
          Returns the title of the node.
 java.awt.Paint getTitleColor(TMNodeAdapter nodeAdapter)
          Returns the color of the title of the node.
 java.lang.String getTooltip(TMNodeAdapter nodeAdapter)
          Returns the tooltip of the node.
 boolean isCompatibleWith(TMNode node)
          Test if this TMComputeDraw could be used with the kind of TMNode passed in parameter.
 

Method Detail

isCompatibleWith

boolean isCompatibleWith(TMNode node)
Test if this TMComputeDraw could be used with the kind of TMNode passed in parameter.

Parameters:
node - the TMNode to test the compatibility with
Returns:
true if this kind of node is compatible; false otherwise

getFilling

java.awt.Paint getFilling(TMNodeAdapter nodeAdapter)
                          throws 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.

getTooltip

java.lang.String getTooltip(TMNodeAdapter nodeAdapter)
                            throws 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.

getTitle

java.lang.String getTitle(TMNodeAdapter nodeAdapter)
                          throws 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

java.awt.Paint getTitleColor(TMNodeAdapter nodeAdapter)
                             throws 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.

TreeMap Java Library

TreeMap Java Library - www.bouthier.net - treemap.sf.net - 2001