public class DigitalRenderer extends Renderer
Modifier and Type | Class and Description |
---|---|
static class |
DigitalRenderer.Align |
Modifier and Type | Field and Description |
---|---|
protected DigitalRenderer.Align |
align |
protected java.awt.Color |
color |
protected int |
dataSetSizeLimit |
static java.lang.String |
PROP_ALIGN |
static java.lang.String |
PROP_COLOR |
static java.lang.String |
PROP_DATASETSIZELIMIT |
static java.lang.String |
PROP_FILLLABEL |
static java.lang.String |
PROP_FONTSIZE
font size, expressed as relative string like "1em" or "6pt"
|
static java.lang.String |
PROP_FORMAT
format, empty string means use either dataset's format, or %.2f
|
static java.lang.String |
PROP_PLOTSYMBOL |
static java.lang.String |
PROP_SIZE
font size, 0 indicates the plot font should be used.
|
bottomDecorator, colorBar, control, CONTROL_KEY_COLOR, CONTROL_KEY_COLOR_TABLE, CONTROL_KEY_DRAW_ERROR, CONTROL_KEY_FILL_COLOR, CONTROL_KEY_FILL_DIRECTION, CONTROL_KEY_FILL_TEXTURE, CONTROL_KEY_FONT_SIZE, CONTROL_KEY_LINE_STYLE, CONTROL_KEY_LINE_THICK, CONTROL_KEY_MODULO_X, CONTROL_KEY_MODULO_Y, CONTROL_KEY_REFERENCE, CONTROL_KEY_SPECIAL_COLORS, CONTROL_KEY_SYMBOL, CONTROL_KEY_SYMBOL_SIZE, drawLegendLabel, ds, firstValidIndex, id, lastException, lastValidIndex, legendLabel, logger, MARKER_DATASET, MARKER_X_AXIS_RANGE, MARKER_Y_AXIS_RANGE, needWorkMarkers, PROP_ACTIVE, PROP_BOTTOMDECORATOR, PROP_COLORBAR, PROP_CONTROL, PROP_DRAWLEGENDLABEL, PROP_ID, PROP_LEGENDLABEL, PROP_RECORDFILE, PROP_TOPDECORATOR, propertyChangeSupport, renderException, topDecorator
Constructor and Description |
---|
DigitalRenderer() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptContext(int x,
int y)
Returns true if the render will accept the context for a point.
|
static QDataSet |
doAutorange(QDataSet ds)
autorange on the data, returning a rank 2 bounds for the dataset.
|
static java.lang.String |
formatDatum(java.lang.String form,
Datum d,
char type)
format the datum into a string, using the format and the
pre-calculated type.
|
DigitalRenderer.Align |
getAlign() |
java.awt.Color |
getColor() |
java.lang.String |
getControl()
get the string which summarizes the state of the renderer.
|
int |
getDataSetSizeLimit() |
java.lang.String |
getFillLabel() |
java.lang.String |
getFontSize() |
java.lang.String |
getFormat() |
PlotSymbol |
getPlotSymbol() |
double |
getSize() |
void |
render(java.awt.Graphics2D g,
DasAxis xAxis,
DasAxis yAxis)
Render is called whenever the image needs to be refreshed or the content
has changed.
|
java.awt.Shape |
selectionArea()
like accept context, but provides a shape to indicate selection.
|
void |
setAlign(DigitalRenderer.Align align)
For the box containing the digital number, which corner is anchored
to the data.
|
void |
setColor(java.awt.Color color) |
void |
setControl(java.lang.String s)
set the control string which contains a number of properties.
|
void |
setDataSetSizeLimit(int dataSetSizeLimit) |
void |
setFillLabel(java.lang.String fillLabel)
the label printed where fill data (invalid data placeholder) is found.
|
void |
setFontSize(java.lang.String fontSize) |
void |
setFormat(java.lang.String value)
note the dataset's format will be used if this is "", and "%.2f" if no
format is found there.
|
void |
setPlotSymbol(PlotSymbol plotSymbol) |
void |
setSize(double size) |
static char |
typeForFormat(java.lang.String form)
return the data type needed for the format.
|
void |
updatePlotImage(DasAxis xAxis,
DasAxis yAxis,
ProgressMonitor monitor)
updatePlotImage is called once the expensive operation of loading
the data is completed.
|
acceptsDataSet, addPropertyChangeListener, addPropertyChangeListener, addToStats, decodeDatum, decodeFillStyle, decodePlotSymbolConnectorControl, decodePlotSymbolControl, drawListIcon, encodeBooleanControl, encodeColorControl, encodeDatum, encodeFillStyle, encodePlotSymbolConnectorControl, encodePlotSymbolControl, formatControl, getAffineTransform, getBooleanControl, getBottomDecorator, getColorBar, getColorControl, getConsumedDataSet, getControl, getDataLoader, getDataSet, getDataSetDescriptor, getDataSetID, getDatumControl, getDoubleArrayControl, getDoubleControl, getId, getIntegerControl, getInternalDataSet, getLastException, getLegendLabel, getListIcon, getListLabel, getParent, getRenderCount, getStatsFile, getTopDecorator, getUpdateCount, getXmemento, getYmemento, hasControl, incrementRenderCount, incrementUpdateCount, installRenderer, invalidateParentCacheImage, isActive, isDrawLegendLabel, isDumpDataSet, isTableDataSet, parseControl, parseLayoutString, postException, postMessage, postMessage, refresh, refreshImage, removePropertyChangeListener, removePropertyChangeListener, renderException, resetCounters, setActive, setBottomDecorator, setColorBar, setDataSet, setDataSetDescriptor, setDataSetID, setDataSetLoader, setDrawLegendLabel, setDumpDataSet, setException, setId, setLastException, setLegendLabel, setParent, setStatsFile, setTopDecorator, setUpFont, setUpFont, uninstallRenderer, update, updateCacheImage, updateImmediately
protected java.awt.Color color
public static final java.lang.String PROP_COLOR
protected DigitalRenderer.Align align
public static final java.lang.String PROP_ALIGN
public static final java.lang.String PROP_PLOTSYMBOL
public static final java.lang.String PROP_FORMAT
public static final java.lang.String PROP_SIZE
public static final java.lang.String PROP_FONTSIZE
public static final java.lang.String PROP_FILLLABEL
protected int dataSetSizeLimit
public static final java.lang.String PROP_DATASETSIZELIMIT
public static QDataSet doAutorange(QDataSet ds)
ds
- the datasetSchemes.boundingBox()
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public DigitalRenderer.Align getAlign()
public void setAlign(DigitalRenderer.Align align)
align
- public PlotSymbol getPlotSymbol()
public void setPlotSymbol(PlotSymbol plotSymbol)
public java.lang.String getFormat()
public void setFormat(java.lang.String value)
value
- public double getSize()
public void setSize(double size)
public java.lang.String getFontSize()
public void setFontSize(java.lang.String fontSize)
public java.lang.String getFillLabel()
public void setFillLabel(java.lang.String fillLabel)
fillLabel
- the label such as "fill" or "" for nothing.public void setControl(java.lang.String s)
Renderer
setControl
in class Renderer
s
- the controletc
public java.lang.String getControl()
Renderer
getControl
in class Renderer
public java.awt.Shape selectionArea()
public int getDataSetSizeLimit()
public void setDataSetSizeLimit(int dataSetSizeLimit)
public void render(java.awt.Graphics2D g, DasAxis xAxis, DasAxis yAxis)
Renderer
public static char typeForFormat(java.lang.String form)
form
- public static java.lang.String formatDatum(java.lang.String form, Datum d, char type)
form
- the format, such as %.2f or "x=%d cc"d
- type
- 'x' 'X' 'd' 'o' 'c' 'C' or 'f'public boolean acceptContext(int x, int y)
Renderer
acceptContext
in class Renderer
x
- the x coordinate in the canvas coordinate system.y
- the y coordinate in the canvas coordinate system.public void updatePlotImage(DasAxis xAxis, DasAxis yAxis, ProgressMonitor monitor) throws DasException
Renderer
updatePlotImage
in class Renderer
xAxis
- the axis relating x data coordinates to horizontal pixel coordinatesyAxis
- the axis relating y data coordinates to horizontal pixel coordinatesmonitor
- a monitor for the operation. Note the updatePlotImage operation should be fast (<1000ms).DasException