Package sc.fiji.snt.hyperpanes
Class MultiDThreePanesCanvas
java.lang.Object
java.awt.Component
java.awt.Canvas
ij.gui.ImageCanvas
sc.fiji.snt.hyperpanes.MultiDThreePanesCanvas
- All Implemented Interfaces:
MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,Cloneable,EventListener,Accessible
- Direct Known Subclasses:
TracerCanvas
public class MultiDThreePanesCanvas
extends ij.gui.ImageCanvas
Canvas for displaying and interacting with multiple planes in 3D space,
providing synchronized visualization and navigation across orthogonal projections.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvasNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected PaneOwnerprotected intprotected booleanFields inherited from class ij.gui.ImageCanvas
crosshairCursor, defaultCursor, dstHeight, dstWidth, flags, handCursor, ij, imageHeight, imageUpdated, imageWidth, imp, lastZoomSX, lastZoomSY, magnification, MAX_MOUSEMOVE_ZOOM, moveCursor, srcRect, usePointer, xMouse, xMouseStart, xSrcStart, yMouse, yMouseStart, ySrcStart, zoomTargetOX, zoomTargetOYFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultiDThreePanesCanvas(ij.ImagePlus imagePlus, PaneOwner owner, int plane) -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableEvents(boolean disable) Sets whether mouse and key events should be waived back to IJ.protected voiddrawCrosshairs(Graphics2D g, double x_on_screen, double y_on_screen) protected voidReturns the string currently rendered on canvas' upper left corner.booleanvoidintmyOffScreenX(int sx) Converts a screen x-coordinate to an offscreen (image) x-coordinate.doublemyOffScreenXD(int sx) Converts a screen x-coordinate to a floating-point offscreen (image) x-coordinate.intmyOffScreenY(int sy) Converts a screen y-coordinate to an offscreen (image) y-coordinate.doublemyOffScreenYD(int sy) Converts a screen y-coordinate to a floating-point offscreen (image) y-coordinate.intmyScreenX(int ox) Converts an offscreen (image) x-coordinate to a screen x-coordinate.intmyScreenXD(double ox) Converts a floating-point offscreen (image) x-coordinate to a screen x-coordinate.doublemyScreenXDprecise(double ox) Converts an offscreen (image) x-coordinate to a screen x-coordinate with floating-point precision.intmyScreenY(int oy) Converts an offscreen (image) y-coordinate to a screen y-coordinate.intmyScreenYD(double oy) Converts a floating-point offscreen (image) x-coordinate to a screen x-coordinate.doublemyScreenYDprecise(double oy) Converts an offscreen (image) y-coordinate to a screen y-coordinate with floating-point precision.voidvoidscrollTo(int newOffscreenX, int newOffscreenY) voidsetAnnotationsColor(Color color) voidsetCanvasLabel(String label) Sets the string to be rendered on canvas' upper left corner.voidsetCanvasLabelBackground(Color color) Sets the background color for the canvas label.voidsetCrosshairs(double x, double y, double z, boolean display) Deprecated.voidsetCursorText(String cursorText) Sets the string to be appended to the current cursor.voidsetDrawCrosshairs(boolean drawCrosshairs) protected voidsetLockCursor(boolean lock) protected voidsetZoom(double zoomFactor) protected voidtriggerZoomEvent(boolean in, int off_screen_x, int off_screen_y) voidupdateCursor(double x, double y, double z) voidupdatePosition(double x, double y, double z) voidzoomIn(int sx, int sy) voidzoomOut(int sx, int sy) Methods inherited from class ij.gui.ImageCanvas
canEnlarge, cursorOverImage, disablePopupMenu, fitToWindow, getCursorLoc, getCustomRoi, getDisplayList, getHigherZoomLevel, getImage, getLowerZoomLevel, getMagnification, getModifiers, getOverlay, getPaintPending, getPreferredSize, getScaleToFit, getShowAllColor, getShowAllList, getShowAllROIs, getSliceNumber, getSrcRect, handlePopupMenu, handleRoiMouseDown, hideZoomIndicator, mouseClicked, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, offScreenX, offScreenX2, offScreenXD, offScreenY, offScreenY2, offScreenYD, paint, repaintOverlay, resetDoubleBuffer, roiManagerSelect, screenX, screenXD, screenY, screenYD, scroll, setCursor, setCursor, setCustomRoi, setDisplayList, setDisplayList, setDisplayList, setDrawingColor, setDrawingSize, setImageUpdated, setLongClickDelay, setMagnification, setOverlay, setPaintPending, setScaleToFit, setShowAllColor, setShowAllList, setShowAllROIs, setShowCursorStatus, setSize, setSourceRect, setupScroll, unzoom, update, zoom100PercentMethods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
Field Details
-
owner
-
plane
protected int plane -
waitingForRoiDrawing
protected boolean waitingForRoiDrawing -
cursorLocked
protected boolean cursorLocked
-
-
Constructor Details
-
MultiDThreePanesCanvas
-
-
Method Details
-
setZoom
protected void setZoom(double zoomFactor) -
drawOverlay
-
getCursorPos
- Returns:
- the current X,Y position of the mouse cursor
-
getGraphics2D
-
triggerZoomEvent
protected void triggerZoomEvent(boolean in, int off_screen_x, int off_screen_y) -
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classij.gui.ImageCanvas
-
zoomIn
public void zoomIn(int sx, int sy) - Overrides:
zoomInin classij.gui.ImageCanvas
-
zoomOut
public void zoomOut(int sx, int sy) - Overrides:
zoomOutin classij.gui.ImageCanvas
-
drawCrosshairs
-
updatePosition
public void updatePosition(double x, double y, double z) -
setCrosshairs
Deprecated. -
updateCursor
public void updateCursor(double x, double y, double z) -
scrollTo
public void scrollTo(int newOffscreenX, int newOffscreenY) -
myOffScreenX
public int myOffScreenX(int sx) Converts a screen x-coordinate to an offscreen (image) x-coordinate.- Parameters:
sx- the screen x coordinate- Returns:
- the image x coordinate
-
myOffScreenY
public int myOffScreenY(int sy) Converts a screen y-coordinate to an offscreen (image) y-coordinate.- Parameters:
sy- the screen y coordinate- Returns:
- the image y coordinate
-
myOffScreenXD
public double myOffScreenXD(int sx) Converts a screen x-coordinate to a floating-point offscreen (image) x-coordinate.- Parameters:
sx- the screen x coordinate- Returns:
- the image x coordinate
-
myOffScreenYD
public double myOffScreenYD(int sy) Converts a screen y-coordinate to a floating-point offscreen (image) y-coordinate.- Parameters:
sy- the screen y coordinate- Returns:
- the image y coordinate
-
myScreenX
public int myScreenX(int ox) Converts an offscreen (image) x-coordinate to a screen x-coordinate.- Parameters:
ox- the image x coordinate- Returns:
- the screen x coordinate
-
myScreenY
public int myScreenY(int oy) Converts an offscreen (image) y-coordinate to a screen y-coordinate.- Parameters:
oy- the image y coordinate- Returns:
- the screen y coordinate
-
myScreenXD
public int myScreenXD(double ox) Converts a floating-point offscreen (image) x-coordinate to a screen x-coordinate.- Parameters:
ox- the image x coordinate- Returns:
- the screen x coordinate
-
myScreenXDprecise
public double myScreenXDprecise(double ox) Converts an offscreen (image) x-coordinate to a screen x-coordinate with floating-point precision.- Parameters:
ox- the image x coordinate- Returns:
- the screen x coordinate
-
myScreenYD
public int myScreenYD(double oy) Converts a floating-point offscreen (image) x-coordinate to a screen x-coordinate.- Parameters:
oy- the image x coordinate- Returns:
- the screen x coordinate
-
myScreenYDprecise
public double myScreenYDprecise(double oy) Converts an offscreen (image) y-coordinate to a screen y-coordinate with floating-point precision.- Parameters:
oy- the image y coordinate- Returns:
- the screen y coordinate
-
restoreDefaultCursor
public void restoreDefaultCursor() -
setCanvasLabel
Sets the string to be rendered on canvas' upper left corner.- Parameters:
label- the string to be displayed
-
setCanvasLabelBackground
Sets the background color for the canvas label. When non-null, the label is drawn with dark text on the specified background (useful for warnings). When null, the default semi-transparent gray background is used.- Parameters:
color- the background color, or null to reset to default
-
getCanvasLabel
Returns the string currently rendered on canvas' upper left corner.- Returns:
- the current label, or null if none
-
setCursorText
Sets the string to be appended to the current cursor.- Parameters:
cursorText- the string to be displayed around the cursor
-
setAnnotationsColor
-
getAnnotationsColor
-
getViewPort
-
isEventsDisabled
public boolean isEventsDisabled()- Returns:
- whether SNT is being notified of mouse/key events
-
disableEvents
public void disableEvents(boolean disable) Sets whether mouse and key events should be waived back to IJ.- Parameters:
disable- If true, SNT will not be notified of mouse/keyboard events
-
setLockCursor
protected void setLockCursor(boolean lock) -
setDrawCrosshairs
public void setDrawCrosshairs(boolean drawCrosshairs)
-