public interface UIService extends SciJavaService
Modifier and Type | Field and Description |
---|---|
static String |
UI_PROPERTY
System property to set for overriding the default UI.
|
Modifier and Type | Method and Description |
---|---|
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.
|
File |
chooseFile(String title,
File file,
String style)
Prompts the user to choose a file.
|
File[] |
chooseFiles(File parent,
File[] files,
FileFilter filter,
String style)
Prompts the user to select one or multiple files.
|
List<File> |
chooseFiles(File parent,
List<File> fileList,
FileFilter filter,
String style)
Prompts the user to select one or multiple files.
|
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 |
isHeadless()
Gets whether the UI is running in headless mode (no UI).
|
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 |
setHeadless(boolean isHeadless)
Sets whether the application is running in headless mode (no UI).
|
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.
|
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
static final String UI_PROPERTY
void addUI(UserInterface ui)
Note that a UI added explicitly via this method will never be considered
the default UI unless setDefaultUI(UserInterface)
is also called.
ui
- The UI to add.void addUI(String name, UserInterface ui)
Note that a UI added explicitly via this method will never be considered
the default UI unless setDefaultUI(UserInterface)
is also called.
name
- The nickname for the UI.ui
- The UI to add.void showUI()
getDefaultUI()
,
setDefaultUI(UserInterface)
void showUI(String name)
void showUI(UserInterface ui)
boolean isVisible()
getDefaultUI()
,
setDefaultUI(UserInterface)
boolean isVisible(String name)
void setHeadless(boolean isHeadless)
boolean isHeadless()
UserInterface getDefaultUI()
showUI()
,
isVisible()
void setDefaultUI(UserInterface ui)
showUI()
boolean isDefaultUI(String name)
UserInterface getUI(String name)
List<UserInterface> getAvailableUIs()
List<UserInterface> getVisibleUIs()
List<PluginInfo<DisplayViewer<?>>> getViewerPlugins()
void addDisplayViewer(DisplayViewer<?> viewer)
DisplayViewer<?> getDisplayViewer(Display<?> display)
Display
.void show(Object o)
Display
for the given object, and shows it using an
appropriate UI widget of the default user interface.void show(String name, Object o)
Display
for the given object, and shows it using an
appropriate UI widget of the default user interface.name
- The name to use when displaying the object.o
- The object to be displayed.void show(Display<?> display)
Display
using an appropriate UI widget
of the default user interface.DialogPrompt.Result showDialog(String message)
The prompt is displayed in the default user interface.
message
- The message in the dialog itself.DialogPrompt.Result showDialog(String message, DialogPrompt.MessageType messageType)
The prompt is displayed in the default user interface.
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.DialogPrompt.Result showDialog(String message, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
The prompt is displayed in the default user interface.
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.DialogPrompt.Result showDialog(String message, String title)
The prompt is displayed in the default user interface.
message
- The message in the dialog itself.title
- The title of the dialog.DialogPrompt.Result showDialog(String message, String title, DialogPrompt.MessageType messageType)
The prompt is displayed in the default user interface.
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.DialogPrompt.Result showDialog(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
The prompt is displayed in the default user interface.
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.File chooseFile(File file, String style)
The prompt is displayed in the default user interface.
file
- The initial value displayed in the file chooser prompt.style
- The style of chooser to use:
File chooseFile(String title, File file, String style)
The prompt is displayed in the default user interface.
title
- Title to use in the file chooser dialog.file
- The initial value displayed in the file chooser prompt.style
- The style of chooser to use:
File[] chooseFiles(File parent, File[] files, FileFilter filter, String style)
The prompt is displayed in the default user interface.
files
- The initial value displayed in the file chooser prompt.filter
- A filter allowing to restrict the choice of filesList<File> chooseFiles(File parent, List<File> fileList, FileFilter filter, String style)
The prompt is displayed in the default user interface.
fileList
- The initial value displayed in the file chooser prompt.filter
- A filter allowing to restrict the choice of filesvoid showContextMenu(String menuRoot, Display<?> display, int x, int y)
The context menu is displayed in the default user interface.
String getStatusMessage(StatusEvent statusEvent)
Copyright © 2015–2022 SciJava. All rights reserved.