Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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
PathCommand s 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 PathCommand s 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()
|
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
PathCommand s 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
PathCommand s added to the sprite. |
PathSprite |
toAbsolute()
Returns the path converted to only absolute
PathCommand s. |
PathSprite |
toCurve()
|
PathSprite |
toSmooth(int subsections)
Returns the path smoothed by increasing the number of subsections.
|
String |
toString() |
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
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 pathpublic static List<PathCommand> copyCommands(List<PathCommand> commands)
PathCommand
s by making copies of the given
commands.commands
- the commands to be copiedpublic 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 againstpublic 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 Sprite
public PathSprite copy()
Sprite
public PreciseRectangle dimensions()
public PathCommand getCommand(int index)
PathCommand
at the given index.index
- the index of the command to returnpublic List<PathCommand> getCommands()
List
of all the PathCommand
s in the sprite. Note that modifying this will not cause the
path to be marked as dirty, either use the other command manipulation methods, or force redraw some other way.addCommand(int, PathCommand)
,
addCommand(PathCommand)
,
clearCommands()
,
setCommand(int, PathCommand)
,
setCommands(java.util.List)
public double getMiterLimit()
public PathSprite getPathSprite()
Sprite
Sprite
as a path.getPathSprite
in class Sprite
public Context2d.LineCap getStrokeLineCap()
public Context2d.LineJoin getStrokeLineJoin()
Context2d.LineJoin
of the path.public boolean isAbsolute()
public boolean isCurved()
public boolean isDirty()
Sprite
public 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
PathSprite
public void removeCommand(int index)
PathCommand
at the given index.index
- the index of the commandpublic 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)
PathCommand
s 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()
PathCommand
s added to the sprite.public PathSprite toAbsolute()
PathCommand
s.public PathSprite toCurve()
public PathSprite toSmooth(int subsections)
CurveTo
commands.subsections
- the number of subdivisions used in the smoothing
function; must be no less than 4Copyright © 2015. All rights reserved.