Package com.formdev.flatlaf.extras
Class FlatInspector
java.lang.Object
com.formdev.flatlaf.extras.FlatInspector
A simple UI inspector that shows information about UI component at mouse location
in a tooltip.
To use it in an application install it with:
FlatInspector.install( "ctrl shift alt X" );This can be done e.g. in the main() method and allows enabling (and disabling) the UI inspector for the active window with the given keystroke.
When the UI inspector is active some additional keys are available:
- press
Esc
key to disable UI inspector - press
Ctrl
key to increase inspection level, which shows information about parent of UI component at mouse location - press
Shift
key to decrease inspection level
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final Integer
private JComponent
private int
private static final int
private final AWTEventListener
private Component
private long
private int
private int
private final MouseMotionListener
private Object
private Popup
private final PropertyChangeSupport
private final JRootPane
private boolean
private boolean
private Window
private final WindowListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
private static void
appendRow
(StringBuilder buf, String key, String value) private static String
buildToolTipText
(Component c, int parentLevel, boolean classHierarchy) private JComponent
private Component
getDeepestComponentAt
(Component parent, int x, int y) private void
private void
private int
inspect
(int x, int y) static void
Installs a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g.boolean
void
void
setEnabled
(boolean enabled) private void
showToolTip
(Component c, int x, int y, int parentLevel) private static String
toDimmedText
(String text) private static String
private static String
private static String
private static String
private static String
void
update()
-
Field Details
-
HIGHLIGHT_LAYER
-
KEY_MODIFIERS_MASK
private static final int KEY_MODIFIERS_MASK- See Also:
-
rootPane
-
mouseMotionListener
-
keyListener
-
propertyChangeSupport
-
windowListener
-
window
-
enabled
private boolean enabled -
oldGlassPaneFullHeight
-
lastComponent
-
lastX
private int lastX -
lastY
private int lastY -
inspectParentLevel
private int inspectParentLevel -
wasModifierKeyPressed
private boolean wasModifierKeyPressed -
showClassHierarchy
private boolean showClassHierarchy -
lastWhen
private long lastWhen -
highlightFigure
-
popup
-
-
Constructor Details
-
FlatInspector
-
-
Method Details
-
install
Installs a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g. "ctrl shift alt X").- Parameters:
activationKeys
- a keystroke (e.g. "ctrl shift alt X")
-
addPropertyChangeListener
-
removePropertyChangeListener
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
hidePopup
private void hidePopup() -
update
public void update() -
inspect
private int inspect(int x, int y) -
getDeepestComponentAt
-
highlight
-
createHighlightFigure
-
showToolTip
-
buildToolTipText
-
appendRow
-
toString
-
toString
-
toString
-
toString
-
toString
-
toDimmedText
-