public class ImageViewer
extends javax.swing.JFrame
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.KeyListener, java.awt.event.MouseMotionListener, java.lang.Runnable, java.awt.event.WindowListener
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected boolean |
anim |
protected static char |
ANIMATION_KEY |
protected boolean |
canCloseReader |
protected javax.swing.JSlider |
cSlider |
protected java.lang.String |
filename |
protected IFormatReader |
fileReader
Reader for files on disk.
|
protected javax.swing.JMenuItem |
fileSave |
protected javax.swing.JMenuItem |
fileView |
protected IFormatWriter |
fileWriter
Writer for files on disk.
|
protected int |
fps |
protected javax.swing.ImageIcon |
icon |
protected javax.swing.JLabel |
iconLabel |
protected java.awt.image.BufferedImage[] |
images |
protected IFormatReader |
in |
private static org.slf4j.Logger |
LOGGER |
protected BufferedImageReader |
myReader
Current format reader.
|
protected BufferedImageWriter |
myWriter
Current format writer.
|
protected javax.swing.JSlider |
nSlider |
protected MetadataStore |
omeMeta
Attached OME metadata store, if available.
|
protected OMEXMLService |
omexmlService
Service for working with OME-XML metadata.
|
protected javax.swing.JPanel |
pane |
protected javax.swing.JLabel |
probeLabel |
protected java.lang.StringBuilder |
sb |
protected int |
sizeC |
protected int |
sizeT |
protected int |
sizeZ |
protected javax.swing.JPanel |
sliderPanel |
protected static java.lang.String |
TITLE |
protected javax.swing.JSlider |
tSlider |
protected javax.swing.JSlider |
zSlider |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
ImageViewer()
Constructs an image viewer.
|
ImageViewer(boolean canCloseReader)
Constructs an image viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Handles menu commands.
|
int |
getC()
Gets the C value of the currently displayed image.
|
java.awt.image.BufferedImage |
getImage()
Gets the currently displayed image.
|
int |
getImageIndex()
Gets the index of the currently displayed image.
|
int |
getT()
Gets the T value of the currently displayed image.
|
int |
getZ()
Gets the Z value of the currently displayed image.
|
void |
keyPressed(java.awt.event.KeyEvent e)
Handles key presses.
|
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
static void |
main(java.lang.String[] args) |
void |
mouseDragged(java.awt.event.MouseEvent e)
Handles cursor probes.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Handles cursor probes.
|
void |
open(java.lang.String id)
Opens the given data source using the current format reader.
|
protected void |
open(java.lang.String id,
IFormatReader r)
Opens from the given data source using the specified reader
in a separate thread.
|
void |
run()
Handles animation.
|
void |
save(java.lang.String id)
Saves the current images to the given destination
using the current format writer.
|
protected void |
save(java.lang.String id,
IFormatWriter w)
Saves to the given data destination using the specified writer
in a separate thread.
|
void |
setImages(java.awt.image.BufferedImage[] img)
Sets the viewer to display the given images.
|
void |
setImages(IFormatReader reader,
java.awt.image.BufferedImage[] img)
Sets the viewer to display the given images, obtaining
corresponding core metadata from the specified format reader.
|
void |
setVisible(boolean visible) |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Handles slider events.
|
protected void |
updateLabel(int x,
int y)
Updates cursor probe label.
|
protected void |
wait(boolean wait)
Toggles wait cursor.
|
void |
windowActivated(java.awt.event.WindowEvent e) |
void |
windowClosed(java.awt.event.WindowEvent e) |
void |
windowClosing(java.awt.event.WindowEvent e) |
void |
windowDeactivated(java.awt.event.WindowEvent e) |
void |
windowDeiconified(java.awt.event.WindowEvent e) |
void |
windowIconified(java.awt.event.WindowEvent e) |
void |
windowOpened(java.awt.event.WindowEvent e) |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final org.slf4j.Logger LOGGER
protected static final java.lang.String TITLE
protected static final char ANIMATION_KEY
protected javax.swing.JPanel pane
protected javax.swing.ImageIcon icon
protected javax.swing.JLabel iconLabel
protected javax.swing.JPanel sliderPanel
protected javax.swing.JSlider nSlider
protected javax.swing.JSlider zSlider
protected javax.swing.JSlider tSlider
protected javax.swing.JSlider cSlider
protected javax.swing.JLabel probeLabel
protected javax.swing.JMenuItem fileView
protected javax.swing.JMenuItem fileSave
protected MetadataStore omeMeta
protected BufferedImageReader myReader
protected BufferedImageWriter myWriter
protected IFormatReader fileReader
protected IFormatWriter fileWriter
protected java.lang.String filename
protected IFormatReader in
protected java.awt.image.BufferedImage[] images
protected int sizeZ
protected int sizeT
protected int sizeC
protected boolean anim
protected int fps
protected boolean canCloseReader
protected OMEXMLService omexmlService
protected final java.lang.StringBuilder sb
public ImageViewer()
public ImageViewer(boolean canCloseReader)
canCloseReader
- whether or not the underlying reader can be closedpublic void open(java.lang.String id)
public void save(java.lang.String id)
public void setImages(java.awt.image.BufferedImage[] img)
public void setImages(IFormatReader reader, java.awt.image.BufferedImage[] img)
public java.awt.image.BufferedImage getImage()
public int getImageIndex()
public int getZ()
public int getT()
public int getC()
public void setVisible(boolean visible)
setVisible
in class java.awt.Window
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void run()
run
in interface java.lang.Runnable
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
protected void updateLabel(int x, int y)
protected void wait(boolean wait)
protected void open(java.lang.String id, IFormatReader r)
protected void save(java.lang.String id, IFormatWriter w)
public static void main(java.lang.String[] args)
Copyright © 2021 Open Microscopy Environment