|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--edu.umd.cs.jazz.scenegraph.ZVisualComponent
|
+--edu.umd.cs.jazz.component.ZPolyline
ZPolyline is a visual component that represents a line with one or more segments.
| Field Summary | |
static int |
ARRAY_INC
|
static int |
ARROW_BOTH
|
static int |
ARROW_FIRST
|
static int |
ARROW_LAST
|
static int |
ARROW_NONE
|
protected int |
arrowHead
|
protected int |
cap
|
static java.awt.Color |
DEFAULT_PEN_COLOR
|
static float |
DEFAULT_PEN_WIDTH
|
protected boolean |
empty
|
protected java.awt.geom.GeneralPath |
firstArrowHead
|
protected int |
join
|
protected java.awt.geom.GeneralPath |
lastArrowHead
|
protected int |
np
|
protected java.awt.geom.GeneralPath |
path
|
protected java.awt.Color |
penColor
|
protected float |
penWidth
|
protected float[] |
xp
|
protected float[] |
yp
|
| Fields inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
cacheVolatile,
findable,
findable_DEFAULT,
isVolatile,
localBounds,
localBoundsDirty,
parent,
pickable,
pickable_DEFAULT,
selected |
| Constructor Summary | |
ZPolyline()
Constructs a new Polyline with no points. |
|
ZPolyline(float[] xp,
float[] yp)
Constructs a new Polyline. |
|
ZPolyline(float x,
float y)
Constructs a new Polyline with a single point. |
|
ZPolyline(float x1,
float y1,
float x2,
float y2)
Constructs a new Polyline with a two points |
|
ZPolyline(java.awt.geom.Point2D pt)
Constructs a new Polyline with a single point. |
|
ZPolyline(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
Constructs a new Polyline with two points. |
|
ZPolyline(ZPolyline poly)
Constructs a new ZPolyline that is a duplicate of the reference polyline, i.e., a "copy constructor" |
|
| Method Summary | |
void |
add(float x,
float y)
Add a point to the end of this polyline. |
void |
add(java.awt.geom.Point2D pt)
Add a point to the end of this polyline. |
java.lang.Object |
clone()
Duplicates the current ZPolyline by using the copy constructor. |
protected java.awt.geom.GeneralPath |
computeArrowHead(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Calculate the points used to represent the arrowhead. |
protected void |
computeLocalBounds()
Notifies this object that it has changed and that it should update its notion of its bounding box. |
int |
getArrowHead()
|
int |
getNumberPoints()
Get the number of points in this polyline. |
java.awt.Color |
getPenColor()
|
float |
getPenWidth()
|
float[] |
getXCoords()
Get an array of the X coordinates of the points in this polyline. |
float[] |
getYCoords()
Get an array of the Y coordinates of the points in this polyline. |
void |
paint(ZRenderContext renderContext)
Paints this object. |
boolean |
pick(java.awt.geom.Rectangle2D rect)
Returns true if the specified rectangle is on the polyline. |
void |
setArrowHead(int ah)
|
void |
setCoords(float[] xp,
float[] yp)
Set the coordinates of this polyline. |
void |
setPenColor(java.awt.Color color)
|
void |
setPenWidth(float width)
|
void |
setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
Set some state of this object as it gets read back in. |
void |
trimToSize()
Trims the capacity of the arrays that store the polyline points to the actual number of points. |
protected void |
updateArrowHeads()
Updates the internal representation of the arrowheads to reflect the current state of the polyline. |
void |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
| Methods inherited from class edu.umd.cs.jazz.scenegraph.ZVisualComponent |
damage,
damage,
findNode,
findVisualComponent,
getLocalBounds,
getParent,
isFindable,
isPickable,
isSelected,
isVolatile,
pickBounds,
select,
select,
setFindable,
setParent,
setPickable,
setSelected,
setVisualComponent,
setVolatile,
toString,
unselect,
updateBounds,
updateChildBounds,
updateLocalBounds,
updateVolatility,
writeObjectRecurse |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int ARROW_NONE
public static final int ARROW_FIRST
public static final int ARROW_LAST
public static final int ARROW_BOTH
public static final java.awt.Color DEFAULT_PEN_COLOR
public static final float DEFAULT_PEN_WIDTH
public static final int ARRAY_INC
protected java.awt.Color penColor
protected float penWidth
protected boolean empty
protected java.awt.geom.GeneralPath path
protected float[] xp
protected float[] yp
protected int np
protected int cap
protected int join
protected int arrowHead
protected java.awt.geom.GeneralPath firstArrowHead
protected java.awt.geom.GeneralPath lastArrowHead
| Constructor Detail |
public ZPolyline()
public ZPolyline(java.awt.geom.Point2D pt)
pt - Initial point
public ZPolyline(java.awt.geom.Point2D pt1,
java.awt.geom.Point2D pt2)
pt1 - First pointpt2 - Second point
public ZPolyline(float x,
float y)
x,y - Initial point
public ZPolyline(float x1,
float y1,
float x2,
float y2)
x,y - First pointx,y - Second point
public ZPolyline(float[] xp,
float[] yp)
xp - Array of X pointsyp - Array of Y pointspublic ZPolyline(ZPolyline poly)
poly - Reference polyline| Method Detail |
public java.lang.Object clone()
ZPolyline(ZPolyline)public float getPenWidth()
public void setPenWidth(float width)
public java.awt.Color getPenColor()
public void setPenColor(java.awt.Color color)
public int getArrowHead()
public void setArrowHead(int ah)
public void add(java.awt.geom.Point2D pt)
pt - The new point
public void add(float x,
float y)
x,y - The new point
public void setCoords(float[] xp,
float[] yp)
xp - An array of the X coordinates of the new points.yp - An array of the Y coordinates of the new points.public float[] getXCoords()
getNumberPoints() to get the actual
number of points in the polyline.public float[] getYCoords()
getNumberPoints() to get the actual
number of points in the polyline.public int getNumberPoints()
public void trimToSize()
getXCoords(),
getYCoords(),
getNumberPoints()public void paint(ZRenderContext renderContext)
g2 - The graphics context to paint into.protected void computeLocalBounds()
updateBounds when needed.ZNode.getGlobalBounds()public boolean pick(java.awt.geom.Rectangle2D rect)
rect - Pick rectangle of object coordinates.protected void updateArrowHeads()
protected java.awt.geom.GeneralPath computeArrowHead(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
public void writeObject(ZObjectOutputStream out)
throws java.io.IOException
out - The stream that this object writes into
public void setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
fieldType - The fully qualified type of the fieldfieldName - The name of the fieldfieldValue - The value of the field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||