public class GuiUtils extends Object
Modifier and Type | Class and Description |
---|---|
class |
GuiUtils.JTextFieldFile |
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_MENU_WEIGHT
The default sorting weight for the Plugins>Neuroanatomy> submenu
|
static String |
LAF_DARCULA |
static String |
LAF_DARK |
static String |
LAF_DEFAULT |
static String |
LAF_LIGHT |
static String |
LAF_LIGHT_INTJ |
Modifier and Type | Method and Description |
---|---|
static void |
addSeparator(JComponent component,
JLabel label,
boolean vgap,
GridBagConstraints c) |
static void |
addSeparator(JComponent component,
String heading,
boolean vgap,
GridBagConstraints c) |
void |
addTooltip(JComponent c,
String text) |
static String[] |
availableLookAndFeels() |
void |
blinkingError(JComponent blinkingComponent,
String msg) |
void |
centeredMsg(String msg,
String title) |
void |
centeredMsg(String msg,
String title,
String buttonLabel) |
static void |
closeSplashScreen() |
static void |
collapseAllTreeNodes(JTree tree) |
static ImageIcon |
createIcon(Color color,
int width,
int height) |
static String |
ctrlKey() |
static GridBagConstraints |
defaultGbc() |
JDialog |
dialog(String msg,
JComponent component,
String title) |
static JSpinner |
doubleSpinner(double value,
double min,
double max,
double step,
int nDecimals) |
static void |
enableComponents(Container container,
boolean enable) |
void |
error(String msg) |
void |
error(String msg,
String title) |
void |
error(String msg,
String title,
String helpURI) |
static void |
errorPrompt(String msg) |
static void |
expandAllTreeNodes(JTree tree) |
static double |
extractDouble(JTextField textfield) |
JDialog |
floatingMsg(String msg,
boolean autodismiss) |
static AbstractButton |
getButton(Container parent,
String label) |
String |
getChoice(String message,
String title,
String[] choices,
String defaultChoice) |
Color |
getColor(String title,
Color defaultValue) |
Color |
getColor(String title,
Color defaultValue,
String... panes)
Simplified color chooser.
|
ColorRGB |
getColorRGB(String title,
Color defaultValue,
String... panes) |
boolean |
getConfirmation(String msg,
String title) |
boolean |
getConfirmation(String msg,
String title,
String yesLabel,
String noLabel) |
Boolean |
getConfirmation2(String msg,
String title,
String yesLabel,
String noLabel) |
boolean[] |
getConfirmationAndOption(String msg,
String title,
String checkboxLabel,
boolean checkboxDefault) |
static Color |
getDisabledComponentColor() |
static JFileChooser |
getDnDFileChooser() |
Double |
getDouble(String promptMsg,
String promptTitle,
Number defaultValue) |
static int |
getMenuItemHeight() |
static List<JMenuItem> |
getMenuItems(JMenuBar menuBar) |
static List<JMenuItem> |
getMenuItems(JPopupMenu popupMenu) |
List<String> |
getMultipleChoices(String message,
String title,
String[] choices) |
boolean[] |
getOptions(String msg,
String[] options,
boolean[] defaults,
String title) |
boolean[] |
getPersistentConfirmation(String msg,
String title) |
Boolean |
getPersistentWarning(String msg,
String title) |
float[] |
getRange(String promptMsg,
String promptTitle,
float[] defaultRange) |
String |
getString(String promptMsg,
String promptTitle,
String defaultValue) |
static JMenu |
helpMenu() |
static void |
initSplashScreen() |
static JSpinner |
integerSpinner(int value,
int min,
int max,
int step,
boolean allowEditing) |
static boolean |
isLegacy3DViewerAvailable() |
static JLabel |
leftAlignedLabel(String text,
boolean enabled) |
static JLabel |
leftAlignedLabel(String text,
String uri,
boolean enabled) |
static JMenuItem |
menubarButton(IconFactory.GLYPH glyphIcon,
JMenuBar menuBar) |
static JMenuItem |
menuItemTriggeringURL(String label,
String URL) |
static JMenuItem |
menuItemWithoutAccelerator() |
static String |
micrometer() |
static String |
modKey() |
static void |
removeIcon(Window window) |
static void |
restoreLookAndFeel() |
File |
saveFile(String title,
File file,
List<String> allowedExtensions) |
static String |
scaledMicrometer(double umLength,
int digits)
Returns a more human readable representation of a length in micrometers.
|
static void |
setAutoDismiss(JDialog dialog) |
static void |
setLookAndFeel() |
static boolean |
setLookAndFeel(String lookAndFeelName,
boolean persistentChoice,
Component... componentsToUpdate) |
void |
setTmpMsgTimeOut(int mseconds) |
static void |
showHTMLDialog(String msg,
String title) |
JDialog |
showHTMLDialog(String msg,
String title,
boolean modal) |
static JButton |
smallButton(String text) |
void |
tempMsg(String msg) |
void |
tempMsg(String msg,
int location) |
static JTextField |
textField(String placeholder) |
int |
yesNoDialog(String msg,
String title) |
int |
yesNoDialog(String msg,
String title,
String yesButtonLabel,
String noButtonLabel) |
DialogPrompt.Result |
yesNoPrompt(String message,
String title) |
public static final String LAF_LIGHT
public static final String LAF_LIGHT_INTJ
public static final String LAF_DARK
public static final String LAF_DARCULA
public static final String LAF_DEFAULT
public static final double DEFAULT_MENU_WEIGHT
public GuiUtils(Component parent)
public GuiUtils()
public void error(String msg)
public void tempMsg(String msg)
public void tempMsg(String msg, int location)
public static boolean isLegacy3DViewerAvailable()
public void setTmpMsgTimeOut(int mseconds)
public int yesNoDialog(String msg, String title, String yesButtonLabel, String noButtonLabel)
public DialogPrompt.Result yesNoPrompt(String message, String title)
public boolean getConfirmation(String msg, String title, String yesLabel, String noLabel)
public Boolean getConfirmation2(String msg, String title, String yesLabel, String noLabel)
public String getChoice(String message, String title, String[] choices, String defaultChoice)
public List<String> getMultipleChoices(String message, String title, String[] choices)
public boolean[] getConfirmationAndOption(String msg, String title, String checkboxLabel, boolean checkboxDefault)
public Color getColor(String title, Color defaultValue, String... panes)
title
- the title of the chooser dialogdefaultValue
- the initial color set in the chooserpanes
- the panes a list of strings specifying which tabs should be
displayed. In most platforms this includes: "Swatches", "HSB" and
"RGB". Note that e.g., the GTK L&F may only include the
default GtkColorChooser panepublic JDialog dialog(String msg, JComponent component, String title)
public boolean[] getOptions(String msg, String[] options, boolean[] defaults, String title)
public void addTooltip(JComponent c, String text)
public void blinkingError(JComponent blinkingComponent, String msg)
public static void initSplashScreen()
public static void closeSplashScreen()
public static void collapseAllTreeNodes(JTree tree)
public static void expandAllTreeNodes(JTree tree)
public static void addSeparator(JComponent component, String heading, boolean vgap, GridBagConstraints c)
public static void addSeparator(JComponent component, JLabel label, boolean vgap, GridBagConstraints c)
public static JMenuItem menubarButton(IconFactory.GLYPH glyphIcon, JMenuBar menuBar)
public static int getMenuItemHeight()
public static JMenuItem menuItemWithoutAccelerator()
public static String ctrlKey()
public static String modKey()
public static GridBagConstraints defaultGbc()
public static List<JMenuItem> getMenuItems(JPopupMenu popupMenu)
public static JTextField textField(String placeholder)
public static void removeIcon(Window window)
public static JMenu helpMenu()
public static Color getDisabledComponentColor()
public static JSpinner integerSpinner(int value, int min, int max, int step, boolean allowEditing)
public static JSpinner doubleSpinner(double value, double min, double max, double step, int nDecimals)
public static double extractDouble(JTextField textfield)
public static void enableComponents(Container container, boolean enable)
public static String micrometer()
public static String scaledMicrometer(double umLength, int digits)
E.g., scaledMicrometer(0.01,1) returns "1.0nm"
umLength
- the length in micrometersdigits
- the number of output decimalspublic static void errorPrompt(String msg)
public static String[] availableLookAndFeels()
public static void setLookAndFeel()
public static AbstractButton getButton(Container parent, String label)
public static JFileChooser getDnDFileChooser()
public static void restoreLookAndFeel()
public static boolean setLookAndFeel(String lookAndFeelName, boolean persistentChoice, Component... componentsToUpdate)
public static void setAutoDismiss(JDialog dialog)
Copyright © 2018–2021 Morphonets. All rights reserved.