|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.graphics.GraphicsSupport
public abstract class GraphicsSupport
Provides general-purpose graphics support functionality globally throughout the system. It is declared abstract to play a singleton role. These methods are mid-level helpers that interpret high-level semantics defined in terms of their system context to low-level Java graphics. In most cases, the unit of measurement is pixels.
| Field Summary | |
|---|---|
private static AngleMathematical |
ARC_STEP
the arc length between points on any rendered arc. |
| Constructor Summary | |
|---|---|
private |
GraphicsSupport()
Prevents subclassing and inadvertent instantiation. |
| Method Summary | ||
|---|---|---|
static void |
activateClipMode(java.awt.Graphics2D graphics,
Box box)
Activates the Java2D clipping mode to prevent drawing outside a rectangular region. |
|
static CoordinateCartesianAbsolute[] |
calculateLineCircleIntercepts(Line line,
Circle circle)
Calculates the two points where a line passing through a circle intercepts the perimeter. |
|
static void |
deactivateClipMode(java.awt.Graphics2D graphics)
Deactivates the Java2D clipping mode to prevent drawing outside a rectangular region. |
|
static
|
drawArc(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
ArcDescriptor<_UNIT_> descriptor,
I_AngleMapper<_UNIT_> instrument)
Draws an arc. |
|
static void |
drawBox(java.awt.Graphics2D graphics,
Box box,
boolean isFilled)
Draws a box anchored at its center, not top left, as in Java graphics. |
|
static void |
drawBoxOutlined(java.awt.Graphics2D graphics,
BoxDescriptor descriptor,
boolean... isClipModeEnabled)
Draws a box anchored at its center, not top left, as in Java graphics. |
|
static void |
drawCircle(java.awt.Graphics2D graphics,
Circle circle,
boolean isFilled)
Draws a circle anchored at its center, not top left, as in Java graphics. |
|
static void |
drawCircleOutlined(java.awt.Graphics2D graphics,
CircleDescriptor descriptor)
Draws a box anchored at its center, not top left, as in Java graphics. |
|
static void |
drawLine(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute start,
CoordinateCartesianAbsolute end)
Draws a line. |
|
static void |
drawLine(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute origin,
CoordinatePolarMathematical vector)
Draws a line. |
|
static void |
drawLine(java.awt.Graphics2D graphics,
Line line)
Draws a line. |
|
static
|
drawNeedle(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
NeedleDescriptor descriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_ value)
Draws a needle. |
|
static
|
drawNumbers(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
NumberDescriptor<_UNIT_> descriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_... offset)
Draws numbers on a ringed instrument. |
|
static java.awt.Polygon |
drawPolygon(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute origin,
double[][] polygon,
Size scale,
AngleMathematical rotation,
boolean isFilled)
Draws a polygon. |
|
static void |
drawText(java.awt.Graphics2D graphics,
java.lang.String text,
Size canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
CoordinateCartesianRelative anchorScale,
TextProperties textProperties)
Draws text. |
|
static void |
drawText(java.awt.Graphics2D graphics,
TextDescriptor text)
Draws text. |
|
static
|
drawTick(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute anchor,
_UNIT_ value,
Ring radii,
int width,
I_AngleMapper<_UNIT_> instrument)
Draws a single tick. |
|
static void |
drawTick(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute anchor,
AngleMathematical angle,
Ring radii,
int width)
Draws a single tick. |
|
static
|
drawTicks(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute anchor,
TickDescriptor<_UNIT_> tickDescriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_... offset)
Draws ticks over an interval on a ringed instrument. |
|
static void |
resetLineWidth(java.awt.Graphics2D graphics)
Resets the line width in pixels modally to 1. |
|
static void |
setColor(java.awt.Graphics2D graphics,
java.awt.Color color)
Sets the color of the graphics context modally. |
|
static void |
setLineWidth(java.awt.Graphics2D graphics,
float width)
Sets the line width in pixels modally. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final AngleMathematical ARC_STEP
| Constructor Detail |
|---|
private GraphicsSupport()
| Method Detail |
|---|
public static void activateClipMode(java.awt.Graphics2D graphics,
Box box)
graphics - - the graphics contextbox - - the rectangle
public static CoordinateCartesianAbsolute[] calculateLineCircleIntercepts(Line line,
Circle circle)
line - - the linecircle - - the circle
public static void deactivateClipMode(java.awt.Graphics2D graphics)
graphics - - the graphics context
public static <_UNIT_ extends I_Unitable<_UNIT_>> java.awt.Polygon drawArc(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
ArcDescriptor<_UNIT_> descriptor,
I_AngleMapper<_UNIT_> instrument)
_UNIT_ - - the unit that the arc is based ongraphics - - the graphics context baseradius - - the radius of the arc, which is scaled by descriptororigin - - the arc origindescriptor - - the inner and outer scalers for the radiusinstrument - - the instrument defining the arc
public static void drawBox(java.awt.Graphics2D graphics,
Box box,
boolean isFilled)
graphics - - the graphics contextbox - - the rectangleisFilled - - whether to fill the box
public static void drawBoxOutlined(java.awt.Graphics2D graphics,
BoxDescriptor descriptor,
boolean... isClipModeEnabled)
graphics - - the graphics contextdescriptor - - the box descriptorisClipModeEnabled - - whether to optionally activate clip mode
public static void drawCircle(java.awt.Graphics2D graphics,
Circle circle,
boolean isFilled)
graphics - - the graphics contextcircle - - the circleisFilled - - whether to fill the circle
public static void drawCircleOutlined(java.awt.Graphics2D graphics,
CircleDescriptor descriptor)
graphics - - the graphics contextdescriptor - - the circle descriptor
public static void drawLine(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute start,
CoordinateCartesianAbsolute end)
graphics - - the graphics contextstart - - the line startend - - the line end
public static void drawLine(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute origin,
CoordinatePolarMathematical vector)
graphics - - the graphics contextorigin - - the line startvector - - the line end
public static void drawLine(java.awt.Graphics2D graphics,
Line line)
graphics - - the graphics contextline - - the line
public static <_UNIT_ extends I_Unitable<_UNIT_>> java.awt.Polygon drawNeedle(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
NeedleDescriptor descriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_ value)
_UNIT_ - - the unit that the needle is based ongraphics - - the graphics contextradius - - the radius of the needleorigin - - the needle origindescriptor - - the needle descriptorinstrument - - the instrument defining the arcvalue - - the unit value of the needle
public static <_UNIT_ extends I_Unitable<_UNIT_>> void drawNumbers(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute origin,
NumberDescriptor<_UNIT_> descriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_... offset)
_UNIT_ - - the unit that the numbers are based ongraphics - - the graphics contextradius - - the radius of the numbersorigin - - the numbers origindescriptor - - the number descriptorinstrument - - the instrument defining the arcoffset - - the optional offset for starting the number series
public static java.awt.Polygon drawPolygon(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute origin,
double[][] polygon,
Size scale,
AngleMathematical rotation,
boolean isFilled)
graphics - - the graphics contextorigin - - the polygon originpolygon - - the polygon as (x,y) pixel coordinatesscale - - the scale to apply to the polygon verticesrotation - - the rotation about the originisFilled - - whether to fill the polygon
public static void drawText(java.awt.Graphics2D graphics,
java.lang.String text,
Size canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
CoordinateCartesianRelative anchorScale,
TextProperties textProperties)
graphics - - the graphics contexttext - - the textcanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixelsanchorScale - - the absolute coordinate offset from canvasAnchor mapped onto canvasSizetextProperties - - the text propertiesCoordinateCartesianAbsolute.convertToCoordinateAbsolute(CoordinateCartesianRelative,Size)
public static void drawText(java.awt.Graphics2D graphics,
TextDescriptor text)
graphics - - the graphics contexttext - - the text descriptor
public static <_UNIT_ extends I_Unitable<_UNIT_>> void drawTick(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute anchor,
_UNIT_ value,
Ring radii,
int width,
I_AngleMapper<_UNIT_> instrument)
_UNIT_ - - the unit that the tick is based ongraphics - - the graphics contextanchor - - the anchor of the radius in pixelsvalue - - the equivalent value of the tick that determines where on the interval arc to draw it based on the
I_AngleMapper doing the angle mappingradii - - the inner and outer radii in pixelswidth - - the width in pixelsinstrument - - the instrument defining the arc
public static void drawTick(java.awt.Graphics2D graphics,
CoordinateCartesianAbsolute anchor,
AngleMathematical angle,
Ring radii,
int width)
graphics - - the graphics contextanchor - - the anchor of the radius in pixelsangle - - the angleradii - - the inner and outer radii in pixelswidth - - the tick width in pixels
public static <_UNIT_ extends I_Unitable<_UNIT_>> void drawTicks(java.awt.Graphics2D graphics,
Radius radius,
CoordinateCartesianAbsolute anchor,
TickDescriptor<_UNIT_> tickDescriptor,
I_AngleMapper<_UNIT_> instrument,
_UNIT_... offset)
_UNIT_ - - the unit that the ticks are based ongraphics - - the graphics contextradius - - the radius defining the size of the instrument, against which the inner and outer radii in
TickDescriptor will be scaledanchor - - the anchor of the radius in pixelstickDescriptor - - the tick descriptorinstrument - - the instrument defining the arcoffset - - the optional offset for starting the tickspublic static void resetLineWidth(java.awt.Graphics2D graphics)
graphics - - the graphics context
public static void setColor(java.awt.Graphics2D graphics,
java.awt.Color color)
graphics - - the graphics contextcolor - - the color
public static void setLineWidth(java.awt.Graphics2D graphics,
float width)
graphics - - the graphics contextwidth - - the width
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||