public class LAFUtils extends Object
T-Plan Robot Enterprise, (C) 2009-2025 T-Plan Limited. All rights reserved.
Modifier and Type | Field and Description |
---|---|
static String |
CFG_FONT_SIZE |
static String |
CFG_LAST_LAF |
static String |
CFG_LAST_LAF_LEGACY |
static String |
CFG_RECENT_LAFS |
Constructor and Description |
---|
LAFUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
createFontMenu(JPopupMenu menu,
String actionPrefix)
Create the font size menu.
|
static void |
createLAFMenu(JPopupMenu menu,
String actionPrefix,
MouseListener ml,
ActionListener al,
boolean indicateRestart,
boolean createToolTip)
Create the Look & Feel selection menu.
|
static void |
getAvailableFontOptions(List<String> names,
List<String> vals)
Get the font size options.
|
static void |
getAvailableLAFs(List<String> names,
List<String> classes) |
static Color |
getDefaultBackground(Object o)
Get default background color for a component.
|
static void |
getJTattooDarkLAFs(List<String> names,
List<String> classes) |
static void |
getJTattooLAFs(List<String> names,
List<String> classes) |
static void |
getJTattooStandardLAFs(List<String> names,
List<String> classes) |
static void |
getNativeLAFs(List<String> names,
List<String> classes) |
static boolean |
isDarkMode()
Indicate whether the UI is currently using a dark Look And Feel.
|
static boolean |
isDarkMode(String laf)
Indicate whether argument LAF class is dark one.
|
static boolean |
isJTattoo(String laf)
Test out if a LAF class is a JTattoo one.
|
static boolean |
isRestartNeeded(String currentLaf,
String newLaf) |
public static final String CFG_LAST_LAF
public static final String CFG_LAST_LAF_LEGACY
public static final String CFG_RECENT_LAFS
public static final String CFG_FONT_SIZE
public static boolean isDarkMode()
public static boolean isDarkMode(String laf)
laf
- the fully qualified LAF class name.public static Color getDefaultBackground(Object o)
o
- either a Swing component (JPanel, JButton, ...) or the component
class (JPanel.class, ...).public static boolean isJTattoo(String laf)
laf
- LAF class name.public static void getJTattooStandardLAFs(List<String> names, List<String> classes)
public static void getAvailableFontOptions(List<String> names, List<String> vals)
names
- a list for option names.vals
- a list for the corresponding size values or codes
representing special options such as 'Auto'.public static void createFontMenu(JPopupMenu menu, String actionPrefix)
menu
- a menu to add the font size menu to.actionPrefix
- prefix of the action command.public static void createLAFMenu(JPopupMenu menu, String actionPrefix, MouseListener ml, ActionListener al, boolean indicateRestart, boolean createToolTip)
menu
- a menu to insert the submenu to.actionPrefix
- action prefix, for example "laf_".ml
- a mouse listener to be registered with each item (optional).al
- an action listener to be registered with each item.indicateRestart
- use true to display the "restart" icon by items
that can not be switched to on the fly. This is actually subject to where
the menu is called from. The only component supporting on-the-fly LAF
change is the Login dialog.createToolTip
- use true to create a tool tip for each item showing
an example of a component in the target LAF.