|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.chart.client.draw.sprite.Sprite
com.sencha.gxt.chart.client.draw.path.PathSprite
public class PathSprite
A Sprite that represents a path. Also contains utility functions for
path manipulation.
| Constructor Summary | |
|---|---|
PathSprite()
Creates a path with no values. |
|
PathSprite(CircleSprite sprite)
Creates a path sprite by converting the given CircleSprite. |
|
PathSprite(EllipseSprite sprite)
Creates a path sprite by converting the given EllipseSprite. |
|
PathSprite(PathSprite path)
Creates a copy of the given path. |
|
PathSprite(RectangleSprite sprite)
Creates a path sprite by converting the given RectangleSprite. |
|
PathSprite(TextSprite sprite)
Creates a path sprite by converting the given TextSprite. |
|
| Method Summary | |
|---|---|
void |
addCommand(int index,
PathCommand command)
Adds a PathCommand to the path at the given index. |
void |
addCommand(PathCommand command)
Adds a PathCommand to the path. |
void |
clearCommands()
Clears all PathCommand in the path. |
void |
clearDirtyFlags()
Clears all of the dirty flags on the sprite. |
PathSprite |
copy()
Returns a copy of the sprite. |
static List<PathCommand> |
copyCommands(List<PathCommand> commands)
Returns a new list of PathCommands by making copies of the given
commands. |
PreciseRectangle |
dimensions()
Returns the calculated dimensions of the path. |
static List<PathSprite> |
findDelta(PathSprite origin,
List<PathCommand> commands)
Ensures PathCommand parity between this path and the given path. |
PathCommand |
getCommand(int index)
Returns the PathCommand at the given index. |
List<PathCommand> |
getCommands()
Returns a List of all the PathCommands in the sprite. |
double |
getMiterLimit()
Returns the miter limit of the path. |
PathSprite |
getPathSprite()
Returns the Sprite as a path. |
Context2d.LineCap |
getStrokeLineCap()
Returns the shape to be used at the end of open subpaths when they are stroked. |
Context2d.LineJoin |
getStrokeLineJoin()
Returns the Context2d.LineJoin of the path. |
boolean |
isAbsolute()
Returns true if all path commands are absolute. |
boolean |
isCurved()
Returns true if all path commands are MoveTo or CurveTo
commands. |
boolean |
isDirty()
Returns true if the sprite changed since the last render. |
boolean |
isMiterLimitDirty()
Returns true if the miter limit changed since the last render. |
boolean |
isPathDirty()
Returns true if the path changed since the last render. |
boolean |
isStrokeLineCapDirty()
Returns true if the line cap changed since the last render. |
boolean |
isStrokeLineJoinDirty()
Returns true if the line join changed since the last render. |
PathSprite |
map(Matrix matrix)
Transforms the PathSprite by the passed Matrix. |
void |
removeCommand(int index)
Removes the PathCommand at the given index. |
void |
setCommand(int index,
PathCommand command)
Sets the PathCommand of the path at given index. |
void |
setCommands(List<PathCommand> commands)
Replace the path's PathCommands with the given List of
commands. |
void |
setMiterLimit(double miterLimit)
Sets miter limit of the path. |
void |
setStrokeLineCap(Context2d.LineCap strokeLineCap)
Sets the Context2d.LineCap of the path. |
void |
setStrokeLineJoin(Context2d.LineJoin strokeLineJoin)
Sets the Context2d.LineJoin of the path. |
int |
size()
Returns the number of PathCommands added to the sprite. |
PathSprite |
toAbsolute()
Returns the path converted to only absolute PathCommands. |
PathSprite |
toCurve()
Returns the path converted to only MoveTo and CurveTo
commands. |
PathSprite |
toSmooth(int subsections)
Returns the path smoothed by increasing the number of subsections. |
String |
toString()
|
| Methods inherited from class com.sencha.gxt.chart.client.draw.sprite.Sprite |
|---|
getBBox, getClipRectangle, getComponent, getFill, getFillOpacity, getOpacity, getRotation, getScaling, getStroke, getStrokeOpacity, getStrokeWidth, getSurface, getTranslation, getzIndex, isClipRectangleDirty, isFillDirty, isFillOpacityDirty, isHidden, isHiddenDirty, isOpacityDirty, isStrokeDirty, isStrokeOpacityDirty, isStrokeWidthDirty, isTransformDirty, isZIndexDirty, redraw, remove, setClipRectangle, setComponent, setCursor, setFill, setFillOpacity, setHidden, setOpacity, setRotation, setRotation, setRotation, setScaling, setScaling, setScaling, setStroke, setStrokeOpacity, setStrokeWidth, setSurface, setTranslation, setTranslation, setZIndex, transformMatrix, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PathSprite()
public PathSprite(CircleSprite sprite)
CircleSprite.
sprite - the circle sprite to be converted to a pathpublic PathSprite(EllipseSprite sprite)
EllipseSprite.
sprite - the ellipse sprite to be converted to a pathpublic PathSprite(PathSprite path)
path - the sprite to be copiedpublic PathSprite(RectangleSprite sprite)
RectangleSprite.
sprite - the rectangle sprite to be converted to a pathpublic PathSprite(TextSprite sprite)
TextSprite.
sprite - the text sprite to be converted to a path| Method Detail |
|---|
public static List<PathCommand> copyCommands(List<PathCommand> commands)
PathCommands by making copies of the given
commands.
commands - the commands to be copied
public static List<PathSprite> findDelta(PathSprite origin,
List<PathCommand> commands)
PathCommand parity between this path and the given path.
origin - the path to be comparedcommands - the path commands to compare against
public void addCommand(int index,
PathCommand command)
PathCommand to the path at the given index.
index - the index to add the commandcommand - the path command to addpublic void addCommand(PathCommand command)
PathCommand to the path.
command - the path command to addpublic void clearCommands()
PathCommand in the path.
public void clearDirtyFlags()
Sprite
clearDirtyFlags in class Spritepublic PathSprite copy()
Sprite
copy in class Spritepublic PreciseRectangle dimensions()
public PathCommand getCommand(int index)
PathCommand at the given index.
index - the index of the command to return
public List<PathCommand> getCommands()
List of all the PathCommands in the sprite.
public double getMiterLimit()
public PathSprite getPathSprite()
SpriteSprite as a path.
getPathSprite in class Spritepublic Context2d.LineCap getStrokeLineCap()
public Context2d.LineJoin getStrokeLineJoin()
Context2d.LineJoin of the path.
public boolean isAbsolute()
public boolean isCurved()
MoveTo or CurveTo
commands.
public boolean isDirty()
Sprite
isDirty in class Spritepublic boolean isMiterLimitDirty()
public boolean isPathDirty()
public boolean isStrokeLineCapDirty()
public boolean isStrokeLineJoinDirty()
public PathSprite map(Matrix matrix)
PathSprite by the passed Matrix.
matrix - the transformation Matrix
PathSpritepublic void removeCommand(int index)
PathCommand at the given index.
index - the index of the command
public void setCommand(int index,
PathCommand command)
PathCommand of the path at given index.
index - the index of the command to be setcommand - the command to be setpublic void setCommands(List<PathCommand> commands)
PathCommands with the given List of
commands.
commands - the new list of commandspublic void setMiterLimit(double miterLimit)
miterLimit - the new miter limit of the pathpublic void setStrokeLineCap(Context2d.LineCap strokeLineCap)
Context2d.LineCap of the path. Determines the shape to be used at
the end of open subpaths.
strokeLineCap - the line cap of the pathpublic void setStrokeLineJoin(Context2d.LineJoin strokeLineJoin)
Context2d.LineJoin of the path. Determines the shape to be used at
the corners of paths.
strokeLineJoin - the line join of the pathpublic int size()
PathCommands added to the sprite.
public PathSprite toAbsolute()
PathCommands.
public PathSprite toCurve()
MoveTo and CurveTo
commands.
public PathSprite toSmooth(int subsections)
CurveTo commands.
subsections - the number of subdivisions used in the smoothing
function; must be no less than 4
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||