public class ViewerPanel extends AbstractViewerPanel implements OverlayRenderer, PainterThread.Paintable, ViewerStateChangeListener
Sources. The panel contains a
canvas and a time slider (if there
are multiple time-points). Maintains a render state, the
renderer, and basic navigation help overlays. It has it's own
PainterThread for painting, which is started on construction (use
to stop the PainterThread.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ViewerPanel.RenderThreadFactory |
AbstractViewerPanel.AlignPlane, AbstractViewerPanel.MouseCoordinateListenerJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected static AtomicInteger |
panelNumber |
mouseCoordinateslistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ViewerPanel(List<SourceAndConverter<?>> sources,
int numTimePoints,
CacheControl cacheControl) |
ViewerPanel(List<SourceAndConverter<?>> sources,
int numTimepoints,
CacheControl cacheControl,
ViewerOptions optional) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(SourceGroup group)
Deprecated.
Modify
state() directly |
void |
addInterpolationModeListener(InterpolationModeListener listener)
Deprecated.
Use
interpolationModeListeners().add( listener ). |
void |
addOverlayAnimator(OverlayAnimator animator)
Add a new
OverlayAnimator to the list of animators. |
void |
addRenderTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
Deprecated.
Use
renderTransformListeners().add( listener ). |
void |
addRenderTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener,
int index)
Deprecated.
Use
renderTransformListeners().add( index, listener ). |
void |
addSource(SourceAndConverter<?> sourceAndConverter)
Deprecated.
Modify
state() directly |
void |
addSources(Collection<SourceAndConverter<?>> sourceAndConverter)
Deprecated.
Modify
state() directly |
void |
addTimePointListener(TimePointListener listener)
Deprecated.
Use
timePointListeners().add( listener ). |
void |
addTimePointListener(TimePointListener listener,
int index)
Deprecated.
Use
timePointListeners().add( index, listener ). |
void |
addTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
Deprecated.
Use
transformListeners().add( listener ). |
void |
addTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener,
int index)
Deprecated.
Use
transformListeners().add( index, listener ). |
void |
displayToGlobalCoordinates(double[] gPos)
Set
gPos to the display coordinates at gPos transformed into the
global coordinate system. |
void |
displayToGlobalCoordinates(double x,
double y,
net.imglib2.RealPositionable gPos)
Set
gPos to the display coordinates (x,y,0)T transformed into the
global coordinate system. |
<P extends net.imglib2.RealLocalizable & net.imglib2.RealPositionable> |
displayToGlobalCoordinates(P gPos)
Set
gPos to the display coordinates at gPos transformed into the
global coordinate system. |
void |
drawOverlays(Graphics g)
Render overlays.
|
InteractiveDisplayCanvas |
getDisplay()
Get the viewer canvas.
|
Component |
getDisplayComponent()
Get the AWT
Component of the viewer canvas. |
org.scijava.ui.behaviour.io.InputTriggerConfig |
getInputTriggerConfig() |
ViewerOptions.Values |
getOptionValues() |
SourceInfoOverlayRenderer |
getSourceInfoOverlayRenderer() |
ViewerState |
getState()
Deprecated.
Use
state() instead.
Get a copy of the current ViewerState. |
TransformEventHandler |
getTransformEventHandler() |
VisibilityAndGrouping |
getVisibilityAndGrouping()
Deprecated.
Modify
state() directly
Returns the VisibilityAndGrouping that can be used to modify
visibility and currentness of sources and groups, as well as grouping of
sources, and display mode. |
org.scijava.listeners.Listeners<InterpolationModeListener> |
interpolationModeListeners()
Add/remove
InterpolationModeListener to notify when the interpolation
mode is changed.. |
void |
nextTimePoint()
Show the next time-point.
|
protected void |
onMouseMoved() |
void |
paint()
This is called by the painter thread to repaint the display.
|
void |
previousTimePoint()
Show the previous time-point.
|
void |
removeAllSources()
Deprecated.
Modify
state() directly |
void |
removeGroup(SourceGroup group)
Deprecated.
Modify
state() directly |
void |
removeInterpolationModeListener(InterpolationModeListener listener)
Deprecated.
Use
interpolationModeListeners().remove( listener ). |
void |
removeSource(Source<?> source)
Deprecated.
Modify
state() directly |
void |
removeSources(Collection<Source<?>> sources)
Deprecated.
Modify
state() directly |
void |
removeTimePointListener(TimePointListener listener)
Deprecated.
Use
timePointListeners().remove( listener ). |
void |
removeTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
Deprecated.
Use
transformListeners().remove( listener ) or
renderTransformListeners().remove( listener ) (whichever the listener was added to). |
org.scijava.listeners.Listeners<TransformListener<net.imglib2.realtransform.AffineTransform3D>> |
renderTransformListeners()
Add/remove
TransformListeners to notify about viewer transformation
changes. |
void |
requestRepaint()
Repaint as soon as possible.
|
void |
requestRepaint(net.imglib2.Interval screenInterval) |
void |
setCurrentViewerTransform(net.imglib2.realtransform.AffineTransform3D viewerTransform)
Deprecated.
Modify
state() directly (state().setViewerTransform(t)) |
void |
setDisplayMode(DisplayMode displayMode)
Set the
DisplayMode. |
void |
setInterpolation(Interpolation mode)
Set the
Interpolation mode. |
void |
setNumTimepoints(int numTimepoints)
Set the number of available timepoints.
|
void |
setTimepoint(int timepoint)
Show the specified time-point.
|
void |
setTransformAnimator(AbstractTransformAnimator animator) |
DebugTilingOverlay |
showDebugTileOverlay()
Display overlay to show how the display is tiled for rendering.
|
void |
showMessage(String msg)
Display the specified message in a text overlay for a short time.
|
SynchronizedViewerState |
state()
Get the ViewerState.
|
void |
stateFromXml(org.jdom2.Element parent) |
org.jdom2.Element |
stateToXml() |
void |
stop()
Stop the
painterThread and shutdown rendering ExecutorService. |
org.scijava.listeners.Listeners<TimePointListener> |
timePointListeners()
Add/remove
TimePointListener to notify about time-point
changes. |
void |
toggleInterpolation()
Switch to next interpolation mode.
|
org.scijava.listeners.Listeners<TransformListener<net.imglib2.realtransform.AffineTransform3D>> |
transformListeners()
Add/remove
TransformListeners to notify about viewer transformation
changes. |
void |
viewerStateChanged(ViewerStateChange change) |
align, getGlobalMouseCoordinates, getMouseCoordinates, requestFocusInWindowgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, paint, 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, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetCanvasSizeprotected static final AtomicInteger panelNumber
public ViewerPanel(List<SourceAndConverter<?>> sources, int numTimePoints, CacheControl cacheControl)
public ViewerPanel(List<SourceAndConverter<?>> sources, int numTimepoints, CacheControl cacheControl, ViewerOptions optional)
sources - the sources to display.numTimepoints - number of available timepoints.cacheControl - to control IO budgeting and fetcher queue.optional - optional parameters. See ViewerOptions.options().@Deprecated public void addSource(SourceAndConverter<?> sourceAndConverter)
state() directly@Deprecated public void addSources(Collection<SourceAndConverter<?>> sourceAndConverter)
state() directly@Deprecated public void removeSource(Source<?> source)
state() directly@Deprecated public void removeSources(Collection<Source<?>> sources)
state() directly@Deprecated public void removeAllSources()
state() directly@Deprecated public void addGroup(SourceGroup group)
state() directly@Deprecated public void removeGroup(SourceGroup group)
state() directlypublic void displayToGlobalCoordinates(double[] gPos)
gPos to the display coordinates at gPos transformed into the
global coordinate system.gPos - is set to the corresponding global coordinates.public <P extends net.imglib2.RealLocalizable & net.imglib2.RealPositionable> void displayToGlobalCoordinates(P gPos)
gPos to the display coordinates at gPos transformed into the
global coordinate system.gPos - is set to the corresponding global coordinates.public void displayToGlobalCoordinates(double x,
double y,
net.imglib2.RealPositionable gPos)
gPos to the display coordinates (x,y,0)T transformed into the
global coordinate system.gPos - is set to the global coordinates at display (x,y,0)T.public void paint()
PainterThread.Paintablepaint in interface PainterThread.Paintablepublic void requestRepaint()
requestRepaint in interface RequestRepaintpublic void requestRepaint(net.imglib2.Interval screenInterval)
protected void onMouseMoved()
onMouseMoved in class AbstractViewerPanelpublic void drawOverlays(Graphics g)
OverlayRendererdrawOverlays in interface OverlayRendererpublic void viewerStateChanged(ViewerStateChange change)
viewerStateChanged in interface ViewerStateChangeListenerpublic void setTransformAnimator(AbstractTransformAnimator animator)
setTransformAnimator in class AbstractViewerPanelpublic void toggleInterpolation()
public void setInterpolation(Interpolation mode)
Interpolation mode.public void setDisplayMode(DisplayMode displayMode)
DisplayMode.@Deprecated public void setCurrentViewerTransform(net.imglib2.realtransform.AffineTransform3D viewerTransform)
state() directly (state().setViewerTransform(t))public void setTimepoint(int timepoint)
timepoint - time-point index.public void nextTimePoint()
public void previousTimePoint()
public void setNumTimepoints(int numTimepoints)
numTimepoints == 1
this will hide the time slider, otherwise show it. If the currently
displayed timepoint would be out of range with the new number of
timepoints, the current timepoint is set to numTimepoints - 1.
This is equivalent to state().setNumTimepoints(numTimepoints}.
numTimepoints - number of available timepoints. Must be >= 1.@Deprecated public ViewerState getState()
state() instead.
Get a copy of the current ViewerState.ViewerState.public SynchronizedViewerState state()
SynchronizedViewerState for
thread-safety considerations.state in class AbstractViewerPanelpublic InteractiveDisplayCanvas getDisplay()
getDisplay in class AbstractViewerPanelpublic Component getDisplayComponent()
Component of the viewer canvas.getDisplayComponent in class AbstractViewerPanelpublic TransformEventHandler getTransformEventHandler()
public void showMessage(String msg)
showMessage in class AbstractViewerPanelmsg - String to display. Should be just one line of text.public void addOverlayAnimator(OverlayAnimator animator)
OverlayAnimator to the list of animators. The animation
is immediately started. The new OverlayAnimator will remain in
the list of animators until it OverlayAnimator.isComplete().addOverlayAnimator in class AbstractViewerPanelanimator - animator to add.public org.scijava.listeners.Listeners<InterpolationModeListener> interpolationModeListeners()
InterpolationModeListener to notify when the interpolation
mode is changed.. Listeners will be notified before calling
requestRepaint() so they have the chance to interfere.@Deprecated public void addInterpolationModeListener(InterpolationModeListener listener)
interpolationModeListeners().add( listener ).@Deprecated public void removeInterpolationModeListener(InterpolationModeListener listener)
interpolationModeListeners().remove( listener ).public org.scijava.listeners.Listeners<TransformListener<net.imglib2.realtransform.AffineTransform3D>> renderTransformListeners()
TransformListeners to notify about viewer transformation
changes. Listeners will be notified when a new image has been painted
with the viewer transform used to render that image.
This happens immediately after that image is painted onto the screen, before any overlays are painted.
renderTransformListeners in class AbstractViewerPanel@Deprecated public void addRenderTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
renderTransformListeners().add( listener ).@Deprecated public void addRenderTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener, int index)
renderTransformListeners().add( index, listener ).public org.scijava.listeners.Listeners<TransformListener<net.imglib2.realtransform.AffineTransform3D>> transformListeners()
TransformListeners to notify about viewer transformation
changes. Listeners will be notified before calling
requestRepaint() so they have the chance to interfere.transformListeners in class AbstractViewerPanel@Deprecated public void addTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
transformListeners().add( listener ).@Deprecated public void addTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener, int index)
transformListeners().add( index, listener ).@Deprecated public void removeTransformListener(TransformListener<net.imglib2.realtransform.AffineTransform3D> listener)
transformListeners().remove( listener ) or
renderTransformListeners().remove( listener ) (whichever the listener was added to).public org.scijava.listeners.Listeners<TimePointListener> timePointListeners()
TimePointListener to notify about time-point
changes. Listeners will be notified before calling
requestRepaint() so they have the chance to interfere.@Deprecated public void addTimePointListener(TimePointListener listener)
timePointListeners().add( listener ).@Deprecated public void addTimePointListener(TimePointListener listener, int index)
timePointListeners().add( index, listener ).@Deprecated public void removeTimePointListener(TimePointListener listener)
timePointListeners().remove( listener ).public org.jdom2.Element stateToXml()
public void stateFromXml(org.jdom2.Element parent)
@Deprecated public VisibilityAndGrouping getVisibilityAndGrouping()
state() directly
Returns the VisibilityAndGrouping that can be used to modify
visibility and currentness of sources and groups, as well as grouping of
sources, and display mode.public ViewerOptions.Values getOptionValues()
public org.scijava.ui.behaviour.io.InputTriggerConfig getInputTriggerConfig()
getInputTriggerConfig in class AbstractViewerPanelpublic SourceInfoOverlayRenderer getSourceInfoOverlayRenderer()
public void stop()
painterThread and shutdown rendering ExecutorService.public DebugTilingOverlay showDebugTileOverlay()
Copyright © 2012–2025 BigDataViewer. All rights reserved.