org.scijava.ui
Interface UserInterface

All Superinterfaces:
Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, Prioritized, RichPlugin, SciJavaPlugin
All Known Implementing Classes:
AbstractUserInterface

public interface UserInterface
extends RichPlugin, Disposable

An end-user ImageJ application user interface.

UIs discoverable at runtime must implement this interface and be annotated with @Plugin with attribute Plugin.type() = UserInterface.class. While it possible to create a UI merely by implementing this interface, it is encouraged to instead extend AbstractUserInterface, for convenience.

Author:
Curtis Rueden
See Also:
Plugin, UIService

Method Summary
 File chooseFile(File file, String style)
          Prompts the user to choose a file.
 DisplayWindow createDisplayWindow(Display<?> display)
          Creates a new display window housing the given display.
 DialogPrompt dialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
          Creates a dialog prompter.
 ApplicationFrame getApplicationFrame()
          Gets the main ImageJ application frame, or null if not applicable.
 Desktop getDesktop()
          Gets the desktop, for use with multi-document interfaces (MDI).
 StatusBar getStatusBar()
          Gets the main ImageJ status bar, or null if not applicable.
 SystemClipboard getSystemClipboard()
          Gets the system clipboard associated with this UI.
 ToolBar getToolBar()
          Gets the main ImageJ toolbar, or null if not applicable.
 boolean isVisible()
          Whether this UI is visible onscreen.
 boolean requiresEDT()
          Returns true if this UI requires the EDT.
 void restoreLocation()
          Restores the application frame's current location.
 void saveLocation()
          Persists the application frame's current location.
 void show()
          Shows the UI.
 void show(Display<?> display)
          Shows the display onscreen using an appropriate UI widget.
 void show(Object o)
          Shows the object onscreen using an appropriate UI widget.
 void show(String name, Object o)
          Shows the object onscreen using an appropriate UI widget.
 void showContextMenu(String menuRoot, Display<?> display, int x, int y)
          Displays a popup context menu for the given display at the specified position.
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Method Detail

show

void show()
Shows the UI.

Note that the actual UI components are created lazily when this method is called, rather then upon the UI's initial construction.


isVisible

boolean isVisible()
Whether this UI is visible onscreen.


show

void show(Object o)
Shows the object onscreen using an appropriate UI widget.


show

void show(String name,
          Object o)
Shows the object onscreen using an appropriate UI widget.

Parameters:
name - The name to use when displaying the object.
o - The object to be displayed.

show

void show(Display<?> display)
Shows the display onscreen using an appropriate UI widget.


getDesktop

Desktop getDesktop()
Gets the desktop, for use with multi-document interfaces (MDI).


getApplicationFrame

ApplicationFrame getApplicationFrame()
Gets the main ImageJ application frame, or null if not applicable.


getToolBar

ToolBar getToolBar()
Gets the main ImageJ toolbar, or null if not applicable.


getStatusBar

StatusBar getStatusBar()
Gets the main ImageJ status bar, or null if not applicable.


getSystemClipboard

SystemClipboard getSystemClipboard()
Gets the system clipboard associated with this UI.


createDisplayWindow

DisplayWindow createDisplayWindow(Display<?> display)
Creates a new display window housing the given display.


dialogPrompt

DialogPrompt dialogPrompt(String message,
                          String title,
                          DialogPrompt.MessageType messageType,
                          DialogPrompt.OptionType optionType)
Creates a dialog prompter.

Parameters:
message - The message in the dialog itself.
title - The title of the dialog.
messageType - The type of message. This typically is rendered as an icon next to the message. For example, DialogPrompt.MessageType.WARNING_MESSAGE typically appears as an exclamation point.
optionType - The choices available when dismissing the dialog. These choices are typically rendered as buttons for the user to click.
Returns:
The newly created DialogPrompt object.

chooseFile

File chooseFile(File file,
                String style)
Prompts the user to choose a file.

Parameters:
file - The initial value displayed in the file chooser prompt.
style - The style of chooser to use:

showContextMenu

void showContextMenu(String menuRoot,
                     Display<?> display,
                     int x,
                     int y)
Displays a popup context menu for the given display at the specified position.


saveLocation

void saveLocation()
Persists the application frame's current location.


restoreLocation

void restoreLocation()
Restores the application frame's current location.


requiresEDT

boolean requiresEDT()
Returns true if this UI requires the EDT.



Copyright © 2009–2014 SciJava. All rights reserved.