public interface UserInterface extends RichPlugin, Disposable
UIs discoverable at runtime must implement this interface and be annotated
with @Plugin
with attribute Plugin.type()
=
UserInterface
.class. While it possible to create a UI merely by
implementing this interface, it is encouraged to instead extend
AbstractUserInterface
, for convenience.
Modifier and Type | Method and Description |
---|---|
File |
chooseFile(File file,
String style)
Prompts the user to choose a file.
|
DisplayWindow |
createDisplayWindow(Display<?> display)
Creates a new display window housing the given display.
|
DialogPrompt |
dialogPrompt(String message,
String title,
DialogPrompt.MessageType messageType,
DialogPrompt.OptionType optionType)
Creates a dialog prompter.
|
ApplicationFrame |
getApplicationFrame()
Gets the main SciJava application frame, or null if not applicable.
|
ConsolePane<?> |
getConsolePane()
Gets the main SciJava console pane, or null if not applicable.
|
Desktop |
getDesktop()
Gets the desktop, for use with multi-document interfaces (MDI).
|
StatusBar |
getStatusBar()
Gets the main SciJava status bar, or null if not applicable.
|
SystemClipboard |
getSystemClipboard()
Gets the system clipboard associated with this UI.
|
ToolBar |
getToolBar()
Gets the main SciJava toolbar, or null if not applicable.
|
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(Object o)
Shows the object 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.
|
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
void show()
Note that the actual UI components are created lazily when this method is called, rather then upon the UI's initial construction.
boolean isVisible()
void show(Object o)
void show(String name, Object o)
name
- The name to use when displaying the object.o
- The object to be displayed.void show(Display<?> display)
Desktop getDesktop()
ApplicationFrame getApplicationFrame()
ToolBar getToolBar()
StatusBar getStatusBar()
ConsolePane<?> getConsolePane()
SystemClipboard getSystemClipboard()
DisplayWindow createDisplayWindow(Display<?> display)
DialogPrompt dialogPrompt(String message, String title, DialogPrompt.MessageType messageType, DialogPrompt.OptionType optionType)
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)
file
- The initial value displayed in the file chooser prompt.style
- The style of chooser to use:
void showContextMenu(String menuRoot, Display<?> display, int x, int y)
void saveLocation()
void restoreLocation()
boolean requiresEDT()
Copyright © 2009–2015 SciJava. All rights reserved.