|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectp3j.misc.gui.GUI
public final class GUI
Class to store static GUI helper functions. Created on 4 February 4, 2007
Field Summary | |
---|---|
static int |
INPUT_COLUMN_INDEX
The index of the column at which the input elements (textfields etc.) are added to the content panel (for stand-alone dialogs). |
static int |
KEYS_COLUMN_INDEX
The index of the column at which the keys are added to the content panel (for stand-alone dialogs). |
static int |
ROW_SKIP_LAYOUT
The number of rows used for a single 'content' row in the layout (for stand-alone dialogs). |
static int |
STD_LAYOUT_GAP
Number of pixels in the gaps of the standard border layout. |
Method Summary | |
---|---|
static int |
addRowToPanel(JPanel panel,
String key,
JComponent input,
int currentRow)
Adds a pair of key and input components to the given panel panel. |
static void |
centerOnScreen(Window window)
Centre a given window on the screen. |
static JFileChooser |
getDirectoryChooser(String dialogTitle)
Gets a file chooser configured to select a directory. |
static JLabel |
getLabelToWait()
Gets the label to wait. |
static BorderLayout |
getStdBorderLayout()
Get standard border layout. |
static boolean |
isHeadless()
Checks the headless mode. |
static void |
printErrorMessage(Component parent,
String title,
Object message)
Prints an error message. |
static void |
printErrorMessage(Component parent,
String title,
Object message,
Throwable throwable)
Prints an error message and the stack trace of the corresponding exception. |
static void |
printErrorMessage(String title,
Throwable throwable)
Prints an error message with the P3J main window as parent instance. |
static void |
printMessage(Component parent,
String title,
Object message)
Prints a message. |
static boolean |
printQuestion(Component parent,
String title,
Object message)
Prints a question message. |
static void |
replaceListContents(DefaultListModel model,
List<?> newContent)
Replaces the contents o a default list model. |
static void |
setHeadless(boolean headless)
Sets the head-less mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STD_LAYOUT_GAP
public static final int ROW_SKIP_LAYOUT
public static final int KEYS_COLUMN_INDEX
public static final int INPUT_COLUMN_INDEX
Method Detail |
---|
public static BorderLayout getStdBorderLayout()
public static void centerOnScreen(Window window)
window
- a Windowpublic static void setHeadless(boolean headless)
headless
- the new head-less modepublic static boolean isHeadless()
public static void printErrorMessage(Component parent, String title, Object message)
parent
- the parent component for the dialogtitle
- the title of the error dialogmessage
- the message to be displayedpublic static void printErrorMessage(Component parent, String title, Object message, Throwable throwable)
parent
- the parent component for the dialogtitle
- the title of the error dialogmessage
- the message to be displayedthrowable
- the throwable (may provide additional info)public static void printErrorMessage(String title, Throwable throwable)
P3J.getInstance()
to retrieve it.
title
- the title of the error dialogthrowable
- the throwable (may provide additional info)public static void printMessage(Component parent, String title, Object message)
parent
- the parent component for the dialogtitle
- the title of the error dialogmessage
- the message to be displayedpublic static boolean printQuestion(Component parent, String title, Object message)
parent
- the parent component for the dialogtitle
- the title of the dialogmessage
- the question
public static void replaceListContents(DefaultListModel model, List<?> newContent)
model
- the list model to be fillednewContent
- the list containing the contentpublic static JFileChooser getDirectoryChooser(String dialogTitle)
dialogTitle
- the dialog title
public static JLabel getLabelToWait()
public static int addRowToPanel(JPanel panel, String key, JComponent input, int currentRow)
panel
- the panelkey
- the name of the label to be usedinput
- the input componentcurrentRow
- the current row in the layout
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |