public class PSWTPath extends PNode
PNode.PSceneGraphDelegate
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_SHAPE
The property name that identifies a change of this node's path.
|
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
PSWTPath()
Creates an empty PSWTPath.
|
PSWTPath(Shape aShape)
Creates an SWTPath in the given shape with the default paint and stroke.
|
Modifier and Type | Method and Description |
---|---|
Shape |
cloneShape(Shape aShape)
Clone's the shape provided.
|
static PSWTPath |
createEllipse(float x,
float y,
float width,
float height)
Creates a path representing an ellipse that covers the rectangle
provided.
|
static PSWTPath |
createPolyline(float[] xp,
float[] yp)
Creates a PPath for the poly-line for the given points.
|
static PSWTPath |
createPolyline(Point2D[] points)
Creates a PPath for the poly-line for the given points.
|
static PSWTPath |
createRectangle(float x,
float y,
float width,
float height)
Creates a path representing the rectangle provided.
|
static PSWTPath |
createRoundRectangle(float x,
float y,
float width,
float height,
float arcWidth,
float arcHeight)
Creates a path representing the rounded rectangle provided.
|
Point2D |
getCenter()
Return the center of this SWT path node, based on its bounds.
|
Paint |
getStrokePaint()
Returns the paint to use when drawing the stroke of the shape.
|
protected void |
internalUpdateBounds(double x,
double y,
double width,
double height)
Set the bounds of this path.
|
boolean |
intersects(Rectangle2D aBounds)
Returns true if path crosses the provided bounds.
|
protected void |
paint(PPaintContext paintContext)
Paints the path on the context provided.
|
void |
setPathToEllipse(float x,
float y,
float width,
float height)
Resets the path to an ellipse positioned at the coordinate provided with
the dimensions provided.
|
void |
setPathToPolyline(float[] xp,
float[] yp)
Sets the path to a sequence of segments described by the point components
provided.
|
void |
setPathToPolyline(Point2D[] points)
Sets the path to a sequence of segments described by the points.
|
void |
setPathToRectangle(float x,
float y,
float width,
float height)
Resets the path to a rectangle with the dimensions and position provided.
|
void |
setPathToRoundRectangle(float x,
float y,
float width,
float height,
float arcWidth,
float arcHeight)
Resets the path to a rectangle with the dimensions and position provided.
|
void |
setShape(Shape newShape)
Changes the underlying shape of this PSWTPath.
|
void |
setStrokeColor(Paint strokeColor)
Sets the paint to use when drawing the stroke of the shape.
|
void |
updateBoundsFromPath()
Recalculates the path's bounds by examining it's associated shape.
|
void |
updateShapePoints(Shape aShape)
Updates the internal points used to draw the shape.
|
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
public static final String PROPERTY_SHAPE
public PSWTPath()
public PSWTPath(Shape aShape)
aShape
- the desired shapepublic static PSWTPath createRectangle(float x, float y, float width, float height)
x
- left of rectangley
- top of rectanglewidth
- width of rectangleheight
- height of rectanglepublic static PSWTPath createRoundRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)
x
- left of rectangley
- top of rectanglewidth
- width of rectangleheight
- height of rectanglearcWidth
- width of the arc at the cornersarcHeight
- height of arc at the cornerspublic static PSWTPath createEllipse(float x, float y, float width, float height)
x
- left of rectangley
- top of rectanglewidth
- width of rectangleheight
- height of rectanglepublic static PSWTPath createPolyline(Point2D[] points)
points
- array of points for the point linespublic static PSWTPath createPolyline(float[] xp, float[] yp)
xp
- array of x components of the points of the poly-linesyp
- array of y components of the points of the poly-linespublic Paint getStrokePaint()
public void setStrokeColor(Paint strokeColor)
strokeColor
- new stroke colorprotected void internalUpdateBounds(double x, double y, double width, double height)
internalUpdateBounds
in class PNode
x
- new left position of boundsy
- new top position of boundswidth
- the new width of the boundsheight
- the new height of the boundspublic boolean intersects(Rectangle2D aBounds)
intersects
in class PNode
aBounds
- bounds being tested for intersectionpublic void updateBoundsFromPath()
protected void paint(PPaintContext paintContext)
public void setShape(Shape newShape)
newShape
- new associated shape of this PSWTPathpublic void updateShapePoints(Shape aShape)
aShape
- shape to read points frompublic Shape cloneShape(Shape aShape)
aShape
- shape to be clonedpublic void setPathToRectangle(float x, float y, float width, float height)
x
- left of the rectangley
- top of te rectanglewidth
- width of the rectangleheight
- height of the rectanglepublic void setPathToRoundRectangle(float x, float y, float width, float height, float arcWidth, float arcHeight)
x
- left of the rectangley
- top of te rectanglewidth
- width of the rectangleheight
- height of the rectanglearcWidth
- width of arc in the corners of the rectanglearcHeight
- height of arc in the corners of the rectanglepublic void setPathToEllipse(float x, float y, float width, float height)
x
- left of the ellipsey
- top of the ellipsewidth
- width of the ellipseheight
- height of the ellipsepublic void setPathToPolyline(Point2D[] points)
points
- points to that lie along the generated pathpublic void setPathToPolyline(float[] xp, float[] yp)
xp
- the x components of the points along the pathyp
- the y components of the points along the pathpublic Point2D getCenter()
Copyright © 1995-2013 Piccolo2D. All Rights Reserved.