org.scijava.ui
Interface UIService

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

public interface UIService
extends SciJavaService

Interface for service that handles user interfaces.

Author:
Curtis Rueden

Field Summary
static String UI_PROPERTY
          System property to set for overriding the default UI.
 
Method Summary
 void addDisplayViewer(DisplayViewer<?> viewer)
          Registers the given viewer with the service.
 void addUI(String name, UserInterface ui)
          Adds the given UI to those managed by the service.
 void addUI(UserInterface ui)
          Adds the given UI to those managed by the service.
 File chooseFile(File file, String style)
          Prompts the user to choose a file.
 List<UserInterface> getAvailableUIs()
          Gets the user interfaces available to the service.
 UserInterface getDefaultUI()
          Gets the default user interface.
 DisplayViewer<?> getDisplayViewer(Display<?> display)
          Gets the UI widget being used to visualize the given Display.
 String getStatusMessage(StatusEvent statusEvent)
          Gets the status message associated with the given event.
 UserInterface getUI(String name)
          Gets the UI with the given name (or class name).
 List<PluginInfo<DisplayViewer<?>>> getViewerPlugins()
          Gets the list of known viewer plugins.
 List<UserInterface> getVisibleUIs()
          Gets the user interfaces that are currently visible.
 boolean isDefaultUI(String name)
          Gets whether the UI with the given name (or class name) is the default one.
 boolean isVisible()
          Gets whether the default UI is visible.
 boolean isVisible(String name)
          Gets whether the UI with the given name or class name is visible.
 void setDefaultUI(UserInterface ui)
          Sets the default user interface.
 void show(Display<?> display)
          Creates and shows the given Display using an appropriate UI widget of the default user interface.
 void show(Object o)
          Creates a Display for the given object, and shows it using an appropriate UI widget of the default user interface.
 void show(String name, Object o)
          Creates a Display for the given object, and shows it using an appropriate UI widget of the default user interface.
 void showContextMenu(String menuRoot, Display<?> display, int x, int y)
          Displays a popup context menu for the given display at the specified position.
 DialogPrompt.Result showDialog(String message)
          Displays a dialog prompt.
 DialogPrompt.Result showDialog(String message, DialogPrompt.MessageType messageType)
          Displays a dialog prompt.
 DialogPrompt.Result showDialog(String message, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
          Displays a dialog prompt.
 DialogPrompt.Result showDialog(String message, String title)
          Displays a dialog prompt.
 DialogPrompt.Result showDialog(String message, String title, DialogPrompt.MessageType messageType)
          Displays a dialog prompt.
 DialogPrompt.Result showDialog(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
          Displays a dialog prompt.
 void showUI()
          Displays the UI for the default user interface.
 void showUI(String name)
          Displays the UI with the given name (or class name).
 void showUI(UserInterface ui)
          Displays the given UI.
 
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
 
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
 

Field Detail

UI_PROPERTY

static final String UI_PROPERTY
System property to set for overriding the default UI.

See Also:
Constant Field Values
Method Detail

addUI

void addUI(UserInterface ui)
Adds the given UI to those managed by the service.

Note that a UI added explicitly via this method will never be considered the default UI unless setDefaultUI(UserInterface) is also called.

Parameters:
ui - The UI to add.

addUI

void addUI(String name,
           UserInterface ui)
Adds the given UI to those managed by the service.

Note that a UI added explicitly via this method will never be considered the default UI unless setDefaultUI(UserInterface) is also called.

Parameters:
name - The nickname for the UI.
ui - The UI to add.

showUI

void showUI()
Displays the UI for the default user interface.

See Also:
getDefaultUI(), setDefaultUI(UserInterface)

showUI

void showUI(String name)
Displays the UI with the given name (or class name).


showUI

void showUI(UserInterface ui)
Displays the given UI.


isVisible

boolean isVisible()
Gets whether the default UI is visible.

See Also:
getDefaultUI(), setDefaultUI(UserInterface)

isVisible

boolean isVisible(String name)
Gets whether the UI with the given name or class name is visible.


getDefaultUI

UserInterface getDefaultUI()
Gets the default user interface.

See Also:
showUI(), isVisible()

setDefaultUI

void setDefaultUI(UserInterface ui)
Sets the default user interface.

See Also:
showUI()

isDefaultUI

boolean isDefaultUI(String name)
Gets whether the UI with the given name (or class name) is the default one.


getUI

UserInterface getUI(String name)
Gets the UI with the given name (or class name).


getAvailableUIs

List<UserInterface> getAvailableUIs()
Gets the user interfaces available to the service.


getVisibleUIs

List<UserInterface> getVisibleUIs()
Gets the user interfaces that are currently visible.


getViewerPlugins

List<PluginInfo<DisplayViewer<?>>> getViewerPlugins()
Gets the list of known viewer plugins.


addDisplayViewer

void addDisplayViewer(DisplayViewer<?> viewer)
Registers the given viewer with the service.


getDisplayViewer

DisplayViewer<?> getDisplayViewer(Display<?> display)
Gets the UI widget being used to visualize the given Display.


show

void show(Object o)
Creates a Display for the given object, and shows it using an appropriate UI widget of the default user interface.


show

void show(String name,
          Object o)
Creates a Display for the given object, and shows it using an appropriate UI widget of the default user interface.

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

show

void show(Display<?> display)
Creates and shows the given Display using an appropriate UI widget of the default user interface.


showDialog

DialogPrompt.Result showDialog(String message)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

Parameters:
message - The message in the dialog itself.
Returns:
The choice selected by the user when dismissing the dialog.

showDialog

DialogPrompt.Result showDialog(String message,
                               DialogPrompt.MessageType messageType)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

Parameters:
message - The message in the dialog itself.
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.
Returns:
The choice selected by the user when dismissing the dialog.

showDialog

DialogPrompt.Result showDialog(String message,
                               DialogPrompt.MessageType messageType,
                               DialogPrompt.OptionType optionType)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

Parameters:
message - The message in the dialog itself.
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 choice selected by the user when dismissing the dialog.

showDialog

DialogPrompt.Result showDialog(String message,
                               String title)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

Parameters:
message - The message in the dialog itself.
title - The title of the dialog.
Returns:
The choice selected by the user when dismissing the dialog.

showDialog

DialogPrompt.Result showDialog(String message,
                               String title,
                               DialogPrompt.MessageType messageType)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

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.
Returns:
The choice selected by the user when dismissing the dialog.

showDialog

DialogPrompt.Result showDialog(String message,
                               String title,
                               DialogPrompt.MessageType messageType,
                               DialogPrompt.OptionType optionType)
Displays a dialog prompt.

The prompt is displayed in the default user interface.

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 choice selected by the user when dismissing the dialog.

chooseFile

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

The prompt is displayed in the default user interface.

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.

The context menu is displayed in the default user interface.


getStatusMessage

String getStatusMessage(StatusEvent statusEvent)
Gets the status message associated with the given event.

See Also:
StatusService.getStatusMessage(String, StatusEvent)


Copyright © 2009–2014 SciJava. All rights reserved.