Class ShapeNode
java.lang.Object
com.codename1.art.ArtNode
com.codename1.art.ShapeNode
A vector shape: a path with any number of fills and strokes, painted in order.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()A deep copy.static ShapeNodeellipse(double cx, double cy, double rx, double ry) An ellipse.Adds a fill and returns this shape.getFills()The fills, painted first to last.double[]The bounds of this node's own content in its own space asx, y, w, h, without effects; null when it has none.getPath()The outline.The strokes, painted after the fills.static ShapeNodeline(double x1, double y1, double x2, double y2) A straight line.static ShapeNoderect(double x, double y, double w, double h, double rx) A rectangle, optionally with rounded corners.voidsetPath(GeneralPath path) Replaces the outline.stroke(StrokeStyle stroke) Adds a stroke and returns this shape.Methods inherited from class ArtNode
copyBase, getBlendMode, getBounds, getClipPath, getEffects, getId, getMask, getName, getOpacity, getTransform, isKnockout, isLocked, isLuminanceMask, isVisible, setBlendMode, setClipPath, setId, setKnockout, setLocked, setMask, setName, setOpacity, setTransform, setVisible
-
Constructor Details
-
ShapeNode
Creates a shape.
Parameters
path: its outline, in the shape's space
-
-
Method Details
-
rect
A rectangle, optionally with rounded corners.
Parameters
x: lefty: topw: widthh: heightrx: corner radius; 0 for square corners
-
ellipse
An ellipse.
Parameters
cx: center xcy: center yrx: horizontal radiusry: vertical radius
-
line
A straight line.
Parameters
x1: start xy1: start yx2: end xy2: end y
-
getPath
The outline. -
setPath
Replaces the outline.
Parameters
path: the new outline
-
getFills
-
getStrokes
The strokes, painted after the fills. The list is live. -
fill
-
stroke
Adds a stroke and returns this shape.
Parameters
stroke: the stroke
-
getLocalBounds
public double[] getLocalBounds()Description copied from class:ArtNodeThe bounds of this node's own content in its own space asx, y, w, h, without effects; null when it has none.- Specified by:
getLocalBoundsin classArtNode
-
copy
-