Shape
interface provides definitions for objects that represent some form of geometric shape. The Shape
is described by a {@link PathIterator} object, which can express theoutline of the Shape
as well as a rule for determining how the outline divides the 2D plane into interior and exterior points. Each Shape
object provides callbacks to get the bounding box of the geometry, determine whether points or rectangles lie partly or entirely within the interior of the Shape
, and retrieve a PathIterator
object that describes the trajectory path of the Shape
outline. Definition of insideness: A point is considered to lie inside a Shape
if and only if:
Shape
boundary or Shape
boundary and the space immediately adjacent to the point in the increasing X
direction is entirely inside the boundary or Y
direction is inside the boundary. The contains
and intersects
methods consider the interior of a Shape
to be the area it encloses as if it were filled. This means that these methods consider unclosed shapes to be implicitly closed for the purpose of determining if a shape contains or intersects a rectangle or if a shape contains a point.
@see ae.java.awt.geom.PathIterator
@see ae.java.awt.geom.AffineTransform
@see ae.java.awt.geom.FlatteningPathIterator
@see ae.java.awt.geom.GeneralPath
@author Jim Graham
@since 1.2
reset(...)
method then its use means the shape is actually mutable. Mutating shape state is considered expert and should be done with care.
Shape
interface provides definitions for objects that represent some form of geometric shape. The Shape
is described by a {@link PathIterator} object, which can express the outline of the Shape
as well as a rule for determining how the outline divides the 2D plane into interior and exterior points. Each Shape
object provides callbacks to get the bounding box of the geometry, determine whether points or rectangles lie partly or entirely within the interior of the Shape
, and retrieve a PathIterator
object that describes the trajectory path of the Shape
outline. Definition of insideness: A point is considered to lie inside a Shape
if and only if:
Shape
boundary or Shape
boundary and the space immediately adjacent to the point in the increasing X
direction is entirely inside the boundary or Y
direction is inside the boundary. The contains
and intersects
methods consider the interior of a Shape
to be the area it encloses as if it were filled. This means that these methods consider unclosed shapes to be implicitly closed for the purpose of determining if a shape contains or intersects a rectangle or if a shape contains a point.
@see java.awt.geom.PathIterator
@see java.awt.geom.AffineTransform
@see java.awt.geom.FlatteningPathIterator
@see java.awt.geom.GeneralPath
@version 1.19 06/24/98
@author Jim Graham
@since 1.2
Represents a Shape which is the elemental object that composes a drawing. This class is a wrapper around EscherSpContainer which holds all information about a shape in PowerPoint document.
When you add a shape, you usually specify the dimensions of the shape and the position of the upper�left corner of the bounding box for the shape relative to the upper�left corner of the page, worksheet, or slide. Distances in the drawing layer are measured in points (72 points = 1 inch).
@author Yegor Kozlov
Shape
interface provides definitions for objects that represent some form of geometric shape. The Shape
is described by a {@link PathIterator} object, which can express theoutline of the Shape
as well as a rule for determining how the outline divides the 2D plane into interior and exterior points. Each Shape
object provides callbacks to get the bounding box of the geometry, determine whether points or rectangles lie partly or entirely within the interior of the Shape
, and retrieve a PathIterator
object that describes the trajectory path of the Shape
outline. Definition of insideness: A point is considered to lie inside a Shape
if and only if:
Shape
boundary or Shape
boundary and the space immediately adjacent to the point in the increasing X
direction is entirely inside the boundary or Y
direction is inside the boundary. The contains
and intersects
methods consider the interior of a Shape
to be the area it encloses as if it were filled. This means that these methods consider unclosed shapes to be implicitly closed for the purpose of determining if a shape contains or intersects a rectangle or if a shape contains a point.
@see java.awt.geom.PathIterator
@see java.awt.geom.AffineTransform
@see java.awt.geom.FlatteningPathIterator
@see java.awt.geom.GeneralPath
@author Jim Graham
@since 1.2
The following features are supported:
Shape
is an abstract class and is not meant to be used directly. The following classes extend Shape
.
Shape
can also be extended to create custom shape classes. The Path class creates a shape through the use of drawing methods. The Path class has the following drawing methods available: clear, curveTo, drawRect¸ drawRoundRect, end, lineTo, moveTo, quadraticCurveTo
Like other shapes, Path elements are created using the addShape method of the Graphic class. The method's cfg argument contains a type attribute. Assigning "path" or Y.Path to this attribute will create a Path instance. After instantiation, a series of drawing operations must be performed in order to render a shape. The below code instantiates a path element by defining the type attribute as "path":
var myPath = myGraphic.addShape({ type: "path", fill: { color: "#9aa" }, stroke: { weight: 1, color: "#000" } });
Below a Path element with the same properties is instantiated by defining the type attribute with a class reference:
var myPath = myGraphic.addShape({ type: Y.Path, fill: { color: "#9aa" }, stroke: { weight: 1, color: "#000" } });
After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed, the end method will render the shape. The code below will draw a triangle:
myPath.moveTo(35, 5); myPath.lineTo(65, 65); myPath.lineTo(5, 65); myPath.lineTo(35, 5); myPath.end();@author sg
The following features are supported:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|