public class GuiUtils extends LayoutUtil
Modifier and Type | Class and Description |
---|---|
static class |
GuiUtils.CardLayoutPanel
Class CardLayoutPanel is a utility that does a card layou of its components.
|
static class |
GuiUtils.ColorSwatch
A color swatch panel
|
static class |
GuiUtils.JJMenu0 |
static class |
GuiUtils.ProgressDialog
Class ProgressDialog _more_
|
static class |
GuiUtils.TreeSearchResults
Class TreeSearchResults Holds state from a tree search
|
static class |
GuiUtils.VerticalLabelUI
Class for a vertical label
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_ACTION
xml attribute name
|
static java.lang.String |
ATTR_ICON
xml attribute name
|
static java.lang.String |
ATTR_ID
xml attribute name
|
static java.lang.String |
ATTR_TOOLTIP
xml attribute name
|
static java.awt.Font |
buttonFont
Used by apps for having a common font for buttons
|
static java.lang.String |
CMD_APPLY
Action command used for the Apply button
|
static java.lang.String |
CMD_CANCEL
Action command used for the Cancel button
|
static java.lang.String |
CMD_CLOSE
Action command used for the Close button
|
static java.lang.String |
CMD_EXPORT
Action command used for the Export button
|
static java.lang.String |
CMD_HELP
Action command used for the Help button
|
static java.lang.String |
CMD_IMPORT
Action command used for the Import button
|
static java.lang.String |
CMD_NEW
Action command used for the New button
|
static java.lang.String |
CMD_NO
Action command used for the No button
|
static java.lang.String |
CMD_OK
Action command used for the OK button
|
static java.lang.String |
CMD_OPEN
Action command used for the Open button
|
static java.lang.String |
CMD_REMOVE
Action command used for the Remove button
|
static java.lang.String |
CMD_RENAME
Action command used for the Rename button
|
static java.lang.String |
CMD_RESET
Action command used for the Reset button
|
static java.lang.String |
CMD_SAVE
Action command used for the Save button
|
static java.lang.String |
CMD_SAVEAS
Action command used for the Saveas button
|
static java.lang.String |
CMD_START
Action command used for the Start button
|
static java.lang.String |
CMD_STOP
Action command used for the Stop button
|
static java.lang.String |
CMD_SUBMIT
Action command used for the Submit button
|
static java.lang.String |
CMD_UPDATE
Action command used for the Update button
|
static java.lang.String |
CMD_YES
Action command used for the Yes button
|
static java.lang.String[] |
COLORNAMES
Used to map named colors to color
|
static java.awt.Color[] |
COLORS
Used to map named colors to color
|
static int[] |
FONT_SIZES
font sizes
|
static java.lang.String |
HEX_COLOR_PATTERN
hex color string without leading #
|
static java.lang.String |
MISSING_IMAGE
missing image path
|
static java.awt.Cursor |
normalCursor
The normal cursor_
|
static java.util.TimeZone |
TIMEZONE_UTC
_more_
|
static java.awt.Cursor |
waitCursor
The cursor to use when waiting
|
INSETS_2, INSETS_5, tmpAnchor, tmpColFills, tmpFill, tmpInsets, WT_N, WT_NN, WT_NNN, WT_NNNY, WT_NNY, WT_NNYN, WT_NNYNY, WT_NNYNYNY, WT_NY, WT_NYN, WT_NYNY, WT_NYNYN, WT_NYY, WT_Y, WT_YN, WT_YNN, WT_YNY, WT_YNYN, WT_YY, WT_YYN, WT_YYY, ZERO_INSETS
MENU_SEPARATOR
Modifier and Type | Method and Description |
---|---|
static javax.swing.JComponent |
addActionListener(javax.swing.JComponent comp,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg)
Adds an action listener to the button.
|
static void |
addKeyBindings(javax.swing.text.JTextComponent comp)
_more_
|
static void |
addKeyListenerRecurse(java.awt.event.KeyListener listener,
java.awt.Container c)
Add a key listener to all components of a container
|
static void |
addLinkListener(javax.swing.JEditorPane editor)
_more_
|
static void |
addModalDialogComponent(java.awt.Component comp)
Add the model dialog to the list
|
static void |
addMouseListenerRecurse(java.awt.event.MouseListener listener,
java.awt.Container c)
Add a mouse listener to all components of a container
|
static boolean |
anySelected(javax.swing.JComboBox box)
Check if there are any selected items in the combobox.
|
static void |
appendText(javax.swing.text.JTextComponent fld,
java.lang.String s,
java.lang.String delimiter)
_more_
|
static void |
applyDefaultFont(java.awt.Component comp)
_more_
|
static boolean |
askOkCancel(java.lang.String title,
java.lang.Object question)
Ask the user the question.
|
static boolean |
askYesNo(java.lang.String title,
java.lang.Object question)
Ask the user the question.
|
static javax.swing.ButtonGroup |
buttonGroup(javax.swing.JToggleButton b1,
javax.swing.JToggleButton b2)
Create a button group and add the two buttons to it.
|
static javax.swing.ButtonGroup |
buttonGroup(javax.swing.JToggleButton b1,
javax.swing.JToggleButton b2,
javax.swing.JToggleButton b3)
Create a button group and add the three buttons to it.
|
static javax.swing.ButtonGroup |
buttonGroup(javax.swing.JToggleButton b1,
javax.swing.JToggleButton b2,
javax.swing.JToggleButton b3,
javax.swing.JToggleButton b4)
Create a button group and add the three buttons to it.
|
static int |
charToKeyCode(char ch)
Return the numeric key code of the given character.
|
static int |
charToKeyCode(java.lang.String s)
Take the first character of the string and return the numeric key code
|
static void |
checkHeavyWeightComponents(javax.swing.JTabbedPane tab)
Walk the components of the tab and toggle the heavyweight components visiblity
|
static boolean |
checkHeight(int height)
Check the height against a value
|
static javax.swing.JLabel |
cLabel(java.lang.String s)
Create a center aligned JLabel
|
static void |
configureStepSelection(javax.swing.JList list)
Add a listener to the JList that pops up a menu on a right
click that allos for the selection of different strides.
|
static javax.swing.JDialog |
createDialog(java.lang.String title,
boolean modal)
A utility to create a dialog.
|
static javax.swing.JDialog |
createDialog(java.awt.Window parent,
java.lang.String title,
boolean modal)
Utility to create a JDialog with a parent component.
|
static javax.swing.JFrame |
createFrame(java.lang.String title)
A utility to create a frame.
|
static javax.swing.JComboBox |
createValueBox(java.awt.event.ActionListener listener,
java.lang.String command,
int initValue,
java.util.List values,
boolean editable)
Create a combobx boxc that holds a set of integer values.
|
static java.awt.Color |
decodeColor(java.lang.String value,
java.awt.Color dflt)
This takes the given String and tries to convert it to a color.
|
static void |
decorateFrame(javax.swing.JFrame frame,
javax.swing.JMenuBar menuBar)
_more_
|
static double |
distance(double[] p1,
double[] p2)
Get distance between
|
static double |
distance(double x1,
double y1,
double x2,
double y2)
Calculate distance between 2 points.
|
static double |
distance(double x,
double y,
java.awt.geom.Rectangle2D r)
Calculate distance between point and rectangle.
|
static double |
distance(int[] p1,
int[] p2)
Get distance between
|
static boolean |
doMacMenubar()
_more_
|
static javax.swing.JComboBox |
doMakeFontBox(java.awt.Font f)
Make a font selector box
|
static javax.swing.JComboBox |
doMakeFontSizeBox(int size)
Make a box for setting the font size
|
static javax.swing.JComponent |
doMultiSplitPane(java.util.List comps,
boolean hsplit)
Make an evenly balanced group of split panes for the given components
|
static GuiUtils.TreeSearchResults |
doTreeSearch(javax.swing.JTree tree,
java.lang.Object lastState,
java.lang.String nodeDesc,
javax.swing.JComponent near)
Popup a dialog and search the given tree for a tree node that matches
the user provided string.
|
static GuiUtils.TreeSearchResults |
doTreeSearch(javax.swing.JTree tree,
java.lang.Object lastState,
java.lang.String nodeDesc,
javax.swing.JComponent near,
java.lang.String originalPhrase)
Search the given tree
|
static void |
empty(java.awt.Container c)
If non-null then removes all children and removes from parent.
|
static void |
empty(java.awt.Container c,
boolean doItInSwingThread)
If non-null then removes all children and removes from parent.
|
static void |
enableComponents(java.util.List comps,
boolean enable)
Enable or disable the list of Components
|
static void |
enablePanel(javax.swing.JPanel panel,
boolean enable)
_more_
|
static void |
enableTree(java.awt.Component comp,
boolean enable)
Enable or disable a whole tree's worth of components
|
static void |
expandPathsAfterChange(javax.swing.JTree tree,
java.util.Hashtable state,
javax.swing.tree.DefaultMutableTreeNode root)
Call this after the structure of a JTree changes to re-expand the paths.
|
static void |
exportAsCsv(java.lang.String header,
javax.swing.table.TableModel model)
Write out the given table model as a comma separated value (CSV) file
prepending the header.
|
static void |
exportAsCsv(java.lang.String header,
javax.swing.table.TableModel model,
boolean includeColumnNames)
Write out the given table model as a comma separated value (CSV) file
prepending the header.
|
static void |
exportAsCsv(java.lang.String header,
javax.swing.table.TableModel model,
java.lang.String filename)
Export a table as csv
|
static void |
exportAsCsv(java.lang.String header,
javax.swing.table.TableModel model,
java.lang.String filename,
boolean includeColumnNames)
Export a table as csv
|
static void |
exportAsCsv(javax.swing.table.TableModel model)
Write out the given table model as a csv file
|
static java.util.List |
findChildren(org.w3c.dom.Node parent,
java.lang.String tag)
_more_
|
static javax.swing.JPanel |
flow(java.awt.Component[] comps)
Create a panel and do flow layout of the components
|
static javax.swing.JPanel |
flowRight(java.awt.Component[] comps)
Create a panel and do a a right align flow layout of the components
|
static java.lang.String |
formatDate(java.util.Date dttm)
Format the date with the default date format and timezone
|
static javax.swing.JComponent |
formLayout(java.awt.Component[] comps)
Do a 2 column layout.
|
static javax.swing.JComponent |
formLayout(java.awt.Component[] comps,
double[] widths,
double[] heights)
Do a 2 column layout.
|
static javax.swing.JComponent |
formLayout(java.util.List objects)
Layout as a 2 column form
|
static javax.swing.JComponent |
formLayout(java.util.List comps,
boolean rightAlignFirstColumn)
Do a 2 column layout.
|
static javax.swing.JComponent |
formLayout(java.util.List comps,
double[] widths,
double[] heights)
Do a 2 column layout.
|
static javax.swing.JComponent |
formLayout(java.util.List comps,
double[] widths,
double[] heights,
boolean rightAlignFirstColumn)
Do a 2 column layout.
|
static javax.swing.JComponent |
formLayout(java.util.List objects,
java.awt.Insets insets)
Do a 2 column layout of the objects with the given insets for spacing
|
static javax.swing.JComponent |
formLayout(java.lang.Object[] objects)
This does a doLayout with 2 columns.
|
static javax.swing.JComponent |
formLayout(java.lang.Object[] objects,
java.awt.Insets insets)
This does a doLayout with 2 columns.
|
static java.lang.String |
getApplicationTitle()
_more_
|
static java.lang.String |
getAttribute(org.w3c.dom.NamedNodeMap attrs,
java.lang.String name)
_more_
|
static boolean |
getAttribute(org.w3c.dom.NamedNodeMap attrs,
java.lang.String name,
boolean dflt)
_more_
|
static java.lang.String |
getAttribute(org.w3c.dom.NamedNodeMap attrs,
java.lang.String name,
java.lang.String dflt)
_more_
|
static java.lang.String |
getAttribute(org.w3c.dom.Node element,
java.lang.String name,
java.lang.String dflt)
Get the given name-d attribute from the given element.
|
static int |
getBoxValue(javax.swing.JComboBox box)
Return the selected item in the given box as an integer.
|
static ObjectListener |
getCloseDialogListener(javax.swing.JDialog dialog)
Create a listener that will close the given dialog.
|
static java.lang.String |
getColorName(java.awt.Color color)
Return the name of the given color.
|
static void |
getConfigureStepSelectionItems(javax.swing.JList list,
java.util.List items)
popup a menu to select strides
|
static java.awt.Font |
getDefaultFont()
Get the default font
|
static int |
getDefaultIconSize()
Get the default icon size
|
static javax.swing.JComboBox |
getEditableBox(java.util.List items,
java.lang.Object selected)
Create an editable combobox with the given items.
|
static javax.swing.JLabel |
getFixedWidthLabel(java.lang.String s)
Create a JLabel with a fixed width font
|
static java.util.Vector |
getFontList()
Get a list of fonts
|
static java.util.Vector |
getFontSizeList()
Get a list of font sizes
|
static javax.swing.JFrame |
getFrame(java.awt.Component component)
This finds and returns the JFrame, or null if not found, that
holds the given component.
|
static java.awt.Component[] |
getHtmlComponent(java.lang.String html,
javax.swing.event.HyperlinkListener linkListener,
int width,
int height)
Make a JTextEditor component and scroller for the given html
|
static boolean |
getIconsInMenus()
Do we show icons in the menus
|
static java.awt.Image |
getImage(java.awt.Component component)
Get the screen image from the component
|
static java.awt.Image |
getImage(java.lang.String file)
Create an Image from the given image file name.
|
static java.awt.Image |
getImage(java.lang.String file,
java.lang.Class c)
Create an Image from the given image file name.
|
static java.awt.Image |
getImage(java.lang.String file,
java.lang.Class c,
boolean cache)
Create an Image from the given image file name.
|
static java.awt.Image |
getImage(java.lang.String file,
java.lang.Class c,
boolean cache,
boolean returnNullIfNotFound)
Get an image
|
static javax.swing.JButton |
getImageButton(javax.swing.ImageIcon icon)
Create a JButton that displays the given image icon
|
static javax.swing.JButton |
getImageButton(javax.swing.ImageIcon icon,
int offset)
Create a JButton that displays the given image icon
|
static javax.swing.JButton |
getImageButton(javax.swing.ImageIcon icon,
int hinset,
int vinset)
Create a JButton that displays the given image icon
|
static javax.swing.JButton |
getImageButton(java.lang.String icon,
java.lang.Class origin)
Create a JButton that displays an image icon create from the
given icon path (may be a file, resource or url).
|
static javax.swing.JButton |
getImageButton(java.lang.String icon,
java.lang.Class origin,
int hInset,
int vInset)
Create a JButton that displays an image icon create from the
given icon path (may be a file, resource or url).
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String file)
Create an ImageIcon from the given image file name.
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String file,
boolean cache)
Create an ImageIcon from the given image file name.
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String file,
java.lang.Class c)
Create an ImageIcon from the given image file name.
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String file,
java.lang.Class c,
boolean cache)
Create an ImageIcon from the given image file name.
|
static javax.swing.JLabel |
getImageLabel(java.lang.String icon)
Create a JLabel that displays an image icon create from the
given icon path (may be a file, resource or url).
|
static javax.swing.JLabel |
getImageLabel(java.lang.String icon,
java.lang.Class origin)
Create a JLabel that displays an image icon create from the
given icon path (may be a file, resource or url).
|
static java.lang.String |
getInput(java.lang.String question)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue,
java.lang.String trailingLabel)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue,
java.lang.String trailingLabel,
java.lang.Object underLabel)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue,
java.lang.String trailingLabel,
java.lang.Object underLabel,
java.lang.String title)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue,
java.lang.String trailingLabel,
java.lang.Object underLabel,
java.lang.String title,
int fieldWidth)
Ask the user the question.
|
static java.lang.String |
getInput(java.lang.String question,
java.lang.String label,
java.lang.String initValue,
java.lang.String trailingLabel,
java.lang.Object underLabel,
java.lang.String title,
int fieldWidth,
javax.swing.JComponent nearComponent)
Ask the user the question.
|
static int |
getInt(javax.swing.JTextField fld)
Get an integer value from the text field
|
static java.util.List |
getItems(javax.swing.JComboBox box)
return the list of items held by the combo box.
|
static java.util.List |
getItems(javax.swing.JList list)
_more_
|
static java.lang.String |
getLocalName(java.lang.String n,
boolean local)
_more_
|
static java.lang.String |
getLocalName(java.lang.String n,
boolean local,
boolean addHtml)
_more_
|
static java.awt.Point |
getLocation(java.awt.Component src)
Find the location of the given componet on the screen.
|
static javax.swing.JTabbedPane |
getNestedTabbedPane()
Make a JTabbedPane without some of its border
|
static javax.swing.JTabbedPane |
getNestedTabbedPane(int orient)
Make a JTabbedPane without some of its border
|
static javax.swing.JTabbedPane |
getNestedTabbedPane(int orient,
int top,
int left,
int bottom,
int right)
Make a JTabbedPane without some of its border
|
static javax.swing.JButton |
getScaledImageButton(java.lang.String icon,
java.lang.Class origin,
int hInset,
int vInset)
Get a scaled image button
|
static javax.swing.ImageIcon |
getScaledImageIcon(java.lang.String file,
java.lang.Class c,
boolean cache)
Get a scaled image icon
|
static double |
getSliderPercent(javax.swing.JSlider s)
Return the slider value as a percentage between its min and max
|
static java.util.TimeZone |
getTimeZone()
Get the default timezone used for formatting
|
static javax.swing.JToggleButton |
getToggleButton(javax.swing.ImageIcon icon,
int hinset,
int vinset)
Create a toggle button with the given image.
|
static javax.swing.JToggleButton |
getToggleButton(java.lang.String iconPath,
int hinset,
int vinset)
Create a toggle button with the given image.
|
static javax.swing.JToggleButton |
getToggleImageButton(javax.swing.ImageIcon icon,
javax.swing.ImageIcon selectedIcon,
int hinset,
int vinset)
Create a JToggleButton with the given image and, if non-null,
the given selected image.
|
static javax.swing.JToggleButton |
getToggleImageButton(javax.swing.ImageIcon icon,
javax.swing.ImageIcon selectedIcon,
int hinset,
int vinset,
boolean addMouseOverBorder)
Create a JToggleButton with the given image and, if non-null,
the given selected image.
|
static javax.swing.JToggleButton |
getToggleImageButton(java.lang.String icon,
java.lang.String selectedIcon,
int hinset,
int vinset,
boolean addMouseOverBorder)
Create a JToggleButton with the given image and, if non-null,
the given selected image.
|
static double |
getValue(javax.swing.JTextField fld)
Get an double value from the text field
|
static int |
getValueFromBox(javax.swing.JComboBox box)
Get the integer value from a JComboBox of integer items
|
static java.awt.Window |
getWindow(java.awt.Component component)
This finds and returns the Window, or null if not found, that contains
the given component.
|
static void |
handleHeavyWeightComponentsInTabs(javax.swing.JTabbedPane tab)
Add a change listener to the tab that toggles on any heavy weight components
in the selected tab and turns off any in the non-selected tabs.
|
static javax.swing.JComponent |
hspace(int w,
int h)
Create a a minimally sized spacer
|
static javax.swing.JSplitPane |
hsplit(java.awt.Component left,
java.awt.Component right)
Create a basic horizontally aligned JSplitPane
|
static javax.swing.JSplitPane |
hsplit(java.awt.Component left,
java.awt.Component right,
double resizeWeight)
Create a horizontally aligned JSplitPane
|
static javax.swing.JSplitPane |
hsplit(java.awt.Component left,
java.awt.Component right,
int leftSpace)
Create a horizontally aligned JSplitPane
|
static javax.swing.JSplitPane |
hsplit(java.awt.Component left,
java.awt.Component right,
int leftSpace,
double resizeWeight)
Create a horizontally aligned JSplitPane.
|
static java.util.Hashtable |
initializeExpandedPathsBeforeChange(javax.swing.JTree tree,
javax.swing.tree.DefaultMutableTreeNode root)
Call this before a JTree changes.
|
static void |
initLabels()
Init the fixed labels
|
static void |
insertText(javax.swing.text.JTextComponent comp,
java.lang.String s)
Insert text into the component
|
static void |
invokeInSwingThread(java.lang.Runnable runnable)
RUn the given runnable in the swing event dispatch thread
|
static boolean |
isControlKey(java.awt.event.InputEvent event)
Is the given event a control (or meta for the mac) key
|
static boolean |
isControlKey(java.awt.event.KeyEvent event,
int keyCode)
_more_
|
static boolean |
isDeleteEvent(java.awt.event.KeyEvent e)
_more_
|
static boolean |
isMac()
Is this running on a Mac?
|
static boolean |
isShowing(javax.swing.JDialog f)
Is the dialog showing
|
static boolean |
isShowing(javax.swing.JFrame f)
Is the frame showing
|
static java.awt.Component |
italicizeFont(java.awt.Component comp)
Italicize the font on the given component
|
static javax.swing.JPanel |
label(java.awt.Component widget,
java.lang.String label)
Create a JPanel that holds a the given widget/JLabel
|
static javax.swing.JPanel |
label(java.lang.String label,
java.awt.Component widget)
Create a JPanel that holds a JLabel/the given widget
|
static void |
limitMenuSize(javax.swing.JMenu menu,
java.lang.String name,
int size)
This ensures that there are no more than size number of items in any sub menu.
|
static void |
limitMenuSize(javax.swing.JMenu menu,
java.lang.String name,
int size,
boolean recurse)
This ensures that there are no more than size number of items in any sub menu.
|
static void |
limitMenuSize(java.util.List items,
java.lang.String name,
int size)
This takes the list of JMenuItems and, for each JMenu, will ensure
that there are no more than size number of items in any sub menu.
|
static javax.swing.JLabel |
lLabel(java.lang.String s)
Create a left aligned JLabel
|
static void |
main(java.lang.String[] args)
test
|
static java.awt.event.ActionListener |
makeActionListener(java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg)
Make an ActionListener.
|
static javax.swing.JButton |
makeApplyButton(java.awt.event.ActionListener l)
Utility to make apply button panel
|
static javax.swing.JPanel |
makeApplyCancelButtons(java.awt.event.ActionListener l)
Utility to make apply/cancel button panel
|
static javax.swing.JPanel |
makeApplyOkCancelButtons(java.awt.event.ActionListener l)
Utility to make apply/ok/cancel button panel
|
static javax.swing.JPanel |
makeApplyOkHelpCancelButtons(java.awt.event.ActionListener l)
Utility to make apply/ok/help/cancel button panel
|
static javax.swing.JPanel |
makeApplyOkResetCancelButtons(java.awt.event.ActionListener l)
Utility to make apply/ok/reset/cancel button panel
|
static javax.swing.JButton |
makeButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName)
Make a JButton.
|
static javax.swing.JButton |
makeButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg)
Make a JButton.
|
static javax.swing.JButton |
makeButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg,
java.lang.String tooltip)
Make a JButton.
|
static javax.swing.JPanel |
makeButtons(java.awt.event.ActionListener l,
java.lang.String[] cmds)
Make a set of JButtons, each with a label and action command from the given cmds
array.
|
static javax.swing.JPanel |
makeButtons(java.awt.event.ActionListener l,
java.lang.String[] cmds,
java.util.Hashtable buttonMap)
Make a set of JButtons, each with a label and action command from the given cmds
array.
|
static javax.swing.JPanel |
makeButtons(java.awt.event.ActionListener l,
java.lang.String[] labels,
java.lang.String[] cmds)
Make a set of JButtons, each with a label and action command from the given cmds and labels
arrays.
|
static javax.swing.JPanel |
makeButtons(java.awt.event.ActionListener l,
java.lang.String[] labels,
java.lang.String[] cmds,
java.util.Hashtable buttonMap)
Make a set of JButtons, each with a label and action command from the given cmds and labels
arrays.
|
static javax.swing.JPanel |
makeButtons(java.awt.event.ActionListener l,
java.lang.String[] labels,
java.lang.String[] cmds,
java.lang.String[] tooltips,
java.util.Hashtable buttonMap)
Make a set of JButtons, each with a label and action command from the given cmds and labels
arrays.
|
static javax.swing.JCheckBox |
makeCheckbox(java.lang.String label,
java.lang.Object object,
java.lang.String property)
Make a checkbox.
|
static javax.swing.JCheckBox |
makeCheckbox(java.lang.String label,
java.lang.Object object,
java.lang.String property,
java.lang.Object arg)
Make a checkbox.
|
static javax.swing.JComboBox |
makeColorNameComboBox(java.awt.Color dflt)
A helper to make a color selector combo box
|
static javax.swing.JComponent[] |
makeColorSwatchWidget(java.awt.Color color,
java.lang.String label)
This makes a color swatch and a 'Set' button that is used to set the
color.
|
static javax.swing.JComboBox |
makeComboBox(int[] values,
java.lang.String[] labels,
int current)
Make a combo box from a set of values and labels
|
static javax.swing.JComboBox |
makeComboBox(java.util.List items,
java.lang.Object selected,
boolean editable,
java.lang.Object listener,
java.lang.String methodName)
Make a JComboBox
|
static javax.swing.JComboBox |
makeComboBox(java.util.List items,
java.lang.Object selected,
boolean editable,
java.lang.Object listener,
java.lang.String methodName,
boolean inAThread)
Make a JComboBox
|
static int |
makeDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src,
java.lang.String[] buttonLabels)
Make and show a modeful dialog with the given collection of buttons.
|
static javax.swing.JMenu |
makeDynamicMenu(java.lang.String name,
java.lang.Object object,
java.lang.String methodName)
Create a menu and add a listener to it that removes all items
and calls the given method on te given object with the menu as an argument.
|
static javax.swing.JMenu |
makeDynamicMenu(java.lang.String name,
java.lang.Object object,
java.lang.String methodName,
boolean doRemoveAll)
Create a menu and add a listener to it that removes all items
and calls the given method on te given object with the menu as an argument.
|
static javax.swing.JButton |
makeFileBrowseButton(javax.swing.text.JTextComponent fld)
Make a button that pops up a file browser and sets the text of the given field with the selected file
|
static javax.swing.JButton |
makeFileBrowseButton(javax.swing.text.JTextComponent fld,
boolean chooseDirectory,
java.util.List filters)
Make a button that pops up a file browser and sets the text of the given field with the selected file
|
static javax.swing.JButton |
makeFileBrowseButton(javax.swing.text.JTextComponent fld,
java.util.List filters)
Make a button that pops up a file browser and sets the text of the given field with the selected file
|
static javax.swing.JComponent |
makeHeader(java.lang.String label)
Utility to create a header that is a label and a line.
|
static javax.swing.JButton |
makeImageButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName)
Make a JButton.
|
static javax.swing.JButton |
makeImageButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg)
Make a JButton.
|
static javax.swing.JButton |
makeImageButton(java.lang.String label,
java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg,
boolean addMouseOverBorder)
Make a JButton.
|
static javax.swing.JButton |
makeJButton(java.lang.String label,
java.awt.event.ActionListener listener)
Utility to make a JButton, adding the given listener as an ActionListener
|
static javax.swing.JButton |
makeJButton(java.lang.String label,
java.lang.Object[] args)
Utility method for creating and setting various properties of a JButton
args array holds a set of key value pairs:
-tooltip <The tooltip text>
-bg <Background color>
-listener <Action listener>
-command <Action command>
|
static javax.swing.JMenuBar |
makeMenuBar(java.util.List menus)
Create a JMenuBar and add the menus contained with the menus list
If no menus then return null.
|
static void |
makeMouseOverBorder(javax.swing.JComponent b)
Make a mouse over border
|
static javax.swing.JPanel |
makeNewOkCancelButtons(java.awt.event.ActionListener l)
Utility to make new/ok/cancel button panel
|
static javax.swing.JPanel |
makeNewOkCancelButtons(java.awt.event.ActionListener l,
java.lang.String newLabel,
java.lang.String okLabel,
java.lang.String cancelLabel)
Utility to make new/ok/cancel button panel
|
static javax.swing.JPanel |
makeNewOkCancelHelpButtons(java.awt.event.ActionListener l)
Utility to make new/ok/cancel/help button panel
|
static javax.swing.JPanel |
makeOkCancelButtons(java.awt.event.ActionListener l)
Utility to make ok/cancel button panel
|
static javax.swing.JPanel |
makeOkCancelButtons(java.awt.event.ActionListener l,
java.lang.String okLabel,
java.lang.String cancelLabel)
Utility to make ok/cancel button panel
|
static javax.swing.JPanel |
makeOkHelpCancelButtons(java.awt.event.ActionListener l)
Utility to make ok/help/cancel button panel
|
static javax.swing.JRadioButton[] |
makeRadioButtons(java.util.List labels,
int selectedIndex,
java.lang.Object object,
java.lang.String methodName)
Make a set of radio buttons
|
static void |
makeRowVisible(javax.swing.JTable table,
int row)
Make the given row in the table visible
|
static javax.swing.JScrollPane |
makeScrollPane(java.awt.Component c,
int xdim,
int ydim)
Make a scroll pane for the input box which may be used to hold
selection buttons later; size is given; text for a title in box.
|
static javax.swing.JSlider |
makeSlider(int min,
int max,
int value,
java.lang.Object listener,
java.lang.String methodName)
Make a JSlider
|
static javax.swing.JSlider |
makeSlider(int min,
int max,
int value,
java.lang.Object listener,
java.lang.String methodName,
boolean updateAsMove)
Make a JSlider
|
static javax.swing.JComponent[] |
makeSliderPopup(int min,
int max,
int value,
javax.swing.event.ChangeListener listener)
This creates a JButton and a JSlider.
|
static TwoFacedObject |
makeTwoFacedFont(java.awt.Font f)
Make a TwoFacedObject from a font for displaying in a combobox.
|
static javax.swing.JLabel |
makeVerticalLabel(java.lang.String text)
Make a vertical label
|
static javax.swing.JFrame |
makeWindow(java.lang.String title,
java.awt.Component contents,
int x,
int y)
Create a new JFrame, add the contents to it, set its location
and return it.
|
static void |
moveSubtreesToTop(javax.swing.tree.DefaultMutableTreeNode parent)
_more_
|
static javax.swing.JDialog |
packDialog(javax.swing.JDialog f,
java.awt.Component contents)
Add the given contents into the given dialog
|
static void |
packInCenter(javax.swing.JDialog dialog)
pack the dialog in the center of the screen
|
static javax.swing.JFrame |
packWindow(javax.swing.JFrame f,
java.awt.Component contents)
Add the given contents into the given frame
|
static javax.swing.JFrame |
packWindow(javax.swing.JFrame f,
java.awt.Component contents,
boolean andShow)
Add the given contents into the given frame
|
static java.awt.Component[] |
popup(java.lang.String text,
int x,
int y,
boolean modal)
Popup an html widget at the given x/y that shows the text (or, if the text
is a URI will read the URI).
|
static void |
popupUnitMenu(javax.swing.JTextField fld,
javax.swing.JComponent comp)
This pops up a menu near the given comp and allows the user to
select a unit name which gets put into the given fld
|
static void |
positionAndFitToScreen(java.awt.Window window,
java.awt.Rectangle bounds)
Position and fit a window to the screen
|
static javax.swing.JMenu |
processXmlMenu(org.w3c.dom.Node menuNode,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems)
Create the JMenu from the given xml.
|
static javax.swing.JMenu |
processXmlMenu(org.w3c.dom.Node menuNode,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems,
java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons)
Create the JMenu from the given xml.
|
static javax.swing.JMenuBar |
processXmlMenuBar(org.w3c.dom.Element root,
javax.swing.JMenuBar menuBar,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems)
Create, if null, and ddd to the JMenuBar from the xml
|
static javax.swing.JMenuBar |
processXmlMenuBar(org.w3c.dom.Element root,
javax.swing.JMenuBar menuBar,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems,
java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons)
Create, if null, and ddd to the JMenuBar from the xml
|
static javax.swing.JMenuItem |
processXmlMenuItem(org.w3c.dom.Node node,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems)
Create the JMenuItem defined by the given xml
|
static javax.swing.JMenuItem |
processXmlMenuItem(org.w3c.dom.Node node,
java.awt.event.ActionListener listener,
java.util.Hashtable menuItems,
java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons)
Create the JMenuItem defined by the given xml
|
static void |
removeModalDialogComponent(java.awt.Component comp)
Remove the model dialog from the list
|
static void |
resetHeavyWeightComponents(javax.swing.JTabbedPane tab)
Walk the components of the tab and toggle the heavyweight components visiblity
|
static javax.swing.JLabel |
rLabel(java.lang.String s)
Create a right aligned JLabel
|
static javax.swing.ImageIcon |
scaleImageIcon(javax.swing.ImageIcon icon)
This scales the image icon up to the minimum icon size if it is defined
|
static void |
scrollToTop(javax.swing.JEditorPane editor)
Scroll the given component to the top
|
static void |
setApplicationTitle(java.lang.String title)
_more_
|
static void |
setBackgroundOnTree(java.awt.Container c,
java.awt.Color bgColor)
Recurse the Component hierarchy, setting the background color
of each component.
|
static void |
setCursor(java.awt.Component component,
java.awt.Cursor cursor)
This finds the Window the given component c is in and,
if it is found, sets the cursor of the Window to the given cursor.
|
static void |
setDefaultDateFormat(java.lang.String fmt)
Set the default date format
|
static void |
setDefaultFont(java.awt.Font font)
Set the default font
|
static void |
setDefaultIconSize(int size)
Set the default icon size
|
static void |
setFixedWidthFont(java.awt.Component comp)
Set the font on the component to be monospaced
|
static void |
setFontOnTree(javax.swing.JComponent c,
java.awt.Font f)
Recurse the Component hierarchy, setting the font.
|
static void |
setForegroundOnTree(java.awt.Component comp,
java.awt.Color fgColor)
Recurse the Component hierarchy, setting the foreground color
of each component.
|
static void |
setForegroundOnTree(java.awt.Component comp,
java.awt.Color fgColor,
java.awt.Color ifEquals)
Recurse the Component hierarchy, setting the foreground color
of each component.
|
static javax.swing.AbstractButton |
setIcon(javax.swing.AbstractButton button,
java.lang.String iconPath)
Set the icon on the button.
|
static void |
setIconsInMenus(boolean doIcons)
Do we show icons in the menus
|
static void |
setListData(javax.swing.JComboBox box,
java.util.List items)
Procedure to set the list of items in a ComboBox
|
static void |
setListData(javax.swing.JComboBox box,
java.lang.Object[] items)
Procedure to set the list of items in a ComboBox
|
static void |
setPreferredWidth(javax.swing.JComponent comp,
int width)
Set the preferred width on a component
|
static void |
setSelectedItems(javax.swing.JList list,
java.util.List selected)
_more_
|
static javax.swing.JComponent |
setSize(javax.swing.JComponent comp,
int w,
int h)
Set the size and preferred size of the component and return it
|
static void |
setSliderPercent(javax.swing.JSlider s,
double percent)
Set the slider value as a percentage between its min and max
|
static void |
setTimeZone(java.util.TimeZone tz)
Set the default timezone used for formatting
|
static void |
setToolTipOnTree(java.awt.Container c,
java.lang.String tooltip)
Recurse the Component hierarchy, setting the tooltip
of each component.
|
static void |
setupDirectoryChooser(javax.swing.JButton btn,
javax.swing.JTextField directoryFld)
Set up a directory chooser
|
static void |
setupFileChooser(javax.swing.JButton btn,
javax.swing.JTextField directoryFld,
boolean justDirectories)
Set up a directory chooser
|
static void |
setValueOfBox(javax.swing.JComboBox box,
int value,
int[] values,
java.lang.String[] labels)
Set the value of the box
|
static void |
showComponentInTabs(java.awt.Component comp)
Show the component in any contained tabs
|
static void |
showComponentInTabs(java.awt.Component comp,
boolean andShowWindow)
Show the component in any containing tabs
|
static void |
showDialog(java.lang.String title,
java.awt.Component comp)
Show the given component in a dialog.
|
static void |
showDialog(java.lang.String title,
java.awt.Component comp,
java.awt.Component parentComponent)
Show the given component in a dialog.
|
static void |
showDialogNearSrc(java.awt.Component src,
java.awt.Component theWindow)
This will set the location of the theWindow component (might be
A JDialog or a JFrame) at the screen location of the given src component.
|
static void |
showFrameAsDialog(java.awt.Component parentComponent,
javax.swing.JFrame frame)
popup but a modal dialog with input Jframe
|
static java.awt.Component[] |
showHtmlDialog(java.lang.String html,
javax.swing.event.HyperlinkListener linkListener)
Show the given html in a window.
|
static java.awt.Component[] |
showHtmlDialog(java.lang.String html,
java.lang.String title,
javax.swing.event.HyperlinkListener linkListener)
Show the given html in a window with the given title.
|
static java.awt.Component[] |
showHtmlDialog(java.lang.String html,
java.lang.String title,
java.lang.String label,
javax.swing.event.HyperlinkListener linkListener,
boolean modal)
Show a dialog window that contains an html editor
|
static void |
showInCenter(javax.swing.JDialog dialog)
pack and show the dialog in the center of the screen
|
static void |
showIntervalSelectionDialog(javax.swing.JList list)
Show the list interval selection dialog
|
static boolean |
showOkCancelDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src)
Show a modeful Ok/Cancel dialog.
|
static boolean |
showOkCancelDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src,
java.util.List actionComponents)
Show a modeful Ok/Cancel dialog.
|
static boolean |
showOkCancelDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src,
java.util.List actionComponents,
java.lang.String okLabel)
Show a modeful Ok/Cancel dialog.
|
static boolean |
showOkCancelDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src,
java.util.List actionComponents,
java.lang.String okLabel,
boolean resizable,
java.awt.Dimension dialogPrefSize)
Show a modal Ok/Cancel dialog.
|
static void |
showOkDialog(java.awt.Window f,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src)
Show OK dialog
|
static void |
showUrl(java.lang.String s)
_more_
|
static void |
showWidget(java.awt.Component c)
This will show and/or deiconify the given component.
|
static int |
showYesNoCancelDialog(java.awt.Window frame,
java.lang.String message,
java.lang.String title)
Show a modeful dialog, attached to the given frame, with the given message.
|
static int |
showYesNoCancelDialog(java.awt.Window frame,
java.lang.String message,
java.lang.String title,
java.lang.String defaultCmd)
Show a modeful dialog, attached to the given frame, with the given message.
|
static boolean |
showYesNoDialog(java.awt.Window frame,
java.lang.String title,
java.awt.Component contents,
java.awt.Component src)
Show a modeful dialog, attached to the given frame, with the given message.
|
static boolean |
showYesNoDialog(java.awt.Window frame,
java.lang.String message,
java.lang.String title)
Show a modeful dialog, attached to the given frame, with the given message.
|
static boolean |
showYesNoDialog(java.awt.Window frame,
java.lang.String message,
java.lang.String title,
java.lang.String yes,
java.lang.String no)
Show a modeful dialog, attached to the given frame, with the given message.
|
static java.lang.String |
toCsv(javax.swing.table.TableModel model)
Convert the given table model to comma separated string
|
static java.lang.String |
toCsv(javax.swing.table.TableModel model,
boolean includeColumnNames)
Convert the given table model to comma separated string
|
static void |
toFront(java.awt.Window window)
Move the window to the front
|
static void |
toFrontModalDialogs()
Move to the front any modal dialogs
|
static void |
toggleHeavyWeightComponents(java.awt.Component comp,
boolean visible)
Walk the tree and set any heavyweight components visibility.
|
static javax.swing.JComponent |
valignLabel(java.lang.String s)
This makes a component that contains a jlabel.
|
static javax.swing.JSplitPane |
vsplit(java.awt.Component top,
java.awt.Component bottom)
Create a JSplitPane in vertical mode.
|
static javax.swing.JSplitPane |
vsplit(java.awt.Component top,
java.awt.Component bottom,
double resizeWeight)
Create a JSplitPane in vertical mode.
|
static javax.swing.JSplitPane |
vsplit(java.awt.Component top,
java.awt.Component bottom,
int topSpace)
Create a JSplitPane in vertical mode.
|
static javax.swing.JSplitPane |
vsplit(java.awt.Component top,
java.awt.Component bottom,
int topSpace,
double resizeWeight)
Create a JSplitPane in vertical mode.
|
bottom, center, centerBottom, centerRight, colGrid, doLayout, doLayout, doLayout, doLayout, doLayout, filler, filler, getComponentArray, grid, grid, hbox, hbox, hbox, hbox, hbox, hbox, hbox, hbox, hbox, hbox, hbox, hfill, hflow, hflow, hgrid, hgrid, hgrid, inset, inset, inset, inset, left, leftCenter, leftCenterRight, leftRight, leftVbox, right, rowGrid, rowGrid, setAnchorBottom, setAnchorTop, setHFill, setNoFill, toList, top, topBottom, topCenter, topCenterBottom, topLeft, vbox, vbox, vbox, vbox, vbox, vbox, vbox, vgrid, vgrid, wrap, wrapLeft
findMethod, makeCheckboxMenuItem, makeCheckboxMenuItem, makeMenu, makeMenu, makeMenuItem, makeMenuItem, makeMenuItem, makeMenuItems, makePopupMenu, makePopupMenu, showPopupMenu, typesMatch
public static java.lang.String MISSING_IMAGE
public static final java.lang.String ATTR_ACTION
public static final java.lang.String ATTR_TOOLTIP
public static final java.lang.String ATTR_ICON
public static final java.lang.String ATTR_ID
public static final java.awt.Cursor waitCursor
public static final java.awt.Cursor normalCursor
public static final int[] FONT_SIZES
public static final java.lang.String[] COLORNAMES
public static final java.awt.Color[] COLORS
public static final java.lang.String HEX_COLOR_PATTERN
public static java.lang.String CMD_APPLY
public static java.lang.String CMD_CANCEL
public static java.lang.String CMD_CLOSE
public static java.lang.String CMD_IMPORT
public static java.lang.String CMD_EXPORT
public static java.lang.String CMD_SUBMIT
public static java.lang.String CMD_RENAME
public static java.lang.String CMD_REMOVE
public static java.lang.String CMD_NEW
public static java.lang.String CMD_YES
public static java.lang.String CMD_NO
public static java.lang.String CMD_OK
public static java.lang.String CMD_OPEN
public static java.lang.String CMD_RESET
public static java.lang.String CMD_HELP
public static java.lang.String CMD_SAVE
public static java.lang.String CMD_SAVEAS
public static java.lang.String CMD_UPDATE
public static java.lang.String CMD_START
public static java.lang.String CMD_STOP
public static java.awt.Font buttonFont
public static final java.util.TimeZone TIMEZONE_UTC
public static void initLabels()
public static void setTimeZone(java.util.TimeZone tz)
tz
- timezonepublic static java.util.TimeZone getTimeZone()
public static void setDefaultDateFormat(java.lang.String fmt)
fmt
- date format stringpublic static java.lang.String formatDate(java.util.Date dttm)
dttm
- datepublic static void setDefaultIconSize(int size)
size
- new sizepublic static int getDefaultIconSize()
public static void setDefaultFont(java.awt.Font font)
font
- the default fontpublic static java.awt.Font getDefaultFont()
public static void applyDefaultFont(java.awt.Component comp)
comp
- _more_public static javax.swing.JLabel getFixedWidthLabel(java.lang.String s)
s
- Initial label stringpublic static void setFixedWidthFont(java.awt.Component comp)
comp
- The componentpublic static void setCursor(java.awt.Component component, java.awt.Cursor cursor)
component
- The component to look for the window fromcursor
- The cursorpublic static javax.swing.JFrame getFrame(java.awt.Component component)
component
- The component to look for the framepublic static void showComponentInTabs(java.awt.Component comp)
comp
- The component to look for the window frompublic static void showComponentInTabs(java.awt.Component comp, boolean andShowWindow)
comp
- Component to showandShowWindow
- If we get to a window do we also show itpublic static void toFront(java.awt.Window window)
window
- the windowpublic static java.awt.Window getWindow(java.awt.Component component)
component
- The component to look for the window frompublic static void empty(java.awt.Container c)
c
- The component to emptypublic static void empty(java.awt.Container c, boolean doItInSwingThread)
c
- The component to emptydoItInSwingThread
- If true then do the emptying in the Swing threadpublic static java.awt.Color decodeColor(java.lang.String value, java.awt.Color dflt)
value
- String valuedflt
- This is returned if the value cannot be convertedpublic static java.lang.String getColorName(java.awt.Color color)
color
- The colorpublic static boolean checkHeight(int height)
height
- the value to checkpublic static void setPreferredWidth(javax.swing.JComponent comp, int width)
comp
- componentwidth
- widthpublic static javax.swing.JComponent[] makeColorSwatchWidget(java.awt.Color color, java.lang.String label)
color
- The initial colorlabel
- The label to use when popping up the color dialogpublic static javax.swing.JComboBox makeColorNameComboBox(java.awt.Color dflt)
dflt
- The default color valuepublic static javax.swing.ImageIcon getImageIcon(java.lang.String file)
file
- The image filepublic static javax.swing.ImageIcon getImageIcon(java.lang.String file, boolean cache)
file
- The image filecache
- Should the local in memory cache be checkedpublic static javax.swing.ImageIcon getImageIcon(java.lang.String file, java.lang.Class c)
file
- The image filec
- The class to use when looking up the image as a resourcepublic static javax.swing.ImageIcon getImageIcon(java.lang.String file, java.lang.Class c, boolean cache)
file
- The image filec
- The class to use when looking up the image as a resourcecache
- Should the local in memory cache be checkedpublic static javax.swing.ImageIcon getScaledImageIcon(java.lang.String file, java.lang.Class c, boolean cache)
file
- location of the imagec
- relative classcache
- true to cache resultpublic static javax.swing.ImageIcon scaleImageIcon(javax.swing.ImageIcon icon)
icon
- The iconpublic static java.awt.Image getImage(java.lang.String file)
file
- The image filepublic static java.awt.Image getImage(java.lang.String file, java.lang.Class c)
file
- The image filec
- Used to lookup the image as a java resourcepublic static java.awt.Image getImage(java.lang.String file, java.lang.Class c, boolean cache)
file
- The image filec
- Used to lookup the image as a java resourcecache
- Should the local cache of Images be checkedpublic static java.awt.Image getImage(java.lang.String file, java.lang.Class c, boolean cache, boolean returnNullIfNotFound)
file
- location of the imagec
- relative classcache
- true to cache resultreturnNullIfNotFound
- true to return null;public static void showDialogNearSrc(java.awt.Component src, java.awt.Component theWindow)
src
- Where we locatetheWindow
- What we locatepublic static void showWidget(java.awt.Component c)
c
- The thing to show.public static javax.swing.JButton makeJButton(java.lang.String label, java.awt.event.ActionListener listener)
label
- The button labellistener
- The ActionListenerpublic static javax.swing.JButton makeJButton(java.lang.String label, java.lang.Object[] args)
label
- The button labelargs
- The argname/value arraypublic static double getSliderPercent(javax.swing.JSlider s)
s
- The sliderpublic static void setSliderPercent(javax.swing.JSlider s, double percent)
s
- The sliderpercent
- The percent valuepublic static void setBackgroundOnTree(java.awt.Container c, java.awt.Color bgColor)
c
- The componentbgColor
- The colorpublic static void setToolTipOnTree(java.awt.Container c, java.lang.String tooltip)
c
- The componenttooltip
- The tooltippublic static void setFontOnTree(javax.swing.JComponent c, java.awt.Font f)
c
- The componentf
- The fontpublic static void setForegroundOnTree(java.awt.Component comp, java.awt.Color fgColor)
comp
- The componentfgColor
- The colorpublic static void setForegroundOnTree(java.awt.Component comp, java.awt.Color fgColor, java.awt.Color ifEquals)
comp
- The componentfgColor
- The colorifEquals
- If non null then only set the foreground color
on the component its current color equals the given fgColorpublic static void enableTree(java.awt.Component comp, boolean enable)
comp
- The componentenable
- The enable flagpublic static void enableComponents(java.util.List comps, boolean enable)
comps
- List of componentsenable
- Enable or disablepublic static void enablePanel(javax.swing.JPanel panel, boolean enable)
panel
- _more_enable
- _more_public static javax.swing.JScrollPane makeScrollPane(java.awt.Component c, int xdim, int ydim)
c
- The component to put in the scroll panexdim
- The x dimensionydim
- The y dimensionpublic static javax.swing.JComponent setSize(javax.swing.JComponent comp, int w, int h)
comp
- componentw
- widthh
- height_public static javax.swing.ButtonGroup buttonGroup(javax.swing.JToggleButton b1, javax.swing.JToggleButton b2)
b1
- Button 1b2
- Button 2public static javax.swing.ButtonGroup buttonGroup(javax.swing.JToggleButton b1, javax.swing.JToggleButton b2, javax.swing.JToggleButton b3)
b1
- Button 1b2
- Button 2b3
- Button 3public static javax.swing.ButtonGroup buttonGroup(javax.swing.JToggleButton b1, javax.swing.JToggleButton b2, javax.swing.JToggleButton b3, javax.swing.JToggleButton b4)
b1
- Button 1b2
- Button 2b3
- Button 3b4
- Button 3public static javax.swing.JComponent valignLabel(java.lang.String s)
s
- The string to create the label withpublic static javax.swing.JComponent formLayout(java.util.List objects)
objects
- objects to lay outpublic static javax.swing.JComponent formLayout(java.util.List objects, java.awt.Insets insets)
objects
- May be components or strings. If strings this method will create jlabelsinsets
- spacingpublic static javax.swing.JComponent formLayout(java.lang.Object[] objects, java.awt.Insets insets)
objects
- array of components to layoutinsets
- The spacingpublic static javax.swing.JComponent formLayout(java.lang.Object[] objects)
objects
- array of components to layoutpublic static javax.swing.JPanel flowRight(java.awt.Component[] comps)
comps
- The components to addpublic static javax.swing.JPanel flow(java.awt.Component[] comps)
comps
- The components to addpublic static javax.swing.JPanel makeButtons(java.awt.event.ActionListener l, java.lang.String[] cmds)
l
- Listenercmds
- Button labels.action commandspublic static javax.swing.JPanel makeButtons(java.awt.event.ActionListener l, java.lang.String[] cmds, java.util.Hashtable buttonMap)
l
- Listenercmds
- Button labels.action commandsbuttonMap
- If non-null will hold a mapping from (String) command to JButtonpublic static javax.swing.JPanel makeButtons(java.awt.event.ActionListener l, java.lang.String[] labels, java.lang.String[] cmds)
l
- Listenerlabels
- Button labelscmds
- Button action commandspublic static javax.swing.JPanel makeButtons(java.awt.event.ActionListener l, java.lang.String[] labels, java.lang.String[] cmds, java.util.Hashtable buttonMap)
l
- Listenerlabels
- Button labelscmds
- Button action commandsbuttonMap
- If non-null will hold a mapping from (String) command to JButtonpublic static javax.swing.JPanel makeButtons(java.awt.event.ActionListener l, java.lang.String[] labels, java.lang.String[] cmds, java.lang.String[] tooltips, java.util.Hashtable buttonMap)
l
- Listenerlabels
- Button labels. If a label starts with icon: then we make an image button, the image path
is the rest of the labelcmds
- Button action commandstooltips
- If non-null then set te tooltip on the buttonbuttonMap
- If non-null will hold a mapping from (String) command to JButtonpublic static javax.swing.JPanel makeApplyCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JButton makeApplyButton(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeOkCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeNewOkCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeNewOkCancelHelpButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeNewOkCancelButtons(java.awt.event.ActionListener l, java.lang.String newLabel, java.lang.String okLabel, java.lang.String cancelLabel)
l
- The listener to add to the buttonsnewLabel
- Label to use for the new buttonokLabel
- Label to use for the ok buttoncancelLabel
- Label to use for the cancel buttonpublic static javax.swing.JPanel makeOkCancelButtons(java.awt.event.ActionListener l, java.lang.String okLabel, java.lang.String cancelLabel)
l
- The listener to add to the buttonsokLabel
- Label to use for the ok buttoncancelLabel
- Label to use for the cancel buttonpublic static javax.swing.JPanel makeApplyOkCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeOkHelpCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeApplyOkHelpCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static javax.swing.JPanel makeApplyOkResetCancelButtons(java.awt.event.ActionListener l)
l
- The listener to add to the buttonspublic static boolean showYesNoDialog(java.awt.Window frame, java.lang.String message, java.lang.String title)
frame
- Frame to attach to.message
- Message to showtitle
- Window titlepublic static boolean showYesNoDialog(java.awt.Window frame, java.lang.String message, java.lang.String title, java.lang.String yes, java.lang.String no)
frame
- Frame to attach to.message
- Message to showtitle
- Window titleyes
- The Yes textno
- The No textpublic static void insertText(javax.swing.text.JTextComponent comp, java.lang.String s)
comp
- components
- text to insertpublic static int showYesNoCancelDialog(java.awt.Window frame, java.lang.String message, java.lang.String title)
frame
- Frame to attach to.message
- Message to showtitle
- Window titlepublic static int showYesNoCancelDialog(java.awt.Window frame, java.lang.String message, java.lang.String title, java.lang.String defaultCmd)
frame
- Frame to attach to.message
- Message to showtitle
- Window titledefaultCmd
- default for the dialog (CMD_YES, CMD_NO, CMD_CANCEL)public static boolean showYesNoDialog(java.awt.Window frame, java.lang.String title, java.awt.Component contents, java.awt.Component src)
frame
- Frame to attach to.contents
- GUI contentstitle
- Window titlesrc
- Where to show windowpublic static boolean showOkCancelDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src)
f
- The frame to attach totitle
- The window titlecontents
- The gui contents to showsrc
- Where should the window popuppublic static boolean showOkCancelDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src, java.util.List actionComponents)
f
- The frame to attach totitle
- The window titlecontents
- The gui contents to showsrc
- Where should the window popupactionComponents
- If non-null then these are components
in the contents (e.g., JTextField) that an action listener is added to to do the Ok
on an action eventpublic static javax.swing.JFrame createFrame(java.lang.String title)
title
- Frame titlepublic static javax.swing.JDialog createDialog(java.lang.String title, boolean modal)
title
- Dialog titlemodal
- Is modalpublic static java.awt.Component[] popup(java.lang.String text, int x, int y, boolean modal)
text
- text or urix
- xy
- ymodal
- modalpublic static javax.swing.JDialog createDialog(java.awt.Window parent, java.lang.String title, boolean modal)
parent
- The parent window. May be null, a Dialog or a Frametitle
- Dialog titlemodal
- Is modalpublic static boolean showOkCancelDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src, java.util.List actionComponents, java.lang.String okLabel)
f
- The frame to attach totitle
- The window titlecontents
- The gui contents to showsrc
- Where should the window popupactionComponents
- If non-null then these are components
in the contents (e.g., JTextField) that an
action listener is added to to do the Ok
on an action eventokLabel
- text for the OK buttonpublic static boolean showOkCancelDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src, java.util.List actionComponents, java.lang.String okLabel, boolean resizable, java.awt.Dimension dialogPrefSize)
f
- The frame to attach totitle
- The window titlecontents
- The gui contents to showsrc
- Where should the window popupactionComponents
- If non-null then these are components
in the contents (e.g., JTextField) that an
action listener is added to to do the Ok
on an action eventokLabel
- text for the OK buttonresizable
- Whether or not the dialog can be resized.dialogPrefSize
- If not null
, use as preferred size of
resulting dialog.public static void showOkDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src)
f
- relative windowtitle
- title for the dialogcontents
- dialog contentssrc
- src componentpublic static int makeDialog(java.awt.Window f, java.lang.String title, java.awt.Component contents, java.awt.Component src, java.lang.String[] buttonLabels)
f
- Frame to attach totitle
- Window titlecontents
- GUI contentssrc
- Where to show windowbuttonLabels
- Buttonspublic static void configureStepSelection(javax.swing.JList list)
list
- list to popup onpublic static void showIntervalSelectionDialog(javax.swing.JList list)
list
- listpublic static void getConfigureStepSelectionItems(javax.swing.JList list, java.util.List items)
list
- JListitems
- menu itemspublic static javax.swing.JComponent formLayout(java.util.List comps, boolean rightAlignFirstColumn)
comps
- Components to layoutrightAlignFirstColumn
- If true then right align the first columnpublic static javax.swing.JComponent formLayout(java.awt.Component[] comps)
comps
- Components to layoutpublic static javax.swing.JComponent formLayout(java.awt.Component[] comps, double[] widths, double[] heights)
comps
- Components to layoutwidths
- WT_heights
- WT_public static javax.swing.JComponent formLayout(java.util.List comps, double[] widths, double[] heights)
comps
- Components to layoutwidths
- WT_heights
- WT_public static javax.swing.JComponent formLayout(java.util.List comps, double[] widths, double[] heights, boolean rightAlignFirstColumn)
comps
- Components to layoutrightAlignFirstColumn
- If true then right align the first column.widths
- WT_heights
- WT_public static javax.swing.JPanel label(java.lang.String label, java.awt.Component widget)
label
- The label text to usewidget
- The widget to labelpublic static javax.swing.JPanel label(java.awt.Component widget, java.lang.String label)
widget
- The widget to labellabel
- The label text to usepublic static javax.swing.JFrame packWindow(javax.swing.JFrame f, java.awt.Component contents)
f
- The framecontents
- The contentspublic static javax.swing.JFrame packWindow(javax.swing.JFrame f, java.awt.Component contents, boolean andShow)
f
- The framecontents
- The contentsandShow
- If true then show the window.public static javax.swing.JDialog packDialog(javax.swing.JDialog f, java.awt.Component contents)
f
- The dialogcontents
- The contentspublic static javax.swing.JFrame makeWindow(java.lang.String title, java.awt.Component contents, int x, int y)
title
- The window titlecontents
- The contentsx
- x locationy
- y locationpublic static javax.swing.JMenuBar makeMenuBar(java.util.List menus)
menus
- List if JMenu-spublic static ObjectListener getCloseDialogListener(javax.swing.JDialog dialog)
dialog
- The dialog to closepublic static javax.swing.JLabel getImageLabel(java.lang.String icon, java.lang.Class origin)
icon
- The image fileorigin
- Used to lookup java resourcespublic static javax.swing.JLabel getImageLabel(java.lang.String icon)
icon
- The image filepublic static javax.swing.JButton getImageButton(java.lang.String icon, java.lang.Class origin)
icon
- The image fileorigin
- Used to lookup java resourcespublic static javax.swing.JButton getImageButton(java.lang.String icon, java.lang.Class origin, int hInset, int vInset)
icon
- The image fileorigin
- Used to lookup java resourceshInset
- Horizontal insetvInset
- Vertical insetpublic static javax.swing.JButton getScaledImageButton(java.lang.String icon, java.lang.Class origin, int hInset, int vInset)
icon
- path to icon for the buttonorigin
- relative classhInset
- horizontal insetvInset
- vertical insetpublic static javax.swing.JButton getImageButton(javax.swing.ImageIcon icon)
icon
- The image iconpublic static javax.swing.JButton getImageButton(javax.swing.ImageIcon icon, int offset)
icon
- The image iconoffset
- The spacing around the image in the JButtonpublic static javax.swing.JButton getImageButton(javax.swing.ImageIcon icon, int hinset, int vinset)
icon
- The image iconhinset
- The hor. spacing around the image in the JButtonvinset
- The vert. spacing around the image in the JButtonpublic static javax.swing.JToggleButton getToggleImageButton(java.lang.String icon, java.lang.String selectedIcon, int hinset, int vinset, boolean addMouseOverBorder)
icon
- Image for buttonselectedIcon
- Image to use when selectedhinset
- Hor. insetvinset
- Vert. insetaddMouseOverBorder
- add a mouseover borderpublic static javax.swing.JToggleButton getToggleImageButton(javax.swing.ImageIcon icon, javax.swing.ImageIcon selectedIcon, int hinset, int vinset)
icon
- Image for buttonselectedIcon
- Image to use when selectedhinset
- Hor. insetvinset
- Vert. insetpublic static javax.swing.JToggleButton getToggleImageButton(javax.swing.ImageIcon icon, javax.swing.ImageIcon selectedIcon, int hinset, int vinset, boolean addMouseOverBorder)
icon
- Image for buttonselectedIcon
- Image to use when selectedhinset
- Hor. insetvinset
- Vert. insetaddMouseOverBorder
- add a mouseover borderpublic static void makeMouseOverBorder(javax.swing.JComponent b)
b
- the componentpublic static javax.swing.JToggleButton getToggleButton(java.lang.String iconPath, int hinset, int vinset)
iconPath
- path to imagehinset
- hor. insetvinset
- vert insetpublic static javax.swing.JToggleButton getToggleButton(javax.swing.ImageIcon icon, int hinset, int vinset)
icon
- The icon to usehinset
- hor.insetvinset
- vert. insetpublic static java.awt.Point getLocation(java.awt.Component src)
src
- Source componentpublic static void showInCenter(javax.swing.JDialog dialog)
dialog
- The dialogpublic static void packInCenter(javax.swing.JDialog dialog)
dialog
- The dialogpublic static javax.swing.JSplitPane vsplit(java.awt.Component top, java.awt.Component bottom, int topSpace, double resizeWeight)
top
- Top componentbottom
- Bottom componenttopSpace
- How much space to give the topresizeWeight
- How much weight to give the top when resizingpublic static javax.swing.JSplitPane vsplit(java.awt.Component top, java.awt.Component bottom, int topSpace)
top
- Top componentbottom
- Bottom componenttopSpace
- How much space to give the toppublic static javax.swing.JSplitPane vsplit(java.awt.Component top, java.awt.Component bottom, double resizeWeight)
top
- Top componentbottom
- Bottom componentresizeWeight
- How much weight to give the top when resizingpublic static javax.swing.JSplitPane vsplit(java.awt.Component top, java.awt.Component bottom)
top
- Top componentbottom
- Bottom componentpublic static javax.swing.JSplitPane hsplit(java.awt.Component left, java.awt.Component right, int leftSpace, double resizeWeight)
left
- The left componentright
- The right componentleftSpace
- Where to put the dividerresizeWeight
- The resize weightpublic static javax.swing.JSplitPane hsplit(java.awt.Component left, java.awt.Component right, int leftSpace)
left
- The left componentright
- The right componentleftSpace
- Where to put the dividerpublic static javax.swing.JSplitPane hsplit(java.awt.Component left, java.awt.Component right, double resizeWeight)
left
- The left componentright
- The right componentresizeWeight
- How much resize weight to usepublic static javax.swing.JSplitPane hsplit(java.awt.Component left, java.awt.Component right)
left
- The left componentright
- The right componentpublic static javax.swing.JLabel rLabel(java.lang.String s)
s
- The String to use for the labelpublic static javax.swing.JLabel cLabel(java.lang.String s)
s
- The String to use for the labelpublic static javax.swing.JLabel lLabel(java.lang.String s)
s
- The String to use for the labelpublic static javax.swing.JComponent hspace(int w, int h)
w
- The min widthh
- The min heightpublic static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue)
question
- The question.label
- Extra label.initValue
- Initial value of answerpublic static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue, java.lang.String trailingLabel)
question
- The question.label
- Extra label.initValue
- Initial value of answertrailingLabel
- Label after the text field.public static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue, java.lang.String trailingLabel, java.lang.Object underLabel)
question
- The question.label
- Extra label.initValue
- Initial value of answertrailingLabel
- Label after the text field.underLabel
- Label under the text field.public static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue, java.lang.String trailingLabel, java.lang.Object underLabel, java.lang.String title)
question
- The question.label
- Extra label.initValue
- Initial value of answertrailingLabel
- Label after the text field.underLabel
- Label under the text field.title
- for the dialog box.public static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue, java.lang.String trailingLabel, java.lang.Object underLabel, java.lang.String title, int fieldWidth)
question
- The question.label
- Extra label.initValue
- Initial value of answertrailingLabel
- Label after the text field.underLabel
- Label under the text field.title
- for the dialog box.fieldWidth
- Field widthpublic static java.lang.String getInput(java.lang.String question, java.lang.String label, java.lang.String initValue, java.lang.String trailingLabel, java.lang.Object underLabel, java.lang.String title, int fieldWidth, javax.swing.JComponent nearComponent)
question
- The question.label
- Extra label.initValue
- Initial value of answertrailingLabel
- Label after the text field.underLabel
- Label under the text field.title
- for the dialog box.fieldWidth
- Field widthnearComponent
- If non-null then show the dialog near this componentpublic static java.lang.String getInput(java.lang.String question)
question
- The questionpublic static boolean askYesNo(java.lang.String title, java.lang.Object question)
title
- The window title.question
- The question.public static boolean askOkCancel(java.lang.String title, java.lang.Object question)
title
- The window title.question
- The question.public static void showDialog(java.lang.String title, java.awt.Component comp)
title
- The titlecomp
- The component to showpublic static void addModalDialogComponent(java.awt.Component comp)
comp
- The component in the model dialogpublic static void removeModalDialogComponent(java.awt.Component comp)
comp
- The component in the model dialogpublic static void showDialog(java.lang.String title, java.awt.Component comp, java.awt.Component parentComponent)
title
- The titlecomp
- The component to showparentComponent
- The parent component of the dialog.public static void toFrontModalDialogs()
public static void setListData(javax.swing.JComboBox box, java.lang.Object[] items)
box
- Combobox to fillitems
- Items to addpublic static boolean anySelected(javax.swing.JComboBox box)
box
- The box to checkpublic static void setListData(javax.swing.JComboBox box, java.util.List items)
box
- Combobox to fillitems
- Items to addpublic static javax.swing.JComboBox getEditableBox(java.util.List items, java.lang.Object selected)
items
- Items in the boxselected
- Selected itempublic static int getBoxValue(javax.swing.JComboBox box)
box
- The boxpublic static javax.swing.JComboBox createValueBox(java.awt.event.ActionListener listener, java.lang.String command, int initValue, java.util.List values, boolean editable)
listener
- The action listenercommand
- Action command for boxinitValue
- Initial valuevalues
- List of Integerseditable
- Is box editablepublic static javax.swing.JMenuItem processXmlMenuItem(org.w3c.dom.Node node, java.awt.event.ActionListener listener, java.util.Hashtable menuItems) throws java.lang.Exception
node
- Xml menu item nodelistener
- Action listener to add to the menu itemmenuItems
- Mapping from id (from xml) to JMenuItemjava.lang.Exception
public static javax.swing.JMenuItem processXmlMenuItem(org.w3c.dom.Node node, java.awt.event.ActionListener listener, java.util.Hashtable menuItems, java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons) throws java.lang.Exception
node
- Xml menu item nodelistener
- Action listener to add to the menu itemmenuItems
- Mapping from id (from xml) to JMenuItemactionIcons
- mapping of string action to imageicon to use in the menu itemjava.lang.Exception
public static int charToKeyCode(java.lang.String s)
s
- The stringpublic static int charToKeyCode(char ch)
ch
- The characterpublic static javax.swing.JMenu processXmlMenu(org.w3c.dom.Node menuNode, java.awt.event.ActionListener listener, java.util.Hashtable menuItems) throws java.lang.Exception
menuNode
- The menu xml nodelistener
- The action listenermenuItems
- Mapping from id to menu itemsjava.lang.Exception
public static javax.swing.JMenu processXmlMenu(org.w3c.dom.Node menuNode, java.awt.event.ActionListener listener, java.util.Hashtable menuItems, java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons) throws java.lang.Exception
menuNode
- The menu xml nodelistener
- The action listenermenuItems
- Mapping from id to menu itemsactionIcons
- mapping of string action to imageicon to use in the menu itemjava.lang.Exception
public static javax.swing.JMenuBar processXmlMenuBar(org.w3c.dom.Element root, javax.swing.JMenuBar menuBar, java.awt.event.ActionListener listener, java.util.Hashtable menuItems)
root
- Xml rootmenuBar
- The menu barlistener
- The action listenermenuItems
- Mapping from id to menu itemspublic static javax.swing.JMenuBar processXmlMenuBar(org.w3c.dom.Element root, javax.swing.JMenuBar menuBar, java.awt.event.ActionListener listener, java.util.Hashtable menuItems, java.util.Hashtable<java.lang.String,javax.swing.ImageIcon> actionIcons)
root
- Xml rootmenuBar
- The menu barlistener
- The action listenermenuItems
- Mapping from id to menu itemsactionIcons
- mapping of string action to imageicon to use in the menu itempublic static java.util.List getItems(javax.swing.JComboBox box)
box
- The boxpublic static boolean isShowing(javax.swing.JFrame f)
f
- The framepublic static boolean isShowing(javax.swing.JDialog f)
f
- The dialogpublic static java.awt.Image getImage(java.awt.Component component) throws java.lang.Exception
component
- The component.java.lang.Exception
public static java.awt.Component[] showHtmlDialog(java.lang.String html, javax.swing.event.HyperlinkListener linkListener)
html
- The htmllinkListener
- The listenerpublic static java.awt.Component[] showHtmlDialog(java.lang.String html, java.lang.String title, javax.swing.event.HyperlinkListener linkListener)
html
- The htmltitle
- The title of the windowlinkListener
- The listenerpublic static java.awt.Component[] getHtmlComponent(java.lang.String html, javax.swing.event.HyperlinkListener linkListener, int width, int height)
html
- htmllinkListener
- Listenerwidth
- heightheight
- widthpublic static java.awt.Component[] showHtmlDialog(java.lang.String html, java.lang.String title, java.lang.String label, javax.swing.event.HyperlinkListener linkListener, boolean modal)
html
- htmltitle
- window titlelabel
- labellinkListener
- Listenermodal
- is window modalpublic static java.util.Hashtable initializeExpandedPathsBeforeChange(javax.swing.JTree tree, javax.swing.tree.DefaultMutableTreeNode root)
tree
- The jtreeroot
- Its tree rootpublic static void expandPathsAfterChange(javax.swing.JTree tree, java.util.Hashtable state, javax.swing.tree.DefaultMutableTreeNode root)
tree
- The treestate
- The state. From initializeExpandedPathsBeforeChangeroot
- The tree rootpublic static GuiUtils.TreeSearchResults doTreeSearch(javax.swing.JTree tree, java.lang.Object lastState, java.lang.String nodeDesc, javax.swing.JComponent near)
tree
- Tree to searchlastState
- For successive searches, this keeps state aroundnodeDesc
- A descriptive term for the node for when we tell something to the usernear
- If non-null then show the input dialog near this componentpublic static void limitMenuSize(java.util.List items, java.lang.String name, int size)
items
- List of JMenuItemsname
- The name suffix to usesize
- Max size of a menupublic static void limitMenuSize(javax.swing.JMenu menu, java.lang.String name, int size)
menu
- The menuname
- The name suffix to usesize
- Max size of a menupublic static void limitMenuSize(javax.swing.JMenu menu, java.lang.String name, int size, boolean recurse)
menu
- The menuname
- The name suffix to usesize
- Max size of a menurecurse
- If true then limit the size of all sub menuspublic static GuiUtils.TreeSearchResults doTreeSearch(javax.swing.JTree tree, java.lang.Object lastState, java.lang.String nodeDesc, javax.swing.JComponent near, java.lang.String originalPhrase)
tree
- the treelastState
- last statenodeDesc
- the node descriptionnear
- the near componentoriginalPhrase
- the search phrasepublic static java.lang.String toCsv(javax.swing.table.TableModel model)
model
- The table model to writepublic static java.lang.String toCsv(javax.swing.table.TableModel model, boolean includeColumnNames)
model
- The table model to writeincludeColumnNames
- true to include the column namespublic static void exportAsCsv(javax.swing.table.TableModel model)
model
- The table model to writepublic static void exportAsCsv(java.lang.String header, javax.swing.table.TableModel model)
header
- a header to prepend to the tablemodel
- The table model to writepublic static void exportAsCsv(java.lang.String header, javax.swing.table.TableModel model, boolean includeColumnNames)
header
- a header to prepend to the tablemodel
- The table model to writeincludeColumnNames
- true to include the column namespublic static void exportAsCsv(java.lang.String header, javax.swing.table.TableModel model, java.lang.String filename)
header
- header for the outputmodel
- table modelfilename
- file name to export topublic static void exportAsCsv(java.lang.String header, javax.swing.table.TableModel model, java.lang.String filename, boolean includeColumnNames)
header
- header for the outputmodel
- table modelfilename
- file name to export toincludeColumnNames
- true to include the column namespublic static void setupDirectoryChooser(javax.swing.JButton btn, javax.swing.JTextField directoryFld)
btn
- button for choosing directorydirectoryFld
- directory fieldpublic static void setupFileChooser(javax.swing.JButton btn, javax.swing.JTextField directoryFld, boolean justDirectories)
btn
- button for choosing directorydirectoryFld
- directory fieldjustDirectories
- flag for just looking at directoriespublic static javax.swing.JCheckBox makeCheckbox(java.lang.String label, java.lang.Object object, java.lang.String property)
label
- Labelobject
- Object to callproperty
- Name of property to get/set valuepublic static javax.swing.JCheckBox makeCheckbox(java.lang.String label, java.lang.Object object, java.lang.String property, java.lang.Object arg)
label
- Labelobject
- Object to callproperty
- Name of property to get/set valuearg
- Optional arg to pass to methodpublic static javax.swing.JRadioButton[] makeRadioButtons(java.util.List labels, int selectedIndex, java.lang.Object object, java.lang.String methodName)
labels
- labelsselectedIndex
- which one is onobject
- Object to callmethodName
- The methodpublic static javax.swing.JButton makeButton(java.lang.String label, java.lang.Object object, java.lang.String methodName)
label
- Labelobject
- Object to callmethodName
- Method name to callpublic static javax.swing.JButton makeButton(java.lang.String label, java.lang.Object object, java.lang.String methodName, java.lang.Object arg)
label
- Labelobject
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.public static javax.swing.JButton makeButton(java.lang.String label, java.lang.Object object, java.lang.String methodName, java.lang.Object arg, java.lang.String tooltip)
label
- Labelobject
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.tooltip
- if non-null then set the tooltip on the buttonpublic static java.awt.event.ActionListener makeActionListener(java.lang.Object object, java.lang.String methodName, java.lang.Object arg)
object
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.public static void invokeInSwingThread(java.lang.Runnable runnable)
runnable
- runnable to runpublic static javax.swing.JButton makeImageButton(java.lang.String label, java.lang.Object object, java.lang.String methodName)
label
- Labelobject
- Object to callmethodName
- Method name to callpublic static javax.swing.JButton makeImageButton(java.lang.String label, java.lang.Object object, java.lang.String methodName, java.lang.Object arg)
label
- Labelobject
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.public static javax.swing.JButton makeImageButton(java.lang.String label, java.lang.Object object, java.lang.String methodName, java.lang.Object arg, boolean addMouseOverBorder)
label
- Labelobject
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.addMouseOverBorder
- add a mouse-over borderpublic static javax.swing.JComponent addActionListener(javax.swing.JComponent comp, java.lang.Object object, java.lang.String methodName, java.lang.Object arg)
comp
- The componentobject
- Object to callmethodName
- Method name to callarg
- Pass this to method name if non-null.public static javax.swing.JMenu makeDynamicMenu(java.lang.String name, java.lang.Object object, java.lang.String methodName)
name
- Menu nameobject
- Object to callmethodName
- method to invokepublic static javax.swing.JMenu makeDynamicMenu(java.lang.String name, java.lang.Object object, java.lang.String methodName, boolean doRemoveAll)
name
- Menu nameobject
- Object to callmethodName
- method to invokedoRemoveAll
- true to remove all firstpublic static javax.swing.JComboBox makeComboBox(java.util.List items, java.lang.Object selected, boolean editable, java.lang.Object listener, java.lang.String methodName)
items
- items for the boxselected
- the selected itemeditable
- flag for whether this is editable or notlistener
- Listener for changesmethodName
- method to call when item changespublic static javax.swing.JComboBox makeComboBox(java.util.List items, java.lang.Object selected, boolean editable, java.lang.Object listener, java.lang.String methodName, boolean inAThread)
items
- items for the boxselected
- the selected itemeditable
- flag for whether this is editable or notlistener
- Listener for changesmethodName
- method to call when item changesinAThread
- Call the method in a threadpublic static javax.swing.JComboBox makeComboBox(int[] values, java.lang.String[] labels, int current)
values
- integer valueslabels
- labels for valuescurrent
- current one to selectpublic static void setValueOfBox(javax.swing.JComboBox box, int value, int[] values, java.lang.String[] labels)
box
- the box to setvalue
- the default valuevalues
- the valueslabels
- labels for the valuespublic static int getValueFromBox(javax.swing.JComboBox box)
box
- the box to usepublic static javax.swing.JSlider makeSlider(int min, int max, int value, java.lang.Object listener, java.lang.String methodName)
min
- minimum valuemax
- maximum valuevalue
- initial valuelistener
- listener for changesmethodName
- method to call when change occurspublic static javax.swing.JSlider makeSlider(int min, int max, int value, java.lang.Object listener, java.lang.String methodName, boolean updateAsMove)
min
- minimum valuemax
- maximum valuevalue
- initial valuelistener
- listener for changesmethodName
- method to call when change occursupdateAsMove
- If true we call the listener as the slider moves.public static java.util.Vector getFontSizeList()
public static java.util.Vector getFontList()
public static TwoFacedObject makeTwoFacedFont(java.awt.Font f)
f
- Font to usepublic static void makeRowVisible(javax.swing.JTable table, int row)
table
- The tablerow
- The rowpublic static void scrollToTop(javax.swing.JEditorPane editor)
editor
- editor to scrollpublic static void addMouseListenerRecurse(java.awt.event.MouseListener listener, java.awt.Container c)
listener
- the mouse listenerc
- the containerpublic static void addKeyListenerRecurse(java.awt.event.KeyListener listener, java.awt.Container c)
listener
- the key listenerc
- the containerpublic static double distance(double x1, double y1, double x2, double y2)
x1
- x1y1
- y1x2
- x2y2
- y2public static double distance(double[] p1, double[] p2)
p1
- Fromp2
- Topublic static double distance(int[] p1, int[] p2)
p1
- Fromp2
- Topublic static double distance(double x, double y, java.awt.geom.Rectangle2D r)
x
- xy
- yr
- rectpublic static javax.swing.JLabel makeVerticalLabel(java.lang.String text)
text
- textpublic static javax.swing.JComponent doMultiSplitPane(java.util.List comps, boolean hsplit)
comps
- List of componentshsplit
- horizontal or verticalpublic static javax.swing.JTabbedPane getNestedTabbedPane()
public static javax.swing.JTabbedPane getNestedTabbedPane(int orient)
orient
- tab orientationpublic static javax.swing.JTabbedPane getNestedTabbedPane(int orient, int top, int left, int bottom, int right)
orient
- tab orientationtop
- top borderleft
- left borderbottom
- bottom borderright
- right borderpublic static javax.swing.JComponent[] makeSliderPopup(int min, int max, int value, javax.swing.event.ChangeListener listener)
min
- slider min valuemax
- slider max valuevalue
- slider valuelistener
- slider change listenerpublic static void positionAndFitToScreen(java.awt.Window window, java.awt.Rectangle bounds)
window
- window to fitbounds
- new boundspublic static void toggleHeavyWeightComponents(java.awt.Component comp, boolean visible)
comp
- Componentvisible
- On/offpublic static void checkHeavyWeightComponents(javax.swing.JTabbedPane tab)
tab
- tabpublic static void resetHeavyWeightComponents(javax.swing.JTabbedPane tab)
tab
- tabpublic static void handleHeavyWeightComponentsInTabs(javax.swing.JTabbedPane tab)
tab
- tabpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- argsjava.lang.Exception
- on badnesspublic static javax.swing.JButton makeFileBrowseButton(javax.swing.text.JTextComponent fld)
fld
- Field to setpublic static javax.swing.JButton makeFileBrowseButton(javax.swing.text.JTextComponent fld, java.util.List filters)
fld
- Field to setfilters
- File filters. May be null.public static javax.swing.JButton makeFileBrowseButton(javax.swing.text.JTextComponent fld, boolean chooseDirectory, java.util.List filters)
fld
- Field to setchooseDirectory
- Select a directoryfilters
- File filters. May be null.public static javax.swing.JComboBox doMakeFontBox(java.awt.Font f)
f
- Font to select in the boxpublic static javax.swing.JComboBox doMakeFontSizeBox(int size)
size
- Selected sizepublic static java.awt.Component italicizeFont(java.awt.Component comp)
comp
- The componentpublic static void popupUnitMenu(javax.swing.JTextField fld, javax.swing.JComponent comp)
fld
- The fld to setcomp
- THe component to popup the menu nearpublic static boolean getIconsInMenus()
public static void setIconsInMenus(boolean doIcons)
doIcons
- show iconspublic static javax.swing.AbstractButton setIcon(javax.swing.AbstractButton button, java.lang.String iconPath)
button
- The buttoniconPath
- The icon pathpublic static void setSelectedItems(javax.swing.JList list, java.util.List selected)
list
- _more_selected
- _more_public static java.util.List getItems(javax.swing.JList list)
list
- _more_public static java.lang.String getLocalName(java.lang.String n, boolean local)
n
- _more_local
- _more_public static java.lang.String getLocalName(java.lang.String n, boolean local, boolean addHtml)
n
- _more_local
- _more_addHtml
- _more_public static void appendText(javax.swing.text.JTextComponent fld, java.lang.String s, java.lang.String delimiter)
fld
- _more_s
- _more_delimiter
- _more_public static void addKeyBindings(javax.swing.text.JTextComponent comp)
comp
- _more_public static void moveSubtreesToTop(javax.swing.tree.DefaultMutableTreeNode parent)
parent
- _more_public static javax.swing.JComponent makeHeader(java.lang.String label)
label
- Header labelpublic static java.lang.String getAttribute(org.w3c.dom.Node element, java.lang.String name, java.lang.String dflt)
element
- The xml element to look within.name
- The attribute name.dflt
- The default value.public static java.lang.String getAttribute(org.w3c.dom.NamedNodeMap attrs, java.lang.String name, java.lang.String dflt)
attrs
- _more_name
- _more_dflt
- _more_public static boolean getAttribute(org.w3c.dom.NamedNodeMap attrs, java.lang.String name, boolean dflt)
attrs
- _more_name
- _more_dflt
- _more_public static java.lang.String getAttribute(org.w3c.dom.NamedNodeMap attrs, java.lang.String name)
attrs
- _more_name
- _more_public static java.util.List findChildren(org.w3c.dom.Node parent, java.lang.String tag)
parent
- _more_tag
- _more_public static int getInt(javax.swing.JTextField fld)
fld
- text fieldpublic static double getValue(javax.swing.JTextField fld)
fld
- text fieldpublic static void setApplicationTitle(java.lang.String title)
title
- _more_public static java.lang.String getApplicationTitle()
public static boolean doMacMenubar()
public static boolean isControlKey(java.awt.event.InputEvent event)
event
- _more_public static boolean isControlKey(java.awt.event.KeyEvent event, int keyCode)
event
- _more_keyCode
- _more_public static boolean isMac()
public static boolean isDeleteEvent(java.awt.event.KeyEvent e)
e
- _more_public static void decorateFrame(javax.swing.JFrame frame, javax.swing.JMenuBar menuBar)
frame
- _more_menuBar
- _more_public static void showUrl(java.lang.String s) throws java.lang.Exception
s
- _more_java.lang.Exception
- _more_public static void addLinkListener(javax.swing.JEditorPane editor)
editor
- _more_public static void showFrameAsDialog(java.awt.Component parentComponent, javax.swing.JFrame frame)