Package org.scijava.ui.headless
Class HeadlessUI
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.ui.headless.HeadlessUI
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Identifiable,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,UserInterface,Versioned
- Direct Known Subclasses:
HeadlessUI
public class HeadlessUI extends AbstractRichPlugin implements UserInterface
A no-op user interface used when the application is running headless.Most operations do nothing. Attempting to show an object via one of the
show()methods logs the object via theLogService.- Author:
- Richard Domander (Royal Veterinary College, London), Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description HeadlessUI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilechooseFile(String title, File file, String style)Prompts the user to choose a file.DisplayWindowcreateDisplayWindow(Display<?> display)Creates a new display window housing the given display, or null if not applicable.DialogPromptdialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)Creates a dialog prompter.voiddispose()Performs any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible).booleanisVisible()Whether this UI is visible onscreen.booleanrequiresEDT()Returns true if this UI requires the EDT.voidrestoreLocation()Restores the application frame's current location.voidsaveLocation()Persists the application frame's current location.voidshow()Shows the UI.voidshow(String name, Object o)Shows the object onscreen using an appropriate UI widget.voidshow(Display<?> display)Shows the display onscreen using an appropriate UI widget.voidshowContextMenu(String menuRoot, Display<?> display, int x, int y)Displays a popup context menu for the given display at the specified position.-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.ui.UserInterface
chooseFile, chooseFiles, chooseFiles, getApplicationFrame, getConsolePane, getDesktop, getStatusBar, getSystemClipboard, getToolBar, show
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
show
public void show()
Description copied from interface:UserInterfaceShows the UI.Note that the actual UI components are created lazily when this method is called, rather then upon the UI's initial construction.
- Specified by:
showin interfaceUserInterface
-
isVisible
public boolean isVisible()
Description copied from interface:UserInterfaceWhether this UI is visible onscreen.- Specified by:
isVisiblein interfaceUserInterface
-
show
public void show(String name, Object o)
Description copied from interface:UserInterfaceShows the object onscreen using an appropriate UI widget.- Specified by:
showin interfaceUserInterface- Parameters:
name- The name to use when displaying the object.o- The object to be displayed.
-
show
public void show(Display<?> display)
Description copied from interface:UserInterfaceShows the display onscreen using an appropriate UI widget.- Specified by:
showin interfaceUserInterface
-
createDisplayWindow
public DisplayWindow createDisplayWindow(Display<?> display)
Description copied from interface:UserInterfaceCreates a new display window housing the given display, or null if not applicable.- Specified by:
createDisplayWindowin interfaceUserInterface
-
dialogPrompt
public DialogPrompt dialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
Description copied from interface:UserInterfaceCreates a dialog prompter.- Specified by:
dialogPromptin interfaceUserInterface- 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_MESSAGEtypically 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, or null if not applicable.
-
chooseFile
public File chooseFile(String title, File file, String style)
Description copied from interface:UserInterfacePrompts the user to choose a file.- Specified by:
chooseFilein interfaceUserInterface- Parameters:
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:- Returns:
- The
Filechosen by the user, or null if prompt is not available
-
showContextMenu
public void showContextMenu(String menuRoot, Display<?> display, int x, int y)
Description copied from interface:UserInterfaceDisplays a popup context menu for the given display at the specified position.- Specified by:
showContextMenuin interfaceUserInterface
-
saveLocation
public void saveLocation()
Description copied from interface:UserInterfacePersists the application frame's current location.- Specified by:
saveLocationin interfaceUserInterface
-
restoreLocation
public void restoreLocation()
Description copied from interface:UserInterfaceRestores the application frame's current location.- Specified by:
restoreLocationin interfaceUserInterface
-
requiresEDT
public boolean requiresEDT()
Description copied from interface:UserInterfaceReturns true if this UI requires the EDT.- Specified by:
requiresEDTin interfaceUserInterface
-
dispose
public void dispose()
Description copied from interface:DisposablePerforms any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible).- Specified by:
disposein interfaceDisposable
-
-