|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tigris.gef.presentation.AnnotationHelper
public class AnnotationHelper
Contains utility methods for solving std geometry problems. The original class had several bugs and/or performance problems that were fixed. The new AnnotationHelper can handle FigPolys, ie, lines with bend points. Improvement can be made by improving FigPoly's method for getting all points.
| Method Summary | |
|---|---|
static java.awt.Point |
getClosestPoint(java.awt.Point from,
FigEdgePoly to)
Returns the closest point on an edge with several points. |
static java.awt.Point |
getClosestPointOnEdge(java.awt.Point p,
java.awt.Point begin,
java.awt.Point end)
Standard geometry here. |
static int |
getNormOffset(java.awt.Point p0,
java.awt.Point p1,
java.awt.Point p2)
Unmodified method. |
static java.awt.Point |
getNormPointOnEdge(java.awt.Point r1,
java.awt.Point r0,
java.awt.Point r2)
|
static float |
getRatio(java.awt.Point from,
java.awt.Point begin,
java.awt.Point end)
Calculates the point (as relative length) where the perpendicular hits the line. |
static AnnotationHelper |
instance()
|
static int |
sqr_distance(java.awt.Point p1,
java.awt.Point p2)
sqr distance of two points; unmodified method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AnnotationHelper instance()
public static final int getNormOffset(java.awt.Point p0,
java.awt.Point p1,
java.awt.Point p2)
public static final float getRatio(java.awt.Point from,
java.awt.Point begin,
java.awt.Point end)
from - The point that sits in space.begin - The start point of the edge.end - The end point of the edge.
public static final java.awt.Point getClosestPoint(java.awt.Point from,
FigEdgePoly to)
public static final java.awt.Point getClosestPointOnEdge(java.awt.Point p,
java.awt.Point begin,
java.awt.Point end)
p - The point that is somewhere near the edge.begin - The begin point of the edge.end - The end point of the edge.
public static final int sqr_distance(java.awt.Point p1,
java.awt.Point p2)
public static java.awt.Point getNormPointOnEdge(java.awt.Point r1,
java.awt.Point r0,
java.awt.Point r2)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||