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

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

public class DefaultGridRenderer
extends java.lang.Object
implements GridRenderer

Simple default implementation of a GridRenderer rendering the major and minor ticks using two different colors.

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

Field Summary
protected  de.jaret.util.ui.timebars.swing.renderer.DefaultGridRenderer.MyGridRenderer _component
          component used for painting.
protected  java.awt.Color _majorGridColor
          color used to paint the major grid.
protected  java.awt.Color _minorGridColor
          color used to paint the minor grid.
protected  ITickProvider _tickProvider
          external tick provider.
 
Constructor Summary
DefaultGridRenderer()
           
 
Method Summary
 java.awt.Color getMajorGridColor()
          Retrieve the major grid color.
 java.awt.Color getMinorGridColor()
          Retrieve the minor grid color.
 javax.swing.JComponent getRendererComponent(TimeBarViewer tbv)
          Supply a configured JComponent for rendering the grid.
 void setMajorGridColor(java.awt.Color majorGridColor)
          Set the major grid color.
 void setMinorGridColor(java.awt.Color minorGridColor)
          Set the minor grid color.
 void setTickProvider(ITickProvider tickProvider)
          Set a tick provider to determine the ticks to be drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_majorGridColor

protected java.awt.Color _majorGridColor
color used to paint the major grid.


_minorGridColor

protected java.awt.Color _minorGridColor
color used to paint the minor grid.


_component

protected de.jaret.util.ui.timebars.swing.renderer.DefaultGridRenderer.MyGridRenderer _component
component used for painting.


_tickProvider

protected ITickProvider _tickProvider
external tick provider.

Constructor Detail

DefaultGridRenderer

public DefaultGridRenderer()
Method Detail

getRendererComponent

public javax.swing.JComponent getRendererComponent(TimeBarViewer tbv)
Supply a configured JComponent for rendering the grid.

Specified by:
getRendererComponent in interface GridRenderer
Parameters:
tbv - Timebarviewer for retrieving everything to paramatrize the compoennt
Returns:
configured component

setTickProvider

public void setTickProvider(ITickProvider tickProvider)
Set a tick provider to determine the ticks to be drawn. If no tick provider is set the defaulst by the tick scaler will be used.

Specified by:
setTickProvider in interface GridRenderer
Parameters:
tickProvider - tick provider to be used or null.

getMajorGridColor

public java.awt.Color getMajorGridColor()
Retrieve the major grid color.

Returns:
the major grid color

setMajorGridColor

public void setMajorGridColor(java.awt.Color majorGridColor)
Set the major grid color.

Parameters:
majorGridColor - the Color to use for the major grid

getMinorGridColor

public java.awt.Color getMinorGridColor()
Retrieve the minor grid color.

Returns:
the minor grid color

setMinorGridColor

public void setMinorGridColor(java.awt.Color minorGridColor)
Set the minor grid color.

Parameters:
minorGridColor - the color to use for the minor grid


Copyright © 2012. All Rights Reserved.