|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.ui.DefaultUIService
public final class DefaultUIService
Default service for handling ImageJ user interfaces.
| Field Summary |
|---|
| Fields inherited from interface org.scijava.ui.UIService |
|---|
UI_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultUIService()
|
|
| 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. |
void |
dispose()
Performs any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible). |
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. |
protected void |
onEvent(AppQuitEvent event)
|
protected void |
onEvent(DisplayActivatedEvent e)
Called when a display is activated. |
protected void |
onEvent(DisplayCreatedEvent e)
Called when a display is created. |
protected void |
onEvent(DisplayDeletedEvent e)
Called when a display is deleted. |
protected void |
onEvent(DisplayUpdatedEvent e)
Called when a display is updated. |
protected void |
onEvent(StatusEvent event)
|
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 class org.scijava.service.AbstractService |
|---|
getContext, initialize, registerEventHandlers, setContext, toString |
| Methods inherited from class org.scijava.plugin.AbstractRichPlugin |
|---|
compareTo, getInfo, getPriority, setInfo, setPriority |
| Methods inherited from class org.scijava.AbstractContextual |
|---|
context |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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 |
| Constructor Detail |
|---|
public DefaultUIService()
| Method Detail |
|---|
public void addUI(UserInterface ui)
UIService
Note that a UI added explicitly via this method will never be considered
the default UI unless UIService.setDefaultUI(UserInterface) is also called.
addUI in interface UIServiceui - The UI to add.
public void addUI(String name,
UserInterface ui)
UIService
Note that a UI added explicitly via this method will never be considered
the default UI unless UIService.setDefaultUI(UserInterface) is also called.
addUI in interface UIServicename - The nickname for the UI.ui - The UI to add.public void showUI()
UIService
showUI in interface UIServiceUIService.getDefaultUI(),
UIService.setDefaultUI(UserInterface)public void showUI(String name)
UIService
showUI in interface UIServicepublic void showUI(UserInterface ui)
UIService
showUI in interface UIServicepublic boolean isVisible()
UIService
isVisible in interface UIServiceUIService.getDefaultUI(),
UIService.setDefaultUI(UserInterface)public boolean isVisible(String name)
UIService
isVisible in interface UIServicepublic UserInterface getDefaultUI()
UIService
getDefaultUI in interface UIServiceUIService.showUI(),
UIService.isVisible()public void setDefaultUI(UserInterface ui)
UIService
setDefaultUI in interface UIServiceUIService.showUI()public boolean isDefaultUI(String name)
UIService
isDefaultUI in interface UIServicepublic UserInterface getUI(String name)
UIService
getUI in interface UIServicepublic List<UserInterface> getAvailableUIs()
UIService
getAvailableUIs in interface UIServicepublic List<UserInterface> getVisibleUIs()
UIService
getVisibleUIs in interface UIServicepublic List<PluginInfo<DisplayViewer<?>>> getViewerPlugins()
UIService
getViewerPlugins in interface UIServicepublic void show(Object o)
UIServiceDisplay for the given object, and shows it using an
appropriate UI widget of the default user interface.
show in interface UIService
public void show(String name,
Object o)
UIServiceDisplay for the given object, and shows it using an
appropriate UI widget of the default user interface.
show in interface UIServicename - The name to use when displaying the object.o - The object to be displayed.public void show(Display<?> display)
UIServiceDisplay using an appropriate UI widget
of the default user interface.
show in interface UIServicepublic void addDisplayViewer(DisplayViewer<?> viewer)
UIService
addDisplayViewer in interface UIServicepublic DisplayViewer<?> getDisplayViewer(Display<?> display)
UIServiceDisplay.
getDisplayViewer in interface UIServicepublic DialogPrompt.Result showDialog(String message)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - The message in the dialog itself.
public DialogPrompt.Result showDialog(String message,
DialogPrompt.MessageType messageType)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - 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.
public DialogPrompt.Result showDialog(String message,
DialogPrompt.MessageType messageType,
DialogPrompt.OptionType optionType)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - 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.
public DialogPrompt.Result showDialog(String message,
String title)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - The message in the dialog itself.title - The title of the dialog.
public DialogPrompt.Result showDialog(String message,
String title,
DialogPrompt.MessageType messageType)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - 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.
public DialogPrompt.Result showDialog(String message,
String title,
DialogPrompt.MessageType messageType,
DialogPrompt.OptionType optionType)
UIServiceThe prompt is displayed in the default user interface.
showDialog in interface UIServicemessage - 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.
public File chooseFile(File file,
String style)
UIServiceThe prompt is displayed in the default user interface.
chooseFile in interface UIServicefile - The initial value displayed in the file chooser prompt.style - The style of chooser to use:
public void showContextMenu(String menuRoot,
Display<?> display,
int x,
int y)
UIServiceThe context menu is displayed in the default user interface.
showContextMenu in interface UIServicepublic String getStatusMessage(StatusEvent statusEvent)
UIService
getStatusMessage in interface UIServiceStatusService.getStatusMessage(String, StatusEvent)public void dispose()
Disposable
dispose in interface Disposabledispose in class AbstractServiceprotected void onEvent(DisplayCreatedEvent e)
protected void onEvent(DisplayDeletedEvent e)
protected void onEvent(DisplayUpdatedEvent e)
protected void onEvent(DisplayActivatedEvent e)
The goal here is to eventually synchronize the window activation state with the display activation state if the display activation state changed programmatically. We queue a call on the UI thread to activate the display viewer of the currently active window.
protected void onEvent(AppQuitEvent event)
protected void onEvent(StatusEvent event)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||