Package com.formdev.flatlaf.extras
Class FlatUIDefaultsInspector
- java.lang.Object
-
- com.formdev.flatlaf.extras.FlatUIDefaultsInspector
-
public class FlatUIDefaultsInspector extends java.lang.Object
A simple UI defaults inspector that shows a window with all UI defaults used in current look and feel.To use it in an application install it with:
FlatUIDefaultsInspector.install( "ctrl shift alt Y" );
This can be done e.g. in the main() method and allows enabling (and disabling) the UI defaults inspector with the given keystroke.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
FlatUIDefaultsInspector.Item
private static class
FlatUIDefaultsInspector.ItemsTableModel
private static class
FlatUIDefaultsInspector.KeyRenderer
private static class
FlatUIDefaultsInspector.Renderer
private static class
FlatUIDefaultsInspector.SafeIcon
private static class
FlatUIDefaultsInspector.ValueRenderer
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JMenuItem
copyKeyAndValueMenuItem
private javax.swing.JMenuItem
copyKeyMenuItem
private javax.swing.JMenuItem
copyValueMenuItem
private java.util.Properties
derivedColorKeys
private FlatTextField
filterField
private javax.swing.JLabel
filterLabel
private javax.swing.JPanel
filterPanel
private static javax.swing.JFrame
inspectorFrame
private static int
KEY_MODIFIERS_MASK
private java.beans.PropertyChangeListener
lafDefaultsListener
private java.beans.PropertyChangeListener
lafListener
private javax.swing.JPanel
panel
private boolean
refreshPending
private javax.swing.JScrollPane
scrollPane
private javax.swing.JTable
table
private javax.swing.JPopupMenu
tablePopupMenu
private javax.swing.JComboBox<java.lang.String>
valueTypeField
private javax.swing.JLabel
valueTypeLabel
-
Constructor Summary
Constructors Modifier Constructor Description private
FlatUIDefaultsInspector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
copyKey()
private void
copyKeyAndValue()
private void
copyToClipboard(int column)
private void
copyValue()
private javax.swing.JFrame
createFrame()
static javax.swing.JComponent
createInspectorPanel()
Creates a UI defaults inspector panel that can be embedded into any window.private void
delegateKey(int keyCode, java.lang.String actionKey)
private static void
ensureOnScreen(javax.swing.JFrame frame)
private void
filterChanged()
private java.util.prefs.Preferences
getPrefs()
private FlatUIDefaultsInspector.Item[]
getUIDefaultsItems()
static void
hide()
private void
initComponents()
static void
install(java.lang.String activationKeys)
Installs a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g.private void
lafChanged(java.beans.PropertyChangeEvent e)
private void
lafDefaultsChanged(java.beans.PropertyChangeEvent e)
private java.util.Properties
loadDerivedColorKeys()
private void
refresh()
private java.awt.Color
resolveDerivedColor(javax.swing.UIDefaults defaults, java.lang.String key, java.awt.Color color, java.awt.Color[] pBaseColor)
private void
saveWindowBounds(javax.swing.JFrame frame)
static void
show()
private void
tableMousePressed(java.awt.event.MouseEvent e)
private java.lang.String
typeOfValue(java.lang.Object value)
private static void
updateWindowTitle(javax.swing.JFrame frame)
-
-
-
Field Detail
-
KEY_MODIFIERS_MASK
private static final int KEY_MODIFIERS_MASK
- See Also:
- Constant Field Values
-
inspectorFrame
private static javax.swing.JFrame inspectorFrame
-
lafListener
private final java.beans.PropertyChangeListener lafListener
-
lafDefaultsListener
private final java.beans.PropertyChangeListener lafDefaultsListener
-
refreshPending
private boolean refreshPending
-
derivedColorKeys
private java.util.Properties derivedColorKeys
-
panel
private javax.swing.JPanel panel
-
filterPanel
private javax.swing.JPanel filterPanel
-
filterLabel
private javax.swing.JLabel filterLabel
-
filterField
private FlatTextField filterField
-
valueTypeLabel
private javax.swing.JLabel valueTypeLabel
-
valueTypeField
private javax.swing.JComboBox<java.lang.String> valueTypeField
-
scrollPane
private javax.swing.JScrollPane scrollPane
-
table
private javax.swing.JTable table
-
tablePopupMenu
private javax.swing.JPopupMenu tablePopupMenu
-
copyKeyMenuItem
private javax.swing.JMenuItem copyKeyMenuItem
-
copyValueMenuItem
private javax.swing.JMenuItem copyValueMenuItem
-
copyKeyAndValueMenuItem
private javax.swing.JMenuItem copyKeyAndValueMenuItem
-
-
Method Detail
-
install
public static void install(java.lang.String activationKeys)
Installs a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g. "ctrl shift alt Y").- Parameters:
activationKeys
- a keystroke (e.g. "ctrl shift alt Y")
-
show
public static void show()
-
hide
public static void hide()
-
createInspectorPanel
public static javax.swing.JComponent createInspectorPanel()
Creates a UI defaults inspector panel that can be embedded into any window.
-
createFrame
private javax.swing.JFrame createFrame()
-
delegateKey
private void delegateKey(int keyCode, java.lang.String actionKey)
-
ensureOnScreen
private static void ensureOnScreen(javax.swing.JFrame frame)
-
lafChanged
private void lafChanged(java.beans.PropertyChangeEvent e)
-
lafDefaultsChanged
private void lafDefaultsChanged(java.beans.PropertyChangeEvent e)
-
refresh
private void refresh()
-
getUIDefaultsItems
private FlatUIDefaultsInspector.Item[] getUIDefaultsItems()
-
resolveDerivedColor
private java.awt.Color resolveDerivedColor(javax.swing.UIDefaults defaults, java.lang.String key, java.awt.Color color, java.awt.Color[] pBaseColor)
-
loadDerivedColorKeys
private java.util.Properties loadDerivedColorKeys()
-
updateWindowTitle
private static void updateWindowTitle(javax.swing.JFrame frame)
-
saveWindowBounds
private void saveWindowBounds(javax.swing.JFrame frame)
-
getPrefs
private java.util.prefs.Preferences getPrefs()
-
filterChanged
private void filterChanged()
-
typeOfValue
private java.lang.String typeOfValue(java.lang.Object value)
-
tableMousePressed
private void tableMousePressed(java.awt.event.MouseEvent e)
-
copyKey
private void copyKey()
-
copyValue
private void copyValue()
-
copyKeyAndValue
private void copyKeyAndValue()
-
copyToClipboard
private void copyToClipboard(int column)
-
initComponents
private void initComponents()
-
-