|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.sketch.geom.GeneralPath
This class represents the GeneralPath object. This is a wrapper class for enabling Serialization and extension.
| Field Summary | |
protected GeneralPath |
general_path
The general path |
Graphics2D |
graphics
Graphics context for this Geometric object. |
long |
time_stamp
Time stamp of this object. |
| Fields inherited from interface edu.mit.sketch.geom.GeometricObject |
CIRCLE, ELLIPSE, LINE, POINT, POLYGON, RECTANGLE, SQUARE |
| Constructor Summary | |
GeneralPath()
The constructor. |
|
GeneralPath(GeneralPath general_path)
The constructor. |
|
GeneralPath(int rule)
The constructor. |
|
GeneralPath(int rule,
int initial_capacity)
The constructor. |
|
GeneralPath(Shape shape)
The constructor. |
|
| Method Summary | |
void |
append(PathIterator pi,
boolean connect)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
append(Shape s,
boolean connect)
Implement methods for extension of java.awt.geom.GeneralPath |
Object |
clone()
Implement methods for extension of java.awt.geom.GeneralPath |
void |
closePath()
Implement methods for extension of java.awt.geom.GeneralPath |
void |
combineEndPoints(double error)
Combines the ends of the polygon if they are sufficiently close. |
boolean |
contains(double x,
double y)
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
contains(double x,
double y,
double w,
double h)
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
contains(Point2D p)
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
contains(Rectangle2D r)
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
containsGeometricObject(GeometricObject object)
Returns false if the argument is not completely inside this object. |
boolean |
containsGeometricObjects(GeometricObject[] objects)
Returns false if the objects in the input array are completely inside this object. |
Shape |
createTransformedShape(AffineTransform at)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Implement methods for extension of java.awt.geom.GeneralPath |
Vertex[] |
flatten(double flatness,
int limit)
Return an array of vertices corresponding to the flattened version of this GeneralPath |
double |
getAngle()
Returns the angle of the object WRT the x axis in radians. |
Rectangle |
getBounds()
Implement methods for extension of java.awt.geom.GeneralPath |
Rectangle2D |
getBounds2D()
Implement methods for extension of java.awt.geom.GeneralPath |
double |
getCartesianAngle()
Returns the angle of the object WRT the x axis in radians. |
Point2D |
getCurrentPoint()
Implement methods for extension of java.awt.geom.GeneralPath |
Polygon |
getDataPoints()
This method is used to get the original data points that forms this GeometricObject |
Range[] |
getGeneralPathRanges(StrokeData data)
getGeneralPathRanges. |
double |
getLSQEror(StrokeData data,
Range[] ranges)
Get the LSQE for the general path by measuring the distance to the vertices in the StrokeData. |
PathIterator |
getPathIterator(AffineTransform at)
Implement methods for extension of java.awt.geom.GeneralPath |
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
Implement methods for extension of java.awt.geom.GeneralPath |
Polygon |
getPolygonalBounds()
This method should return a polygon that fully contains the current object. |
Rectangle |
getRectangularBounds()
Supplied for completeness. |
int |
getSegmentCount()
Return the number of segments in a java.awt.GeneralPath object. |
Point |
getStartPosition()
Return the beginning the position. |
long |
getTimeStamp()
Returns the time stamp of the current Terminal |
String |
getType()
Implement GeometricObject |
int |
getWindingRule()
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
intersects(double x,
double y,
double w,
double h)
Implement methods for extension of java.awt.geom.GeneralPath |
boolean |
intersects(Rectangle2D r)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
lineTo(float x,
float y)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
moveTo(float x,
float y)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
paint()
Draw the object |
void |
paint(Graphics g2D)
Paint the general path |
void |
paintConvexHulls(Graphics2D g2D)
Show convex hulls for the curves |
void |
paintInSegments(Graphics2D g2D)
Paint the general path in segments |
void |
paintOriginal(Graphics g)
This method is used to paint the original data points that forms this GeometricObject |
boolean |
pointIsOn(Point point,
int radius)
Returns true if the point is within +-radius distance from the curve defining the object. |
boolean |
pointIsOnOriginal(Point p,
int radius)
Returns true if the point is within +-radius distance from the original curve defining the object. |
void |
quadTo(float x1,
float y1,
float x2,
float y2)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
reset()
Implement methods for extension of java.awt.geom.GeneralPath |
void |
setDataPoints(Polygon points)
This method is used to set the original data points that forms this GeometricObject |
void |
setGraphicsContext(Graphics g)
Set graphics context for this Geometric object. |
void |
setTimeStamp(long time_stamp)
Sets the time stamp of the current Terminal |
void |
setWindingRule(int rule)
Implement methods for extension of java.awt.geom.GeneralPath |
int |
spatialRelation(GeometricObject object)
This method should return the spatial relation of the input parameter with respect to this object. |
Polygon |
toPolygon()
This method is used to get the original data points that forms this GeometricObject |
String |
toString()
Override toString |
boolean |
touches(GeometricObject object)
This method should return true if the input objects touch. |
void |
transform(AffineTransform at)
Implement methods for extension of java.awt.geom.GeneralPath |
void |
translate(double dx,
double dy)
Add the arguments to the position of the object. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected transient GeneralPath general_path
public long time_stamp
public transient Graphics2D graphics
| Constructor Detail |
public GeneralPath()
public GeneralPath(Shape shape)
public GeneralPath(int rule)
public GeneralPath(int rule,
int initial_capacity)
public GeneralPath(GeneralPath general_path)
| Method Detail |
public String getType()
getType in interface Paintablepublic String toString()
toString in class Objectpublic void paint(Graphics g2D)
paint in interface Paintablepublic void paintInSegments(Graphics2D g2D)
public void paintConvexHulls(Graphics2D g2D)
public void paint()
paint in interface Paintablepublic void paintOriginal(Graphics g)
paintOriginal in interface Paintable
public boolean pointIsOn(Point point,
int radius)
pointIsOn in interface Translatable
public boolean pointIsOnOriginal(Point p,
int radius)
pointIsOnOriginal in interface Translatablepublic void setGraphicsContext(Graphics g)
setGraphicsContext in interface Paintablepublic boolean touches(GeometricObject object)
touches in interface GeometricObjectpublic Rectangle getRectangularBounds()
getRectangularBounds in interface GeometricObjectpublic boolean containsGeometricObject(GeometricObject object)
containsGeometricObject in interface GeometricObjectpublic Polygon getPolygonalBounds()
getPolygonalBounds in interface GeometricObjectpublic int spatialRelation(GeometricObject object)
spatialRelation in interface GeometricObjectpublic double getCartesianAngle()
public double getAngle()
public void setTimeStamp(long time_stamp)
setTimeStamp in interface Terminalpublic long getTimeStamp()
getTimeStamp in interface Terminalpublic void setDataPoints(Polygon points)
setDataPoints in interface GeometricObjectpublic Polygon getDataPoints()
getDataPoints in interface GeometricObjectpublic Polygon toPolygon()
public boolean containsGeometricObjects(GeometricObject[] objects)
containsGeometricObjects in interface GeometricObject
public void translate(double dx,
double dy)
translate in interface Translatable
public void append(PathIterator pi,
boolean connect)
public void append(Shape s,
boolean connect)
public Object clone()
clone in class Objectpublic void closePath()
public boolean contains(double x,
double y)
contains in interface Shape
public boolean contains(double x,
double y,
double w,
double h)
contains in interface Shapepublic boolean contains(Point2D p)
contains in interface Shapepublic boolean contains(Rectangle2D r)
contains in interface Shapepublic Shape createTransformedShape(AffineTransform at)
public void curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
public Rectangle getBounds()
getBounds in interface Shapepublic Rectangle2D getBounds2D()
getBounds2D in interface Shapepublic Point2D getCurrentPoint()
public PathIterator getPathIterator(AffineTransform at)
getPathIterator in interface Shape
public PathIterator getPathIterator(AffineTransform at,
double flatness)
getPathIterator in interface Shapepublic int getWindingRule()
public boolean intersects(double x,
double y,
double w,
double h)
intersects in interface Shapepublic boolean intersects(Rectangle2D r)
intersects in interface Shape
public void lineTo(float x,
float y)
public void moveTo(float x,
float y)
public void quadTo(float x1,
float y1,
float x2,
float y2)
public void reset()
public void setWindingRule(int rule)
public void transform(AffineTransform at)
public int getSegmentCount()
public Vertex[] flatten(double flatness,
int limit)
public Point getStartPosition()
public double getLSQEror(StrokeData data,
Range[] ranges)
public Range[] getGeneralPathRanges(StrokeData data)
public void combineEndPoints(double error)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||