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
Esckey to disable UI inspector - press
Ctrlkey to increase inspection level, which shows information about parent of UI component at mouse location - press
Shiftkey to decrease inspection level
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final Integerprivate JComponentprivate intprivate static final intprivate final AWTEventListenerprivate Componentprivate longprivate intprivate intprivate final MouseMotionListenerprivate Objectprivate Popupprivate final PropertyChangeSupportprivate final JRootPaneprivate booleanprivate booleanprivate Windowprivate final WindowListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static voidappendRow(StringBuilder buf, String key, String value) private static StringbuildToolTipText(Component c, int parentLevel, boolean classHierarchy) private JComponentprivate ComponentgetDeepestComponentAt(Component parent, int x, int y) private voidprivate voidprivate intinspect(int x, int y) static voidInstalls a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g.booleanvoidvoidsetEnabled(boolean enabled) private voidshowToolTip(Component c, int x, int y, int parentLevel) private static StringtoDimmedText(String text) private static Stringprivate static Stringprivate static Stringprivate static Stringprivate static Stringvoidupdate()
-
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"), ornullto use "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
-