- All Implemented Interfaces:
ActionListener,ItemListener,KeyListener,MouseListener,WindowListener,ImageObserver,MenuContainer,Serializable,Runnable,EventListener,Accessible
public class ImageJ
extends Frame
implements ActionListener, MouseListener, KeyListener, WindowListener, ItemListener, Runnable
This frame is the main ImageJ class.
ImageJ is a work of the United States Government. It is in the public domain and open source. There is no copyright. You are free to do anything you want with this source but I like to get credit for my work and I would like you to offer your changes to me so I can possibly add them to the "official" version.
The following command line options are recognized by ImageJ:
"file-name"
Opens a file
Example 1: blobs.tif
Example 2: /Users/wayne/images/blobs.tif
Example 3: e81*.tif
-macro path [arg]
Runs a macro or script (JavaScript, BeanShell or Python), passing an
optional string argument, which the macro or script can be retrieve
using the getArgument() function. The macro or script is assumed to
be in the ImageJ/macros folder if 'path' is not a full directory path.
Example 1: -macro analyze.ijm
Example 2: -macro script.js /Users/wayne/images/stack1
Example 2: -macro script.py '1.2 2.4 3.8'
-batch path [arg]
Runs a macro or script (JavaScript, BeanShell or Python) in
batch (no GUI) mode, passing an optional argument.
ImageJ exits when the macro finishes.
-eval "macro code"
Evaluates macro code
Example 1: -eval "print('Hello, world');"
Example 2: -eval "return getVersion();"
-run command
Runs an ImageJ menu command
Example: -run "About ImageJ..."
-ijpath path
Specifies the path to the directory containing the plugins directory
Example: -ijpath /Applications/ImageJ
-port
Specifies the port ImageJ uses to determine if another instance is running
Example 1: -port1 (use default port address + 1)
Example 2: -port2 (use default port address + 2)
Example 3: -port0 (don't check for another instance)
-debug
Runs ImageJ in debug mode
- Author:
- Wayne Rasband (rasband@gmail.com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHandles exceptions on the EDT.Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Colorstatic final Stringstatic final intRun ImageJ in debug mode.static final intAddress of socket where Image accepts commandsstatic final intRun embedded in another application.static final intRun as the ImageJ application.static final intRun embedded and invisible in another application.static final FontSansSerif, 12-point, plain font.static final FontSansSerif, 14-point, plain font.static final intRun as normal application.static final StringPlugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string.Fields inherited from class java.awt.Frame
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_CURSORFields 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
ConstructorsConstructorDescriptionImageJ()Creates a new ImageJ frame that runs as an application.ImageJ(int mode) Creates a new ImageJ frame that runs as an application in the specified mode.Creates a new ImageJ frame that runs as an applet.If 'applet' is not null, creates a new ImageJ frame that runs as an applet. -
Method Summary
Modifier and TypeMethodDescriptionvoidHandle menu events.voidexitWhenQuitting(boolean ewq) ImageJ calls System.exit() when qutting when 'exitWhenQuitting' is true.static String[]getArgs()Returns the command line arguments passed to ImageJ.static StringgetInfo()static intgetPort()Returns the port that ImageJ checks on startup to see if another instance is running.static StringvoidHandles CheckboxMenuItem state changes.voidvoidvoidstatic voidstatic Stringmodifiers(int flags) Return the current list of modifier keys.voidvoidvoidvoidvoidvoidquit()Called by ImageJ when the user selects Quit.booleanquitting()Returns true if ImageJ is exiting.booleanReturns true if ImageJ is quitting as a result of a run("Quit") macro call.voidAdds the specified class to a Vector to keep it from being garbage collected, causing static fields to be reset.voidresize()voidrun()Quit using a separate thread, hopefully avoiding thread deadlocks.voidrunFilterPlugIn(Object theFilter, String cmd, String arg) runUserPlugIn(String commandName, String className, String arg, boolean createNewLoader) voidsavePreferences(Properties prefs) Called once when ImageJ quits.static voidsetCommandName(String name) voidvoidvoidvoidvoidvoidvoidMethods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
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, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTreeMethods inherited from class java.awt.Component
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, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
VERSION
Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string.- See Also:
-
BUILD
- See Also:
-
backgroundColor
-
SansSerif12
SansSerif, 12-point, plain font. -
SansSerif14
SansSerif, 14-point, plain font. -
DEFAULT_PORT
public static final int DEFAULT_PORTAddress of socket where Image accepts commands- See Also:
-
STANDALONE
public static final int STANDALONERun as normal application.- See Also:
-
EMBEDDED
public static final int EMBEDDEDRun embedded in another application.- See Also:
-
NO_SHOW
public static final int NO_SHOWRun embedded and invisible in another application.- See Also:
-
IMAGEJ_APP
public static final int IMAGEJ_APPRun as the ImageJ application.- See Also:
-
DEBUG
public static final int DEBUGRun ImageJ in debug mode.- See Also:
-
-
Constructor Details
-
ImageJ
public ImageJ()Creates a new ImageJ frame that runs as an application. -
ImageJ
public ImageJ(int mode) Creates a new ImageJ frame that runs as an application in the specified mode. -
ImageJ
Creates a new ImageJ frame that runs as an applet. -
ImageJ
If 'applet' is not null, creates a new ImageJ frame that runs as an applet. If 'mode' is ImageJ.EMBEDDED and 'applet is null, creates an embedded (non-standalone) version of ImageJ.
-
-
Method Details
-
getPreferredLocation
-
getProgressBar
-
getStatusBar
-
getStatusBarText
-
runFilterPlugIn
-
runUserPlugIn
-
modifiers
Return the current list of modifier keys. -
actionPerformed
Handle menu events.- Specified by:
actionPerformedin interfaceActionListener
-
itemStateChanged
Handles CheckboxMenuItem state changes.- Specified by:
itemStateChangedin interfaceItemListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
getInfo
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
windowClosing
- Specified by:
windowClosingin interfaceWindowListener
-
windowActivated
- Specified by:
windowActivatedin interfaceWindowListener
-
windowClosed
- Specified by:
windowClosedin interfaceWindowListener
-
windowDeactivated
- Specified by:
windowDeactivatedin interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconifiedin interfaceWindowListener
-
windowIconified
- Specified by:
windowIconifiedin interfaceWindowListener
-
windowOpened
- Specified by:
windowOpenedin interfaceWindowListener
-
register
Adds the specified class to a Vector to keep it from being garbage collected, causing static fields to be reset. -
quit
public void quit()Called by ImageJ when the user selects Quit. -
quitting
public boolean quitting()Returns true if ImageJ is exiting. -
quittingViaMacro
public boolean quittingViaMacro()Returns true if ImageJ is quitting as a result of a run("Quit") macro call. -
savePreferences
Called once when ImageJ quits. -
main
-
getPort
public static int getPort()Returns the port that ImageJ checks on startup to see if another instance is running.- See Also:
-
getArgs
Returns the command line arguments passed to ImageJ. -
exitWhenQuitting
public void exitWhenQuitting(boolean ewq) ImageJ calls System.exit() when qutting when 'exitWhenQuitting' is true. -
run
public void run()Quit using a separate thread, hopefully avoiding thread deadlocks. -
getCommandName
-
setCommandName
-
resize
public void resize()
-