Package com.formdev.flatlaf.extras
Class FlatUIDefaultsInspector
- java.lang.Object
-
- com.formdev.flatlaf.extras.FlatUIDefaultsInspector
-
public class FlatUIDefaultsInspector extends java.lang.ObjectA 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 classFlatUIDefaultsInspector.Itemprivate static classFlatUIDefaultsInspector.ItemsTableModelprivate static classFlatUIDefaultsInspector.KeyRendererprivate static classFlatUIDefaultsInspector.Rendererprivate static classFlatUIDefaultsInspector.SafeIconprivate static classFlatUIDefaultsInspector.ValueRenderer
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JMenuItemcopyKeyAndValueMenuItemprivate javax.swing.JMenuItemcopyKeyMenuItemprivate javax.swing.JMenuItemcopyValueMenuItemprivate java.util.PropertiesderivedColorKeysprivate FlatTextFieldfilterFieldprivate javax.swing.JLabelfilterLabelprivate javax.swing.JPanelfilterPanelprivate static javax.swing.JFrameinspectorFrameprivate static intKEY_MODIFIERS_MASKprivate java.beans.PropertyChangeListenerlafDefaultsListenerprivate java.beans.PropertyChangeListenerlafListenerprivate javax.swing.JPanelpanelprivate booleanrefreshPendingprivate javax.swing.JScrollPanescrollPaneprivate javax.swing.JTabletableprivate javax.swing.JPopupMenutablePopupMenuprivate javax.swing.JComboBox<java.lang.String>valueTypeFieldprivate javax.swing.JLabelvalueTypeLabel
-
Constructor Summary
Constructors Modifier Constructor Description privateFlatUIDefaultsInspector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcopyKey()private voidcopyKeyAndValue()private voidcopyToClipboard(int column)private voidcopyValue()private javax.swing.JFramecreateFrame()static javax.swing.JComponentcreateInspectorPanel()Creates a UI defaults inspector panel that can be embedded into any window.private voiddelegateKey(int keyCode, java.lang.String actionKey)private static voidensureOnScreen(javax.swing.JFrame frame)private voidfilterChanged()private java.util.prefs.PreferencesgetPrefs()private FlatUIDefaultsInspector.Item[]getUIDefaultsItems()static voidhide()private voidinitComponents()static voidinstall(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 voidlafChanged(java.beans.PropertyChangeEvent e)private voidlafDefaultsChanged(java.beans.PropertyChangeEvent e)private java.util.PropertiesloadDerivedColorKeys()private voidrefresh()private java.awt.ColorresolveDerivedColor(javax.swing.UIDefaults defaults, java.lang.String key, java.awt.Color color, java.awt.Color[] pBaseColor)private voidsaveWindowBounds(javax.swing.JFrame frame)static voidshow()private voidtableMousePressed(java.awt.event.MouseEvent e)private java.lang.StringtypeOfValue(java.lang.Object value)private static voidupdateWindowTitle(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"), ornullto use "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()
-
-