public class GuiUtilities extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
GuiUtilities.IOnCloseListener |
| Modifier and Type | Field and Description |
|---|---|
static String |
LAST_PATH |
static String |
PREF_STRING_SEPARATORS |
| Constructor and Description |
|---|
GuiUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addClosingListener(JFrame frame,
GuiUtilities.IOnCloseListener freeResourcesComponent) |
static void |
centerOnScreen(Component component)
Set the location of a component to center it on the screen.
|
static void |
copyToClipboard(String text) |
static File |
getLastFile()
Handle the last set path preference.
|
static String |
getPreference(String preferenceKey,
String defaultValue)
Get from preference.
|
static String[] |
getPreference(String preferenceKey,
String[] defaultValue) |
static JDialog |
openDialogWithPanel(JPanel panel,
String title,
Dimension dimension) |
static void |
openFile(File file) |
static void |
setDefaultLookAndFeel() |
static void |
setLastPath(String lastPath)
Save the passed path as last path available.
|
static void |
setPreference(String preferenceKey,
String value)
Set a preference.
|
static void |
setPreference(String preferenceKey,
String[] valuesArray) |
static String |
showComboDialog(Component parentComponent,
String title,
String message,
String[] values) |
static void |
showErrorMessage(Component parentComponent,
String title,
String message) |
static void |
showInfoMessage(Component parentComponent,
String title,
String message) |
static String |
showInputDialog(Component parentComponent,
String message,
String defaultInput) |
static String[] |
showMultiInputDialog(Component parentComponent,
String title,
String[] labels,
String[] defaultValues,
HashMap<String,String[]> fields2ValuesMap)
Create a simple multi input pane, that returns what the use inserts.
|
static void |
showWarningMessage(Component parentComponent,
String title,
String message) |
public static final String LAST_PATH
public static final String PREF_STRING_SEPARATORS
public static void centerOnScreen(Component component)
component - the component to center.public static File getLastFile()
public static void setLastPath(String lastPath)
lastPath - the last path to save.public static String getPreference(String preferenceKey, String defaultValue)
preferenceKey - the preference key.defaultValue - the default value in case of null.public static void setPreference(String preferenceKey, String value)
preferenceKey - the preference key.value - the value to set.public static void copyToClipboard(String text)
public static void openFile(File file) throws IOException
IOExceptionpublic static JDialog openDialogWithPanel(JPanel panel, String title, Dimension dimension)
public static String showInputDialog(Component parentComponent, String message, String defaultInput)
public static String[] showMultiInputDialog(Component parentComponent, String title, String[] labels, String[] defaultValues, HashMap<String,String[]> fields2ValuesMap)
parentComponent - title - the dialog title.labels - the labels to set.defaultValues - a set of default values.public static String showComboDialog(Component parentComponent, String title, String message, String[] values)
public static void setDefaultLookAndFeel()
public static void addClosingListener(JFrame frame, GuiUtilities.IOnCloseListener freeResourcesComponent)
public static void showInfoMessage(Component parentComponent, String title, String message)
public static void showWarningMessage(Component parentComponent, String title, String message)
Copyright © 2005-2017 HydroloGIS. All Rights Reserved.