ij
Class WindowManager

java.lang.Object
  extended by ij.WindowManager

public class WindowManager
extends java.lang.Object

This class consists of static methods used to manage ImageJ's windows.


Field Summary
static boolean checkForDuplicateName
           
 
Method Summary
(package private) static void activateWindow(java.lang.String menuItemLabel, java.awt.MenuItem item)
          Activates a window selected from the Window menu.
static void addWindow(java.awt.Frame win)
          Adds the specified window to the Window menu.
(package private) static void checkForDuplicateName(ImagePlus imp)
           
static boolean closeAllWindows()
          Closes all windows.
static ImagePlus getCurrentImage()
          Returns the active ImagePlus.
(package private) static int getCurrentIndex()
           
static ij.gui.ImageWindow getCurrentWindow()
          Returns the active ImageWindow.
static java.awt.Frame getFrame(java.lang.String title)
          Returns the frame with the specified title or null if a frame with that title is not found.
static java.awt.Frame getFrontWindow()
          Returns the front most window or null.
static int[] getIDList()
          Returns a list of the IDs of open images.
static ImagePlus getImage(int imageID)
          For IDs less than zero, returns the ImagePlus with the specified ID.
static ImagePlus getImage(java.lang.String title)
          Returns the first image that has the specified title or null if it is not found.
static int getImageCount()
          Returns the number of open images.
static java.awt.Frame[] getNonImageWindows()
          Returns an array containing a list of the non-image windows.
static int getNthImageID(int n)
          Returns the ID of the Nth open image.
static ImagePlus getTempCurrentImage()
          Returns tempCurrentImage, which may be null.
static java.lang.String getUniqueName(java.lang.String name)
          Returns a unique name by adding, before the extension, -1, -2, etc. as needed.
static int getWindowCount()
          Returns the number of open image windows.
(package private) static boolean isDuplicateName(java.lang.String name)
           
static java.lang.String makeUniqueName(java.lang.String name)
          If 'name' is not unique, adds -1, -2, etc. as needed to make it unique.
static void putBehind()
          Activates the next image window on the window list.
static void removeWindow(java.awt.Frame win)
          Removes the specified window from the Window menu.
static void repaintImageWindows()
          Repaints all open image windows.
static void setCurrentWindow(ij.gui.ImageWindow win)
          Makes the image contained in the specified window the active image.
static void setTempCurrentImage(ImagePlus imp)
          Makes the specified image temporarily the active image.
static void setWindow(java.awt.Frame win)
          The specified frame becomes the front window, the one returnd by getFrontWindow().
(package private) static void showList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkForDuplicateName

public static boolean checkForDuplicateName
Method Detail

setCurrentWindow

public static void setCurrentWindow(ij.gui.ImageWindow win)
Makes the image contained in the specified window the active image.


getCurrentWindow

public static ij.gui.ImageWindow getCurrentWindow()
Returns the active ImageWindow.


getCurrentIndex

static int getCurrentIndex()

getCurrentImage

public static ImagePlus getCurrentImage()
Returns the active ImagePlus.


getWindowCount

public static int getWindowCount()
Returns the number of open image windows.


getImageCount

public static int getImageCount()
Returns the number of open images.


getFrontWindow

public static java.awt.Frame getFrontWindow()
Returns the front most window or null.


getIDList

public static int[] getIDList()
Returns a list of the IDs of open images. Returns null if no windows are open.


getNonImageWindows

public static java.awt.Frame[] getNonImageWindows()
Returns an array containing a list of the non-image windows.


getImage

public static ImagePlus getImage(int imageID)
For IDs less than zero, returns the ImagePlus with the specified ID. Returns null if no open window has a matching ID or no images are open. For IDs greater than zero, returns the Nth ImagePlus. Returns null if the ID is zero.


getNthImageID

public static int getNthImageID(int n)
Returns the ID of the Nth open image. Returns zero if n<=0 or n greater than the number of open image windows.


getImage

public static ImagePlus getImage(java.lang.String title)
Returns the first image that has the specified title or null if it is not found.


addWindow

public static void addWindow(java.awt.Frame win)
Adds the specified window to the Window menu.


checkForDuplicateName

static void checkForDuplicateName(ImagePlus imp)

isDuplicateName

static boolean isDuplicateName(java.lang.String name)

getUniqueName

public static java.lang.String getUniqueName(java.lang.String name)
Returns a unique name by adding, before the extension, -1, -2, etc. as needed.


makeUniqueName

public static java.lang.String makeUniqueName(java.lang.String name)
If 'name' is not unique, adds -1, -2, etc. as needed to make it unique.


removeWindow

public static void removeWindow(java.awt.Frame win)
Removes the specified window from the Window menu.


setWindow

public static void setWindow(java.awt.Frame win)
The specified frame becomes the front window, the one returnd by getFrontWindow().


closeAllWindows

public static boolean closeAllWindows()
Closes all windows. Stops and returns false if any image "save changes" dialog is canceled.


putBehind

public static void putBehind()
Activates the next image window on the window list.


setTempCurrentImage

public static void setTempCurrentImage(ImagePlus imp)
Makes the specified image temporarily the active image. Allows use of IJ.run() commands on images that are not displayed in a window. Call again with a null argument to revert to the previous active image.


getTempCurrentImage

public static ImagePlus getTempCurrentImage()
Returns tempCurrentImage, which may be null.


getFrame

public static java.awt.Frame getFrame(java.lang.String title)
Returns the frame with the specified title or null if a frame with that title is not found.


activateWindow

static void activateWindow(java.lang.String menuItemLabel,
                           java.awt.MenuItem item)
Activates a window selected from the Window menu.


repaintImageWindows

public static void repaintImageWindows()
Repaints all open image windows.


showList

static void showList()