de.jaret.util.ui.timebars.swing.renderer
Interface TimeScaleRenderer

All Known Implementing Classes:
BoxTimeScaleRenderer, DefaultTimeScaleRenderer, OldDefaultTimeScaleRenderer

public interface TimeScaleRenderer

Interface for a renderer used to render a time scale in the TimeBarViewer. Care has to be taken not to create a JComponent for every call of getRendererComponent. The renderer should guard one JComponent to configure and return on subsequent calls.

Version:
$Id: TimeScaleRenderer.java 800 2008-12-27 22:27:33Z kliem $
Author:
Peter Kliem

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.
 

Method Detail

getRendererComponent

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

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

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.

Returns:
the height of the time scale


Copyright © 2012. All Rights Reserved.