de.jaret.util.ui.timebars.swing.renderer
Class OldDefaultTimeScaleRenderer

java.lang.Object
  extended by de.jaret.util.ui.timebars.swing.renderer.OldDefaultTimeScaleRenderer
All Implemented Interfaces:
TimeScaleRenderer

public class OldDefaultTimeScaleRenderer
extends java.lang.Object
implements TimeScaleRenderer

A default renderer for a time scale to be used in a TimeBarViewer.

Version:
$Id: OldDefaultTimeScaleRenderer.java 1083 2011-07-01 20:29:16Z kliem $
Author:
Peter Kliem

Field Summary
protected  de.jaret.util.ui.timebars.swing.renderer.OldDefaultTimeScaleRenderer.MyTimeScaleRenderer _renderer
          rendering component.
 
Constructor Summary
OldDefaultTimeScaleRenderer()
           
 
Method Summary
 int getHeight()
          Return the height needed for painting the time scale.
 javax.swing.JComponent getRendererComponent(TimeBarViewer tbv, boolean top)
          Return a JComponent to be used to render the time scale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_renderer

protected de.jaret.util.ui.timebars.swing.renderer.OldDefaultTimeScaleRenderer.MyTimeScaleRenderer _renderer
rendering component.

Constructor Detail

OldDefaultTimeScaleRenderer

public OldDefaultTimeScaleRenderer()
Method Detail

getRendererComponent

public javax.swing.JComponent getRendererComponent(TimeBarViewer tbv,
                                                   boolean top)
Return a JComponent to be used to render the time scale. The component has to be configured properly before returning it. All needed information about the time scale, major and minor ticks can be obtainend by the TimeBarViewer.

The component may implement getToolTipText(MouseEvent evt) to return a proper tooltip for the location

Specified by:
getRendererComponent in interface TimeScaleRenderer
Parameters:
tbv - the TimeBarViwer the component is used for
top - if true the scale is drawn at the top of the diagram
Returns:
a configured JComponent

getHeight

public int getHeight()
Return the height needed for painting the time scale. The value will be fetched only once when the renderer is set for the TimeBarViewer for reasons of stability in painting.

Specified by:
getHeight in interface TimeScaleRenderer
Returns:
the height of the time scale


Copyright © 2012. All Rights Reserved.