public enum RectanglePainter2D extends java.lang.Enum<RectanglePainter2D> implements RegionPainter2D<java.lang.Double>
LinePainter2D.StrokeType
. The size of the rectangle is exactly
of the requested width/height (unlike in Graphics.drawRect(int, int, int, int)
).
It's assumed that the ScaleType.USR_SCALE
factor is already applied to the values (given in the user space)
passed to the methods of this class. So the user scale factor is not taken into account.
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Rectangle2D |
align(java.awt.Graphics2D g,
java.util.EnumSet<LinePainter2D.Align> align,
double x,
double y,
double prefWidth,
double prefHeight,
LinePainter2D.StrokeType strokeType,
double strokeWidth)
Aligns the rectangle relative to the provided
x, y according to the provided align . |
abstract void |
paint(java.awt.Graphics2D g,
double x,
double y,
double width,
double height) |
abstract void |
paint(java.awt.Graphics2D g,
double x,
double y,
double width,
double height,
java.lang.Double arc,
LinePainter2D.StrokeType strokeType,
double strokeWidth,
java.lang.Object valueAA)
Paints on the given
Graphics2D object. |
abstract void |
paint(java.awt.Graphics2D g,
double x,
double y,
double width,
double height,
LinePainter2D.StrokeType strokeType,
double strokeWidth) |
abstract void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D rect,
java.lang.Double arc,
LinePainter2D.StrokeType strokeType,
double strokeWidth,
java.lang.Object valueAA) |
static RectanglePainter2D |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static RectanglePainter2D[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
paint
public static final RectanglePainter2D DRAW
public static final RectanglePainter2D FILL
public static RectanglePainter2D[] values()
for (RectanglePainter2D c : RectanglePainter2D.values()) System.out.println(c);
public static RectanglePainter2D valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.awt.geom.Rectangle2D align(java.awt.Graphics2D g, java.util.EnumSet<LinePainter2D.Align> align, double x, double y, double prefWidth, double prefHeight, LinePainter2D.StrokeType strokeType, double strokeWidth)
x, y
according to the provided align
.
If align
contains CENTER_X
, the provided x
is treated as the x center.
If align
contains CENTER_Y
, the provided y
is treated as the y center.
Otherwise, x and/or y is not changed.
As the center x (y) coordinate it's expected either a value equal to integer in the device space,
in which case the prefWidth (prefHeight)
is adjusted to a closed even value in the device space,
or a value b/w two integers in the device space, in which case the prefWidth (prefHeight)
is adjusted
to a closed odd value in the device space.
g
- the graphicsalign
- the alignx
- x obeying align
y
- y obeying align
prefWidth
- the preferred widthprefHeight
- the preferred heightstrokeType
- the stroke typestrokeWidth
- the stroke widthpublic abstract void paint(java.awt.Graphics2D g, double x, double y, double width, double height, java.lang.Double arc, LinePainter2D.StrokeType strokeType, double strokeWidth, java.lang.Object valueAA)
Graphics2D
object.
Renders to the given Graphics2D
object.g
- the Graphics2D
object to render tox
- X position of the area to painty
- Y position of the area to paintwidth
- width of the area to paintheight
- height of the area to paintarc
- an optional configuration parameterstrokeType
- the stroke typestrokeWidth
- the stroke widthvalueAA
- overrides current RenderingHints.KEY_ANTIALIASING
to valueAA
public abstract void paint(java.awt.Graphics2D g, double x, double y, double width, double height, LinePainter2D.StrokeType strokeType, double strokeWidth)
public abstract void paint(java.awt.Graphics2D g, double x, double y, double width, double height)
public abstract void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D rect, java.lang.Double arc, LinePainter2D.StrokeType strokeType, double strokeWidth, java.lang.Object valueAA)