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 java.lang.String CHART_TYPE
           
static boolean checkForDuplicateName
           
static java.lang.String CLUSTER_TYPE
           
static java.lang.String IMAGE_TYPE
           
 
Method Summary
static void addWindow(java.awt.Frame win)
          Adds the specified Frame to the Window menu.
static void addWindow(java.awt.Window win)
          Adds the specified window to the Window menu.
static boolean closeAllWindows()
          Closes all windows.
static java.awt.Window getActiveWindow()
          Returns the front most window or null.
static java.util.Vector getAvailableLayoutComponents()
           
static java.util.Vector getAvailableLayoutComponents(java.lang.String type)
           
static java.util.Vector getAvailableLayoutComponents(java.lang.String type, boolean silent)
           
static java.util.Vector getAvailableLayouts()
           
static java.util.Vector getCharts()
           
static java.util.Vector getClusters()
           
static ImagePlus getCurrentImage()
          Returns a reference to the active image or null if there isn't one.
static ImageWindow getCurrentWindow()
          Returns the active ImageWindow.
static java.awt.Frame getFrame(java.lang.String title)
          Obsolete; replaced by getWindow().
static ChartFramePlugIn getFrontChart()
           
static ClusterFramePlugIn getFrontCluster()
           
static ImagePlus getFrontImage()
           
static Layout getFrontLayout()
           
static java.awt.Frame getFrontWindow()
          Obsolete; replaced by getActiveWindow.
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.util.Vector getImages()
           
static java.lang.String[] getImageTitles()
           
static java.util.Vector getImageWindowsVector()
           
static java.lang.String[] getNonImageTitles()
          Returns an array containing the titles of non-image Frames and Dialogs.
static java.awt.Frame[] getNonImageWindows()
          Returns an array containing a list of the non-image Frames.
static java.util.Vector getNonImageWindowsVector()
           
static int getNthImageID(int n)
          Returns the ID of the Nth open image.
static ImagePlus getTempCurrentImage()
          Returns the temporary current image for this thread, or 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 java.awt.Window getWindow(java.lang.String title)
          Returns the window (a Frame or a Dialog) with the specified title, or null if a window with that title is not found.
static int getWindowCount()
          Returns the number of open image windows.
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 Frame from the Window menu.
static void removeWindow(java.awt.Window win)
          Removes the specified window from the Window menu.
static void repaintImageWindows()
          Repaints all open image windows.
static void setCurrentWindow(ImageWindow win)
          Makes the image contained in the specified window the active image.
static void setTempCurrentImage(ImagePlus img)
          Makes the specified image temporarily the active image for this thread.
static void setTempCurrentImage(java.lang.Thread thread, ImagePlus img)
          Sets a temporary image for the specified thread.
static void setWindow(java.awt.Frame win)
          The specified frame becomes the front window, the one returnd by getFrontWindow().
static void setWindow(java.awt.Window win)
          The specified Window becomes the front window.
static void toFront(java.awt.Frame frame)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_TYPE

public static java.lang.String IMAGE_TYPE

CHART_TYPE

public static java.lang.String CHART_TYPE

CLUSTER_TYPE

public static java.lang.String CLUSTER_TYPE

checkForDuplicateName

public static boolean checkForDuplicateName
Method Detail

setCurrentWindow

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


getCurrentWindow

public static ImageWindow getCurrentWindow()
Returns the active ImageWindow.


getCurrentImage

public static ImagePlus getCurrentImage()
Returns a reference to the active image or null if there isn't one.

See Also:
IJ.getImage()

setTempCurrentImage

public static void setTempCurrentImage(ImagePlus img)
Makes the specified image temporarily the active image for this thread. Call again with a null argument to revert to the previous active image.


setTempCurrentImage

public static void setTempCurrentImage(java.lang.Thread thread,
                                       ImagePlus img)
Sets a temporary image for the specified thread.


getWindowCount

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


getImageCount

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


getActiveWindow

public static java.awt.Window getActiveWindow()
Returns the front most window or null.


getFrontWindow

public static java.awt.Frame getFrontWindow()
Obsolete; replaced by getActiveWindow.


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 Frames.


getNonImageTitles

public static java.lang.String[] getNonImageTitles()
Returns an array containing the titles of non-image Frames and Dialogs.


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.Window win)
Adds the specified window to the Window menu.


addWindow

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


getImageWindowsVector

public static java.util.Vector getImageWindowsVector()

getNonImageWindowsVector

public static java.util.Vector getNonImageWindowsVector()

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.Window win)
Removes the specified window from the Window menu.


removeWindow

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


setWindow

public static void setWindow(java.awt.Window win)
The specified Window becomes the front window.


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 an image or Editor "save changes" dialog is canceled.


putBehind

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


getTempCurrentImage

public static ImagePlus getTempCurrentImage()
Returns the temporary current image for this thread, or null.


getWindow

public static java.awt.Window getWindow(java.lang.String title)
Returns the window (a Frame or a Dialog) with the specified title, or null if a window with that title is not found.


getFrame

public static java.awt.Frame getFrame(java.lang.String title)
Obsolete; replaced by getWindow().


repaintImageWindows

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


toFront

public static void toFront(java.awt.Frame frame)

getAvailableLayouts

public static java.util.Vector getAvailableLayouts()

getImageTitles

public static java.lang.String[] getImageTitles()

getImages

public static java.util.Vector getImages()

getCharts

public static java.util.Vector getCharts()

getClusters

public static java.util.Vector getClusters()

getFrontLayout

public static Layout getFrontLayout()

getFrontImage

public static ImagePlus getFrontImage()

getFrontCluster

public static ClusterFramePlugIn getFrontCluster()

getFrontChart

public static ChartFramePlugIn getFrontChart()

getAvailableLayoutComponents

public static java.util.Vector getAvailableLayoutComponents()

getAvailableLayoutComponents

public static java.util.Vector getAvailableLayoutComponents(java.lang.String type)

getAvailableLayoutComponents

public static java.util.Vector getAvailableLayoutComponents(java.lang.String type,
                                                            boolean silent)