O
- The type of object to be visualisedpublic class XYPlotVisualisation<O> extends VisualisationImpl<List<XYPlotVisualisation.LocatedObject<O>>>
AxesRenderer2D
to determine the scale of the visualisation.Modifier and Type | Class and Description |
---|---|
static class |
XYPlotVisualisation.LocatedObject<O>
Class that locates an object.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected AxesRenderer2D<Float[],MBFImage> |
axesRenderer2D
The renderer for the axes
|
protected ItemPlotter<O,Float[],MBFImage> |
plotter
The item plotter to use
|
clearBeforeDraw, data, visImage
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XYPlotVisualisation(int width,
int height)
Constructor that provides the width and height of the visualisation and a null plotter
|
XYPlotVisualisation(int width,
int height,
ItemPlotter<O,Float[],MBFImage> plotter)
Constructor that provides the width and height of the visualisation.
|
XYPlotVisualisation(ItemPlotter<O,Float[],MBFImage> plotter)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double x,
double y,
O object)
Add an object to the plot
|
void |
beforeAxesRender(MBFImage visImage,
AxesRenderer2D<Float[],MBFImage> renderer)
A method that can be overridden to plot something prior to the axes being
drawn.
|
void |
clearData()
Clear the data list.
|
AxesRenderer2D<Float[],MBFImage> |
getAxesRenderer()
Provides access to the underlying axes renderer so that various changes
can be made to the visualisation.
|
boolean |
isAutoPositionXAxis() |
boolean |
isAutoScaleAxes() |
boolean |
isRenderAxesLast() |
void |
removePoint(O object)
Remove a specific object
|
void |
setAutoPositionXAxis(boolean autoPositionXAxis) |
void |
setAutoScaleAxes(boolean autoScaleAxes) |
void |
setData(List<XYPlotVisualisation.LocatedObject<O>> data)
Set the data to be visualised.
|
void |
setItemPlotter(ItemPlotter<O,Float[],MBFImage> plotter)
Set the plotter
|
void |
setRenderAxesLast(boolean renderAxesLast) |
void |
update()
Called to update the visualisation.
|
protected void |
validateData()
Set up the min/max of the axes based on the data.
|
addOverlay, componentHidden, componentMoved, componentResized, componentShown, getRequiredSize, getVisualisationImage, isAllowResize, newVisualisationAvailable, paint, removeOverlay, setAllowResize, setClearBeforeDraw, setRequiredSize, showWindow, update, updateVis, updateVis
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, 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
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, processEvent, 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, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, 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, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected final AxesRenderer2D<Float[],MBFImage> axesRenderer2D
protected ItemPlotter<O,Float[],MBFImage> plotter
public XYPlotVisualisation(ItemPlotter<O,Float[],MBFImage> plotter)
plotter
- The item plotter to usepublic XYPlotVisualisation(int width, int height, ItemPlotter<O,Float[],MBFImage> plotter)
width
- Width of the vis in pixelsheight
- Height of the vis in pixelsplotter
- The item plotter to usepublic XYPlotVisualisation(int width, int height)
width
- Width of the vis in pixelsheight
- Height of the vis in pixelspublic void update()
visImage
member to be available and of the correct size.
The method simply needs to draw the visualisation to this MBFImage
.
You should wrap any drawing code in a synchronized block, synchronized on
the visImage - this stops the image being repainted to the screen half way
through drawing.
Update is called from the paint() method so should ideally not force a repaint() as this will call a continuous repaint loop.
update
in class VisualisationImpl<List<XYPlotVisualisation.LocatedObject<O>>>
VisualisationImpl.update()
public void beforeAxesRender(MBFImage visImage, AxesRenderer2D<Float[],MBFImage> renderer)
visImage
- The image to draw torenderer
- The axes rendererpublic void addPoint(double x, double y, O object)
x
- x location of data pointy
- y location of data pointobject
- The objectpublic void removePoint(O object)
object
- The objectpublic void setItemPlotter(ItemPlotter<O,Float[],MBFImage> plotter)
plotter
- The plotterpublic AxesRenderer2D<Float[],MBFImage> getAxesRenderer()
public void clearData()
public void setData(List<XYPlotVisualisation.LocatedObject<O>> data)
setData
in interface Visualisation<List<XYPlotVisualisation.LocatedObject<O>>>
setData
in class VisualisationImpl<List<XYPlotVisualisation.LocatedObject<O>>>
data
- The data to be visualisedVisualisationImpl.setData(java.lang.Object)
protected void validateData()
public boolean isAutoScaleAxes()
public void setAutoScaleAxes(boolean autoScaleAxes)
autoScaleAxes
- the autoScaleAxes to setpublic boolean isAutoPositionXAxis()
public void setAutoPositionXAxis(boolean autoPositionXAxis)
autoPositionXAxis
- the autoPositionXAxis to setpublic boolean isRenderAxesLast()
public void setRenderAxesLast(boolean renderAxesLast)
renderAxesLast
- the renderAxesLast to set