|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tigris.gef.presentation.Fig
org.tigris.gef.presentation.FigEdge
org.tigris.gef.presentation.FigEdgePoly
public class FigEdgePoly
A Fig that paints edges between ports. This version automatically routes a rectilinear edge. The routing is not very good. It avoids the source and sink nodes and no other nodes. It is basically case-analysis, and some of the cases are wrong or missing. Anyway, the user can edit the edge by dragging handles. The 0th and last handles are fixed in position so that they stay connected to ports. If the user drags a handle next to a fixed handle, a new vertex is automatically inserted.
FigPoly,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.tigris.gef.presentation.FigEdge |
|---|
_arrowHeadEnd, _arrowHeadStart, _destFigNode, _fig, _highlight, _pathItems, _sourceFigNode, _useNearest |
| Fields inherited from class org.tigris.gef.presentation.Fig |
|---|
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE |
| Constructor Summary | |
|---|---|
FigEdgePoly()
|
|
| Method Summary | |
|---|---|
void |
computeRoute()
Find the route that the edge should follow. |
protected java.awt.Point |
findAvoidPt(int fx,
int fy,
int x,
int y,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2)
Find a point on the corner of one of the avoid rectangles that is a good intermediate point for the edge layout. |
void |
insertPoint(int i,
int x,
int y)
Add a point to this polygon. |
protected void |
layoutEdge()
Internal function to actually compute the layout of the line if it has never been done on that line before. |
protected Fig |
makeEdgeFig()
Instantiate a FigPoly with its rectilinear flag set. |
void |
moveVertex(Handle h,
int x,
int y,
boolean ov)
|
void |
paint(java.awt.Graphics g)
Paint this FigEdge. |
protected java.awt.Point |
routingRectPoint(java.awt.Point p,
java.awt.Rectangle r,
int sector)
Reply a point on the given routing rect that is "straight out" from the connection point in the proper direction. |
protected boolean |
segOK(int x1,
int y1,
int x2,
int y2,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2)
Reply true if the line segment from (x1, y1) to (x2, y2) does not intersect the given avoid rectangles. |
void |
setEndPoints(java.awt.Point start,
java.awt.Point end)
Set the end points of this polygon, regardless of the number of fixed handles. |
void |
setInitiallyLaidOut(boolean b)
|
void |
setPoint(Handle h,
int mX,
int mY)
When the user drags the handles, move individual points |
protected int |
tryRoute(int x,
int y,
int np,
int[] xs,
int[] ys,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2,
int srcSector,
int dstSector)
Try to find a route from the last point in (xs, ys) to point (x, y). |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.tigris.gef.ui.Highlightable |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public FigEdgePoly()
| Method Detail |
|---|
protected Fig makeEdgeFig()
makeEdgeFig in class FigEdgepublic void setInitiallyLaidOut(boolean b)
public void computeRoute()
computeRoute in class FigEdgeprotected void layoutEdge()
java.lang.IllegalStateException - if the edge is not connected to 2 ports
protected java.awt.Point routingRectPoint(java.awt.Point p,
java.awt.Rectangle r,
int sector)
protected int tryRoute(int x,
int y,
int np,
int[] xs,
int[] ys,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2,
int srcSector,
int dstSector)
protected java.awt.Point findAvoidPt(int fx,
int fy,
int x,
int y,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2)
protected boolean segOK(int x1,
int y1,
int x2,
int y2,
java.awt.Rectangle avoid1,
java.awt.Rectangle avoid2)
public void moveVertex(Handle h,
int x,
int y,
boolean ov)
public void setPoint(Handle h,
int mX,
int mY)
setPoint in class FigEdge
public void insertPoint(int i,
int x,
int y)
insertPoint in class Fig
public void setEndPoints(java.awt.Point start,
java.awt.Point end)
public void paint(java.awt.Graphics g)
FigEdge
paint in class FigEdge
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||