
public class UiUtilities extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
UiUtilities.ActionHandler |
| Constructor and Description |
|---|
UiUtilities(UiUtilities.ActionHandler handler)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static Dimension |
getLabelSize(String text)
Gets the size of a label with standard font.
|
static Dimension |
getLabelSize(String text,
Font font)
Gets the size of a label.
|
static int |
maxEnumLabelWidth(Class enumClass)
Gets the maximum label width produced by the elements of an enumeration.
|
static int |
maxEnumLabelWidth(Class enumClass,
Font font)
Gets the maximum label width produced by the elements of an enumeration.
|
static int |
maxLabelWidth(String[] text,
String term)
Gets the maximum label width produced by a set of strings.
|
static int |
maxLabelWidth(String[] text,
String term,
Font font)
Gets the maximum label width produced by a set of strings.
|
static JPanel |
newBorderedPanel(String title)
Creates a bordered panel.
|
static JPanel |
newBorderedPanel(String title,
Font font)
Creates a bordered panel.
|
JButton |
newButton(String title,
String name)
Creates a button with default font.
|
JButton |
newButton(String title,
String name,
boolean small)
Creates a button with default font.
|
JButton |
newButton(String title,
String name,
boolean small,
Font font)
Creates a button.
|
JButton |
newButton(String title,
String name,
boolean small,
Font lblFont,
Font font)
Creates a button.
|
JButton |
newButton(String title,
String name,
Font font)
Creates a button.
|
JCheckBox |
newCheckBox(String title,
String name)
Creates a check box.
|
JCheckBox |
newCheckBox(String title,
String name,
Font font)
Creates a check box.
|
static JLabel |
newLabel(String text,
int width)
Creates a label with the default font.
|
static JLabel |
newLabel(String text,
int width,
Font font)
Creates a label
|
JRadioButton |
newRadioButton(String title,
String name)
Creates a radio button with the default font
|
JRadioButton |
newRadioButton(String title,
String name,
Font font)
Creates a radio button.
|
JTextField |
newTextField(String text,
String name)
Creates a text field.
|
JTextField |
newTextField(String text,
String name,
boolean small)
Creates a text field.
|
JTextField |
newTextField(String text,
String name,
boolean small,
Font lblFont)
Creates a text field.
|
JTextField |
newTextField(String text,
String name,
boolean small,
Font lblFont,
Font font)
Creates a text field.
|
JTextField |
newTextField(String text,
String name,
Font font)
Creates a text field.
|
TextFieldX |
newTextFieldX(String text,
String name,
int type)
Creates an extended text field.
|
TextFieldX |
newTextFieldX(String text,
String name,
int type,
boolean small)
Creates an extended text field.
|
TextFieldX |
newTextFieldX(String text,
String name,
int type,
boolean small,
Font lblFont)
Creates an extended text field.
|
TextFieldX |
newTextFieldX(String text,
String name,
int type,
boolean small,
Font lblFont,
Font font)
Creates an extended text field.
|
TextFieldX |
newTextFieldX(String text,
String name,
int type,
Font font)
Creates an extended text field.
|
public UiUtilities(UiUtilities.ActionHandler handler)
handler - The action handlerpublic static JLabel newLabel(String text, int width)
text - The label textwidth - The desired label width, 0 if text determines it, or -1 if no width setpublic static JLabel newLabel(String text, int width, Font font)
text - The label textwidth - The desired label width, 0 if text determines it, or -1 if no width setfont - The font to usepublic JRadioButton newRadioButton(String title, String name)
title - The button titlename - The name to be passed to the handlerpublic JRadioButton newRadioButton(String title, String name, Font font)
title - The button titlename - The name to be passed to the action handlerfont - The font to usepublic JButton newButton(String title, String name)
title - The button titlename - The name to be passed to the action handlerpublic JButton newButton(String title, String name, boolean small)
title - The button titlename - The name to be passed to the action handlersmall - Create a less-tall button if truepublic JButton newButton(String title, String name, Font font)
title - The button titlename - The name to be passed to the action handlerfont - The font to usepublic JButton newButton(String title, String name, boolean small, Font font)
title - The button titlename - The name to be passed to the action handlersmall - Create a less-tall button if truefont - The font to usepublic JButton newButton(String title, String name, boolean small, Font lblFont, Font font)
title - The button titlename - The name to be passed to the action handlersmall - Create a less-tall button if truelblFont - Font to use to determine less-tall heightfont - The font to usepublic JTextField newTextField(String text, String name)
text - The initial text, used to set its sizename - The name to be passed to the action handlerpublic JTextField newTextField(String text, String name, Font font)
text - The initial text, used to set its sizename - The name to be passed to the action handlerfont - The font to usepublic JTextField newTextField(String text, String name, boolean small)
text - The initial text, used to set its sizename - The name to be passed to the action handlersmall - Create a less-tall field if truepublic JTextField newTextField(String text, String name, boolean small, Font lblFont)
text - The initial text, used to set its sizename - The name to be passed to the action handlersmall - Create a less-tall field if truelblFont - Font to use to determine less-tall heightpublic JTextField newTextField(String text, String name, boolean small, Font lblFont, Font font)
text - The initial text, used to set its sizename - The name to be passed to the action handlersmall - Create a less-tall field if truelblFont - Font to use to determine less-tall heightfont - The font to usepublic TextFieldX newTextFieldX(String text, String name, int type)
text - The initial text, used to set its sizename - The name to be passed to the action handlertype - The type of field (TYPE_TEXT, TYPE_INT or TYPE_DOUBLE)public TextFieldX newTextFieldX(String text, String name, int type, Font font)
text - The initial text, used to set its sizename - The name to be passed to the action handlertype - The type of field (TYPE_TEXT, TYPE_INT or TYPE_DOUBLE)font - The font to usepublic TextFieldX newTextFieldX(String text, String name, int type, boolean small)
text - The initial text, used to set its sizename - The name to be passed to the action handlertype - The type of field (TYPE_TEXT, TYPE_INT or TYPE_DOUBLE)small - Create a less-tall field if truepublic TextFieldX newTextFieldX(String text, String name, int type, boolean small, Font lblFont)
text - The initial text, used to set its sizename - The name to be passed to the action handlertype - The type of field (TYPE_TEXT, TYPE_INT or TYPE_DOUBLE)small - Create a less-tall field if truelblFont - Font to use to determine less-tall heightpublic TextFieldX newTextFieldX(String text, String name, int type, boolean small, Font lblFont, Font font)
text - The initial text, used to set its sizename - The name to be passed to the action handlertype - The type of field (TYPE_TEXT, TYPE_INT or TYPE_DOUBLE)small - Create a less-tall field if truelblFont - Font to use to determine less-tall heightfont - The font to usepublic JCheckBox newCheckBox(String title, String name)
title - The check box titlename - The name to be passed to the action handlerpublic JCheckBox newCheckBox(String title, String name, Font font)
title - The check box titlename - The name to be passed to the action handlerfont - The font to usepublic static JPanel newBorderedPanel(String title)
title - The panel title, or null if no title requiredpublic static JPanel newBorderedPanel(String title, Font font)
title - The panel title, or null if no title requiredfont - The font to usepublic static int maxLabelWidth(String[] text, String term)
text - An array of stringsterm - The terminating string that will be appended to stringpublic static int maxLabelWidth(String[] text, String term, Font font)
text - An array of stringsterm - The terminating string that will be appended to stringfont - The font to usepublic static int maxEnumLabelWidth(Class enumClass)
enumClass - The enumeration classpublic static int maxEnumLabelWidth(Class enumClass, Font font)
enumClass - The enumeration classfont - The font to usepublic static Dimension getLabelSize(String text)
text - The label textCopyright © 2020 LSST. All rights reserved.