public class ImageViewer extends JFrame implements ActionListener, ChangeListener, KeyListener, MouseMotionListener, Runnable, WindowListener
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected boolean |
anim |
protected static char |
ANIMATION_KEY |
protected boolean |
canCloseReader |
protected JSlider |
cSlider |
protected String |
filename |
protected IFormatReader |
fileReader
Reader for files on disk.
|
protected JMenuItem |
fileSave |
protected JMenuItem |
fileView |
protected IFormatWriter |
fileWriter
Writer for files on disk.
|
protected int |
fps |
protected ImageIcon |
icon |
protected JLabel |
iconLabel |
protected BufferedImage[] |
images |
protected IFormatReader |
in |
protected BufferedImageReader |
myReader
Current format reader.
|
protected BufferedImageWriter |
myWriter
Current format writer.
|
protected JSlider |
nSlider |
protected MetadataStore |
omeMeta
Attached OME metadata store, if available.
|
protected OMEXMLService |
omexmlService
Service for working with OME-XML metadata.
|
protected JPanel |
pane |
protected JLabel |
probeLabel |
protected StringBuffer |
sb |
protected int |
sizeC |
protected int |
sizeT |
protected int |
sizeZ |
protected JPanel |
sliderPanel |
protected static String |
TITLE |
protected JSlider |
tSlider |
protected 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
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ImageViewer()
Constructs an image viewer.
|
ImageViewer(boolean canCloseReader)
Constructs an image viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles menu commands.
|
int |
getC()
Gets the C value of the currently displayed 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(KeyEvent e)
Handles key presses.
|
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
static void |
main(String[] args) |
void |
mouseDragged(MouseEvent e)
Handles cursor probes.
|
void |
mouseMoved(MouseEvent e)
Handles cursor probes.
|
void |
open(String id)
Opens the given data source using the current format reader.
|
protected void |
open(String id,
IFormatReader r)
Opens from the given data source using the specified reader
in a separate thread.
|
void |
run()
Handles animation.
|
void |
save(String id)
Saves the current images to the given destination
using the current format writer.
|
protected void |
save(String id,
IFormatWriter w)
Saves to the given data destination using the specified writer
in a separate thread.
|
void |
setImages(BufferedImage[] img)
Sets the viewer to display the given images.
|
void |
setImages(IFormatReader reader,
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(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(WindowEvent e) |
void |
windowClosed(WindowEvent e) |
void |
windowClosing(WindowEvent e) |
void |
windowDeactivated(WindowEvent e) |
void |
windowDeiconified(WindowEvent e) |
void |
windowIconified(WindowEvent e) |
void |
windowOpened(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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
protected static final String TITLE
protected static final char ANIMATION_KEY
protected JPanel pane
protected ImageIcon icon
protected JLabel iconLabel
protected JPanel sliderPanel
protected JSlider nSlider
protected JSlider zSlider
protected JSlider tSlider
protected JSlider cSlider
protected JLabel probeLabel
protected JMenuItem fileView
protected JMenuItem fileSave
protected MetadataStore omeMeta
protected BufferedImageReader myReader
protected BufferedImageWriter myWriter
protected IFormatReader fileReader
protected IFormatWriter fileWriter
protected String filename
protected IFormatReader in
protected BufferedImage[] images
protected int sizeZ
protected int sizeT
protected int sizeC
protected boolean anim
protected int fps
protected boolean canCloseReader
protected OMEXMLService omexmlService
protected StringBuffer sb
public ImageViewer()
public ImageViewer(boolean canCloseReader)
whether
- or not the underlying reader can be closedpublic void open(String id)
public void save(String id)
public void setImages(BufferedImage[] img)
public void setImages(IFormatReader reader, BufferedImage[] img)
public BufferedImage getImage()
public int getImageIndex()
public int getZ()
public int getT()
public int getC()
public void setVisible(boolean visible)
setVisible
in class Window
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void windowClosing(WindowEvent e)
windowClosing
in interface WindowListener
public void windowActivated(WindowEvent e)
windowActivated
in interface WindowListener
public void windowDeactivated(WindowEvent e)
windowDeactivated
in interface WindowListener
public void windowOpened(WindowEvent e)
windowOpened
in interface WindowListener
public void windowIconified(WindowEvent e)
windowIconified
in interface WindowListener
public void windowDeiconified(WindowEvent e)
windowDeiconified
in interface WindowListener
public void windowClosed(WindowEvent e)
windowClosed
in interface WindowListener
protected void updateLabel(int x, int y)
protected void wait(boolean wait)
protected void open(String id, IFormatReader r)
protected void save(String id, IFormatWriter w)
public static void main(String[] args)
Copyright © 2014 Open Microscopy Environment