public class DasPlot extends DasCanvasComponent
Modifier and Type | Class and Description |
---|---|
protected class |
DasPlot.RebinListener |
DasCanvasComponent.CanvasComponentAction
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected Painter |
bottomDecorator |
protected boolean |
displayTitle
true if the plot title should be displayed.
|
javax.swing.Action |
DUMP_TO_FILE_ACTION
Action to dump the first (0th) renderer's data to a file.
|
protected Renderer |
focusRenderer
returns the Renderer with the current focus.
|
static int |
INFO
These levels are now taken from java.util.logging.Level.
|
static java.lang.String |
PROP_BOTTOMDECORATOR |
static java.lang.String |
PROP_CONTEXT
property where the plot context can be stored.
|
static java.lang.String |
PROP_DISPLAY_CONTEXT
necessary place to put the range of the data actually displayed.
|
static java.lang.String |
PROP_DISPLAYLEGEND
true if the legend should be displayed
|
static java.lang.String |
PROP_DISPLAYTITLE
turns the plot title off or on.
|
static java.lang.String |
PROP_DRAWBACKGROUND
the background should be drawn, if alpha is >0.
|
java.lang.String |
PROP_DRAWDEBUGMESSAGES
draw a purple box in the lower right corner indicating the number
of times each renderer has updated, rendered, and the plot itself
has painted.
|
static java.lang.String |
PROP_DRAWGRID
If true, faint grey lines continue the axis major
ticks across the plot.
|
static java.lang.String |
PROP_DRAWGRIDCOLOR
if not transparent, draw the grid in this color.
|
static java.lang.String |
PROP_DRAWGRIDOVER
if true, then the grid is on top of the data.
|
static java.lang.String |
PROP_DRAWMINORGRID
If true, faint grey lines continue the axis minor
ticks across the plot.
|
static java.lang.String |
PROP_FOCUSRENDERER
property name for the current renderer that the operator has selected.
|
static java.lang.String |
PROP_FONTSIZE |
static java.lang.String |
PROP_ISOTROPIC
true if the x and y scaling (pixel:data) ratio is locked together.
|
static java.lang.String |
PROP_LEGEND_WIDTH_LIMIT_PX |
static java.lang.String |
PROP_LEGENDFONTSIZE |
static java.lang.String |
PROP_LEGENDPOSITION
the location of the legend position, which can be one of the four corners,
or outside and to the right of the plot.
|
static java.lang.String |
PROP_LEGENDRELATIVESIZESIZE
relative font size for the legend.
|
static java.lang.String |
PROP_LINETHICKNESS |
static java.lang.String |
PROP_LOG_LEVEL
the log level for the messages on the screen.
|
static java.lang.String |
PROP_LOG_TIMEOUT_SEC
number of seconds to show the log messages.
|
static java.lang.String |
PROP_LONGTITLES |
static java.lang.String |
PROP_MULTILINETEXTALIGNMENT
property name for multiline labels, the horizontal alignment, where 0 is left, 0.5 is center, and 1.0 is right.
|
static java.lang.String |
PROP_OVERSIZE
boolean property indicating that the data outside the axis
bounds is rendered, to smooth animation when the axis is panned.
|
static java.lang.String |
PROP_PLOTVISIBLE |
static java.lang.String |
PROP_PRINTINGLOGLEVEL
the log level to indicate the log level when printing.
|
static java.lang.String |
PROP_RENDERERS |
static java.lang.String |
PROP_TITLE
title for the plot
|
static java.lang.String |
PROP_TOPDECORATOR |
protected DasPlot.RebinListener |
rebinListener
listens for property changes and triggers the process of updating the plot image.
|
static int |
SEVERE
mark the log message as severe, where an error condition has occurred.
|
protected java.beans.PropertyChangeListener |
ticksListener
listens for x and y axis tick changes, and repaints the plot when
drawing grid lines at tick positions.
|
protected Painter |
topDecorator |
static int |
WARNING
mark the log message as a warning where the operator should be aware.
|
mouseAdapter, PROP_OPAQUEBACKGROUND, PROPERTIES_ACTION
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DasPlot(DasAxis xAxis,
DasAxis yAxis)
create a new plot with the x and y axes.
|
Modifier and Type | Method and Description |
---|---|
static void |
addCustomizer(CustomizerKey key,
Customizer customizer)
Add a new customizer to the collection of customizers being used when creating
new plots.
|
void |
addRenderer(int index,
Renderer rend)
add the renderer to the stack of renderers at the given index.
|
void |
addRenderer(Renderer rend)
add the renderer to the stack of renderers.
|
void |
addToLegend(Renderer renderer,
javax.swing.ImageIcon icon,
int pos,
java.lang.String message)
Add the message to the messages in the legend.
|
protected java.awt.AWTEvent |
coalesceEvents(java.awt.AWTEvent existingEvent,
java.awt.AWTEvent newEvent)
Potentially coalesce an event being posted with an existing
event.
|
boolean |
contains(int x,
int y)
since the plotVisible property can be false and the plot having
no renderers, we want the mouse events to pass on to elements below them.
|
boolean |
containsRenderer(Renderer rend)
return true if the plot contains the renderer.
|
static DasPlot |
createDummyPlot()
provide convenient method for creating a plot.
|
static DasPlot |
createPlot(DatumRange xrange,
DatumRange yrange)
provide convenient method for creating a plot.
|
protected void |
drawContent(java.awt.Graphics2D g)
this is a stub (empty method) that can be overridden to draw content.
|
int |
findRendererAt(int x,
int y)
return the index of the renderer at canvas location (x,y), or -1 if
no renderer is found at the position.
|
java.awt.Shape |
getActiveRegion()
return a Shape containing the plot.
|
protected java.awt.geom.AffineTransform |
getAffineTransform(DasAxis xAxis,
DasAxis yAxis)
returns the AffineTransform to transform data from the last updatePlotImage call
axes (if super.updatePlotImage was called), or null if the transform is not possible.
|
java.awt.Rectangle |
getAxisClip()
return the Rectangle where data is drawn, useful for clipping.
|
Painter |
getBottomDecorator() |
protected java.awt.Rectangle |
getCacheImageBounds()
returns a copy of the position of the cacheImage in the
canvas frame of reference.
|
DatumRange |
getContext()
convenient place to put the plot context.
|
static Customizer |
getCustomizer(CustomizerKey key) |
static java.util.List<CustomizerKey> |
getCustomizerKeys()
Return a list of keys of all current customizing objects in the order they would be invoked.
|
DasColorBar |
getDasColorBar()
return the colorbar associated with this DasPlot.
|
DatumRange |
getDisplayContext() |
java.awt.Color |
getDrawBackground()
return the background color, where alpha=0 (transparent) means don't draw the background.
|
java.awt.Color |
getDrawGridColor() |
Renderer |
getFocusRenderer()
get the current renderer that the operator has selected.
|
java.lang.String |
getFontSize() |
java.lang.String |
getLegendFontSize() |
LegendPosition |
getLegendPosition() |
int |
getLegendRelativeFontSize() |
int |
getLegendWidthLimitPx()
width of plot required to show the legend labels.
|
java.lang.String |
getLineThickness() |
java.util.logging.Level |
getLogLevel() |
int |
getLogTimeoutSec() |
float |
getMultiLineTextAlignment()
get the horizontal alignment for multiline labels, where 0 is left, 0.5 is center, and 1.0 is right.
|
int |
getPaintCount()
get the diagnostic for the number of times the component was asked to paint
itself since the last reset.
|
java.util.logging.Level |
getPrintingLogLevel() |
Renderer |
getRenderer(int index)
return one of the renderers, which paint the data on to the plot.
|
Renderer[] |
getRenderers()
return a list of the renderers, which paint the data on to the plot.
|
java.lang.String |
getTitle()
Returns the title of this plot.
|
Painter |
getTopDecorator() |
protected java.awt.Rectangle |
getUpdateImageBounds()
returns the rectangle that renderers should paint so that when they
are asked to render, they have everything pre-rendered.
|
DasAxis |
getXAxis()
return the x (horizontal) axis.
|
DasAxis |
getYAxis()
return the y (vertical) axis
|
protected void |
installComponent()
currently does nothing.
|
void |
invalidateCacheImage()
mark the dasPlot's cache image as invalid, forcing it to repaint.
|
void |
invalidateCacheImageNoUpdate()
mark the dasPlot's cache image as invalid, but from the update method, so
we don't need to update.
|
boolean |
isCacheImageValid()
introduced to debug Autoplot test018.
|
boolean |
isDisplayLegend()
true if the legend should be displayed
|
boolean |
isDisplayTitle()
return the state of enable/disable display of the title.
|
boolean |
isDrawDebugMessages() |
boolean |
isDrawGrid()
Getter for property drawGrid.
|
boolean |
isDrawGridOver() |
boolean |
isDrawMinorGrid()
Get the value of drawMinorGrid
|
boolean |
isIsotropic() |
boolean |
isLongTitles()
long titles means it won't clip at the axis bounds, at the risk of affecting codes which expect the old boundaries.
|
boolean |
isOverSize() |
boolean |
isPlotVisible() |
boolean |
isPreviewEnabled()
true if the data rendering will be scaled immediately to indicate
axis state changes.
|
protected void |
paintComponent(java.awt.Graphics graphics0) |
void |
postException(Renderer renderer,
java.lang.Exception exception)
notify user of an exception, in the context of the plot.
|
void |
postMessage(Renderer renderer,
java.lang.String message,
int messageType,
Datum x,
Datum y)
Notify user of an exception, in the context of the plot.
|
void |
postMessage(Renderer renderer,
java.lang.String message,
java.util.logging.Level messageLevel,
Datum x,
Datum y)
Notify user of an exception, in the context of the plot.
|
protected void |
printComponent(java.awt.Graphics g)
we need to call each renderer's updatePlotImage method, otherwise we assume
the session is interactive.
|
protected void |
processEvent(java.awt.AWTEvent e)
Processes events occurring on this component.
|
void |
releaseAll()
In Autoplot, we need a way to get help releasing all resources.
|
static void |
removeCustomizer(CustomizerKey key)
Remove the customizer that is associated with the given key.
|
void |
removeRenderer(Renderer rend)
remove the renderer from the stack of renderers.
|
void |
removeRenderers()
remove all the renderers from the dasPlot.
|
void |
repaint()
request that the plot be repainted.
|
void |
resetPaintCount()
reset the paint counter.
|
void |
resize()
recalculate the bounds of the component.
|
void |
setAxisPlotVisible(boolean visible)
set the visibility of both the plot and its x and y axes.
|
void |
setBottomDecorator(Painter bottomDecorator)
add additional painting code to the renderer, which is called after
the renderer is called.
|
protected void |
setCacheImageBounds(java.awt.Rectangle cacheImageBounds)
there's a deadlock that shows with test140 on ci-pw if this is synchronized.
|
void |
setContext(DatumRange context)
convenient place to put the plot context.
|
void |
setDisplayContext(DatumRange displayContext)
set the property
|
void |
setDisplayLegend(boolean displayLegend)
true if the legend should be displayed
|
void |
setDisplayTitle(boolean v)
enable/disable display of the title.
|
void |
setDrawBackground(java.awt.Color drawBackground)
if not transparent, draw this background first.
|
void |
setDrawDebugMessages(boolean v) |
void |
setDrawGrid(boolean drawGrid)
Setter for property drawGrid.
|
void |
setDrawGridColor(java.awt.Color drawGridColor)
if not transparent, draw the grid in this color.
|
void |
setDrawGridOver(boolean gridOver) |
void |
setDrawMinorGrid(boolean newdrawMinorGrid)
Set the value of drawMinorGrid
|
void |
setEnableRenderPropertiesAction(boolean b)
add or remove the menu item to get at the renderer properties.
|
void |
setFocusRenderer(Renderer focusRenderer)
set the current renderer that the operator has selected.
|
void |
setFontSize(java.lang.String fontSize)
set the font size, with respect to the canvas font.
|
void |
setIsotropic(boolean isotropic)
set the property value
|
void |
setLegendFontSize(java.lang.String legendFontSize)
set the font size for the legend, using the conventions where 1em is
the parent's font size:
1em same as plot font.
|
void |
setLegendPosition(LegendPosition newlegendPosition) |
void |
setLegendRelativeFontSize(int size)
set the relative size of the legend element text.
|
void |
setLegendWidthLimitPx(int legendWidthLimitPx)
width of plot required to show the legend labels.
|
void |
setLineThickness(java.lang.String lineThickness)
set the thickness of the lines drawn.
|
void |
setLogLevel(java.util.logging.Level level) |
void |
setLogTimeoutSec(int logTimeoutSec) |
void |
setLongTitles(boolean longTitles)
long titles means it won't clip at the axis bounds, at the risk of affecting codes which expect the old boundaries.
|
void |
setMultiLineTextAlignment(float multiLineTextAlignment)
set the horizontal alignment for multiline labels, where 0 is left, 0.5 is center, and 1.0 is right.
|
void |
setOverSize(boolean overSize) |
void |
setPlotVisible(boolean plotVisible) |
void |
setPreviewEnabled(boolean preview)
if true then the data rendering will be scaled immediately to indicate
axis state changes.
|
void |
setPrintingLogLevel(java.util.logging.Level printingLogLevel) |
void |
setReduceOutsideLegendTopMargin(boolean reduceOutsideLegendTopMargin)
Used at APL for layout.
|
void |
setTitle(java.lang.String t)
Sets the title which will be displayed above this plot.
|
void |
setTopDecorator(Painter topDecorator)
add additional painting code to the renderer, which is called after
the renderer is called.
|
void |
setXAxis(DasAxis xAxis)
set the x axis.
|
void |
setYAxis(DasAxis yAxis)
Attaches a new axis to the plot.
|
protected void |
uninstallComponent()
remove the component row and column update listener.
|
protected void |
updateImmediately()
This method is called when a DasUpdateEvent is processed.
|
acceptContext, addMouseModule, getActions, getCanvas, getColumn, getDasMouseInputAdapter, getDasName, getEmSize, getFont, getLineThicknessDouble, getRow, isOpaqueBackground, processDasUpdateEvent, removeMouseModule, setColumn, setDasName, setOpaqueBackground, setRow, showProperties, toString, update
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PROP_LEGEND_WIDTH_LIMIT_PX
public static final java.lang.String PROP_TITLE
protected boolean displayTitle
protected DasPlot.RebinListener rebinListener
protected transient java.beans.PropertyChangeListener ticksListener
protected Renderer focusRenderer
public static final java.lang.String PROP_FOCUSRENDERER
public static final java.lang.String PROP_MULTILINETEXTALIGNMENT
public javax.swing.Action DUMP_TO_FILE_ACTION
public static final int INFO
public static final int WARNING
public static final int SEVERE
public static final java.lang.String PROP_DISPLAYTITLE
protected Painter bottomDecorator
public static final java.lang.String PROP_BOTTOMDECORATOR
protected Painter topDecorator
public static final java.lang.String PROP_TOPDECORATOR
public static final java.lang.String PROP_CONTEXT
public static final java.lang.String PROP_DISPLAY_CONTEXT
public static final java.lang.String PROP_RENDERERS
public static final java.lang.String PROP_LEGENDPOSITION
public static final java.lang.String PROP_LEGENDRELATIVESIZESIZE
public static final java.lang.String PROP_LEGENDFONTSIZE
public static final java.lang.String PROP_FONTSIZE
public static final java.lang.String PROP_DISPLAYLEGEND
public static final java.lang.String PROP_DRAWBACKGROUND
public static final java.lang.String PROP_DRAWGRIDCOLOR
public static final java.lang.String PROP_DRAWGRID
public static final java.lang.String PROP_DRAWMINORGRID
public static final java.lang.String PROP_DRAWGRIDOVER
public static final java.lang.String PROP_LINETHICKNESS
public static final java.lang.String PROP_PLOTVISIBLE
public static final java.lang.String PROP_OVERSIZE
public static final java.lang.String PROP_LONGTITLES
public static final java.lang.String PROP_LOG_LEVEL
public static final java.lang.String PROP_PRINTINGLOGLEVEL
public static final java.lang.String PROP_LOG_TIMEOUT_SEC
public static final java.lang.String PROP_ISOTROPIC
public java.lang.String PROP_DRAWDEBUGMESSAGES
public static java.util.List<CustomizerKey> getCustomizerKeys()
public static void addCustomizer(CustomizerKey key, Customizer customizer)
key
- the new customizer's lookup keycustomizer
- the new customizerpublic static Customizer getCustomizer(CustomizerKey key)
public static void removeCustomizer(CustomizerKey key)
key
- the key to the customizer to be removed.public int getLegendWidthLimitPx()
public void setLegendWidthLimitPx(int legendWidthLimitPx)
legendWidthLimitPx
- public Renderer getFocusRenderer()
public void setFocusRenderer(Renderer focusRenderer)
focusRenderer
- the current renderer that the operator has selected.public float getMultiLineTextAlignment()
public void setMultiLineTextAlignment(float multiLineTextAlignment)
multiLineTextAlignment
- the alignmentpublic int findRendererAt(int x, int y)
x
- the x position on the canvas.y
- the y position on the canvas. Note 0,0 is the upper left corner.public void setXAxis(DasAxis xAxis)
xAxis
- a horizontal axis.public void setYAxis(DasAxis yAxis)
yAxis
- a vertical axis.protected void updateImmediately()
DasCanvasComponent
updateImmediately
in class DasCanvasComponent
protected java.awt.geom.AffineTransform getAffineTransform(DasAxis xAxis, DasAxis yAxis)
xAxis
- the xaxis of the target coordinate frameyAxis
- the yaxis of the target coordinate frameprotected void printComponent(java.awt.Graphics g)
printComponent
in class javax.swing.JComponent
g
- Java2D graphics context.public java.awt.Rectangle getAxisClip()
DasDevicePosition.toRectangle(org.das2.graph.DasRow, org.das2.graph.DasColumn)
protected void paintComponent(java.awt.Graphics graphics0)
paintComponent
in class javax.swing.JComponent
public void setEnableRenderPropertiesAction(boolean b)
b
- false to remove the menu item if it has been added.public void releaseAll()
public void postMessage(Renderer renderer, java.lang.String message, int messageType, Datum x, Datum y)
renderer
- identifies the renderer posting the exceptionmessage
- the text to be displayed, may contain granny text.messageType
- DasPlot.INFO, DasPlot.WARNING, or DasPlot.SEVERE. (SEVERE was ERROR before)x
- if non-null, the location on the x axis giving context for the text.y
- if non-null, the location on the y axis giving context for the text.public void postMessage(Renderer renderer, java.lang.String message, java.util.logging.Level messageLevel, Datum x, Datum y)
renderer
- identifies the renderer posting the exceptionmessage
- the text to be displayed, may contain granny text.messageLevel
- allows java.util.logging.Level to be used, for example Level.INFO, Level.WARNING, and Level.SEVEREx
- if non-null, the location on the x axis giving context for the text.y
- if non-null, the location on the y axis giving context for the text.public void postException(Renderer renderer, java.lang.Exception exception)
renderer
- the renderer posting the exception.exception
- the exception to post.public void addToLegend(Renderer renderer, javax.swing.ImageIcon icon, int pos, java.lang.String message)
renderer
- identifies the renderer adding to the legendicon
- if non-null, an icon to use. If null, the renderer's icon is used.pos
- integer order parameter, and also identifies item.message
- String message to display.public void setReduceOutsideLegendTopMargin(boolean reduceOutsideLegendTopMargin)
reduceOutsideLegendTopMargin
- shift the Y position.protected void drawContent(java.awt.Graphics2D g)
g
- the graphics context.DasCanvas.addTopDecorator(org.das2.graph.Painter)
public void resize()
resize
in class DasCanvasComponent
public void setTitle(java.lang.String t)
t
- The new title for this plot.setDisplayTitle(boolean)
public java.lang.String getTitle()
setTitle(String)
public boolean isDisplayTitle()
setDisplayTitle(boolean)
public void setDisplayTitle(boolean v)
v
- true if the title should be displayed.isDisplayTitle()
public Painter getBottomDecorator()
public void setBottomDecorator(Painter bottomDecorator)
bottomDecorator
- the Painter to call, or null to clear.public Painter getTopDecorator()
public void setTopDecorator(Painter topDecorator)
topDecorator
- the Painter to call, or null to clear.public DatumRange getContext()
setContext(org.das2.datum.DatumRange)
public void setContext(DatumRange context)
context
- the contextgetContext()
public DatumRange getDisplayContext()
PROP_DISPLAY_CONTEXT
public void setDisplayContext(DatumRange displayContext)
displayContext
- null or the display context.PROP_DISPLAY_CONTEXT
public DasAxis getXAxis()
public DasAxis getYAxis()
public DasColorBar getDasColorBar()
protected void installComponent()
DasCanvasComponent
installComponent
in class DasCanvasComponent
protected void uninstallComponent()
DasCanvasComponent
uninstallComponent
in class DasCanvasComponent
public void addRenderer(Renderer rend)
rend
- the rendererpublic void addRenderer(int index, Renderer rend)
index
- the index, 0 is drawn first.rend
- the rendererpublic void removeRenderer(Renderer rend)
rend
- the rendererpublic boolean contains(int x, int y)
contains
in class javax.swing.JComponent
x
- the mouse xy
- the mouse ypublic boolean containsRenderer(Renderer rend)
rend
- the rendererpublic void removeRenderers()
public static DasPlot createDummyPlot()
DasCanvas c= new DasCanvas(400,400); DasPlot p= DasPlot.createDummyPlot( ); c.add(p,DasRow.create(c,0,1),DasColumn.create(c,0,1)); JOptionPane.showConfirmDialog(None,c)
public static DasPlot createPlot(DatumRange xrange, DatumRange yrange)
DasCanvas c= new DasCanvas(400,400); DasPlot p= DasPlot.createPlot( DatumRangeUtil.parseTimeRange('2001'),DatumRange.newDatumRange(0,10,Units.dimensionless) ); c.add(p,DasRow.create(c,0,1),DasColumn.create(c,0,1)); JOptionPane.showConfirmDialog(None,c)
xrange
- the range for the x axis.yrange
- the range for the y axispublic Renderer getRenderer(int index)
index
- the index of the rendererpublic Renderer[] getRenderers()
public java.awt.Shape getActiveRegion()
getActiveRegion
in class DasCanvasComponent
protected java.awt.AWTEvent coalesceEvents(java.awt.AWTEvent existingEvent, java.awt.AWTEvent newEvent)
EventQueue.postEvent
if an event with the same ID as the event to be posted is found in
the queue (both events must have this component as their source).
This method either returns a coalesced event which replaces
the existing event (and the new event is then discarded), or
null
to indicate that no combining should be done
(add the second event to the end of the queue). Either event
parameter may be modified and returned, as the other one is discarded
unless null
is returned.
This implementation of coalesceEvents
coalesces
DasUpdateEvent
s, returning the existingEvent parameter
coalesceEvents
in class DasCanvasComponent
existingEvent
- the event already on the EventQueue
newEvent
- the event being posted to the
EventQueue
null
indicating that no
coalescing was doneprotected void processEvent(java.awt.AWTEvent e)
process<event type>Event
method for the given class of event.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent
in class DasCanvasComponent
e
- the eventComponent.processComponentEvent(java.awt.event.ComponentEvent)
,
Component.processFocusEvent(java.awt.event.FocusEvent)
,
Component.processKeyEvent(java.awt.event.KeyEvent)
,
Component.processMouseEvent(java.awt.event.MouseEvent)
,
Component.processMouseMotionEvent(java.awt.event.MouseEvent)
,
Component.processInputMethodEvent(java.awt.event.InputMethodEvent)
,
Component.processHierarchyEvent(java.awt.event.HierarchyEvent)
,
Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent)
,
DasCanvasComponent.processDasUpdateEvent(org.das2.event.DasUpdateEvent)
public void repaint()
repaint
in class java.awt.Component
public void invalidateCacheImage()
public void invalidateCacheImageNoUpdate()
public boolean isCacheImageValid()
public LegendPosition getLegendPosition()
PROP_LEGENDPOSITION
,
LegendPosition
public void setLegendPosition(LegendPosition newlegendPosition)
newlegendPosition
- the legend positionPROP_LEGENDPOSITION
public int getLegendRelativeFontSize()
PROP_LEGENDRELATIVESIZESIZE
public void setLegendRelativeFontSize(int size)
size
- relative size in points.PROP_LEGENDRELATIVESIZESIZE
public java.lang.String getLegendFontSize()
public void setLegendFontSize(java.lang.String legendFontSize)
legendFontSize
- setFontSize(java.lang.String)
public java.lang.String getFontSize()
public void setFontSize(java.lang.String fontSize)
fontSize
- public boolean isDisplayLegend()
public void setDisplayLegend(boolean displayLegend)
displayLegend
- true if the legend should be displayeddrawLegend(java.awt.Graphics2D, java.util.List)
public java.awt.Color getDrawBackground()
public void setDrawBackground(java.awt.Color drawBackground)
drawBackground
- the background, or a color with no opacity (new Color(0,0,0,0)) to turn off.public java.awt.Color getDrawGridColor()
PROP_DRAWGRIDCOLOR
public void setDrawGridColor(java.awt.Color drawGridColor)
drawGridColor
- the colorpublic boolean isDrawGrid()
public void setDrawGrid(boolean drawGrid)
drawGrid
- New value of property drawGrid.public boolean isDrawMinorGrid()
PROP_DRAWMINORGRID
public void setDrawMinorGrid(boolean newdrawMinorGrid)
newdrawMinorGrid
- new value of drawMinorGridpublic boolean isDrawGridOver()
PROP_DRAWGRIDOVER
public void setDrawGridOver(boolean gridOver)
gridOver
- if the grid is on top of the data.PROP_DRAWGRIDOVER
public java.lang.String getLineThickness()
public void setLineThickness(java.lang.String lineThickness)
lineThickness
- public void setPreviewEnabled(boolean preview)
preview
- true if preview should be enabled.public boolean isPreviewEnabled()
public void setAxisPlotVisible(boolean visible)
visible
- false if the x and y axes, and the plot is visisble.public boolean isPlotVisible()
public void setPlotVisible(boolean plotVisible)
public boolean isOverSize()
PROP_OVERSIZE
public void setOverSize(boolean overSize)
overSize
- true means draw outside the axis bounds.PROP_OVERSIZE
public boolean isLongTitles()
public void setLongTitles(boolean longTitles)
longTitles
- public void setLogLevel(java.util.logging.Level level)
level
- where Level.INFO is the default.PROP_LOG_LEVEL
public java.util.logging.Level getLogLevel()
PROP_LOG_LEVEL
public java.util.logging.Level getPrintingLogLevel()
PROP_PRINTINGLOGLEVEL
public void setPrintingLogLevel(java.util.logging.Level printingLogLevel)
printingLogLevel
- where Level.ALL is the default.PROP_PRINTINGLOGLEVEL
public int getLogTimeoutSec()
PROP_LOG_TIMEOUT_SEC
public void setLogTimeoutSec(int logTimeoutSec)
logTimeoutSec
- the property valuePROP_LOG_TIMEOUT_SEC
public boolean isIsotropic()
PROP_ISOTROPIC
public void setIsotropic(boolean isotropic)
isotropic
- property valuePROP_ISOTROPIC
protected java.awt.Rectangle getUpdateImageBounds()
which does not recalculate.
protected java.awt.Rectangle getCacheImageBounds()
protected void setCacheImageBounds(java.awt.Rectangle cacheImageBounds)
cacheImageBounds
- https://ci-pw.physics.uiowa.edu/job/autoplot-test140
public int getPaintCount()
public void resetPaintCount()
public void setDrawDebugMessages(boolean v)
v
- true if the messages should be shown.PROP_DRAWDEBUGMESSAGES
public boolean isDrawDebugMessages()
PROP_DRAWDEBUGMESSAGES