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

All Known Implementing Classes:
DefaultTimeBarRenderer

public interface TimeBarRenderer

Interface for supplying a JComponent to render an interval in the TimeBarViewer. The JComponent should be reused, i.e. there only has to be one JComponent to be set up for drawing.

Version:
$Id: TimeBarRenderer.java 869 2009-07-07 19:32:45Z kliem $
Author:
Peter Kliem

Field Summary
static java.lang.String CONTAINING_RECTANGLE
          key for identifying the content rectangle as a client property.
 
Method Summary
 java.awt.Rectangle getPreferredDrawingBounds(java.awt.Rectangle intervalDrawingArea, TimeBarViewerDelegate delegate, de.jaret.util.date.Interval interval, boolean selected, boolean overlap)
          Retrieve the preferred drawing bounds for a specific interval.
 javax.swing.JComponent getTimeBarRendererComponent(TimeBarViewer tbv, de.jaret.util.date.Interval value, boolean isSelected, boolean overlapping)
          Supply a component to render an interval in the TimeBarViewer.
 

Field Detail

CONTAINING_RECTANGLE

static final java.lang.String CONTAINING_RECTANGLE
key for identifying the content rectangle as a client property.

See Also:
Constant Field Values
Method Detail

getTimeBarRendererComponent

javax.swing.JComponent getTimeBarRendererComponent(TimeBarViewer tbv,
                                                   de.jaret.util.date.Interval value,
                                                   boolean isSelected,
                                                   boolean overlapping)
Supply a component to render an interval in the TimeBarViewer. The component may

Parameters:
tbv - the asking TimeBarViewer
value - the interval to render
isSelected - render marked as selected
overlapping - true if the interval is one of an overlapping set of intervals
Returns:
a configured JComponent, ready to be painted by paint(Graphics g)

getPreferredDrawingBounds

java.awt.Rectangle getPreferredDrawingBounds(java.awt.Rectangle intervalDrawingArea,
                                             TimeBarViewerDelegate delegate,
                                             de.jaret.util.date.Interval interval,
                                             boolean selected,
                                             boolean overlap)
Retrieve the preferred drawing bounds for a specific interval. As a default implementation simply return the interval drawing area.

Parameters:
intervalDrawingArea - the rectangle to render the interval in.
delegate - the viewer delegate
interval - the interval to be rendered
selected - true if the interval is selected
overlap - true if the interval is drawn as one of several intervals that overlap while beeing drawn.
Returns:
the bounding rectangle that the renderer will paint in when rendering


Copyright © 2012. All Rights Reserved.