Class GUIFactory
- java.lang.Object
-
- de.desy.mst.libs.framework.mstapp.util.gui.GUIFactory
-
public class GUIFactory extends java.lang.Object
Factory Class zur Erzeugung von (einheitlichen) Gui Widgets
Historie: Rausfaktoriert von Wst Preferences.- Author:
- ws version 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
BASE_FONT_SIZE
static java.lang.String
FONTFAMILY
static java.lang.String
FONTFAMILY_MONOSPACED
-
Constructor Summary
Constructors Constructor Description GUIFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.JDialog
createAndShowLongActionDialog(javax.swing.JFrame owner, java.lang.String title, boolean modal)
Creates a visible alive dialog centered around frame (if non null) with title title
ALWAYS CALL dialog.dispose() AT THE END!!!!static java.awt.Font
createButtonFont()
static javax.swing.JCheckBox
createCheckBoxWithTooltip()
static java.awt.Font
createFixedWidthFont()
static java.awt.Font
createFont(java.awt.Font font, int style)
same Font with a different Font."style" like Bold ....static java.awt.Font
createHeaderFont()
static javax.swing.JButton
createImageButton(java.lang.String fileName, java.lang.String tooltip, java.awt.event.ActionListener listener, java.lang.Class<?> classFromJar)
static javax.swing.ImageIcon
createImageIcon(java.lang.String fileName, java.lang.Class<?> classFromJar)
static javax.swing.ImageIcon
createImageIcon(java.lang.String fileName, java.lang.String toolTip, java.lang.Class<?> classFromJar)
static javax.swing.border.TitledBorder
createTitledBorder(java.lang.String text)
static java.awt.Component
getTopParentCmp(java.awt.Component cmp)
berechnet den obersten GUI Container von cmp (not null)static java.lang.Thread
runInExtraThread_showingBusyDialog(java.lang.Runnable runnable, java.awt.Component refCmp, java.lang.String title, boolean modal)
static java.awt.Cursor
setCursor(java.awt.Cursor newCursor, java.awt.Component cmp)
Setzt den Cursor zum hoechsten erreichbaren Container
-
-
-
Field Detail
-
FONTFAMILY
public static final java.lang.String FONTFAMILY
- See Also:
- Constant Field Values
-
FONTFAMILY_MONOSPACED
public static final java.lang.String FONTFAMILY_MONOSPACED
- See Also:
- Constant Field Values
-
BASE_FONT_SIZE
public static final int BASE_FONT_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
runInExtraThread_showingBusyDialog
public static java.lang.Thread runInExtraThread_showingBusyDialog(java.lang.Runnable runnable, java.awt.Component refCmp, java.lang.String title, boolean modal)
- Parameters:
runnable
- , not null (will be executed in new Thread) runnable should finish only after all other relevant and timeconsuming Threads spawned within are finishedrefCmp
- may be null (for centering the dialog Box)title
- displayed in dialogmodal
- dialog is on Top and other app GUI is disabled for User- Returns:
- the executing thread of runnable (in case you want to do a join)
-
createAndShowLongActionDialog
public static javax.swing.JDialog createAndShowLongActionDialog(javax.swing.JFrame owner, java.lang.String title, boolean modal)
Creates a visible alive dialog centered around frame (if non null) with title title
ALWAYS CALL dialog.dispose() AT THE END!!!!- Parameters:
owner
- may be null (zum Zentrieren des dialogs)title
- wird zur Orientierung des Nutzers angezeigtmodal
- if true then rest of the Application UI is blocked- Returns:
- the busy dialog, YOU MUST call dispose() on it, when your are finisched with it
-
createButtonFont
public static java.awt.Font createButtonFont()
- Returns:
- ButtonFont im wst Design
-
createHeaderFont
public static java.awt.Font createHeaderFont()
-
createFixedWidthFont
public static java.awt.Font createFixedWidthFont()
-
createFont
public static java.awt.Font createFont(java.awt.Font font, int style)
same Font with a different Font."style" like Bold ....
-
createImageButton
public static javax.swing.JButton createImageButton(java.lang.String fileName, java.lang.String tooltip, java.awt.event.ActionListener listener, java.lang.Class<?> classFromJar)
- Parameters:
fileName
- relativ zu src/resources zB "filter/editFilter24.gif"tooltip
- beliebiger Text als Tooltiplistener
- action beim Pressen des buttonsclassFromJar
- damit das image auch geladen werden kann- Returns:
- fertig konfigurierter button
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(java.lang.String fileName, java.lang.String toolTip, java.lang.Class<?> classFromJar)
- Parameters:
fileName
- relativ zu src/resources zB "filter/editFilter24.gif"toolTip
- beliebiger Text als TooltipclassFromJar
- damit das image auch geladen werden kann- Returns:
- Image Icon mit ToolTip
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(java.lang.String fileName, java.lang.Class<?> classFromJar)
- Parameters:
fileName
- relativ zu src/resources zB "filter/editFilter24.gif"classFromJar
- damit das image auch geladen werden kann- Returns:
- Image Icon ohne ToolTip
-
createCheckBoxWithTooltip
public static javax.swing.JCheckBox createCheckBoxWithTooltip()
- Returns:
- CheckBox mit ToolTip im WST Design
-
createTitledBorder
public static javax.swing.border.TitledBorder createTitledBorder(java.lang.String text)
-
setCursor
public static java.awt.Cursor setCursor(java.awt.Cursor newCursor, java.awt.Component cmp)
Setzt den Cursor zum hoechsten erreichbaren Container- Parameters:
newCursor
- new cursor- Returns:
- old Cursor
-
getTopParentCmp
public static java.awt.Component getTopParentCmp(java.awt.Component cmp)
berechnet den obersten GUI Container von cmp (not null)
-
-