TMFileDraw

Kind of class:public class
Package:treemap.demo
Inherits from:none
Implements:
Known subclasses:
Version:2.5
Author:Christophe Bouthier [bouthier@loria.fr]
Package classpath:treemap.demo.TMFileDraw
File last modified:Friday, 28 December 2001, 20:52:44
The TMFileDraw class implements an example of a TMComputeDraw
for a TMFileNode.
It use the date of last modification as color,
and the name of the file as tooltip.

The color legend is :

    white for files less than a hour old
    green for files less than a day old
    yellow for files less than a week old
    orange for files less than a month old
    red for files less than a year old
    blue for files more than a year old

Summary


Instance methods

Instance methods

getFilling

public Paint getFilling(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind

Returns the filling of the node.
The nodeAdapter should return an instance of TMFileNode.
Parameters:
nodeAdapter:
we compute the filling of this node;
should return an instance of TMFileNode
Returns:
  • the filling of the node
Throws:

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:
Specified by:

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:

getTooltip

public String getTooltip(
TMNodeAdapter nodeAdapter) throws TMExceptionBadTMNodeKind, TMExceptionBadTMNodeKind

Returns the tooltip of the node.
The nodeAdapter should return an instance of TMFileNode.
Parameters:
nodeAdapter:
we compute the tooltip of this node;
should return an instance of TMFileNode
Returns:
  • the tooltip of the node
Throws:

isCompatibleWith

public 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