|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolox.swt.PSWTPath
public class PSWTPath
PPath is a wrapper around a java.awt.geom.GeneralPath. The setBounds method works by scaling the path to fit into the specified bounds. This normally works well, but if the specified base bounds get too small then it is impossible to expand the path shape again since all its numbers have tended to zero, so application code may need to take this into consideration.
One option that applications have is to call startResizeBounds
before
starting an interaction that may make the bounds very small, and calling
endResizeBounds
when this interaction is finished. When this is done
PPath will use a copy of the original path to do the resizing so the numbers
in the path wont loose resolution.
This class also provides methods for constructing common shapes using a general path.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_SHAPE
The property name that identifies a change of this node's path. |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PSWTPath()
|
|
PSWTPath(java.awt.Shape aShape)
|
Method Summary | |
---|---|
java.awt.Shape |
cloneShape(java.awt.Shape aShape)
|
static PSWTPath |
createEllipse(float x,
float y,
float width,
float height)
|
static PSWTPath |
createPolyline(float[] xp,
float[] yp)
|
static PSWTPath |
createPolyline(java.awt.geom.Point2D[] points)
|
static PSWTPath |
createRectangle(float x,
float y,
float width,
float height)
|
static PSWTPath |
createRoundRectangle(float x,
float y,
float width,
float height,
float arcWidth,
float arcHeight)
|
java.awt.Paint |
getStrokePaint()
|
protected void |
internalUpdateBounds(double x,
double y,
double width,
double height)
Set the bounds of this path. |
boolean |
intersects(java.awt.geom.Rectangle2D aBounds)
Return true if this node intersects the given rectangle specified in local bounds. |
protected void |
paint(PPaintContext paintContext)
Paint this node behind any of its children nodes. |
protected java.lang.String |
paramString()
Returns a string representing the state of this node. |
void |
setPathToEllipse(float x,
float y,
float width,
float height)
|
void |
setPathToPolyline(float[] xp,
float[] yp)
|
void |
setPathToPolyline(java.awt.geom.Point2D[] points)
|
void |
setPathToRectangle(float x,
float y,
float width,
float height)
|
void |
setPathToRoundRectangle(float x,
float y,
float width,
float height,
float arcWidth,
float arcHeight)
|
void |
setShape(java.awt.Shape aShape)
|
void |
setStrokeColor(java.awt.Paint aPaint)
|
void |
updateBoundsFromPath()
|
void |
updateShapePoints(java.awt.Shape aShape)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_SHAPE
Constructor Detail |
---|
public PSWTPath()
public PSWTPath(java.awt.Shape aShape)
Method Detail |
---|
public static PSWTPath createRectangle(float x, float y, float width, float height)
public static PSWTPath createRoundRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)
public static PSWTPath createEllipse(float x, float y, float width, float height)
public static PSWTPath createPolyline(java.awt.geom.Point2D[] points)
public static PSWTPath createPolyline(float[] xp, float[] yp)
public java.awt.Paint getStrokePaint()
public void setStrokeColor(java.awt.Paint aPaint)
protected void internalUpdateBounds(double x, double y, double width, double height)
internalUpdateBounds
in class PNode
public boolean intersects(java.awt.geom.Rectangle2D aBounds)
PNode
fullIntersects
is used
for quick rejects before calling this method.
intersects
in class PNode
aBounds
- the bounds to test for intersection against
public void updateBoundsFromPath()
protected void paint(PPaintContext paintContext)
PNode
paint
in class PNode
paintContext
- the paint context to use for painting the nodepublic void setShape(java.awt.Shape aShape)
public void updateShapePoints(java.awt.Shape aShape)
public java.awt.Shape cloneShape(java.awt.Shape aShape)
public void setPathToRectangle(float x, float y, float width, float height)
public void setPathToRoundRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)
public void setPathToEllipse(float x, float y, float width, float height)
public void setPathToPolyline(java.awt.geom.Point2D[] points)
public void setPathToPolyline(float[] xp, float[] yp)
protected java.lang.String paramString()
null
.
paramString
in class PNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |