de.jaret.util.ui.timebars.swt.renderer
Class RelationRenderer.Line

java.lang.Object
  extended by de.jaret.util.ui.timebars.swt.renderer.RelationRenderer.Line
Enclosing class:
RelationRenderer

public class RelationRenderer.Line
extends java.lang.Object

Internal line represenation for caching.

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

Field Summary
 IIntervalRelation relation
          relation the line belongs to.
 int x1
          start x coordinate.
 int x2
          end x coordinate.
 int y1
          start y coordinate.
 int y2
          end y coordinate.
 
Constructor Summary
RelationRenderer.Line(IIntervalRelation relation, int x1, int y1, int x2, int y2)
          Construct a line.
 
Method Summary
 boolean hit(int x, int y, int tolerance)
          Check whether the line is hit by a certain coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relation

public IIntervalRelation relation
relation the line belongs to.


x1

public int x1
start x coordinate.


y1

public int y1
start y coordinate.


x2

public int x2
end x coordinate.


y2

public int y2
end y coordinate.

Constructor Detail

RelationRenderer.Line

public RelationRenderer.Line(IIntervalRelation relation,
                             int x1,
                             int y1,
                             int x2,
                             int y2)
Construct a line.

Parameters:
relation - relation the line belongs to
x1 - start x
y1 - start y
x2 - end x
y2 - end y
Method Detail

hit

public boolean hit(int x,
                   int y,
                   int tolerance)
Check whether the line is hit by a certain coordinate.

Parameters:
x - x coord
y - y coord
tolerance - the max delta
Returns:
true if hit


Copyright © 2012. All Rights Reserved.