Class JaxoDialogs
java.lang.Object
net.sf.jaxodraw.gui.JaxoDialogs
A convenience class for user input dialogs.
The common 'parent' Component argument is the Component whose Window
to use as owner for the dialog. It may be 'null' (history, it was),
but this should be avoided in future.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDescription(Component parent, String old) Opens a dialog to choose a new description for a graph.static StringgetNewTabName(Component parent, String oldName) Pops up a JOptionPane to allow the user to enter some text.static StringOpens a dialog to enter a text.static JDialogA new JDialog with the first Dialog/Frame ancestor as owner and the given arguments.static JPanelA new JPanel with LINE_AXIS BoxLayout.static JPanelA new JPanel with PAGE_AXIS BoxLayout.static JPanelA new JPanel with BorderLayout and a titled (translated) border.static JPanelA new JPanel with FlowLayout and a titled (translated) border.static JPanelnewTitledLayoutPanel(String key, LayoutManager l) A new JPanel with the given layout and a titled (translated) border.static JPanelA new JPanel with LINE_AXIS BoxLayout and a titled (translated) border.static JPanelA new JPanel with PAGE_AXIS BoxLayout and a titled (translated) border.static voidshowErrorDialog(Component parent, String message) Shows a simple MessageDialog to display an error message.static voidshowErrorDialog(Component parent, String message, String title) Shows a simple MessageDialog to display an error message.static voidshowI18NErrorDialog(Component parent, String messageKey) Shows a simple MessageDialog to display an error message.static voidshowInfoDialog(Component parent, String message, String title) Shows a simple MessageDialog to display an info message.static voidshowMiniDialog(Component parent, String title, Object contents, ActionListener l) Show 'contents' in a new modal dialog with title 'title' and owner determined by 'parent'; adding "OK" and "Cancel" buttons.static StringtranslatedWindowTitle(String text) Format a text that is already translated as a window title (usually, adding prefix).static StringwindowTitle(String key) LikeJaxoLanguage.translate(String), but format as a window title (usually, adding prefix).static StringwindowTitle(String key, Object[] arguments) LikeJaxoLanguage.message(String,Object[]), but format as a window title (usually, adding prefix).static StringwindowTitle(JaxoDictionary d, String key) LikeJaxoDictionary.value(String), but format as a window title (usually, adding prefix).windowTitle(JaxoDictionary d, String key, Object[] arguments) LikeJaxoDictionary.message(String,Object[]), but format as a window title (usually, adding prefix).
-
Method Details
-
translatedWindowTitle
-
windowTitle
LikeJaxoLanguage.translate(String), but format as a window title (usually, adding prefix).- Parameters:
key- The key of the title text.- Returns:
- The formatted title.
-
windowTitle
LikeJaxoLanguage.message(String,Object[]), but format as a window title (usually, adding prefix).- Parameters:
key- The key of the title text.arguments- An array of arguments.- Returns:
- The formatted title.
-
windowTitle
LikeJaxoDictionary.value(String), but format as a window title (usually, adding prefix).- Parameters:
d- The dictionary for the title text.key- The key of the title text.- Returns:
- The formatted title.
-
windowTitle
LikeJaxoDictionary.message(String,Object[]), but format as a window title (usually, adding prefix).- Parameters:
d- The dictionary for the title text.key- The key of the title text.arguments- An array of arguments.- Returns:
- The formatted title.
-
newDialog
-
showMiniDialog
public static void showMiniDialog(Component parent, String title, Object contents, ActionListener l) Show 'contents' in a new modal dialog with title 'title' and owner determined by 'parent'; adding "OK" and "Cancel" buttons. If the user chooses "OK", the ActionListener argument is notified.- Parameters:
parent- The parent component.title- The title.contents- The dialog contents.l- The actionlistener to notify if the dialog is approved. If l is null, this method returns without bringing up the dialog.
-
showErrorDialog
-
showErrorDialog
-
showInfoDialog
-
showI18NErrorDialog
Shows a simple MessageDialog to display an error message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.- Parameters:
parent- The parent component.messageKey- The ResourceBundle key to look up the message.
-
getNewTabName
-
getDescription
-
getText
-
newLineBoxLayoutPanel
A new JPanel with LINE_AXIS BoxLayout.- Returns:
- A new JPanel.
-
newPageBoxLayoutPanel
A new JPanel with PAGE_AXIS BoxLayout.- Returns:
- A new JPanel.
-
newTitledLineBoxLayoutPanel
-
newTitledPageBoxLayoutPanel
-
newTitledFlowLayoutPanel
-
newTitledBorderLayoutPanel
-
newTitledLayoutPanel
A new JPanel with the given layout and a titled (translated) border.- Parameters:
key- The key of the title.l- The LayoutManager to use.- Returns:
- A new JPanel.
-