com.davisor.graphics
Class BetterPath

java.lang.Object
  extended bycom.davisor.graphics.BetterPath
All Implemented Interfaces:
ParameterConstants, java.io.Serializable, java.awt.Shape

public class BetterPath
extends java.lang.Object
implements ParameterConstants, java.io.Serializable, java.awt.Shape

BetterPath implements an improved serializable general path shape. These better paths have also a well-defined string representation, and there is a parser that can read such path definition strings.

Serialization

Path serialization is implemented by breaking current path information into a list of serializable segments. The segment representation is equivalent to the original shape up to a point where the shape can be reliably reconstructed from the segments. When better path is serialized, only the serializable segments are transmitted, and the shape is automatically recostructed at destination.

Path representation conversions between shapes and segments occur in lazy and cached fashion. This minimizes memory and processors resource consumption overhead.

String representation

Better path segments may also be expressed as strings, and reconstructed from them. The syntax of better path strings is createSegments(String,ParsePosition), toString(), Serialized Form

Nested Class Summary
protected  class BetterPath.Iterator
          BetterPath.Iterator implements a path iterator for the principal shape path storage mechanism.
protected  class BetterPath.Segment
          BetterPath.Segment implements a path segment for the principal shape path storage mechanism.
 
Field Summary
static char ARCABSOLUTE
          Segment absolute arc code character ('A').
static char ARCRELATIVE
          Segment relative arc code character ('a').
static char CARRIAGERETURN
          Carriage return character.
static char CLOSEABSOLUTE
          Segment absolute close code character ('Z').
static char CLOSERELATIVE
          Segment relative close code character ('z').
static char COMMA
          Comma character.
static char CURVEABSOLUTE
          Segment absolute curve code character ('C').
static char CURVERELATIVE
          Segment relative curve code character ('c').
static char EVENODD
          EvenOdd winding rule code character ('%').
static char HORIZONTALLINEABSOLUTE
          Segment absolute horizontal line character ('H')
static char HORIZONTALLINERELATIVE
          Segment relative horizontal line character ('h')
static char LINEABSOLUTE
          Segment absolute line code character ('L').
static char LINERELATIVE
          Segment relative line code character ('l').
protected  int M_character
          Current character in parsing.
protected  double M_currentX
          Current X-coordinate.
protected  double M_currentY
          Current Y-coordinate.
protected  double M_lastMoveToX
          Last moveTo X-coordinate.
protected  double M_lastMoveToY
          Last moveTo Y-coordinate.
protected  java.io.Reader M_reader
          Reader for character parsing.
protected  java.util.List M_segments
          Principal shape path storage.
protected  java.awt.Shape M_shape
          Secondary shape path storage.
protected  double M_smoothX
          Reference X-coordinate for smooth curves.
protected  double M_smoothY
          Reference Y-coordinate for smooth curves.
protected  int M_windingRule
          Shape winding rule.
static char MOVEABSOLUTE
          Segment absolute move code character ('M').
static char MOVERELATIVE
          Segment relative move code character ('m').
static char NEWLINE
          Newline character.
static char NONZERO
          NonZero winding rule code character ('/').
static char QUADABSOLUTE
          Segment absolute quad code character ('Q').
static char QUADRELATIVE
          Segment relative quad code character ('q').
static char SMOOTHCURVEABSOLUTE
          Segment absolute smooth curve code character ('S').
static char SMOOTHCURVERELATIVE
          Segment relative smooth curve code character ('s').
static char SMOOTHQUADABSOLUTE
          Segment absolute smooth quad code character ('T').
static char SMOOTHQUADRELATIVE
          Segment relative smooth quad code character ('t').
static char SPACE
          Space character.
static char TAB
          Tab character.
static char VERTICALLINEABSOLUTE
          Segment absolute vertical line character ('V')
static char VERTICALLINERELATIVE
          Segment relative vertical line character ('v')
 
Fields inherited from interface com.davisor.graphics.ParameterConstants
ANNOTATIONADDRESS, ANNOTATIONCOORDS, ANNOTATIONDESCRIPTION, ANNOTATIONDESCRIPTION_MOZILLA, ANNOTATIONONMOUSEOUT, ANNOTATIONONMOUSEOVER, ANNOTATIONSEPARATOR, ANNOTATIONSHAPE, ANNOTATIONTARGET, CENTER, DOWN, FIELDSEPARATOR, LEFT, RIGHT, TAILSEPARATOR, TERMINAL, UNSET, UP, VALUESEPARATOR
 
Constructor Summary
BetterPath(java.awt.geom.PathIterator iterator)
          Extracts path information from a path iterator.
BetterPath(java.awt.Shape shape)
          Creates a better path from given shape.
BetterPath(java.lang.String parameters, java.text.ParsePosition status)
          Extracts path information from a path specification string.
 
Method Summary
protected  void closePath()
          Closes the current path.
 boolean contains(double x, double y)
          Tests if the specified coordinates are inside the boundary of the Shape.
 boolean contains(double x, double y, double w, double h)
          Tests if the interior of the Shape entirely contains the specified rectangular area.
 boolean contains(java.awt.geom.Point2D p)
          Tests if a specified Point2D is inside the boundary of the Shape.
 boolean contains(java.awt.geom.Rectangle2D r)
          Tests if the interior of the Shape entirely contains the specified Rectangle2D.
protected  void createSegments(java.awt.geom.PathIterator iterator)
          Extracts path information from a path iterator.
protected  void createSegments(java.awt.Shape shape)
          Extracts path information from a shape.
protected  void createSegments(java.lang.String path, java.text.ParsePosition status)
          Extracts path information from a path specification string.
protected  double determineNumber()
          Parses a number.
 boolean equals(java.lang.Object object)
          Tests if this path buffer is equal to given path buffer.
 java.awt.Rectangle getBounds()
          Returns an integer Rectangle that completely encloses the Shape.
 java.awt.geom.Rectangle2D getBounds2D()
          Returns a high precision and more accurate bounding box of the Shape than the getBounds method.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
          Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
          Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.
 java.awt.geom.PathIterator getPathIterator(boolean reverse)
          Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.
protected  java.util.List getSegments()
          Gets path segments representing the current path.
 java.awt.Shape getShape()
          Gets a shape representing the current path.
 boolean intersects(double x, double y, double w, double h)
          Tests if the interior of the Shape intersects the interior of a specified rectangular area.
 boolean intersects(java.awt.geom.Rectangle2D r)
          Tests if the interior of the Shape intersects the interior of a specified Rectangle2D.
protected  void parseArcAbsolute()
          Parses an absolute arc command.
protected  void parseArcRelative()
          Parses a relative arc command.
protected  void parseCurveAbsolute()
          Parses an absolute curve command.
protected  void parseCurveRelative()
          Parses a relative curve command.
protected  void parseHorizontalLineAbsolute()
          Parses an absolute horizontal line command.
protected  void parseHorizontalLineRelative()
          Parses a relative horizontal line command.
protected  void parseLineAbsolute()
          Parses an absolute line command.
protected  void parseLineRelative()
          Parses a relative line command.
protected  void parseMoveAbsolute()
          Parses an absolute move command.
protected  void parseMoveRelative()
          Parses a relative move command.
protected  void parseQuadAbsolute()
          Parses an absolute quad command.
protected  void parseQuadRelative()
          Parses a relative quad command.
protected  void parseSmoothCurveAbsolute()
          Parses an absolute smooth curve command.
protected  void parseSmoothCurveRelative()
          Parses a relative smooth curve command.
protected  void parseSmoothQuadAbsolute()
          Parses an absolute smooth quad command.
protected  void parseSmoothQuadRelative()
          Parses a relative smooth quad command.
protected  void parseVerticalLineAbsolute()
          Parses an absolute vertical line command.
protected  void parseVerticalLineRelative()
          Parses a relative vertical line command.
protected static int points(int type)
          Gets the number of points associated to a path iterator segment.
protected static char prefix(int type)
          Gets the prefix character associated to a path iterator segment type.
protected  void skipSpaces()
          Skips the following characters: 0x9 - tab 0xA - newline 0xD - carriage return 0x20 - space
protected  void skipSpacesAndComma()
          Skips a sequence of characters.
 java.lang.String toString()
          Gets the string representatin of the current path.
protected static int toWinding(char ruleCharacter)
          Gets the winding rule code for given winding rule code character.
protected static char toWinding(int ruleCode)
          Gets the winding rule code character for given winding rule code.
protected static int type(char prefix)
          Gets the segment type associated to a path specification segment prefix character .
protected  java.lang.Object writeReplace()
          Ensures the presense of a serializable segment representation of the current shape.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M_segments

protected java.util.List M_segments
Principal shape path storage.


M_windingRule

protected int M_windingRule
Shape winding rule.


M_character

protected int M_character
Current character in parsing.


M_reader

protected java.io.Reader M_reader
Reader for character parsing.


M_currentX

protected double M_currentX
Current X-coordinate.


M_currentY

protected double M_currentY
Current Y-coordinate.


M_smoothX

protected double M_smoothX
Reference X-coordinate for smooth curves.


M_smoothY

protected double M_smoothY
Reference Y-coordinate for smooth curves.


M_lastMoveToX

protected double M_lastMoveToX
Last moveTo X-coordinate.


M_lastMoveToY

protected double M_lastMoveToY
Last moveTo Y-coordinate.


ARCABSOLUTE

public static final char ARCABSOLUTE
Segment absolute arc code character ('A').

See Also:
Constant Field Values

ARCRELATIVE

public static final char ARCRELATIVE
Segment relative arc code character ('a').

See Also:
Constant Field Values

CLOSEABSOLUTE

public static final char CLOSEABSOLUTE
Segment absolute close code character ('Z'). Works as relative close.

See Also:
Constant Field Values

CLOSERELATIVE

public static final char CLOSERELATIVE
Segment relative close code character ('z').

See Also:
Constant Field Values

CURVEABSOLUTE

public static final char CURVEABSOLUTE
Segment absolute curve code character ('C').

See Also:
Constant Field Values

CURVERELATIVE

public static final char CURVERELATIVE
Segment relative curve code character ('c').

See Also:
Constant Field Values

HORIZONTALLINEABSOLUTE

public static final char HORIZONTALLINEABSOLUTE
Segment absolute horizontal line character ('H')

See Also:
Constant Field Values

HORIZONTALLINERELATIVE

public static final char HORIZONTALLINERELATIVE
Segment relative horizontal line character ('h')

See Also:
Constant Field Values

LINEABSOLUTE

public static final char LINEABSOLUTE
Segment absolute line code character ('L').

See Also:
Constant Field Values

LINERELATIVE

public static final char LINERELATIVE
Segment relative line code character ('l').

See Also:
Constant Field Values

MOVEABSOLUTE

public static final char MOVEABSOLUTE
Segment absolute move code character ('M').

See Also:
Constant Field Values

MOVERELATIVE

public static final char MOVERELATIVE
Segment relative move code character ('m').

See Also:
Constant Field Values

QUADABSOLUTE

public static final char QUADABSOLUTE
Segment absolute quad code character ('Q').

See Also:
Constant Field Values

QUADRELATIVE

public static final char QUADRELATIVE
Segment relative quad code character ('q').

See Also:
Constant Field Values

SMOOTHCURVEABSOLUTE

public static final char SMOOTHCURVEABSOLUTE
Segment absolute smooth curve code character ('S').

See Also:
Constant Field Values

SMOOTHCURVERELATIVE

public static final char SMOOTHCURVERELATIVE
Segment relative smooth curve code character ('s').

See Also:
Constant Field Values

SMOOTHQUADABSOLUTE

public static final char SMOOTHQUADABSOLUTE
Segment absolute smooth quad code character ('T').

See Also:
Constant Field Values

SMOOTHQUADRELATIVE

public static final char SMOOTHQUADRELATIVE
Segment relative smooth quad code character ('t').

See Also:
Constant Field Values

VERTICALLINEABSOLUTE

public static final char VERTICALLINEABSOLUTE
Segment absolute vertical line character ('V')

See Also:
Constant Field Values

VERTICALLINERELATIVE

public static final char VERTICALLINERELATIVE
Segment relative vertical line character ('v')

See Also:
Constant Field Values

SPACE

public static final char SPACE
Space character.

See Also:
Constant Field Values

CARRIAGERETURN

public static final char CARRIAGERETURN
Carriage return character.

See Also:
Constant Field Values

NEWLINE

public static final char NEWLINE
Newline character.

See Also:
Constant Field Values

TAB

public static final char TAB
Tab character.

See Also:
Constant Field Values

COMMA

public static final char COMMA
Comma character.

See Also:
Constant Field Values

EVENODD

public static final char EVENODD
EvenOdd winding rule code character ('%').

See Also:
Constant Field Values

NONZERO

public static final char NONZERO
NonZero winding rule code character ('/').

See Also:
Constant Field Values

M_shape

protected transient java.awt.Shape M_shape
Secondary shape path storage.

Constructor Detail

BetterPath

public BetterPath(java.awt.Shape shape)
Creates a better path from given shape.

Parameters:
shape - the shape to create a better path from (may be null)
See Also:
BetterPath(PathIterator)

BetterPath

public BetterPath(java.awt.geom.PathIterator iterator)
Extracts path information from a path iterator.

Parameters:
iterator - the iterator to extract path information from (may be null)
See Also:
createSegments(PathIterator)

BetterPath

public BetterPath(java.lang.String parameters,
                  java.text.ParsePosition status)
           throws InvalidDataException
Extracts path information from a path specification string.

See Also:
createSegments(String,ParsePosition)
Method Detail

equals

public boolean equals(java.lang.Object object)
Tests if this path buffer is equal to given path buffer.


toString

public java.lang.String toString()
Gets the string representatin of the current path. Please see class description for more information about shape string syntax.

See Also:
getSegments(), toWinding(int), BetterPath.Segment.toString()

closePath

protected void closePath()
                  throws java.io.IOException
Closes the current path. The current point is changed to the point of the last move command.

Throws:
java.io.IOException

createSegments

protected void createSegments(java.awt.geom.PathIterator iterator)
Extracts path information from a path iterator. The current path is replaced with the new path defined by the segments enumerated by the given path iterator. If the iterator is null or empty, the current path will be, too.

Parameters:
iterator - the iterator to extract path information from (may be null)
See Also:
createSegments(String,ParsePosition)

createSegments

protected void createSegments(java.awt.Shape shape)
Extracts path information from a shape. The current path is replaced with the new path defined by the segments enumerated by the given shape. If the shape is null or empty, the current path will be, too.

Parameters:
shape - the shape to extract path information from (may be null)
See Also:
createSegments(PathIterator)

createSegments

protected void createSegments(java.lang.String path,
                              java.text.ParsePosition status)
                       throws java.io.IOException,
                              InvalidDataException
Extracts path information from a path specification string. The current path is replaced with the new path defined by the path specification. If the specification is null or empty, the current path will be, too.

Please see class description for more information about shape string syntax.

Parameters:
path - path specification string (may be null)
status - parse status (may be null)
Throws:
java.io.IOException
InvalidDataException
See Also:
createSegments(PathIterator), toString()

determineNumber

protected double determineNumber()
                          throws java.io.IOException,
                                 InvalidDataException
Parses a number.

Throws:
java.io.IOException
InvalidDataException

getSegments

protected java.util.List getSegments()
Gets path segments representing the current path. If the segments do not yet exists, the segments are created now, stored for later use, and returned.

Returns:
list of current path segments, or null if not defined
See Also:
createSegments(PathIterator), getShape()

parseArcAbsolute

protected void parseArcAbsolute()
                         throws java.io.IOException,
                                InvalidDataException
Parses an absolute arc command. An arc has two radii for an ellipse, rotation of the ellipse in regard to the current coordination system, two flags that determine which arc of possible arcs is drawn and the end point of the arc.

Throws:
java.io.IOException
InvalidDataException

parseArcRelative

protected void parseArcRelative()
                         throws java.io.IOException,
                                InvalidDataException
Parses a relative arc command. An arc has two radii for an ellipse, rotation of the ellipse in regard to the current coordination system, two flags that determine which arc of possible arcs is drawn and the end point of the arc.

Throws:
java.io.IOException
InvalidDataException

parseCurveAbsolute

protected void parseCurveAbsolute()
                           throws java.io.IOException,
                                  InvalidDataException
Parses an absolute curve command. A curve has three coordinate pairs. The first pair and the second pair are the control points for the start and the end of the curve, respectively. The third pair determines the current point after the curve.

Throws:
java.io.IOException
InvalidDataException

parseCurveRelative

protected void parseCurveRelative()
                           throws java.io.IOException,
                                  InvalidDataException
Parses a relative curve command. A curve has three coordinate pairs. The first pair and the second pair are the control points for the start and the end of the curve, respectively. The third pair determines the current point after the curve.

Throws:
java.io.IOException
InvalidDataException

parseHorizontalLineAbsolute

protected void parseHorizontalLineAbsolute()
                                    throws java.io.IOException,
                                           InvalidDataException
Parses an absolute horizontal line command. A horizontal line has only one coordinate value as the vertical point does not change.

Throws:
java.io.IOException
InvalidDataException

parseHorizontalLineRelative

protected void parseHorizontalLineRelative()
                                    throws java.io.IOException,
                                           InvalidDataException
Parses a relative horizontal line command. A horizontal line has only one coordinate value as the vertical point does not change.

Throws:
java.io.IOException
InvalidDataException

parseLineAbsolute

protected void parseLineAbsolute()
                          throws java.io.IOException,
                                 InvalidDataException
Parses an absolute line command. A line command expects a coordinate pair into which to draw the line.

Throws:
java.io.IOException
InvalidDataException

parseLineRelative

protected void parseLineRelative()
                          throws java.io.IOException,
                                 InvalidDataException
Parses a relative line command. A line command expects a coordinate pair into which to draw the line.

Throws:
java.io.IOException
InvalidDataException

parseMoveAbsolute

protected void parseMoveAbsolute()
                          throws java.io.IOException,
                                 InvalidDataException
Parses an absolute move command. A move command expects a coordinate pair into which the move is done. According to the SVG path specification, a line command without line command character can be given after a move command. However, whether the line to be done has relative or absolute coordinates is ambiguous.

Line command is considered to be relative if given without a command character and after a move, absolute or relative, command.

Throws:
java.io.IOException
InvalidDataException

parseMoveRelative

protected void parseMoveRelative()
                          throws java.io.IOException,
                                 InvalidDataException
Parses a relative move command. A move command expects a coordinate pair into which the move is done. According to the SVG path specification, a line command without line command character can be given after a move command. However, whether the line to be done has relative or absolute coordinates is ambiguous.

Line command is considered to be relative if given without a command character and after a move, absolute or relative, command.

Throws:
java.io.IOException
InvalidDataException

parseQuadAbsolute

protected void parseQuadAbsolute()
                          throws java.io.IOException,
                                 InvalidDataException
Parses an absolute quad command. A quad has two coordinate pairs. The first pair is the control point for the quad. The second pair determines the current point after the quad.

Throws:
java.io.IOException
InvalidDataException

parseQuadRelative

protected void parseQuadRelative()
                          throws java.io.IOException,
                                 InvalidDataException
Parses a relative quad command. A quad has two coordinate pairs. The first pair is the control point for the quad. The second pair determines the current point after the quad.

Throws:
java.io.IOException
InvalidDataException

parseSmoothCurveAbsolute

protected void parseSmoothCurveAbsolute()
                                 throws java.io.IOException,
                                        InvalidDataException
Parses an absolute smooth curve command. A smooth curve has two coordinate pairs. If the previous command was a curve, the reflection of the second control point of the previous curve to the current point is the first control point of this curve. Otherwise, the current point is the first control point of this curve. The first coordinate pair is the second control point of this curve. The second pair determines the current point after the curve.

Throws:
java.io.IOException
InvalidDataException

parseSmoothCurveRelative

protected void parseSmoothCurveRelative()
                                 throws java.io.IOException,
                                        InvalidDataException
Parses a relative smooth curve command. A smooth curve has two coordinate pairs. If the previous command was a curve, the reflection of the second control point of the previous curve to the current point is the first control point of this curve. Otherwise, the current point is the first control point of this curve. The first coordinate pair is the second control point of this curve. The second pair determines the current point after the curve.

Throws:
java.io.IOException
InvalidDataException

parseSmoothQuadAbsolute

protected void parseSmoothQuadAbsolute()
                                throws java.io.IOException,
                                       InvalidDataException
Parses an absolute smooth quad command. A smooth quad has one coordinate pair. If the previous command was a quad, the reflection of the control point of the previous quad to the current point is the control point of this quad. Otherwise, the current point is the control point for this quad. The coordinate pair determines the current point after the quad.

Throws:
java.io.IOException
InvalidDataException

parseSmoothQuadRelative

protected void parseSmoothQuadRelative()
                                throws java.io.IOException,
                                       InvalidDataException
Parses a relative smooth quad command. A smooth quad has one coordinate pair. If the previous command was a quad, the reflection of the control point of the previous quad to the current point is the control point of this quad. Otherwise, the current point is the control point for this quad. The coordinate pair determines the current point after the quad.

Throws:
java.io.IOException
InvalidDataException

parseVerticalLineAbsolute

protected void parseVerticalLineAbsolute()
                                  throws java.io.IOException,
                                         InvalidDataException
Parses an absolute vertical line command. A vertical line has only one coordinate value as the horizontal point does not change.

Throws:
java.io.IOException
InvalidDataException

parseVerticalLineRelative

protected void parseVerticalLineRelative()
                                  throws java.io.IOException,
                                         InvalidDataException
Parses a relative vertical line command. A vertical line has only one coordinate value as the horizontal point does not change.

Throws:
java.io.IOException
InvalidDataException

points

protected static int points(int type)
Gets the number of points associated to a path iterator segment.

Parameters:
type - path iterator segment type

prefix

protected static char prefix(int type)
Gets the prefix character associated to a path iterator segment type. The type is expected to be one of:

Parameters:
type - path iterator segment type
See Also:
type(char)

skipSpaces

protected void skipSpaces()
                   throws java.io.IOException
Skips the following characters:

Throws:
java.io.IOException

skipSpacesAndComma

protected void skipSpacesAndComma()
                           throws java.io.IOException
Skips a sequence of characters. Sequence is an either one of the following characters:

Characters that are skipped within spaces are the ones skipped with skipSpaces() method.

Throws:
java.io.IOException

toWinding

protected static int toWinding(char ruleCharacter)
                        throws com.davisor.core.InvalidParameterException
Gets the winding rule code for given winding rule code character. The code character is expected to be one of:

Parameters:
ruleCharacter - winding rule code character
Throws:
com.davisor.core.InvalidParameterException - if rule character is invalid
See Also:
toWinding(int)

toWinding

protected static char toWinding(int ruleCode)
Gets the winding rule code character for given winding rule code. The rule code is expected to be one of:

Parameters:
ruleCode - winding rule code
Returns:
winding rule keyword
See Also:
toWinding(char)

type

protected static int type(char prefix)
Gets the segment type associated to a path specification segment prefix character . The prefix character is expected to be one of:

Parameters:
prefix - path specification segment prefix character
See Also:
type(char)

getPathIterator

public java.awt.geom.PathIterator getPathIterator(boolean reverse)
Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.

Reverse iteration is currently only partially implemented: in particular, paths that contain curved segments are not guaranteed to work properly.

Parameters:
reverse - reverse iteration direction, or not

getShape

public java.awt.Shape getShape()
Gets a shape representing the current path. If the shape does not yet exist, one is created now from current path segments, stored for later use, and returned.

Returns:
current path, or null if not defined
See Also:
getPathIterator(AffineTransform), getSegments()

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
Ensures the presense of a serializable segment representation of the current shape.

Returns:
this instance, with serializable segments
Throws:
java.io.ObjectStreamException
See Also:
createSegments(java.awt.geom.PathIterator)

contains

public boolean contains(double x,
                        double y)
Tests if the specified coordinates are inside the boundary of the Shape.

Specified by:
contains in interface java.awt.Shape
See Also:
getShape()

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Tests if the interior of the Shape entirely contains the specified rectangular area.

Specified by:
contains in interface java.awt.Shape
See Also:
getShape()

contains

public boolean contains(java.awt.geom.Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.

Specified by:
contains in interface java.awt.Shape
See Also:
getShape()

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Tests if the interior of the Shape entirely contains the specified Rectangle2D.

Specified by:
contains in interface java.awt.Shape
See Also:
getShape()

getBounds

public java.awt.Rectangle getBounds()
Returns an integer Rectangle that completely encloses the Shape.

Specified by:
getBounds in interface java.awt.Shape
See Also:
getShape()

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Returns a high precision and more accurate bounding box of the Shape than the getBounds method.

Specified by:
getBounds2D in interface java.awt.Shape
See Also:
getShape()

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.

Specified by:
getPathIterator in interface java.awt.Shape
See Also:
getShape()

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
                                                  double flatness)
Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.

Specified by:
getPathIterator in interface java.awt.Shape
See Also:
getShape()

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests if the interior of the Shape intersects the interior of a specified rectangular area.

Specified by:
intersects in interface java.awt.Shape
See Also:
getShape()

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Tests if the interior of the Shape intersects the interior of a specified Rectangle2D.

Specified by:
intersects in interface java.awt.Shape
See Also:
getShape()


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.