Package ij.gui
Class PlotCanvas
java.lang.Object
java.awt.Component
java.awt.Canvas
ij.gui.ImageCanvas
ij.gui.PlotCanvas
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,ImageObserver
,MenuContainer
,Serializable
,Cloneable
,EventListener
,Accessible
public class PlotCanvas extends ImageCanvas
This subclass of ImageCanvas has special provisions for plots:
- Zooming: sets the plot range
- Scrolling: moves data area
This behavior is suppressed if the plot is frozen
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields 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, zoomTargetOY
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors Constructor Description PlotCanvas(ImagePlus imp)
Creates a new PlotCanvas -
Method Summary
Modifier and Type Method Description void
fitToWindow()
Resizes the plot (unless frozen) to fit the windowPlot
getPlot()
Returns the Plot displayed in this canvasboolean
isFrozen()
Whether the plot is frozen, i.e.void
mouseExited(MouseEvent e)
overrides ImageCanvas.mouseExited; removes 'range' arrowsvoid
mousePressed(MouseEvent e)
overrides ImageCanvas.mousePressed: no further processing of clicks on 'range' arrowsvoid
mouseReleased(MouseEvent e)
Overrides ImageCanvas.mouseReleased, handles clicks on 'range' arrowsprotected void
scroll(int sx, int sy)
overrides ImageCanvas.scroll; if plot is not frozen, scrolling modifies the plot data rangevoid
setMagnification(double magnification)
The image of a PlotCanvas is always shown at 100% magnification unless the plot is frozenvoid
setPlot(Plot plot)
Tells the PlotCanvas which plot to use for zooming etc.void
setSourceRect(Rectangle r)
Scrolling a PlotCanvas is updating the plot, not viewing part of the plot, unless the plot is frozenprotected void
setupScroll(int ox, int oy)
overrides ImageCanvas.setupScroll; if plot is not frozen, scrolling modifies the plot data rangevoid
unzoom()
Implements the Image/Zoom/Original Scale command.void
zoom(String arg)
Zoom operations that are handled by ij.plugin.Zoomvoid
zoom100Percent()
Implements the Image/Zoom/View 100% command: Sets the original frame size as specified in Edit/Options/Plots (unless the plot is frozen)void
zoomIn(int sx, int sy)
Zooms in by modifying the plot range; sx and sy are screen coordinatesvoid
zoomOut(int sx, int sy)
Zooms out by modifying the plot range; sx and sy are screen coordinatesMethods inherited from class ij.gui.ImageCanvas
canEnlarge, cursorOverImage, disablePopupMenu, getCursorLoc, getCustomRoi, getDisplayList, getHigherZoomLevel, getImage, getLowerZoomLevel, getMagnification, getModifiers, getOverlay, getPaintPending, getPreferredSize, getScaleToFit, getShowAllColor, getShowAllList, getShowAllROIs, getSliceNumber, getSrcRect, handlePopupMenu, handleRoiMouseDown, hideZoomIndicator, mouseClicked, mouseDragged, mouseEntered, mouseMoved, offScreenX, offScreenX2, offScreenXD, offScreenY, offScreenY2, offScreenYD, paint, resetDoubleBuffer, roiManagerSelect, screenX, screenXD, screenY, screenYD, setCursor, setCursor, setCustomRoi, setDisplayList, setDisplayList, setDisplayList, setDrawingColor, setDrawingSize, setImageUpdated, setOverlay, setPaintPending, setScaleToFit, setShowAllColor, setShowAllList, setShowAllROIs, setShowCursorStatus, setSize, update
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
Methods 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
-
Constructor Details
-
PlotCanvas
Creates a new PlotCanvas
-
-
Method Details
-
setPlot
Tells the PlotCanvas which plot to use for zooming etc. Call this immediately after construction -
getPlot
Returns the Plot displayed in this canvas -
isFrozen
public boolean isFrozen()Whether the plot is frozen, i.e. its ImageProcessor can not be changed -
zoom
Zoom operations that are handled by ij.plugin.Zoom -
zoomIn
public void zoomIn(int sx, int sy)Zooms in by modifying the plot range; sx and sy are screen coordinates- Overrides:
zoomIn
in classImageCanvas
-
zoomOut
public void zoomOut(int sx, int sy)Zooms out by modifying the plot range; sx and sy are screen coordinates- Overrides:
zoomOut
in classImageCanvas
-
unzoom
public void unzoom()Implements the Image/Zoom/Original Scale command. Sets the original range of the x, y axes (unless the plot is frozen)- Overrides:
unzoom
in classImageCanvas
-
zoom100Percent
public void zoom100Percent()Implements the Image/Zoom/View 100% command: Sets the original frame size as specified in Edit/Options/Plots (unless the plot is frozen)- Overrides:
zoom100Percent
in classImageCanvas
-
fitToWindow
public void fitToWindow()Resizes the plot (unless frozen) to fit the window- Overrides:
fitToWindow
in classImageCanvas
-
setMagnification
public void setMagnification(double magnification)The image of a PlotCanvas is always shown at 100% magnification unless the plot is frozen- Overrides:
setMagnification
in classImageCanvas
-
setSourceRect
Scrolling a PlotCanvas is updating the plot, not viewing part of the plot, unless the plot is frozen- Overrides:
setSourceRect
in classImageCanvas
-
setupScroll
protected void setupScroll(int ox, int oy)overrides ImageCanvas.setupScroll; if plot is not frozen, scrolling modifies the plot data range- Overrides:
setupScroll
in classImageCanvas
-
scroll
protected void scroll(int sx, int sy)overrides ImageCanvas.scroll; if plot is not frozen, scrolling modifies the plot data range- Overrides:
scroll
in classImageCanvas
-
mouseExited
overrides ImageCanvas.mouseExited; removes 'range' arrows- Specified by:
mouseExited
in interfaceMouseListener
- Overrides:
mouseExited
in classImageCanvas
-
mousePressed
overrides ImageCanvas.mousePressed: no further processing of clicks on 'range' arrows- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classImageCanvas
-
mouseReleased
Overrides ImageCanvas.mouseReleased, handles clicks on 'range' arrows- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classImageCanvas
-