java.lang.Object | |
↳ | sofia.graphics.PointAndAnchor |
A PointAndAnchor
encapsulates a PointF
denoting a location
on a shape canvas and an Anchor
that indicates how a shape should be
anchored to that point.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PointAndAnchor(PointF point, Anchor anchor)
Creates a new
PointAndAnchor with the specified point and
anchor. | |||||||||||
PointAndAnchor(PointAndAnchor source)
Creates a new
PointAndAnchor that is a copy of the specified
one. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PointAndAnchor |
copy()
Gets a copy of this
PointAndAnchor . | ||||||||||
Anchor |
getAnchor()
Gets the anchor represented by the receiver.
| ||||||||||
PointF |
getPoint()
Gets the point represented by the receiver.
| ||||||||||
RectF |
sized(SizeF size)
Returns a
RectF -compatible object that is positioned with
respect to this point and anchor and has the specified size. | ||||||||||
RectF |
sized(float width, float height)
Returns a
RectF -compatible object that is positioned with
respect to this point and anchor and has the specified width and height. | ||||||||||
RectF |
sizedProportionalTo(Shape sourceShape, double widthRatio, double heightRatio)
Gets a
RectF -compatible object that is positioned with respect
to this point and anchor and has the specified width and height,
calculated as proportions of the size of another shape. | ||||||||||
RectF |
sizedProportionalToView(double widthRatio, double heightRatio)
Gets a
RectF object that has the receiver as the origin and the
specified size, proportional to the size of the ShapeView that
contains the shape. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
sofia.graphics.CopyableGeometry
|
Creates a new PointAndAnchor
with the specified point and
anchor.
point | the PointF |
---|---|
anchor | the Anchor |
Creates a new PointAndAnchor
that is a copy of the specified
one.
source | the PointAndAnchor to copy
|
---|
Gets the anchor represented by the receiver.
Gets the point represented by the receiver.
Gets a RectF
-compatible object that is positioned with respect
to this point and anchor and has the specified width and height,
calculated as proportions of the size of another shape.
sourceShape | the shape that the width and height are proportional to |
---|---|
widthRatio | the ratio of the desired width compared to the width of the specified shape; 1.0 is equal, and larger numbers will increase the size |
heightRatio | the ratio of the desired height compared to the height of the specified shape |
RectF
-compatible object that has the receiver as the
origin and the specified size
Gets a RectF
object that has the receiver as the origin and the
specified size, proportional to the size of the ShapeView that
contains the shape.
widthRatio | the ratio of the desired width compared to the width of the specified shape; 1.0 is equal, and larger numbers will increase the size |
---|---|
heightRatio | the ratio of the desired height compared to the height of the specified shape |
RectF
that has the receiver as the origin and the
specified size