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

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

public class DefaultHeaderRenderer
extends java.lang.Object
implements HeaderRenderer

Simple default implementation of a HeaderRenderer using a JLabel.

Version:
$Id: DefaultHeaderRenderer.java 427 2007-05-13 15:58:36Z olk $
Author:
Peter Kliem

Constructor Summary
DefaultHeaderRenderer()
           
 
Method Summary
 javax.swing.JComponent getHeaderRendererComponent(TimeBarViewer tbv, TimeBarRowHeader value, boolean isSelected)
          Provide a JComponent configured to render the header object supplied as value.
 int getWidth()
          Return the width required by the header renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHeaderRenderer

public DefaultHeaderRenderer()
Method Detail

getHeaderRendererComponent

public javax.swing.JComponent getHeaderRendererComponent(TimeBarViewer tbv,
                                                         TimeBarRowHeader value,
                                                         boolean isSelected)
Provide a JComponent configured to render the header object supplied as value.

Specified by:
getHeaderRendererComponent in interface HeaderRenderer
Parameters:
tbv - the calling TimeBarViewer
value - the header object to render
isSelected - if true draw the selectd state
Returns:
a configured JComponent ready to be painted

getWidth

public int getWidth()
Return the width required by the header renderer. The value will only be read once by the TimeBarViewer when the rendderer ist set. There is no support for dynamic change of the header width initiated by the renderer.

Specified by:
getWidth in interface HeaderRenderer
Returns:
the width of the header


Copyright © 2012. All Rights Reserved.