|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.MutableGeneralPath
public class MutableGeneralPath
A flexible mutable version of GeneralPath
using doubles.
The flexibility of this class must be weighed against its higher memory consumption.
Nested Class Summary | |
---|---|
static interface |
MutableGeneralPath.Segment
The interface used by all Segments / Operations in the MutableGeneralPath class |
Constructor Summary | |
---|---|
MutableGeneralPath()
Create a new instance with no transform (identity). |
|
MutableGeneralPath(java.awt.geom.AffineTransform trans)
Creates a new instance using the given transform. |
|
MutableGeneralPath(java.awt.geom.PathIterator pi)
Creates a new instance using the given path iterator to initialize this instance from. |
Method Summary | |
---|---|
void |
append(java.awt.geom.PathIterator pi)
Appends the result of iterating over the given PathIterator to this instance |
void |
appendAndClear(MutableGeneralPath gp)
Appends the given MutableGeneralPath instance to this instance and destroys the given instance O(1) operation. |
void |
clear()
Clears the current path. |
MutableGeneralPath.Segment |
close()
Appends a close operation to the end of this path. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double x,
double y,
double w,
double h)
|
boolean |
contains(java.awt.geom.Point2D p)
|
boolean |
contains(java.awt.geom.Rectangle2D r)
|
MutableGeneralPath.Segment |
cubicTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Appends a cubicTo operation to the end of this path using the given coordinates. |
MutableGeneralPath.Segment |
cubicTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
MutableGeneralPath.Segment nextSegment)
Appends a cubicTo operation before the given segment using the given coordinates. |
MutableGeneralPath.Segment |
cubicTo(MutableGeneralPath.Segment prevSegment,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
Appends a cubicTo operation after the given segment using the given coordinates. |
MutableGeneralPath.Segment |
firstSegment()
Returns the first Segment element in the path. |
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
double |
getLastX()
Returns the last x position added to this path. |
double |
getLastY()
Returns the last y position added to this path. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform a)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform a,
double flatness)
|
int |
getWindingRule()
See Path2D.getWindingRule() |
boolean |
intersects(double x,
double y,
double w,
double h)
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
|
boolean |
isClosed()
Returns whether the last element is a close element. |
boolean |
isFlat()
Returns whether this path is already flat, i.e. whether it does not contain any curves, but only moveTo, lineTo and close elements |
MutableGeneralPath.Segment |
lastSegment()
Returns the last Segment element in the path. |
MutableGeneralPath.Segment |
lineTo(double x,
double y)
Appends a lineTo operation to the end of this path using the given coordinates. |
MutableGeneralPath.Segment |
lineTo(double x,
double y,
MutableGeneralPath.Segment nextSegment)
Appends a lineTo operation before the given segment using the given coordinates. |
MutableGeneralPath.Segment |
lineTo(MutableGeneralPath.Segment prevSegment,
double x,
double y)
Appends a lineTo operation after the given segment using the given coordinates. |
MutableGeneralPath.Segment |
moveTo(double x,
double y)
Appends a moveTo operation to the end of this path using the given coordinates. |
MutableGeneralPath.Segment |
moveTo(double x,
double y,
MutableGeneralPath.Segment nextSegment)
Appends a moveTo operation before the given segment using the given coordinates. |
MutableGeneralPath.Segment |
moveTo(MutableGeneralPath.Segment prevSegment,
double x,
double y)
Appends a moveTo operation after the given segment using the given coordinates. |
MutableGeneralPath.Segment |
quadTo(double x1,
double y1,
double x2,
double y2)
Appends a quadTo operation to the end of this path using the given coordinates. |
MutableGeneralPath.Segment |
quadTo(double x1,
double y1,
double x2,
double y2,
MutableGeneralPath.Segment nextSegment)
Appends a quadTo operation before the given segment using the given coordinates. |
MutableGeneralPath.Segment |
quadTo(MutableGeneralPath.Segment prevSegment,
double x1,
double y1,
double x2,
double y2)
Appends a quadTo operation after the given segment using the given coordinates. |
void |
remove(MutableGeneralPath.Segment s)
Removes a given segment from the list of segments. |
void |
setWindingRule(int windingRule)
See Path2D.setWindingRule(int) |
int |
size()
Returns the number of elements this instance uses |
java.awt.geom.GeneralPath |
toGeneralPath()
Creates a GeneralPath instance from this instance. |
java.awt.geom.GeneralPath |
toGeneralPath(java.awt.geom.AffineTransform a)
Creates a GeneralPath instance from this instance using the given transform to transform. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MutableGeneralPath()
public MutableGeneralPath(java.awt.geom.AffineTransform trans)
trans
- the transform to use for the pathIterators.public MutableGeneralPath(java.awt.geom.PathIterator pi)
pi
- Method Detail |
---|
public MutableGeneralPath.Segment firstSegment()
null
if the path is empty.public MutableGeneralPath.Segment lastSegment()
null
if the path is empty.public double getLastX()
public double getLastY()
public void append(java.awt.geom.PathIterator pi)
pi
- public int size()
public boolean isFlat()
public boolean isClosed()
public void appendAndClear(MutableGeneralPath gp)
gp
- public MutableGeneralPath.Segment moveTo(MutableGeneralPath.Segment prevSegment, double x, double y)
prevSegment
- the segment after which the new segment should be
added, if this is null
the new segment will become the first segment.
public MutableGeneralPath.Segment lineTo(MutableGeneralPath.Segment prevSegment, double x, double y)
prevSegment
- the segment after which the new segment should be
added, if this is null
the new segment will become the first segment.
public MutableGeneralPath.Segment quadTo(MutableGeneralPath.Segment prevSegment, double x1, double y1, double x2, double y2)
prevSegment
- the segment after which the new segment should be
added, if this is null
the new segment will become the first segment.
public MutableGeneralPath.Segment cubicTo(MutableGeneralPath.Segment prevSegment, double x1, double y1, double x2, double y2, double x3, double y3)
prevSegment
- the segment after which the new segment should be
added, if this is null
the new segment will become the first segment.
public MutableGeneralPath.Segment quadTo(double x1, double y1, double x2, double y2, MutableGeneralPath.Segment nextSegment)
nextSegment
- the segment before which the new segment should be
added, if this is null
the new segment will become the last segment.
public MutableGeneralPath.Segment cubicTo(double x1, double y1, double x2, double y2, double x3, double y3, MutableGeneralPath.Segment nextSegment)
nextSegment
- the segment before which the new segment should be
added, if this is null
the new segment will become the last segment.
public MutableGeneralPath.Segment moveTo(double x, double y, MutableGeneralPath.Segment nextSegment)
nextSegment
- the segment before which the new segment should be
added, if this is null
the new segment will become the last segment.
public MutableGeneralPath.Segment lineTo(double x, double y, MutableGeneralPath.Segment nextSegment)
nextSegment
- the segment before which the new segment should be
added, if this is null
the new segment will become the last segment.
public MutableGeneralPath.Segment moveTo(double x, double y)
public MutableGeneralPath.Segment lineTo(double x, double y)
public MutableGeneralPath.Segment close()
public MutableGeneralPath.Segment cubicTo(double x1, double y1, double x2, double y2, double x3, double y3)
public MutableGeneralPath.Segment quadTo(double x1, double y1, double x2, double y2)
public void remove(MutableGeneralPath.Segment s)
public void clear()
public int getWindingRule()
Path2D.getWindingRule()
public void setWindingRule(int windingRule)
Path2D.setWindingRule(int)
public java.awt.geom.GeneralPath toGeneralPath(java.awt.geom.AffineTransform a)
a
- the transform to apply before creating the GeneralPath instance.
public java.awt.geom.GeneralPath toGeneralPath()
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform a)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform a, double flatness)
getPathIterator
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D r)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D p)
contains
in interface java.awt.Shape
public boolean contains(double x, double y)
contains
in interface java.awt.Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface java.awt.Shape
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface java.awt.Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface java.awt.Shape
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |