All Packages Class Hierarchy This Package Previous Next Index
Interface java.awt.Stroke
- public interface Stroke
This interface allows a Graphics2D object to get a Path representation
of the boundaries of a stroking primitive from the path to be stroked.
The effect of stroking a path can be compared to drawing a logical
pen of an appropriate size and shape along the trajectory of the path.
The area where the pen would place ink is the area enclosed by the
stroked path.
The stroking primitives of the Graphics2D interface include the
drawPath method and any other methods that are implemented in terms
of that method such as drawLine, drawRect, drawRoundRect, drawOval,
drawArc, drawPolyline, and drawPolygon.
The objects of the classes implementing Stroke must be immutable
(i.e. read-only) because the Graphics2D will not clone these objects
either when they are set as an attribute with the setStroke method
or when the Graphics2D object is itself cloned.
If a Stroke object were modified after it was set in the state of
the Graphics2D then the behavior of subsequent rendering would be
undefined.
- See Also:
- BasicStroke, setStroke
createStrokedShape(Shape)
- Returns a path which encloses the area that should be painted
when the path is stroked according to the rules defined by the
object implementing the Stroke interface.
createStrokedShape
public abstract Shape createStrokedShape(Shape p)
- Returns a path which encloses the area that should be painted
when the path is stroked according to the rules defined by the
object implementing the Stroke interface.
- Parameters:
- p - The path that should be stroked.
- Returns:
- The stroked path.
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature