public abstract class AbstractSwingUI extends AbstractUserInterface implements SwingUI
Constructor and Description |
---|
AbstractSwingUI() |
Modifier and Type | Method and Description |
---|---|
File |
chooseFile(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 choose a list of files.
|
protected JMenuBar |
createConsoleMenu() |
protected JMenuBar |
createMenus()
Creates a
JMenuBar from the master ShadowMenu structure. |
protected void |
createUI()
Subclasses override to control UI creation.
|
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).
|
SwingApplicationFrame |
getApplicationFrame()
Gets the main SciJava application frame, or null if not applicable.
|
SwingConsolePane |
getConsolePane()
Gets the main SciJava console pane, or null if not applicable.
|
SwingStatusBar |
getStatusBar()
Gets the main SciJava status bar, or null if not applicable.
|
SystemClipboard |
getSystemClipboard()
Gets the system clipboard associated with this UI, or null if not
applicable.
|
SwingToolBar |
getToolBar()
Gets the main SciJava toolbar, or null if not applicable.
|
boolean |
requiresEDT()
Returns true if this UI requires the EDT.
|
protected abstract void |
setupAppFrame()
Configures the application frame for subclass-specific settings (e.g., SDI
or MDI).
|
protected abstract void |
setupConsole()
Configures the console for subclass-specific settings (e.g., SDI or MDI).
|
void |
showContextMenu(String menuRoot,
Display<?> display,
int x,
int y)
Displays a popup context menu for the given display at the specified
position.
|
isVisible, restoreLocation, saveLocation, show, show, show
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chooseFile, chooseFiles, createDisplayWindow, dialogPrompt, getDesktop, show
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public SwingApplicationFrame getApplicationFrame()
UserInterface
getApplicationFrame
in interface UserInterface
public SwingToolBar getToolBar()
UserInterface
getToolBar
in interface UserInterface
public SwingStatusBar getStatusBar()
UserInterface
getStatusBar
in interface UserInterface
public SwingConsolePane getConsolePane()
UserInterface
getConsolePane
in interface UserInterface
public SystemClipboard getSystemClipboard()
UserInterface
getSystemClipboard
in interface UserInterface
public File chooseFile(File file, String style)
UserInterface
chooseFile
in interface UserInterface
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 File[] chooseFiles(File parent, File[] files, FileFilter filter, String style)
UserInterface
chooseFiles
in interface UserInterface
parent
- Parent folder for file selectionfiles
- The initial value displayed in the file chooser prompt.filter
- A filter allowing to restrict file choice.style
- File selection style (files, directories, or both) and optional filtersFile
s chosen by the user, or null if the
user cancels the prompt.public void showContextMenu(String menuRoot, Display<?> display, int x, int y)
UserInterface
showContextMenu
in interface UserInterface
public boolean requiresEDT()
UserInterface
requiresEDT
in interface UserInterface
public void dispose()
Disposable
dispose
in interface Disposable
protected void createUI()
AbstractUserInterface
ApplicationFrame
but before
showing it (assuming the UI has an ApplicationFrame
).createUI
in class AbstractUserInterface
protected JMenuBar createMenus()
JMenuBar
from the master ShadowMenu
structure.protected JMenuBar createConsoleMenu()
protected abstract void setupAppFrame()
protected abstract void setupConsole()
Copyright © 2015–2022 SciJava. All rights reserved.