public class JImagePanel extends JComponent implements Cloneable
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected static Cursor |
crosshairCursor |
protected static Cursor |
defaultCursor |
protected int |
dstHeight |
protected int |
dstWidth |
protected int |
flags |
protected static Cursor |
handCursor |
protected ij.ImageJ |
ij |
protected int |
imageHeight |
protected boolean |
imageUpdated |
protected int |
imageWidth |
protected ij.ImagePlus |
imp |
protected double |
magnification |
protected static Cursor |
moveCursor |
protected Rectangle |
srcRect |
static boolean |
usePointer |
protected int |
xMouseStart |
protected int |
xSrcStart |
protected int |
yMouseStart |
protected int |
ySrcStart |
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 |
---|
JImagePanel() |
JImagePanel(ij.ImagePlus imp) |
Modifier and Type | Method and Description |
---|---|
protected void |
adjustSourceRect(double newMag,
int x,
int y) |
protected void |
drawOverlay(Graphics g) |
double |
getMagnification() |
int |
getModifiers()
Returns the mouse event modifiers.
|
Dimension |
getPreferredSize() |
int |
getSliceNumber(String label) |
Rectangle |
getSrcRect() |
void |
initGraphics(Graphics g,
Color c) |
int |
offScreenX(int sx)
Converts a screen x-coordinate to an offscreen x-coordinate.
|
double |
offScreenXD(int sx)
Converts a screen x-coordinate to a floating-point offscreen x-coordinate.
|
int |
offScreenY(int sy)
Converts a screen y-coordinate to an offscreen y-coordinate.
|
double |
offScreenYD(int sy)
Converts a screen y-coordinate to a floating-point offscreen y-coordinate.
|
void |
paintComponent(Graphics g) |
void |
paintDoubleBuffered(Graphics g) |
int |
screenX(int ox)
Converts an offscreen x-coordinate to a screen x-coordinate.
|
int |
screenXD(double ox)
Converts a floating-point offscreen x-coordinate to a screen x-coordinate.
|
int |
screenY(int oy)
Converts an offscreen y-coordinate to a screen y-coordinate.
|
int |
screenYD(double oy)
Converts a floating-point offscreen x-coordinate to a screen x-coordinate.
|
void |
setDrawingSize(int width,
int height) |
void |
setImageUpdated()
ImagePlus.updateAndDraw calls this method to get paint
to update the image from the ImageProcessor.
|
void |
setMagnification(double magnification) |
protected void |
setMagnification2(double magnification) |
protected void |
setSrcRect(Rectangle srcRect) |
void |
update(JImagePanel ic)
Update this JImagePanel to have the same zoom and scale settings as the one specified.
|
void |
updateImage(ij.ImagePlus imp) |
protected boolean |
waitForImage(Image image) |
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, update, updateUI
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, getAccessibleContext, 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 static Cursor defaultCursor
protected static Cursor handCursor
protected static Cursor moveCursor
protected static Cursor crosshairCursor
public static boolean usePointer
protected ij.ImagePlus imp
protected boolean imageUpdated
protected Rectangle srcRect
protected int imageWidth
protected int imageHeight
protected ij.ImageJ ij
protected double magnification
protected int dstWidth
protected int dstHeight
protected int xMouseStart
protected int yMouseStart
protected int xSrcStart
protected int ySrcStart
protected int flags
public JImagePanel()
public JImagePanel(ij.ImagePlus imp)
public void updateImage(ij.ImagePlus imp)
public void update(JImagePanel ic)
public void setDrawingSize(int width, int height)
public void setImageUpdated()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public int getSliceNumber(String label)
public void paintDoubleBuffered(Graphics g)
protected void drawOverlay(Graphics g)
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public int getModifiers()
public int offScreenX(int sx)
public int offScreenY(int sy)
public double offScreenXD(int sx)
public double offScreenYD(int sy)
public int screenX(int ox)
public int screenY(int oy)
public int screenXD(double ox)
public int screenYD(double oy)
public double getMagnification()
public void setMagnification(double magnification)
protected void setMagnification2(double magnification)
public Rectangle getSrcRect()
protected void setSrcRect(Rectangle srcRect)
protected void adjustSourceRect(double newMag, int x, int y)
protected boolean waitForImage(Image image)
Copyright © 2015–2021 Fiji. All rights reserved.