public class HeadlessUI extends AbstractRichPlugin implements UserInterface
Most operations do nothing. Attempting to show an object via one of the
show()
methods logs the object via the LogService
.
Constructor and Description |
---|
HeadlessUI() |
Modifier and Type | Method and Description |
---|---|
File |
chooseFile(String title,
File file,
String style)
Prompts the user to choose a file.
|
DisplayWindow |
createDisplayWindow(Display<?> display)
Creates a new display window housing the given display, or null if not
applicable.
|
DialogPrompt |
dialogPrompt(String message,
String title,
DialogPrompt.MessageType messageType,
DialogPrompt.OptionType optionType)
Creates a dialog prompter.
|
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).
|
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(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.
|
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chooseFile, chooseFiles, chooseFiles, getApplicationFrame, getConsolePane, getDesktop, getStatusBar, getSystemClipboard, getToolBar, show
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public static final String NAME
public void show()
UserInterface
Note that the actual UI components are created lazily when this method is called, rather then upon the UI's initial construction.
show
in interface UserInterface
public boolean isVisible()
UserInterface
isVisible
in interface UserInterface
public void show(String name, Object o)
UserInterface
show
in interface UserInterface
name
- The name to use when displaying the object.o
- The object to be displayed.public void show(Display<?> display)
UserInterface
show
in interface UserInterface
public DisplayWindow createDisplayWindow(Display<?> display)
UserInterface
createDisplayWindow
in interface UserInterface
public DialogPrompt dialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
UserInterface
dialogPrompt
in interface UserInterface
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.public File chooseFile(String title, File file, String style)
UserInterface
chooseFile
in interface UserInterface
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
chosen by the user, or null if prompt is not
availablepublic void showContextMenu(String menuRoot, Display<?> display, int x, int y)
UserInterface
showContextMenu
in interface UserInterface
public void saveLocation()
UserInterface
saveLocation
in interface UserInterface
public void restoreLocation()
UserInterface
restoreLocation
in interface UserInterface
public boolean requiresEDT()
UserInterface
requiresEDT
in interface UserInterface
public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2015–2022 SciJava. All rights reserved.