public abstract class ErrorRenderer extends Object
Modifier and Type | Field and Description |
---|---|
static ErrorRenderer |
DEFAULT
General purpose error renderer.
|
static ErrorRenderer |
EXAMPLE
Error renderer suitable for use in user controls.
|
static ErrorRenderer |
NONE
Error renderer which draws nothing.
|
static ErrorRenderer |
TANGENT
Error renderer suitable for displaying 2D tangential errors.
|
Modifier | Constructor and Description |
---|---|
protected |
ErrorRenderer(String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
drawErrors(Graphics g,
int x,
int y,
int[] xoffs,
int[] yoffs)
Renders error bars in one or more dimensions around a given point.
|
abstract Rectangle |
getBounds(int x,
int y,
int[] xoffs,
int[] yoffs)
Returns a rectangle which will contain the rendered error bar
graphics for a given point.
|
abstract Icon |
getLegendIcon()
Returns an icon giving a general example of what this form looks like.
|
abstract Icon |
getLegendIcon(ErrorMode[] modes,
int width,
int height,
int xpad,
int ypad)
Returns an icon giving an example of what this form looks like in a
detailed context.
|
String |
getName()
Returns a user-readable name for this style of error rendering.
|
static ErrorRenderer[] |
getOptions1d()
Returns an array of ErrorRenderers which can render 1-dimensional
(vertical) errors.
|
static ErrorRenderer[] |
getOptions2d()
Returns an array of ErrorRenderers which can render 2-dimensional errors.
|
static ErrorRenderer[] |
getOptions3d()
Returns an array of ErrorRenderers which can render 3-dimensional errors.
|
static ErrorRenderer[] |
getOptionsEllipse()
Returns an array of ErrorRenderers which is suitable for 2d
ellipse-like applications.
|
static ErrorRenderer[] |
getOptionsGeneral()
Returns an array of ErrorRenderers which can render errors of arbitrary
dimensionality.
|
static ErrorRenderer[] |
getOptionsSizeXY()
Returns an array of ErrorRenderers which is suitable for
applications that plot a shape with independently variable
horizontal and vertical extents.
|
static ErrorRenderer[] |
getOptionsSpherical()
Returns an array of ErrorRenderers which can render errors suitable
for spherical or spherical polar coordinates.
|
static ErrorRenderer[] |
getOptionsVector()
Returns an array of ErrorRenderers which is suitable for
vector-like applications.
|
Pixellator |
getPixels(Rectangle clip,
int x,
int y,
int[] xoffs,
int[] yoffs)
Returns an array of pixel positions which can be used to draw this
marker onto a raster.
|
abstract boolean |
isBlank(ErrorMode[] modes)
Indicates whether this renderer is known to produce no output
for a particular set of ErrorModes.
|
abstract boolean |
supportsDimensionality(int ndim)
Reports whether this form can be used on a given error dimensionality.
|
String |
toString() |
public static final ErrorRenderer NONE
public static final ErrorRenderer DEFAULT
public static final ErrorRenderer EXAMPLE
public static final ErrorRenderer TANGENT
protected ErrorRenderer(String name)
name
- renderer namepublic abstract Icon getLegendIcon()
public abstract Icon getLegendIcon(ErrorMode[] modes, int width, int height, int xpad, int ypad)
modes
- array of ErrorModes, one per error dimension (x, y, ...)width
- total width of iconheight
- total height of iconxpad
- internal horizontal padding of iconypad
- internal vertical padding of iconpublic String getName()
public abstract boolean isBlank(ErrorMode[] modes)
modes
is null,
the question is about whether this renderer will produce no output
regardless of the error mode context.modes
- error mode context, or nullpublic abstract boolean supportsDimensionality(int ndim)
ndim
- number of error dimensions to be usedpublic abstract void drawErrors(Graphics g, int x, int y, int[] xoffs, int[] yoffs)
ErrorRenderer
implementations may impose restrictions
on this count. They must come in consecutive pairs which describe
error bars along the same axis in different directions.
Missing error bars are represented as (0,0). The values must come
in axis order where that makes sense, but note in some contexts
(e.g. 3D) these may be data axes rather than graphics plane axes.
This method is quite likely to get called from time to time with ridiculously large offset arrays. Implementations should try to ensure that they don't attempt graphics operations which may cause the graphics system undue grief, such as filling an ellipse the size of a village.
g
- graphics contextx
- data point X coordinatey
- data point Y coordinatexoffs
- X coordinates of error bar limit offsets from (x,y)yoffs
- Y coordinates of error bar limit offsets from (x,y)public abstract Rectangle getBounds(int x, int y, int[] xoffs, int[] yoffs)
x
- data point X coordinatey
- data point Y coordinatexoffs
- X coordinates of error bar limit offsets from (x,y)yoffs
- Y coordinates of error bar limit offsets from (x,y)public Pixellator getPixels(Rectangle clip, int x, int y, int[] xoffs, int[] yoffs)
drawErrors(java.awt.Graphics, int, int, int[], int[])
method,
for instance in situations where it might be more efficient.
The assumption is that all the pixels are the same colour.
The ErrorRenderer implementation calculates this by painting onto a temporary BufferedImage and then examining the raster to see which pixels have been painted. This is probably not very efficient. Subclasses are encouraged to override this method if they can calculate the pixels which will be painted directly.
clip
- clipping regionx
- data point X coordinatey
- data point Y coordinatexoffs
- X coordinates of error bar limit offsets from (x,y)yoffs
- Y coordinates of error bar limit offsets from (x,y)public static ErrorRenderer[] getOptions1d()
public static ErrorRenderer[] getOptions2d()
public static ErrorRenderer[] getOptions3d()
public static ErrorRenderer[] getOptionsSpherical()
public static ErrorRenderer[] getOptionsGeneral()
public static ErrorRenderer[] getOptionsEllipse()
public static ErrorRenderer[] getOptionsSizeXY()
public static ErrorRenderer[] getOptionsVector()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.