com.explodingpixels.widgets
Constructor and Description |
---|
WindowUtils() |
Modifier and Type | Method and Description |
---|---|
static WindowFocusListener |
createAndInstallRepaintWindowFocusListener(Window window)
Deprecated.
use the more targeted
installJComponentRepainterOnWindowFocusChanged(JComponent)
method. |
static void |
installJComponentRepainterOnWindowFocusChanged(JComponent component)
Installs a listener on the given
JComponent 's parent Window that repaints
the given component when the parent window's focused state changes. |
static void |
installWeakWindowFocusListener(JComponent component,
WindowFocusListener focusListener)
|
static boolean |
isParentWindowFocused(Component component)
|
static void |
makeWindowNonOpaque(Window window)
Try's to make the given
Window non-opqaue (transparent) across platforms and JREs. |
public static void makeWindowNonOpaque(Window window)
Window
non-opqaue (transparent) across platforms and JREs.
This method is not guaranteed to succeed, and will fail silently if the given Window
cannot be made non-opaque.
This method is useful, for example, when creating a HUD style window that is
semi-transparent, and thus doesn't want the window background to be drawn.window
- the Window
to make non-opaque.@Deprecated public static WindowFocusListener createAndInstallRepaintWindowFocusListener(Window window)
installJComponentRepainterOnWindowFocusChanged(JComponent)
method.WindowFocusListener
on the given Window
which calls
the Window
's repaint()
method on focus state changes.window
- the Window
to repaint on focus state changes.public static boolean isParentWindowFocused(Component component)
true
if the given Component
's has a parent Window
(i.e. it's not
null) and that Window
is currently active (focused).component
- the Component
to check the parent Window
's focus for.true
if the given Component
's parent Window
is currently
active.public static void installWeakWindowFocusListener(JComponent component, WindowFocusListener focusListener)
WindowFocusListener
on the given JComponent
's parent
Window
. If the JComponent
doesn't yet have a parent, then the listener will
be installed when the component is added to a container.component
- the component who's parent frame to listen to focus changes on.focusListener
- the WindowFocusListener
to notify when focus changes.public static void installJComponentRepainterOnWindowFocusChanged(JComponent component)
JComponent
's parent Window
that repaints
the given component when the parent window's focused state changes. If the given component
does not have a parent at the time this method is called, then an ancestor listener will be
installed that installs a window listener when the components parent changes.component
- the JComponent
to add the repaint focus listener to.