-
public class Path extends Shape
Path class. Path is sequence of segments of different type, it can be opened or closed. To define the internal fill this rule is used EVEN-ODD. Path always starts with moveTo command.Do not invoke constructor directly. Use path or path to create stage or layer bound path. To create unbound path use path See also:pathpathpath
-
-
Method Summary
Modifier and Type Method Description static Pathinstantiate()StringgetJsBase()PathappendTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)Combines the current transformation with the given transformation matrix. PatharcTo(Number rx, Number ry, Number fromAngle, Number extent)Adds a command to the path that draws an arc of an ellipse. PatharcToAsCurves(Number rx, Number ry, Number fromAngle, Number extent)This method is similar to arcTo, but in this case the arc is approximated by Bezier curves. PatharcToByEndPoint(Number x, Number y, Number rx, Number ry, Boolean largeArc, Boolean clockwiseArc)Adds a command to the path that draws an arc of an ellipse. voidattr(String key)Getter for the attribute. Pathattr(String key, String value)Setter for the attribute. PathcircularArc(Number cx, Number cy, Number rx, Number ry, Number fromAngle, Number sweep, Boolean lineTo)Adds a command to the path that draws a circular arc. Pathclear()Resets all path operations. Rectclip()Gets the current clipping rectangle. Pathclip(Rect value)Sets the clipping rectangle. Pathclip(String value)Sets the clipping rectangle. Pathclose()Adds a command that closes the path by connecting the last point with the first straight line. voidcursor()Getter for the current cursor type. Pathcursor(Cursor value)Setter for the cursor type. PathcurveTo(Number control1X, Number control1Y, Number control2X, Number control2Y, Number endX, Number endY, Number var_args)Adds specified points to the path, drawing sequentially a cubic Bezier curve from the current point to the next. voiddesc()Getter for the element description value. Pathdesc(String value)Setter for the element description value. voiddisablePointerEvents()Gets the current value of the pointer events. PathdisablePointerEvents(Boolean value)Disables the pointer events. voiddisableStrokeScaling()Getter for the current element's vector effect property. PathdisableStrokeScaling(Boolean value)Setter for the element's vector effect property. voiddispose()Disposes element completely. voiddomElement()Returns DOM element if element is rendered. voiddrag()Returns the current state flag. Pathdrag(Boolean value)Turns off/on dragging (moving) of an element. Pathdrag(Rect value)Turns off/on dragging (moving) of an element. voidfill()Gets the current fill. Pathfill(Fill color)Sets a fill as an object or a string. Pathfill(String color, Number opacity)Sets a fill with opacity. Pathfill(GradientKey keys, Number angle, Boolean mode, Number opacity)Linear gradient fill. Pathfill(GradientKey keys, Number angle, Rect mode, Number opacity)Linear gradient fill. Pathfill(GradientKey keys, Number angle, String mode, Number opacity)Linear gradient fill. Pathfill(Array<String> keys, Number angle, Boolean mode, Number opacity)Linear gradient fill. Pathfill(Array<String> keys, Number angle, Rect mode, Number opacity)Linear gradient fill. Pathfill(Array<String> keys, Number angle, String mode, Number opacity)Linear gradient fill. Pathfill(GradientKey keys, Number cx, Number cy, Rect mode, Number opacity, Number fx, Number fy)Radial gradient fill. Pathfill(Array<String> keys, Number cx, Number cy, Rect mode, Number opacity, Number fx, Number fy)Radial gradient fill. RectgetAbsoluteBounds()Gets element bounds in absolute coordinates (root element coordinate system). voidgetAbsoluteHeight()Returns height within root bounds. voidgetAbsoluteWidth()Returns width within root bounds. voidgetAbsoluteX()Returns an absolute X (root element coordinate system). voidgetAbsoluteY()Returns an absolute Y (root element coordinate system). RectgetBounds()Returns the bounds. CoordinategetCurrentPoint()Returns the last coordinates added to the path. voidgetHeight()Returns the height. voidgetLength()Gets path length. voidgetRotationAngle()Returns the current rotation angle in degrees. StagegetStage()Stage object (to which the given element is bound). voidgetTransformationMatrix()Returns the current transformation matrix. voidgetWidth()Returns the width. voidgetX()Returns X in the coordinate system of the parent. voidgetY()Returns Y in the coordinate system of the parent. voidhasParent()Whether parent element is set. voidid()Gets the current element identifier. Pathid(String id)Sets the element identifier. PathlineTo(Number x, Number y, Number var_args)Adds specified points to the current path, drawing sequentially a straight line through the specified coordinates. PathmoveTo(Number x, Number y)Moves path cursor position to a specified coordinate. Layerparent()Returns the parent layer. Pathparent(Layer parent)Adds element to the given layer. Pathparent(Stage parent)Adds element to the given layer. PathquadraticCurveTo(Number controlX, Number controlY, Number endX, Number endY, Number var_args)Adds specified points to the path, drawing sequentially a quadratic Bezier curve from the current point to the next. Pathremove()Current element removes itself from the parent layer. voidremoveAllListeners(String type)Removes all listeners from this listenable. Pathrotate(Number degrees, Number cx, Number cy)Rotates a shape around the given rotation point. PathrotateByAnchor(Number degrees, Anchor anchor)Rotates a shape around the given anchor. PathrotateByAnchor(Number degrees, String anchor)Rotates a shape around the given anchor. Pathscale(Number sx, Number sy, Number cx, Number cy)Scales a shape. PathscaleByAnchor(Number sx, Number sy, Anchor anchor)Scales a shape by anchor. PathscaleByAnchor(Number sx, Number sy, String anchor)Scales a shape by anchor. PathsetPosition(Number x, Number y)Sets top left corner of a shape (transformation taken into account) in the coordinate system of the parent. PathsetRotation(Number degrees, Number cx, Number cy)Rotates a shape around the given point. PathsetRotationByAnchor(Number degrees, Anchor anchor)Rotates a shape around the given anchor. PathsetRotationByAnchor(Number degrees, String anchor)Rotates a shape around the given anchor. PathsetTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)Sets the transformation matrix. voidstroke()Gets the current stroke. Pathstroke(Stroke value)Sets a stroke using one parameter. Pathstroke(ColoredFill value)Sets a stroke using one parameter. Pathstroke(String value)Sets a stroke using one parameter. Pathstroke(Stroke value, Number thickness, String dashpattern, String lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(Stroke value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. Pathstroke(Stroke value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(Stroke value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. Pathstroke(ColoredFill value, Number thickness, String dashpattern, String lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(ColoredFill value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. Pathstroke(ColoredFill value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(ColoredFill value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. Pathstroke(String value, Number thickness, String dashpattern, String lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(String value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. Pathstroke(String value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)Sets stroke settings using several parameter. Pathstroke(String value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)Sets stroke settings using several parameter. voidstrokeThickness()Gets the current stroke thickness. PathstrokeThickness(Number thickness)Sets a stroke thickness. voidtitle()Getter for the element title value. Pathtitle(String value)Setter for the element title value. Pathtranslate(Number tx, Number ty)Moves a shape taking an account the current transformation. voidsetOnClickListener(ListenersInterface.OnClickListener listener)voidsetOnClickListener(ListenersInterface.OnClickListener listener, String type, String ePath)voidvisible()Gets the current visibility flag. Pathvisible(Boolean isVisible)Hides or shows an element. voidzIndex()Gets the current element's zIndex. PathzIndex(Number value)Sets the element's zIndex. voidunlistenByKey(String key)Removes an event listener which was added with listen() by the key returned by listen(). Pathfill(String value)-
Methods inherited from class com.anychart.graphics.vector.Shape
appendTransformationMatrix, attr, clip, clip, cursor, desc, disablePointerEvents, disableStrokeScaling, drag, drag, fill, fill, fill, fill, fill, fill, fill, fill, fill, fill, fill, id, instantiate, parent, parent, remove, rotate, rotateByAnchor, rotateByAnchor, scale, scaleByAnchor, scaleByAnchor, setPosition, setRotation, setRotationByAnchor, setRotationByAnchor, setTransformationMatrix, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, stroke, strokeThickness, title, translate, visible, zIndex -
Methods inherited from class com.anychart.graphics.vector.Element
appendTransformationMatrix, attr, clip, clip, cursor, desc, disablePointerEvents, disableStrokeScaling, drag, drag, id, instantiate, parent, parent, remove, rotate, rotateByAnchor, rotateByAnchor, scale, scaleByAnchor, scaleByAnchor, setPosition, setRotation, setRotationByAnchor, setRotationByAnchor, setTransformationMatrix, title, translate, visible, zIndex -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Path
Path(String jsChart)
-
-
Method Detail
-
instantiate
static Path instantiate()
-
appendTransformationMatrix
Path appendTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)
Combines the current transformation with the given transformation matrix.
-
arcTo
Path arcTo(Number rx, Number ry, Number fromAngle, Number extent)
Adds a command to the path that draws an arc of an ellipse. An ellipse with radius rx, ry, starting from an angle fromAngle, with an angular length extent. The positive direction is considered the direction from a positive direction of the X-axis to a positive direction of the Y-axis, that is clockwise.
-
arcToAsCurves
Path arcToAsCurves(Number rx, Number ry, Number fromAngle, Number extent)
This method is similar to arcTo, but in this case the arc is approximated by Bezier curves.
-
arcToByEndPoint
Path arcToByEndPoint(Number x, Number y, Number rx, Number ry, Boolean largeArc, Boolean clockwiseArc)
Adds a command to the path that draws an arc of an ellipse. An arc of an ellipse with radius rx, ryrx, ry from the current point to a point x, y. The largeArc and clockwiseArc flags define which of the 4 possible arcs is drawn. Read more at ://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
-
circularArc
Path circularArc(Number cx, Number cy, Number rx, Number ry, Number fromAngle, Number sweep, Boolean lineTo)
Adds a command to the path that draws a circular arc. An arc with a center in (cx, cy) start angle (from) and end angle (from + sweep), with clockwise and counterclock drawing option.
-
close
Path close()
Adds a command that closes the path by connecting the last point with the first straight line.
-
cursor
void cursor()
Getter for the current cursor type.
-
curveTo
Path curveTo(Number control1X, Number control1Y, Number control2X, Number control2Y, Number endX, Number endY, Number var_args)
Adds specified points to the path, drawing sequentially a cubic Bezier curve from the current point to the next. Each curve is defined by 3 points (6 coordinates) - two control points and an endpoint.
-
desc
void desc()
Getter for the element description value.
-
disablePointerEvents
void disablePointerEvents()
Gets the current value of the pointer events.
-
disablePointerEvents
Path disablePointerEvents(Boolean value)
Disables the pointer events.
-
disableStrokeScaling
void disableStrokeScaling()
Getter for the current element's vector effect property.
-
disableStrokeScaling
Path disableStrokeScaling(Boolean value)
Setter for the element's vector effect property. Learn more by link.
-
dispose
void dispose()
Disposes element completely. Removes it from the parent layer, sets links to null, removes it from DOM.
-
domElement
void domElement()
Returns DOM element if element is rendered. In case of Stage in Suspended state or unbound element - null is returned.
-
drag
void drag()
Returns the current state flag.
-
fill
void fill()
Gets the current fill.
-
fill
Path fill(Array<String> keys, Number angle, Boolean mode, Number opacity)
Linear gradient fill.
-
fill
Path fill(GradientKey keys, Number cx, Number cy, Rect mode, Number opacity, Number fx, Number fy)
Radial gradient fill.
-
fill
Path fill(Array<String> keys, Number cx, Number cy, Rect mode, Number opacity, Number fx, Number fy)
Radial gradient fill.
-
getAbsoluteBounds
Rect getAbsoluteBounds()
Gets element bounds in absolute coordinates (root element coordinate system).
-
getAbsoluteHeight
void getAbsoluteHeight()
Returns height within root bounds. See illustrations at getAbsoluteWidth
-
getAbsoluteWidth
void getAbsoluteWidth()
Returns width within root bounds.
-
getAbsoluteX
void getAbsoluteX()
Returns an absolute X (root element coordinate system).
-
getAbsoluteY
void getAbsoluteY()
Returns an absolute Y (root element coordinate system).
-
getCurrentPoint
Coordinate getCurrentPoint()
Returns the last coordinates added to the path.
-
getHeight
void getHeight()
Returns the height.
-
getLength
void getLength()
Gets path length.
-
getRotationAngle
void getRotationAngle()
Returns the current rotation angle in degrees.
-
getTransformationMatrix
void getTransformationMatrix()
Returns the current transformation matrix.
-
getWidth
void getWidth()
Returns the width.
-
getX
void getX()
Returns X in the coordinate system of the parent.
-
getY
void getY()
Returns Y in the coordinate system of the parent.
-
hasParent
void hasParent()
Whether parent element is set.
-
id
void id()
Gets the current element identifier.
-
lineTo
Path lineTo(Number x, Number y, Number var_args)
Adds specified points to the current path, drawing sequentially a straight line through the specified coordinates.
-
moveTo
Path moveTo(Number x, Number y)
Moves path cursor position to a specified coordinate. Remember that if you call the moveTo method a few times in a row, only the last call will be applied.
-
quadraticCurveTo
Path quadraticCurveTo(Number controlX, Number controlY, Number endX, Number endY, Number var_args)
Adds specified points to the path, drawing sequentially a quadratic Bezier curve from the current point to the next. Each curve is defined by 2 points (4 coordinates) - a control point and an endpoint.
-
removeAllListeners
void removeAllListeners(String type)
Removes all listeners from this listenable.
-
rotate
Path rotate(Number degrees, Number cx, Number cy)
Rotates a shape around the given rotation point.
-
rotateByAnchor
Path rotateByAnchor(Number degrees, Anchor anchor)
Rotates a shape around the given anchor.
-
rotateByAnchor
Path rotateByAnchor(Number degrees, String anchor)
Rotates a shape around the given anchor.
-
scale
Path scale(Number sx, Number sy, Number cx, Number cy)
Scales a shape. Scaling center is set in the coordinate system of the parent.
-
scaleByAnchor
Path scaleByAnchor(Number sx, Number sy, Anchor anchor)
Scales a shape by anchor. Scaling center is set as an anchor.
-
scaleByAnchor
Path scaleByAnchor(Number sx, Number sy, String anchor)
Scales a shape by anchor. Scaling center is set as an anchor.
-
setPosition
Path setPosition(Number x, Number y)
Sets top left corner of a shape (transformation taken into account) in the coordinate system of the parent.
-
setRotation
Path setRotation(Number degrees, Number cx, Number cy)
Rotates a shape around the given point.
-
setRotationByAnchor
Path setRotationByAnchor(Number degrees, Anchor anchor)
Rotates a shape around the given anchor.
-
setRotationByAnchor
Path setRotationByAnchor(Number degrees, String anchor)
Rotates a shape around the given anchor.
-
setTransformationMatrix
Path setTransformationMatrix(Number m00, Number m10, Number m01, Number m11, Number m02, Number m12)
Sets the transformation matrix.
-
stroke
void stroke()
Gets the current stroke.
-
stroke
Path stroke(ColoredFill value)
Sets a stroke using one parameter.
-
stroke
Path stroke(Stroke value, Number thickness, String dashpattern, String lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(Stroke value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(Stroke value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(Stroke value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(ColoredFill value, Number thickness, String dashpattern, String lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(ColoredFill value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(ColoredFill value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(ColoredFill value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(String value, Number thickness, String dashpattern, String lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(String value, Number thickness, String dashpattern, String lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(String value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, String lineCap)
Sets stroke settings using several parameter.
-
stroke
Path stroke(String value, Number thickness, String dashpattern, StrokeLineJoin lineJoin, StrokeLineCap lineCap)
Sets stroke settings using several parameter.
-
strokeThickness
void strokeThickness()
Gets the current stroke thickness.
-
strokeThickness
Path strokeThickness(Number thickness)
Sets a stroke thickness.
-
title
void title()
Getter for the element title value.
-
translate
Path translate(Number tx, Number ty)
Moves a shape taking an account the current transformation.
-
setOnClickListener
void setOnClickListener(ListenersInterface.OnClickListener listener)
-
setOnClickListener
void setOnClickListener(ListenersInterface.OnClickListener listener, String type, String ePath)
-
visible
void visible()
Gets the current visibility flag.
-
zIndex
void zIndex()
Gets the current element's zIndex.
-
unlistenByKey
void unlistenByKey(String key)
Removes an event listener which was added with listen() by the key returned by listen().
-
-
-
-