public final class TestWindowManager extends WindowManagerEx
WindowManagerEx.WindowShadowMode
Constructor and Description |
---|
TestWindowManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(WindowManagerListener listener) |
void |
adjustContainerWindow(java.awt.Component c,
java.awt.Dimension oldSize,
java.awt.Dimension newSize) |
void |
dispatchComponentEvent(java.awt.event.ComponentEvent e)
This method is invoked by
IdeEventQueue to notify window manager that
some window activity happens. |
void |
doNotSuggestAsParent(java.awt.Window window) |
IdeFrameEx |
findFirstVisibleFrameHelper()
GUI test only.
|
IdeFrame |
findFrameFor(Project project) |
ProjectFrameHelper |
findFrameHelper(Project project)
Find frame for project or if project is null, for a last focused window.
|
javax.swing.JFrame |
findVisibleFrame() |
ProjectFrameHelper [] |
getAllProjectFrames() |
java.awt.Component |
getFocusedComponent(Project project) |
java.awt.Component |
getFocusedComponent(java.awt.Window window) |
IdeFrameImpl |
getFrame(Project project) |
ProjectFrameHelper |
getFrameHelper(Project project) |
IdeFrame |
getIdeFrame(Project project) |
DesktopLayout |
getLayout() |
java.awt.Window |
getMostRecentFocusedWindow() |
java.util.List<ProjectFrameHelper> |
getProjectFrameHelpers() |
java.awt.Rectangle |
getScreenBounds() |
java.awt.Rectangle |
getScreenBounds(Project project) |
StatusBar |
getStatusBar(Project project)
Get the status bar for the project's main frame.
|
void |
hideDialog(javax.swing.JDialog dialog,
Project project)
Either dispose the dialog immediately if project's frame has focus or just hide and dispose when frame gets focus or closes.
|
boolean |
isAlphaModeEnabled(java.awt.Window window) |
boolean |
isAlphaModeSupported() |
boolean |
isFullScreenSupportedInCurrentOS() |
boolean |
isInsideScreenBounds(int x,
int y,
int width)
Tests whether the specified rectangle is inside of screen bounds.
|
void |
releaseFrame(ProjectFrameHelper frameHelper) |
void |
removeListener(WindowManagerListener listener) |
void |
resetWindow(java.awt.Window window) |
void |
setAlphaModeEnabled(java.awt.Window window,
boolean state)
Sets whether the alpha (transparent) mode is enabled for specified
window . |
void |
setAlphaModeRatio(java.awt.Window window,
float ratio)
Sets alpha (transparency) ratio for the specified
window . |
void |
setLayout(DesktopLayout layout)
Copies
layout into internal default layout. |
void |
setWindowMask(java.awt.Window window,
java.awt.Shape mask) |
void |
setWindowShadow(java.awt.Window window,
WindowManagerEx.WindowShadowMode mode) |
java.awt.Window |
suggestParentWindow(Project project)
Gets first window (starting from the active one) that can be the parent for other windows.
|
getInstanceEx, requestUserAttention
getInstance, getStatusBar
public final void doNotSuggestAsParent(java.awt.Window window)
doNotSuggestAsParent
in class WindowManager
public final java.awt.Window suggestParentWindow(Project project)
WindowManager
Dialog
or Frame
.suggestParentWindow
in class WindowManager
null
if there is no currently active window or there is no window that can be the parent.public final StatusBar getStatusBar(Project project)
WindowManager
getStatusBar
in class WindowManager
public IdeFrame getIdeFrame(Project project)
getIdeFrame
in class WindowManager
public ProjectFrameHelper findFrameHelper(Project project)
WindowManagerEx
findFrameHelper
in class WindowManagerEx
public ProjectFrameHelper getFrameHelper(Project project)
getFrameHelper
in class WindowManagerEx
public java.awt.Rectangle getScreenBounds(Project project)
getScreenBounds
in class WindowManagerEx
public void setWindowMask(java.awt.Window window, java.awt.Shape mask)
setWindowMask
in class WindowManagerEx
public void resetWindow(java.awt.Window window)
resetWindow
in class WindowManagerEx
public ProjectFrameHelper [] getAllProjectFrames()
getAllProjectFrames
in class WindowManager
public javax.swing.JFrame findVisibleFrame()
findVisibleFrame
in class WindowManager
public final IdeFrameImpl getFrame(Project project)
getFrame
in class WindowManagerEx
public final java.awt.Component getFocusedComponent(java.awt.Window window)
getFocusedComponent
in class WindowManagerEx
public final java.awt.Component getFocusedComponent(Project project)
getFocusedComponent
in class WindowManagerEx
project
- may be null
when no project is opened.null
.public final java.awt.Window getMostRecentFocusedWindow()
getMostRecentFocusedWindow
in class WindowManagerEx
public IdeFrame findFrameFor(Project project)
findFrameFor
in class WindowManagerEx
public DesktopLayout getLayout()
getLayout
in class WindowManagerEx
public final void setLayout(DesktopLayout layout)
WindowManagerEx
layout
into internal default layout.setLayout
in class WindowManagerEx
public final void dispatchComponentEvent(java.awt.event.ComponentEvent e)
WindowManagerEx
IdeEventQueue
to notify window manager that
some window activity happens. Do not invoke it in other places!!!dispatchComponentEvent
in class WindowManagerEx
public final java.awt.Rectangle getScreenBounds()
getScreenBounds
in class WindowManagerEx
x
and/or y
coordinates can be negative. It depends on physical configuration of graphics devices.
For example, the left monitor has negative coordinates on Win32 platform with dual monitor support
(right monitor is the primer one) .public final boolean isInsideScreenBounds(int x, int y, int width)
WindowManager
Method uses its own heuristic test. Test passes if the intersection of screen bounds and specified rectangle isn't empty and its height and width are not less than some value. Note, that all parameters are in screen coordinate system. The method properly works in a multi-monitor configuration.
isInsideScreenBounds
in class WindowManager
public final boolean isAlphaModeSupported()
isAlphaModeSupported
in class WindowManager
true
if current OS supports alpha mode for windows and all native libraries were successfully loaded.public final void setAlphaModeRatio(java.awt.Window window, float ratio)
WindowManager
window
.
If alpha mode isn't supported by the underlying windowing system, then the method does nothing.
The method also does nothing if alpha mode isn't enabled for the specified window
.
setAlphaModeRatio
in class WindowManager
window
- window
which transparency should be changed.ratio
- ratio of transparency. 0
means absolutely non transparent window.
1
means absolutely transparent window.public final boolean isAlphaModeEnabled(java.awt.Window window)
isAlphaModeEnabled
in class WindowManager
true
if specified window
is currently is alpha mode.public final void setAlphaModeEnabled(java.awt.Window window, boolean state)
WindowManager
window
.
If alpha mode isn't supported by the underlying windowing system, then the method does nothing.setAlphaModeEnabled
in class WindowManager
window
- window which mode to be set.state
- determines the new alpha mode.public void setWindowShadow(java.awt.Window window, WindowManagerEx.WindowShadowMode mode)
setWindowShadow
in class WindowManagerEx
public void hideDialog(javax.swing.JDialog dialog, Project project)
WindowManagerEx
hideDialog
in class WindowManagerEx
dialog
- to hide and dispose laterproject
- the dialog has been shown forpublic void adjustContainerWindow(java.awt.Component c, java.awt.Dimension oldSize, java.awt.Dimension newSize)
adjustContainerWindow
in class WindowManagerEx
public void addListener(WindowManagerListener listener)
addListener
in class WindowManager
public void removeListener(WindowManagerListener listener)
removeListener
in class WindowManager
public boolean isFullScreenSupportedInCurrentOS()
isFullScreenSupportedInCurrentOS
in class WindowManager
true
if full screen mode is supported in current OS.public void releaseFrame(ProjectFrameHelper frameHelper)
releaseFrame
in class WindowManagerEx
public java.util.List<ProjectFrameHelper> getProjectFrameHelpers()
getProjectFrameHelpers
in class WindowManagerEx
public IdeFrameEx findFirstVisibleFrameHelper()
WindowManagerEx
findFirstVisibleFrameHelper
in class WindowManagerEx