|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.PaintMode
Abstract class PaintMode defines the requirements for an object
that can control the painting of a ShapePaintable.
Class PaintMode provides some examples of its own objects.
Class PaintMode also provides some static convenience methods.
In 2.3.5, the class was refactored to be consistent with
the new Paintable interface and
the new AbstractPaintable class.
In 2.4.0, this class was updated to be consistent with refinements
to the Paintable interface.
| Field Summary | |
static PaintMode |
DRAW
The paint mode corresponding to drawing the shape of the shape paintable using its draw paint and draw stroke. |
static PaintMode |
FILL
The paint mode corresponding to filling the shape of the shape paintable using its fill paint. |
static PaintMode |
FILL_DRAW
The paint mode corresponding to filling the shape of the shape paintable using its fill paint and then drawing the shape using its draw paint and draw stroke. |
| Constructor Summary | |
PaintMode()
|
|
| Method Summary | |
static void |
draw(Graphics g,
Shape shape,
Paint drawpaint)
Draws the given shape using the given drawpaint in the given graphics context. |
static void |
draw(Graphics g,
Shape shape,
Paint drawpaint,
Stroke drawstroke)
Draws the given shape using the given drawpaint and the given drawstroke in the given graphics context. |
static void |
fill(Graphics g,
Shape shape,
Paint fillpaint)
Fills the given shape using the given fillpaint in the given graphics context. |
static void |
filldraw(Graphics g,
Shape shape,
Paint fillpaint,
Paint drawpaint)
Fills and draws the given shape using the given fillpaint and the given drawpaint in the given graphics context. |
static void |
filldraw(Graphics g,
Shape shape,
Paint fillpaint,
Paint drawpaint,
Stroke drawstroke)
Fills and draws the given shape using the given fillpaint, the given drawpaint, and the given drawstroke in the given graphics context. |
abstract XRect |
getActualBounds2D(ShapePaintable paintable)
Returns the original 2-dimensional bounds of the paint region that will be changed when the originalPaint
method is called on the given shape paintable. |
abstract Shape |
getOutline(ShapePaintable paintable)
Returns the Shape representing the paint region
that will be changed when the originalPaint method
is called on the given shape paintable. |
abstract boolean |
originalContains(ShapePaintable paintable,
double x,
double y)
Tests if a point specified by coordinates is inside the orignal outline of the given shape paintable. |
boolean |
originalContains(ShapePaintable paintable,
Point2D p)
Tests if a point specified by coordinates is inside the orignal outline of the given shape paintable. |
abstract void |
originalPaint(ShapePaintable paintable,
Graphics g)
Paints the given shape paintable without mutation using the given graphics context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final PaintMode FILL
public static final PaintMode DRAW
public static final PaintMode FILL_DRAW
| Constructor Detail |
public PaintMode()
| Method Detail |
public abstract void originalPaint(ShapePaintable paintable,
Graphics g)
Paints the given shape paintable without mutation using the given graphics context.
It is assumed that the graphics context has been prepared and mutation has been applied by the caller of this method.
If the given shape paintable or given graphics context is
null, then this method should do nothing.
When this method call is complete, the internal state of the given graphics context should be unchanged.
paintable - the shape paintableg - the graphics context on which to paintpublic abstract XRect getActualBounds2D(ShapePaintable paintable)
Returns the original 2-dimensional bounds of the paint
region that will be changed when the originalPaint
method is called on the given shape paintable.
If the given shape paintable is null or if the
bounds may not otherwise be computed then this method should
return new Rectangle2D.Double().
This method should not return null.
paintable - the shape paintable
public abstract Shape getOutline(ShapePaintable paintable)
Returns the Shape representing the paint region
that will be changed when the originalPaint method
is called on the given shape paintable.
If the given shape paintable is null, then this
method should return null.
paintable - the shape paintable
public abstract boolean originalContains(ShapePaintable paintable,
double x,
double y)
Tests if a point specified by coordinates is inside the orignal outline of the given shape paintable.
If the given shape paintable is null, then this
method should return false.
paintable - the shape paintablex - the x-coordinate of the pointy - the y-coordinate of the point
public final boolean originalContains(ShapePaintable paintable,
Point2D p)
Tests if a point specified by coordinates is inside the orignal outline of the given shape paintable.
If the given shape paintable is null, then this
method should return false.
paintable - the shape paintablep - a specified point
public static void fill(Graphics g,
Shape shape,
Paint fillpaint)
Fills the given shape using the given fillpaint in the given graphics context.
g - the graphics contextshape - the shape to paintfillpaint - the paint to use for fillFILL
public static void draw(Graphics g,
Shape shape,
Paint drawpaint)
Draws the given shape using the given drawpaint in the given graphics context.
g - the graphics contextshape - the shape to paintdrawpaint - the paint to use for drawDRAW
public static void draw(Graphics g,
Shape shape,
Paint drawpaint,
Stroke drawstroke)
Draws the given shape using the given drawpaint and the given drawstroke in the given graphics context.
g - the graphics contextshape - the shape to paintdrawpaint - the paint to use for drawdrawstroke - the stroke to use for drawDRAW
public static void filldraw(Graphics g,
Shape shape,
Paint fillpaint,
Paint drawpaint)
Fills and draws the given shape using the given fillpaint and the given drawpaint in the given graphics context.
g - the graphics contextshape - the shape to paintfillpaint - the paint to use for filldrawpaint - the paint to use for drawFILL_DRAW
public static void filldraw(Graphics g,
Shape shape,
Paint fillpaint,
Paint drawpaint,
Stroke drawstroke)
Fills and draws the given shape using the given fillpaint, the given drawpaint, and the given drawstroke in the given graphics context.
g - the graphics contextshape - the shape to paintfillpaint - the paint to use for filldrawpaint - the paint to use for drawdrawstroke - the stroke to use for drawFILL_DRAW
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||