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

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

public class DefaultRelationRenderer
extends java.lang.Object
implements IRelationRenderer

Renderer rendering relations between intervals that implement the IRelationalInterval interface. Does not support vertical orientation.

Version:
$Id: DefaultRelationRenderer.java 1073 2010-11-22 21:25:33Z kliem $
Author:
kliem

Nested Class Summary
 class DefaultRelationRenderer.Line
          Internal line represenation for caching.
 
Field Summary
protected  int _arrowSize
          arrow size.
protected  java.awt.Color _lineColor
          color used for the lines.
protected  int _lineWidth
          linewidth to use.
protected  java.awt.Color _selectedColor
          color used for the lines when selected.
 
Constructor Summary
DefaultRelationRenderer()
          Default constructor.
 
Method Summary
 int getArrowSize()
          Retrieve the current size set for the arrows.
 int getLineWidth()
          Retrieve the current line width.
 java.util.List<IIntervalRelation> getRelationsForCoord(int x, int y)
          Retrieve the list of relations that are hit a the given coordinate.
 java.lang.String getTooltip(int x, int y)
          Supply a tooltip for a position in the diagram area.
 void renderRelations(TimeBarViewerDelegate delegate, java.awt.Graphics graphics)
          Do the complete relation rendering.
 void setArrowSize(int arrowSize)
          Set the arrow size.
 void setLineWidth(int lineWidth)
          Set the line width for the connection lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_lineColor

protected java.awt.Color _lineColor
color used for the lines.


_selectedColor

protected java.awt.Color _selectedColor
color used for the lines when selected.


_lineWidth

protected int _lineWidth
linewidth to use.


_arrowSize

protected int _arrowSize
arrow size.

Constructor Detail

DefaultRelationRenderer

public DefaultRelationRenderer()
Default constructor.

Method Detail

renderRelations

public void renderRelations(TimeBarViewerDelegate delegate,
                            java.awt.Graphics graphics)
Do the complete relation rendering. Processes all rows that are displayed.

Specified by:
renderRelations in interface IRelationRenderer
Parameters:
delegate - the delegate
graphics - Graphics to paint on

getRelationsForCoord

public java.util.List<IIntervalRelation> getRelationsForCoord(int x,
                                                              int y)
Retrieve the list of relations that are hit a the given coordinate.

Specified by:
getRelationsForCoord in interface IRelationRenderer
Parameters:
x - x coordinate
y - y coordinate
Returns:
List of realations that may be empty but must not be null

getTooltip

public java.lang.String getTooltip(int x,
                                   int y)
Supply a tooltip for a position in the diagram area.

Specified by:
getTooltip in interface IRelationRenderer
Parameters:
x - x coordinate
y - y coordinate
Returns:
null for no tooltip contribution or tooltip to be displayed

getLineWidth

public int getLineWidth()
Retrieve the current line width.

Returns:
the current line width

setLineWidth

public void setLineWidth(int lineWidth)
Set the line width for the connection lines.

Parameters:
lineWidth - line width to set

getArrowSize

public int getArrowSize()
Retrieve the current size set for the arrows.

Returns:
the arrow size

setArrowSize

public void setArrowSize(int arrowSize)
Set the arrow size.

Parameters:
arrowSize - arrow size


Copyright © 2012. All Rights Reserved.