|
||||||||||
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.FigLine
public class FigLine
Class to display lines in diagrams.
Field Summary | |
---|---|
protected int |
_x1
Coordinates of the start and end points of the line. |
protected int |
_x2
|
protected int |
_y1
|
protected int |
_y2
|
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 | |
---|---|
FigLine(int x1,
int y1,
int x2,
int y2)
Construct a new FigLine with the given coordinates and attributes. |
|
FigLine(int x1,
int y1,
int x2,
int y2,
java.awt.Color lineColor)
Construct a new FigLine with the given coordinates and color. |
Method Summary | |
---|---|
void |
calcBounds()
Update the bounding box so that it encloses (_x1, _y1)--(_x2, _y2). |
java.awt.Point |
connectionPoint(java.awt.Point anotherPt)
Replys the point that other connected Figs should attach to. |
void |
createDrag(int anchorX,
int anchorY,
int x,
int y,
int snapX,
int snapY)
Resize the object for drag on creation. |
int |
getNumPoints()
Returns the number of points. |
int |
getPerimeterLength()
return the approximate arc length of the path in pixel units |
java.awt.Point |
getPoint(int i)
returns the ith point. |
java.awt.Point[] |
getPoints()
returns an array of lenfth 2 that has the line's endpoints. |
int |
getX1()
|
int |
getX2()
|
int[] |
getXs()
Returns an array of the X coordinates of all (2) points. |
int |
getY1()
|
int |
getY2()
|
int[] |
getYs()
Returns an array of the Y coordinates of all (2) points. |
boolean |
hit(java.awt.Rectangle r)
Reply true if the given point is "near" the line. |
boolean |
intersects(java.awt.Rectangle rect)
Tests, if the given rectangle intersects with this line |
boolean |
intersectsPerimeter(java.awt.Rectangle rect)
Tests if the given rectangle intersects with the perimeter of this polygon. |
boolean |
isReshapable()
Returns true if this Fig can be reshaped by the user. |
boolean |
isResizable()
Lines can be reshaped, but not resized or rotated (for now). |
boolean |
isRotatable()
Returns true if this Fig can be rotated by the user. |
void |
paint(java.awt.Graphics g)
Paint this line object. |
void |
setBounds(int x,
int y,
int w,
int h)
Sets the bounds of the line. |
void |
setPoints(int i,
int x,
int y)
Move point i to location (x, y). |
void |
setPoints(java.awt.Point[] ps)
Sets both endpoints of a line. |
void |
setShape(int x1,
int y1,
int x2,
int y2)
Set both end points. |
void |
setShape(java.awt.Point p1,
java.awt.Point p2)
Set both end points. |
void |
setX1(int x1)
Set one of the end point coordinates. |
void |
setX2(int x2)
|
void |
setY1(int y1)
|
void |
setY2(int y2)
|
void |
stuffPointAlongPerimeter(int dist,
java.awt.Point res)
return a point that is dist pixels along the path |
void |
translate(int dx,
int dy)
Translate (move) this Fig. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int _x1
protected int _y1
protected int _x2
protected int _y2
Constructor Detail |
---|
public FigLine(int x1, int y1, int x2, int y2, java.awt.Color lineColor)
public FigLine(int x1, int y1, int x2, int y2)
Method Detail |
---|
public final void setShape(java.awt.Point p1, java.awt.Point p2)
public void setShape(int x1, int y1, int x2, int y2)
public int getX1()
public int getY1()
public int getX2()
public int getY2()
public void setX1(int x1)
public void setY1(int y1)
public void setX2(int x2)
public void setY2(int y2)
public boolean isResizable()
isResizable
in class Fig
public boolean isReshapable()
Fig
isReshapable
in class Fig
public boolean isRotatable()
Fig
isRotatable
in class Fig
public void setPoints(java.awt.Point[] ps)
setPoints
in class Fig
public java.awt.Point[] getPoints()
getPoints
in class Fig
public void setPoints(int i, int x, int y)
public java.awt.Point getPoint(int i)
getPoint
in class Fig
public int getNumPoints()
getNumPoints
in class Fig
public int[] getXs()
getXs
in class Fig
public int[] getYs()
getYs
in class Fig
public int getPerimeterLength()
getPerimeterLength
in class Fig
public void stuffPointAlongPerimeter(int dist, java.awt.Point res)
stuffPointAlongPerimeter
in class Fig
public void setBounds(int x, int y, int w, int h)
setBounds
in class Fig
public java.awt.Point connectionPoint(java.awt.Point anotherPt)
connectionPoint
in class Fig
public void translate(int dx, int dy)
translate
in class Fig
public void calcBounds()
calcBounds
in class Fig
FigText.calcBounds()
public void paint(java.awt.Graphics g)
paint
in class Fig
public boolean hit(java.awt.Rectangle r)
hit
in class Fig
r
- the rectangular hit area
public void createDrag(int anchorX, int anchorY, int x, int y, int snapX, int snapY)
createDrag
in class Fig
createDrag(int, int, int, int, int, int)
public boolean intersectsPerimeter(java.awt.Rectangle rect)
intersectsPerimeter
in class Fig
rect
- The rectangle to be tested.
public boolean intersects(java.awt.Rectangle rect)
intersects
in class Fig
rect
- The rectangle to be tested.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |