|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.util.swing.GUIHelper
public abstract class GUIHelper
Provides some functionality to help GUIs set defaults, etc.
Field Summary | |
---|---|
static java.awt.Color |
DEFAULT_BG_COLOR
default background color |
static java.awt.Color |
DEFAULT_FG_COLOR
default foreground color |
static java.awt.Font |
DEFAULT_FONT
default font |
static java.awt.Font |
DEFAULT_FONT_BOLD
default font bolded |
static java.awt.Font |
DEFAULT_FONT_SMALL
smaller font size version of the default font |
Constructor Summary | |
---|---|
GUIHelper()
|
Method Summary | |
---|---|
static void |
addListenersToSubcomponents(FileMenuFrame f,
java.util.Vector<BoundComponent> compons)
Adds a listener to each component so that when it is saved the change variable in f is flagged as true |
static int |
confirmDialog(java.lang.String title,
java.lang.String msg,
int type)
Displays an input dialog box |
static void |
displayError(java.lang.Exception e)
Displays an error message from a thrown Excpetion |
static void |
displayError(java.lang.String msg)
Displays an error message |
static void |
displayMessage(java.lang.String msg)
Displays a message |
static void |
displayMessage(java.lang.String title,
java.lang.String msg)
Displays a message |
static int |
getColumnAtCaret(javax.swing.text.JTextComponent component)
|
static java.lang.String |
getInput(java.lang.String msg)
Displays an input dialog box with no default value set |
static java.lang.String |
getInput(java.lang.String msg,
java.lang.String defaultValue)
Displays an input dialog box |
static int |
getLineAtCaret(javax.swing.text.JTextComponent component)
|
static java.util.Vector<BoundComponent> |
getSubcomponents(BoundComponent c)
Gets all bound objects this component holds including itself |
static void |
scrollToTopOnChange(javax.swing.text.JTextComponent txtCompon)
Adds a listener to the specified JTextComponent so that whenever it is changed it will scroll to the top of its text area. |
static void |
scrollToTopOnChangeExceptIfTyping(javax.swing.text.JTextComponent txtCompon)
Adds a listener to the specified JTextComponent so that whenever it is changed it will scroll to the top of its text area (except if the change is due to a user typing). |
static void |
setGUIDefaults()
Sets the defaults for GUIs in this project - all components created *AFTER* this is called will be created with these defaults unless specifically overridden. |
static void |
setUIBgColor(java.awt.Color color)
Sets the default background color for all Swing componenets |
static void |
setUIFont(javax.swing.plaf.FontUIResource f)
Sets the default font for all Swing componenets |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.awt.Color DEFAULT_BG_COLOR
public static final java.awt.Color DEFAULT_FG_COLOR
public static final java.awt.Font DEFAULT_FONT
public static final java.awt.Font DEFAULT_FONT_BOLD
public static final java.awt.Font DEFAULT_FONT_SMALL
Constructor Detail |
---|
public GUIHelper()
Method Detail |
---|
public static void setGUIDefaults()
public static void setUIFont(javax.swing.plaf.FontUIResource f)
public static void setUIBgColor(java.awt.Color color)
public static void displayError(java.lang.Exception e)
e
- the exception whose message will be shown in a JOptionPane MessageDialog boxpublic static void displayError(java.lang.String msg)
msg
- the message which will be shown in a JOptionPane MessageDialog boxpublic static java.lang.String getInput(java.lang.String msg)
msg
- the message which will be shown in a JOptionPane InputDialog box
public static java.lang.String getInput(java.lang.String msg, java.lang.String defaultValue)
msg
- the message which will be shown in a JOptionPane InputDialog boxdefaultValue
- the default value for the InputDialog box
public static int confirmDialog(java.lang.String title, java.lang.String msg, int type)
title
- the title of the message boxmsg
- the message which will be shown in a JOptionPane MessageDialog boxtype
- what kind of JOptionPane to use
public static void displayMessage(java.lang.String msg)
msg
- the message which will be shown in a JOptionPane MessageDialog boxpublic static void displayMessage(java.lang.String title, java.lang.String msg)
title
- the title of the message boxmsg
- the message which will be shown in a JOptionPane MessageDialog boxpublic static java.util.Vector<BoundComponent> getSubcomponents(BoundComponent c)
public static void addListenersToSubcomponents(FileMenuFrame f, java.util.Vector<BoundComponent> compons)
public static void scrollToTopOnChange(javax.swing.text.JTextComponent txtCompon)
txtCompon
- the JTextComponent to add the listener topublic static void scrollToTopOnChangeExceptIfTyping(javax.swing.text.JTextComponent txtCompon)
txtCompon
- the JTextComponent to add the listener topublic static int getColumnAtCaret(javax.swing.text.JTextComponent component)
public static int getLineAtCaret(javax.swing.text.JTextComponent component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |