org.das2.graph.Renderer
PROP_BOTTOMDECORATOR
PROP_TOPDECORATOR
CONTROL_KEY_COLOR
allocate a bunch of canonical properties. See http://autoplot.org/developer.guessRenderType#Proposed_extensions
CONTROL_KEY_FILL_COLOR
CONTROL_KEY_FILL_DIRECTION
CONTROL_KEY_COLOR_TABLE
CONTROL_KEY_LINE_THICK
CONTROL_KEY_LINE_STYLE
used in ContoursRenderer and EventsRenderer, values like DotDashes and Solid
CONTROL_KEY_SYMBOL
CONTROL_KEY_SYMBOL_SIZE
CONTROL_KEY_SPECIAL_COLORS
mapping from one double value to color, like:
This might be expanded to support "ge(100.0):red;lt(0):gray;within(0to100);green" and nominal values.
CONTROL_KEY_FILL_TEXTURE
when filling a region, use this texture (solid,hash,backhash,crosshash) to fill.
CONTROL_KEY_FONT_SIZE
font size relative to the parent, so "" or "1em" is the same size.
CONTROL_KEY_REFERENCE
CONTROL_KEY_DRAW_ERROR
CONTROL_KEY_MODULO_Y
modulo Y indicates that a difference in 23 hours is the same as -1 hours.
CONTROL_KEY_MODULO_X
PROP_CONTROL
PROP_ACTIVE
display the renderer. This is allows a renderer to be disabled without removing it from the application.
PROP_LEGENDLABEL
If non-null and non-zero-length, use this label to describe the renderer
in the plot's legend.
PROP_DRAWLEGENDLABEL
true if the legend label should be drawn.
PROP_ID
PROP_COLORBAR
PROP_RECORDFILE
acceptContext
acceptContext( int x, int y ) → boolean
Returns true if the render will accept the context for a point.
That is, the renderer affected that point, or nearby points. This is
used currently to provide a way for the operator to click on a plot and
directly edit the renderer which drew the pixel.
Parameters
x - the x coordinate in the canvas coordinate system.
y - the y coordinate in the canvas coordinate system.
Returns:
true if the renderer will accept the context.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
acceptsDataSet
acceptsDataSet( QDataSet ds ) → boolean
return true if the dataset appears to be in a scheme accepted by this renderer. This should assume that axis
units can be reset, etc.
Parameters
ds - a QDataSet
Returns:
true if the dataset appears to be acceptable.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
addPropertyChangeListener
addPropertyChangeListener( java.beans.PropertyChangeListener l ) → void
Adds a PropertyChangeListener to the listener list.
Parameters
l - The listener to add.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
addPropertyChangeListener( String propertyName, java.beans.PropertyChangeListener listener ) → void
decodeDatum
decodeDatum( String s, Datum deft ) → Datum
Parameters
s - a String
deft - a Datum
Returns:
org.das2.datum.Datum
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
decodeFillStyle
decodeFillStyle( String s, org.das2.graph.FillStyle deflt ) → FillStyle
decode the string into a fill style
Parameters
s - the symbol name, such as none, solid, and outline.
deflt - the value to use when the value is not parsed.
Returns:
the parsed value.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
decodePlotSymbolConnectorControl
decodePlotSymbolConnectorControl( String s, org.das2.graph.PsymConnector deflt ) → PsymConnector
decode the string into a plot symbol.
Parameters
s - the symbol name, such as none, dashes, dashFine
deflt - the symbol to use when the value is not parsed.
Returns:
the parsed value.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
decodePlotSymbolControl
decodePlotSymbolControl( String s, org.das2.graph.PlotSymbol deflt ) → PlotSymbol
decode the string into a plot symbol.
Parameters
s - the symbol name, such as none, circles, triangles, cross, ex, star, diamond, box
deflt - the symbol to use when the value is not parsed.
Returns:
the parsed value.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
drawListIcon
drawListIcon( java.awt.Graphics2D g, int x, int y ) → void
Parameters
g - a Graphics2D
x - an int
y - an int
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodeBooleanControl
encodeBooleanControl( boolean v ) → String
return the encoding for the boolean value.
Parameters
v - the boolean value.
Returns:
"T" or "F"
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodeColorControl
encodeColorControl( java.awt.Color color ) → String
encode the Color control.
Parameters
color - a Color
Returns:
the color encoded as a string.
See Also:
ColorUtil#encodeColor(java.awt.Color)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodeDatum
encodeDatum( Datum d ) → String
Parameters
d - a Datum
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodeFillStyle
encodeFillStyle( org.das2.graph.FillStyle fillStyle ) → String
encode the fill style as a string, such as:
none, outline, and solid.
Parameters
fillStyle - a FillStyle
Returns:
the string encoding.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodePlotSymbolConnectorControl
encodePlotSymbolConnectorControl( org.das2.graph.PsymConnector psymConnector ) → String
encode the plot symbol connector as a string, such as:
solid, dotted
Parameters
psymConnector - a PsymConnector
Returns:
the string encoding.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
encodePlotSymbolControl
encodePlotSymbolControl( org.das2.graph.PlotSymbol psym ) → String
encode the plot symbol as a string, such as:
none, circles, triangles, cross, ex, star, diamond, box
Parameters
psym - the plot symbol.
Returns:
the string encoding.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
formatControl
formatControl( java.util.Map c ) → String
convenient and official location for method that formats control string.
Parameters
c - a java.util.Map
Returns:
a String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getBooleanControl
getBooleanControl( String key, boolean deft ) → boolean
get the boolean control.
Parameters
key - the key name.
deft - the default value.
Returns:
the boolean value, where "T" is true, false otherwise; or the default when the value is not found.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getBottomDecorator
getBottomDecorator( ) → Painter
Returns:
org.das2.graph.Painter
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getColorBar
getColorBar( ) → DasColorBar
get the colorbar for the renderer.
Returns:
the colorbar for the renderer.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getColorControl
getColorControl( String key, java.awt.Color deft ) → Color
get the Color control.
Parameters
key - the key name.
deft - the default value
Returns:
the Color or the default when the value is not found.
See Also:
ColorUtil#decodeColor(java.lang.String)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getConsumedDataSet
getConsumedDataSet( ) → QDataSet
return the data for DataSetConsumer, which might be rebinned.
Returns:
a QDataSet
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getControl
getControl( ) → String
get the string which summarizes the state of the renderer. These allow a compact string to contain the renderer settings.
This should be an ampersand-delimited list of name=value pairs.
Returns:
a String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getControl( String key, String deft ) → String
getDataLoader
getDataLoader( ) → DataLoader
Returns:
org.das2.graph.DataLoader
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDataSet
getDataSet( ) → QDataSet
returns the current dataset being displayed.
Returns:
a QDataSet
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDataSetDescriptor
getDataSetDescriptor( ) → DataSetDescriptor
Returns:
org.das2.dataset.DataSetDescriptor
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDataSetID
getDataSetID( ) → String
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDatumControl
getDatumControl( String key, Datum deft ) → Datum
get the Datum control.
Parameters
key - the key name.
deft - the default value, which also provides the units.
Returns:
the Datum or the default when the value is not found.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDoubleArrayControl
getDoubleArrayControl( String key, double[] deft ) → double
get the double array control. These should be encoded on a string
with commas delimiting values.
Parameters
key - the key name.
deft - the default value.
Returns:
the double array, each element parsed with Double.parseDouble or the default when the value is not found.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDoubleControl
getDoubleControl( String key, double deft ) → double
get the double control.
Parameters
key - the key name.
deft - the default value.
Returns:
the double, parsed with Double.parseDouble; or the default when the value is not found.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getId
getId( ) → String
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getIntegerControl
getIntegerControl( String key, int deft ) → int
get the integer control.
Parameters
key - the key name.
deft - the default value.
Returns:
the int, parsed with Integer.parseInt; or the default when the value is not found.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getLastException
getLastException( ) → Exception
Returns:
java.lang.Exception
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getLegendLabel
getLegendLabel( ) → String
get the label to describe the renderer in the plot's legend.
If zero-length, then the legend label should be hidden.
Returns:
the label to describe the renderer
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getListIcon
getListIcon( ) → Icon
Returns:
javax.swing.Icon
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getListLabel
getListLabel( ) → String
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getParent
getParent( ) → DasPlot
Returns:
org.das2.graph.DasPlot
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getRenderCount
getRenderCount( ) → int
return the number of times render has been called since the last reset.
Returns:
number of times render has been called since the last reset.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getStatsFile
getStatsFile( ) → String
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getTopDecorator
getTopDecorator( ) → Painter
Returns:
org.das2.graph.Painter
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getUpdateCount
getUpdateCount( ) → int
return the number of times updatePlotImage has been called since the last reset.
Returns:
the number of times updatePlotImage has been called since the last reset.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getXmemento
getXmemento( ) → Memento
Returns:
org.das2.graph.DasAxis.Memento
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getYmemento
getYmemento( ) → Memento
Returns:
org.das2.graph.DasAxis.Memento
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
hasControl
hasControl( String key ) → boolean
return true if the control is specified.
Parameters
key - the key name
Returns:
true if the control is specified.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isActive
isActive( ) → boolean
true when the renderer should be drawn.
Returns:
true when the renderer should be drawn.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isDrawLegendLabel
isDrawLegendLabel( ) → boolean
get the switch used to turn off legend label. This allows the label
to be hidden without loosing the information it provides.
Returns:
true if the legend label should be drawn
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isDumpDataSet
isDumpDataSet( ) → boolean
Getter for property dumpDataSet.
Returns:
Value of property dumpDataSet.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
isTableDataSet
isTableDataSet( QDataSet ds ) → boolean
Parameters
ds - a QDataSet
Returns:
boolean
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
parseControl
parseControl( String c ) → Map
convenient and official location for method that parses control string.
This will split on ampersand, and when no ampersands are found then it will
try semicolons. This is to support embedding the control string in
other control strings (like Autoplot URIs) which use ampersands.
Parameters
c - the control string or null.
Returns:
the control string, parsed.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
parseLayoutString
parseLayoutString( String sizeStr, int nsize, double emSize, double fail ) → double
return the size encoded as normalized by the container size and em size.
Parameters
sizeStr - spec like "5em" or "50%"
nsize - the dimension for percents, for example the size of the canvas or column.
emSize - the size of the current font, for ems.
fail - value to return if the spec cannot be parsed.
Returns:
the size in pixels
See Also:
DasDevicePosition#parseLayoutStr(java.lang.String, double, int, double)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
postException
postException( java.lang.Exception exception ) → void
notify user of an exception, in the context of the plot. This is similar
to postMessage(renderer, exception.getMessage(), DasPlot.SEVERE, null, null )
except that it does catch CancelledOperationExceptions and reduced the
severity since the user probably initiated the condition.
Parameters
exception - the exception to post.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
postMessage
postMessage( String message, int messageType, Datum x, Datum y ) → void
post the message, checking to see that there is a parent first.
Parameters
message - the message
messageType - the message type, DasPlot.INFO, DasPlot.WARNING, or DasPlot.SEVERE.
x - the X position or null
y - the Y position or null
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
postMessage( String message, java.util.logging.Level messageLevel, Datum x, Datum y ) → void
removePropertyChangeListener
removePropertyChangeListener( java.beans.PropertyChangeListener l ) → void
Removes a PropertyChangeListener from the listener list.
Parameters
l - The listener to remove.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
removePropertyChangeListener( String propertyName, java.beans.PropertyChangeListener listener ) → void
render
render( java.awt.Graphics2D g, org.das2.graph.DasAxis xAxis, org.das2.graph.DasAxis yAxis ) → void
Render is called whenever the image needs to be refreshed or the content
has changed. This operation should occur with an animation-interactive
time scale, and an image should be cached when this is not possible. The graphics
object will have its origin at the upper-left corner of the screen.
Parameters
g - the graphics context in the canvas reference frame.
xAxis - the axis relating x data coordinates to horizontal pixel coordinates
yAxis - the axis relating y data coordinates to horizontal pixel coordinates
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
resetCounters
resetCounters( ) → void
reset the counters.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setActive
setActive( boolean active ) → void
set the active property, when false the renderer will not be drawn.
This is allows a renderer to be
disabled without removing it from the application.
Parameters
active - false if the renderer should not be drawn.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setBottomDecorator
setBottomDecorator( org.das2.graph.Painter bottomDecorator ) → void
add additional painting code to the renderer, which is called before
the renderer is called.
Parameters
bottomDecorator - the Painter to call, or null to clear.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setColorBar
setColorBar( org.das2.graph.DasColorBar cb ) → void
set a colorbar for the renderer. By default, the renderer simply ignores
the colorbar, but instances may introduce special handling.
WARNING: some subclasses override this, but do not call super.setColorBar.
Parameters
cb - a colorbar
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setControl
setControl( String s ) → void
set the control string which contains a number of properties. These are defined for
each renderer, but they should try to be consistent. See http://autoplot.org/developer.guessRenderType#Proposed_extensions
When overriding this, be sure to call super.
Parameters
s - the control
Returns:
void (returns nothing)
See Also:
CONTROL_KEY_COLOR etc etc
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDataSet
setDataSet( QDataSet ds ) → void
Set the dataset to be plotted. Different renderers accept QDataSets with
different schemes. For example SeriesRenderer takes:
ds[t] rank 1 dataset with rank 1 DEPEND_0 or
ds[t,n] rank 2 bundle dataset with X in ds[t,0] and Y in ds[t,n-1]
and SpectrogramRenderer takes:
ds[t,y] rank 2 table dataset
ds[n,t,y] rank 3 dataset with the first dimension join
See each renderer's documentation for the schemes it takes.
Note the lastException property is cleared, even when the dataset is null.
Parameters
ds - a QDataSet
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDataSetDescriptor
setDataSetDescriptor( org.das2.dataset.DataSetDescriptor dsd ) → void
Parameters
dsd - a DataSetDescriptor
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDataSetID
setDataSetID( String id ) → void
Parameters
id - a String
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDataSetLoader
setDataSetLoader( org.das2.graph.DataLoader loader ) → void
Parameters
loader - a DataLoader
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDrawLegendLabel
setDrawLegendLabel( boolean drawLegendLabel ) → void
set the switch used to turn off legend label. This allows the label
to be hidden without loosing the information it provides.
Parameters
drawLegendLabel - true if the legend label should be drawn
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setDumpDataSet
setDumpDataSet( boolean dumpDataSet ) → void
Setter for property dumpDataSet setting this to
true causes the dataSet to be dumped.
Parameters
dumpDataSet - New value of property dumpDataSet.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setException
setException( java.lang.Exception e ) → void
set the exception to be rendered instead of the dataset.
Parameters
e - an Exception
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setId
setId( String id ) → void
Parameters
id - a String
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setLastException
setLastException( java.lang.Exception e ) → void
TODO: what is the difference between lastException and exception?
Parameters
e - an Exception
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setLegendLabel
setLegendLabel( String legendLabel ) → void
set the label to describe the renderer in the plot's legend.
If zero-length, then the legend label should be hidden.
Parameters
legendLabel - the label to describe the renderer
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setParent
setParent( org.das2.graph.DasPlot parent ) → void
Parameters
parent - a DasPlot
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setStatsFile
setStatsFile( String recordFile ) → void
name of the file where rendering speed is recorded.
Parameters
recordFile - a String
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setTopDecorator
setTopDecorator( org.das2.graph.Painter topDecorator ) → void
add additional painting code to the renderer, which is called after
the renderer is called.
Parameters
topDecorator - the Painter to call, or null to clear.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setUpFont
setUpFont( java.awt.Font f, String fontSize ) → Font
handle the fontSize property, which has values like "1em" and "7px"
Parameters
f - the parent font.
fontSize - fontSize property, for example "1em" and "7px"
Returns:
the relative font.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
update
update( ) → void
Something has changed with the Render, and the plot should come back
to allow this render to repaint. Its cacheImage is invalidated and a
repaint is posted on the event thread.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
updateCacheImage
updateCacheImage( ) → void
The cacheImage is invalidated and updateEvent posted on the event thread
by calling update.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
updatePlotImage
updatePlotImage( org.das2.graph.DasAxis xAxis, org.das2.graph.DasAxis yAxis, ProgressMonitor monitor ) → void
updatePlotImage is called once the expensive operation of loading
the data is completed. This operation should occur on an interactive
time scale. This is an opportunity to create a cache
image of the data with the current axis state, when the render
operation cannot operate on an animation interactive time scale.
Also, several Renders can be updating at once on separate threads, while
the render methods must be called sequentially.
Only Renderer should call this method! (This should be protected then, but
this is not possible because of exiting use. TODO: introduce "revalidate"
to replace this operation.)
Parameters
xAxis - the axis relating x data coordinates to horizontal pixel coordinates
yAxis - the axis relating y data coordinates to horizontal pixel coordinates
monitor - a monitor for the operation. Note the updatePlotImage operation should be fast (<1000ms).
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]