public class TimeNodeRenderer extends java.lang.Object implements NodeRenderer, Temporal
checkNodeActive and
determineFadeFactor methods.| Constructor and Description |
|---|
TimeNodeRenderer(NodeRenderer renderer)
Creates a new TimeNodeRenderer object.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkNodeTime(java.lang.Object node,
java.util.Date curTime)
Return whether the node should be displayed at the given time.
|
protected double |
determineFadeFactor(java.lang.Object node,
java.util.Date curTime)
Determine the fade factor of the node.
|
void |
drawNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
Draws the node in the graphics context provided.
|
java.awt.Color |
getColor()
Gets the color for the Renderer, if any
|
java.util.Date |
getCurTime()
Gets the current time as displayed by this NodeRenderer
|
long |
getFadeTime()
Returns the fade time
|
java.awt.Rectangle |
getNodeBounds(java.lang.Object node,
java.awt.Point loc)
Returns the bounding box for the node using this renderer.
|
void |
highlightNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
Highlights the node in the graphics context provided.
|
boolean |
pickNode(java.lang.Object node,
java.awt.Point loc,
java.awt.Point pickPoint)
Checks whether the specified pickpoint is within the drawn area for the
node.
|
void |
setColor(java.awt.Color color)
Sets the color for the NodeRenderer.
|
void |
setCurTime(java.util.Date curTime)
Sets the current time represented by this NodeRenderer
|
void |
setFadeTime(long fadeTimeMillis)
Sets the Fade time.
|
public TimeNodeRenderer(NodeRenderer renderer)
renderer - a sub-Renderer to use for the nodes when visibleprotected boolean checkNodeTime(java.lang.Object node,
java.util.Date curTime)
Sequential object and its time segments either
contain the selected time, or if the node is not a
Sequential object.node - the node to checkcurTime - the current time for this rendererprotected double determineFadeFactor(java.lang.Object node,
java.util.Date curTime)
Sequential node based upon the fade time and
the time between the current time and any active time spans. If the
current time is within one of the time spans of the sequential node, the
default implementation returns 1.0. For nodes which are not sequential,
the default implementation returns 0.0.node - the node to checkcurTime - the current time for this rendererpublic void drawNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
Sequential nodes. For any of these nodes, their
visibility depends on whether they are active at the Current Time of
this renderer. If not, but they fall close to being active - within the
fadeTime - the node is faded in using transparency.drawNode in interface NodeRendererg - the Graphics context to display the nodenode - the node to displayloc - The node locationpublic java.awt.Color getColor()
getColor in interface NodeRendererpublic java.util.Date getCurTime()
getCurTime in interface Temporalpublic long getFadeTime()
public java.awt.Rectangle getNodeBounds(java.lang.Object node,
java.awt.Point loc)
getNodeBounds in interface NodeRenderernode - the node to be checkedloc - The node locationpublic void highlightNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
highlightNode in interface NodeRendererg - the Graphics context to display the nodenode - the node to displayloc - The node locationpublic boolean pickNode(java.lang.Object node,
java.awt.Point loc,
java.awt.Point pickPoint)
pickNode in interface NodeRenderernode - the node to check for pickingloc - The node locationpickPoint - the coordinate of the point to checkpublic void setColor(java.awt.Color color)
setColor in interface NodeRenderercolor - The color for the NodeRendererpublic void setCurTime(java.util.Date curTime)
setCurTime in interface TemporalcurTime - the current timepublic void setFadeTime(long fadeTimeMillis)
fadeTimeMillis - The fade time, in milliseconds