public class Canvas2D extends IcyCanvas2D implements ROITask.ROITaskListener
| Modifier and Type | Class and Description |
|---|---|
class |
Canvas2D.CanvasMap |
class |
Canvas2D.CanvasView |
PROPERTY_LAYERS_VISIBLETOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Modifier and Type | Method and Description |
|---|---|
void |
centerOn(java.awt.Rectangle region)
Adjust view position and possibly scaling factor to ensure the specified region become visible.
|
void |
centerOnImage(double x,
double y)
Center image on specified image position in canvas
|
void |
changed(IcyCanvasEvent event)
canvas changed (packed event).
|
void |
customizeToolbar(javax.swing.JToolBar toolBar)
Called by the parent viewer when building the toolbar.
|
void |
fitCanvasToImage()
Change canvas size (so viewer size) to get it fit with image dimension if possible
|
void |
fitImageToCanvas()
Change scale so image fit in canvas view dimension
|
void |
fitImageToCanvas(boolean smooth)
Change zoom so image fit in canvas view dimension
|
java.awt.image.BufferedImage |
getARGBImage(int t,
int z,
int c,
java.awt.image.BufferedImage out)
Return an ARGB BufferedImage form of the image located at position [T, Z, C].
|
java.awt.Color |
getBackgroundColor()
Returns the background color
|
Canvas2D.CanvasMap |
getCanvasMap()
Return the
Canvas2D.CanvasMap component of Canvas2D. |
Canvas2DSettingPanel |
getCanvasSettingPanel() |
Canvas2D.CanvasView |
getCanvasView()
Return the
Canvas2D.CanvasView component of Canvas2D. |
int |
getDestImageCanvasSizeX()
Get destination image size X in canvas pixel coordinate
|
int |
getDestImageCanvasSizeY()
Get destination image size Y in canvas pixel coordinate
|
boolean |
getFitToCanvas() |
int |
getOffsetX()
X offset
|
int |
getOffsetY()
Y offset
|
java.awt.image.BufferedImage |
getRenderedImage(int t,
int z)
Deprecated.
Use
getRenderedImage(t, z, -1, true) instead. |
java.awt.image.BufferedImage |
getRenderedImage(int t,
int z,
boolean canvasView)
Deprecated.
Use
getRenderedImage(t, z, -1, canvasView) instead. |
java.awt.image.BufferedImage |
getRenderedImage(int t,
int z,
int c,
boolean cv)
Returns a RGB or ARGB (depending support) BufferedImage representing the canvas view for
image at position (t, z, c).
|
double |
getRotation()
We want angle to be in [0..2*PI]
|
double |
getRotationZ()
Z rotation angle (radian)
|
double |
getScaleX()
X scale factor
|
double |
getScaleY()
Y scale factor
|
java.awt.Component |
getViewComponent() |
double |
getZoomFactor()
Deprecated.
use getScaleX() or getScaleY() instead
|
boolean |
isBackgroundColorEnabled()
Returns the background color enabled state
|
boolean |
isSynchronizationSupported()
Return true if this canvas support synchronization
|
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
refresh()
Force canvas refresh
|
void |
setBackgroundColor(java.awt.Color color)
Sets the background color
|
void |
setBackgroundColorEnabled(boolean value)
Sets the background color enabled state
|
void |
setFitToCanvas(boolean value)
Sets the automatic 'fit to canvas' state
|
void |
setOffset(int x,
int y,
boolean smooth)
Set offset X and Y.
|
void |
setRotation(double value,
boolean smooth)
Set rotation angle (radian).
|
void |
setScale(double factor,
boolean center,
boolean smooth)
Set zoom factor (this use the smart zoom position and smooth transition).
|
void |
setScale(double x,
double y,
boolean smooth)
Set zoom X and Y factor.
|
void |
setScale(double x,
double y,
boolean mouseCentered,
boolean smooth)
Set zoom X and Y factor.
|
void |
setZoom(float zoom)
Deprecated.
use setScale(...) instead
|
void |
shutDown()
Called by the viewer when canvas is closed to release some resources.
|
void |
toolChanged(java.lang.String command) |
canvasToImage, canvasToImage, canvasToImage, canvasToImage, canvasToImageDelta, canvasToImageDelta, canvasToImageLogDelta, canvasToImageLogDelta, canvasToViewer, centerImage, centerOnImage, getCanvasSize, getCanvasVisibleRect, getImageCanvasSize, getImageSize, getImageVisibleRect, getInverseTransform, getMouseImagePos, getMouseImagePosX, getMouseImagePosY, getTransform, imageToCanvas, imageToCanvas, imageToCanvas, imageToCanvas, imageToCanvasDelta, imageToCanvasDelta, setMouseCanvasPos, setMouseCanvasPos, setMouseImagePos, setMouseImagePos, setMousePos, setPositionT, setPositionZ, viewerToCanvasaddCanvasListener, addLayer, addLayer, addLayerListener, addLayersListener, addViewerToolbarComponents, addVisibleLayerToList, beginUpdate, canvasToImageC, canvasToImageDeltaC, canvasToImageDeltaT, canvasToImageDeltaX, canvasToImageDeltaY, canvasToImageDeltaZ, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaY, canvasToImageLogDeltaY, canvasToImageLogDeltaZ, canvasToImageLogDeltaZ, canvasToImageT, canvasToImageX, canvasToImageY, canvasToImageZ, create, endUpdate, getC, getCanvasClassName, getCanvasClassName, getCanvasOffsetC, getCanvasOffsetT, getCanvasOffsetX, getCanvasOffsetY, getCanvasOffsetZ, getCanvasPluginNames, getCanvasPlugins, getCanvasSize, getCanvasSizeC, getCanvasSizeT, getCanvasSizeX, getCanvasSizeY, getCanvasSizeZ, getCurrentImage, getDrawLayers, getFrameRate, getImage, getImage, getImageCanvasSize, getImageCanvasSizeC, getImageCanvasSizeT, getImageCanvasSizeX, getImageCanvasSizeY, getImageCanvasSizeZ, getImageLayer, getImageOffsetC, getImageOffsetT, getImageOffsetX, getImageOffsetY, getImageOffsetZ, getImageOverlay, getImageSize, getImageSizeC, getImageSizeT, getImageSizeX, getImageSizeY, getImageSizeZ, getLayer, getLayer, getLayer, getLayerListeners, getLayers, getLayers, getLayersPainter, getListeners, getLut, getMax, getMaxC, getMaxPosition, getMaxPosition5D, getMaxPositionC, getMaxPositionT, getMaxPositionX, getMaxPositionY, getMaxPositionZ, getMaxT, getMaxX, getMaxY, getMaxZ, getMouseImageInfosPanel, getMouseImagePos, getMouseImagePos5D, getMouseImagePosC, getMouseImagePosT, getMouseImagePosZ, getMousePos, getNumSelectedSamples, getOffset, getOffset5D, getOffsetC, getOffsetT, getOffsetZ, getOrderedLayersForEvent, getOverlays, getPanel, getPluginClassName, getPosition, getPosition5D, getPositionC, getPositionT, getPositionX, getPositionY, getPositionZ, getRenderedImage, getRenderedImage, getRenderedSequence, getRenderedSequence, getRenderedSequence, getRenderedSequence, getRotation, getRotationC, getRotationT, getRotationX, getRotationY, getScale, getScaleC, getScaleFactorC, getScaleFactorT, getScaleFactorX, getScaleFactorY, getScaleFactorZ, getScaleT, getScaleZ, getSequence, getSyncId, getT, getTNavigationPanel, getViewer, getVisibleLayers, getVisibleLayers, getVisibleOrderedLayersForEvent, getZ, getZNavigationPanel, hasLayer, hasLayer, hasLayer, imageToCanvasC, imageToCanvasDeltaC, imageToCanvasDeltaT, imageToCanvasDeltaX, imageToCanvasDeltaY, imageToCanvasDeltaZ, imageToCanvasT, imageToCanvasX, imageToCanvasY, imageToCanvasZ, isLayersVisible, isSynchHeader, isSynchMaster, isSynchOnCursor, isSynchOnSlice, isSynchOnView, isSynchronized, isSynchSlave, isUpdating, isVisible, keyTyped, layerChanged, lutChanged, mouseClick, mouseClick, mouseDrag, mouseDrag, mouseEntered, mouseEntered, mouseExited, mouseExited, mouseImagePositionChanged, mouseMove, mouseMove, mousePressed, mousePressed, mouseReleased, mouseReleased, mouseWheelMoved, mouseWheelMoved, offsetChanged, onChanged, removeCanvasListener, removeLayer, removeLayer, removeLayer, removeLayerListener, removeLayersListener, rotationChanged, scaleChanged, sequenceChanged, sequenceClosed, setC, setDrawLayers, setFrameRate, setLayersVisible, setMouseImagePos, setMouseImagePosC, setMouseImagePosT, setMouseImagePosX, setMouseImagePosY, setMouseImagePosZ, setMousePos, setOffset, setOffsetC, setOffsetT, setOffsetX, setOffsetY, setOffsetZ, setPosition, setPositionC, setPositionX, setPositionY, setRotation, setRotationC, setRotationT, setRotationX, setRotationY, setRotationZ, setScale, setScaleC, setScaleT, setScaleX, setScaleY, setScaleZ, setSyncId, setT, setZ, viewerChanged, viewerClosedgetAccessibleContext, getUI, getUIClassID, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocusUpCyclepublic void shutDown()
IcyCanvasshutdown is called
after the creation of the other canvas.public Canvas2DSettingPanel getCanvasSettingPanel()
public java.awt.Component getViewComponent()
getViewComponent in class IcyCanvaspublic Canvas2D.CanvasView getCanvasView()
Canvas2D.CanvasView component of Canvas2D.public Canvas2D.CanvasMap getCanvasMap()
Canvas2D.CanvasMap component of Canvas2D.public void customizeToolbar(javax.swing.JToolBar toolBar)
IcyCanvascustomizeToolbar in class IcyCanvastoolBar - the parent toolbar to customizepublic void fitImageToCanvas()
IcyCanvas2DfitImageToCanvas in class IcyCanvas2Dpublic void fitImageToCanvas(boolean smooth)
public void fitCanvasToImage()
IcyCanvas2DfitCanvasToImage in class IcyCanvas2Dpublic void centerOnImage(double x, double y)
IcyCanvas2DcenterOnImage in class IcyCanvas2Dpublic void centerOn(java.awt.Rectangle region)
IcyCanvas2DcenterOn in class IcyCanvas2Dregion - the region we want to seepublic void setOffset(int x, int y, boolean smooth)
smooth - use smooth transitionpublic void setScale(double factor, boolean center, boolean smooth)
center - if true then zoom is centered to current view else zoom is
centered using current mouse positionsmooth - use smooth transitionpublic void setScale(double x, double y, boolean mouseCentered, boolean smooth)
mouseCentered - if true the current mouse image position will becomes the
center of viewport else the current mouse image position will
keep its place.smooth - use smooth transitionpublic void setScale(double x, double y, boolean smooth)
smooth - use smooth transition@Deprecated public void setZoom(float zoom)
public int getDestImageCanvasSizeX()
public int getDestImageCanvasSizeY()
public boolean isBackgroundColorEnabled()
public void setBackgroundColorEnabled(boolean value)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color color)
public boolean getFitToCanvas()
public void setFitToCanvas(boolean value)
public boolean isSynchronizationSupported()
IcyCanvasisSynchronizationSupported in class IcyCanvaspublic int getOffsetX()
IcyCanvasgetOffsetX in class IcyCanvaspublic int getOffsetY()
IcyCanvasgetOffsetY in class IcyCanvaspublic double getRotationZ()
IcyCanvasgetRotationZ in class IcyCanvas@Deprecated public double getZoomFactor()
public double getRotation()
public void setRotation(double value, boolean smooth)
smooth - use smooth transitionpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerkeyPressed in class IcyCanvaspublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerkeyReleased in class IcyCanvaspublic java.awt.image.BufferedImage getARGBImage(int t, int z, int c, java.awt.image.BufferedImage out)
public java.awt.image.BufferedImage getRenderedImage(int t, int z, int c, boolean cv)
IcyCanvasgetRenderedImage in class IcyCanvast - T position of wanted image (-1 for complete sequence)z - Z position of wanted image (-1 for complete stack)c - C position of wanted image (-1 for all channels)cv - render with canvas view if true else use default sequence dimension@Deprecated public java.awt.image.BufferedImage getRenderedImage(int t, int z)
getRenderedImage(t, z, -1, true) instead.@Deprecated public java.awt.image.BufferedImage getRenderedImage(int t, int z, boolean canvasView)
getRenderedImage(t, z, -1, canvasView) instead.public void changed(IcyCanvasEvent event)
IcyCanvaschanged in class IcyCanvas2Dpublic void toolChanged(java.lang.String command)
toolChanged in interface ROITask.ROITaskListener