public final class WindowManagerImpl extends WindowManagerEx implements PersistentStateComponentWithModificationTracker<Element>
WindowManagerEx.WindowShadowMode
Constructor and Description |
---|
WindowManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(WindowManagerListener listener) |
void |
adjustContainerWindow(java.awt.Component c,
java.awt.Dimension oldSize,
java.awt.Dimension newSize) |
ProjectFrameHelper |
allocateFrame(Project project) |
ProjectFrameHelper |
allocateFrame(Project project,
java.util.function.Supplier<? extends ProjectFrameHelper> projectFrameHelperFactory) |
void |
assignFrame(ProjectFrameHelper frameHelper,
Project project) |
void |
dispatchComponentEvent(java.awt.event.ComponentEvent e)
This method is invoked by
IdeEventQueue to notify window manager that
some window activity happens. |
void |
disposeRootFrame() |
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() |
FrameInfo |
getDefaultFrameInfo() |
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() |
IdeRootPane |
getProjectFrameRootPane(Project project) |
java.awt.Rectangle |
getScreenBounds() |
java.awt.Rectangle |
getScreenBounds(Project project) |
Element |
getState() |
long |
getStateModificationCount() |
StatusBar |
getStatusBar(java.awt.Component c,
Project project) |
StatusBar |
getStatusBar(Project project)
Get the status bar for the project's main frame.
|
WindowWatcher |
getWindowWatcher() |
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 |
loadState(Element state)
This method is called when new component state is loaded.
|
void |
noStateLoaded()
This method is called when the component is initialized, but no state is persisted.
|
void |
releaseFrame(ProjectFrameHelper frameHelper) |
ProjectFrameHelper |
removeAndGetRootFrame() |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent
public ProjectFrameHelper [] getAllProjectFrames()
getAllProjectFrames
in class WindowManager
public java.util.List<ProjectFrameHelper> getProjectFrameHelpers()
getProjectFrameHelpers
in class WindowManagerEx
public javax.swing.JFrame findVisibleFrame()
findVisibleFrame
in class WindowManager
public IdeFrameEx findFirstVisibleFrameHelper()
WindowManagerEx
findFirstVisibleFrameHelper
in class WindowManagerEx
public void addListener(WindowManagerListener listener)
addListener
in class WindowManager
public void removeListener(WindowManagerListener listener)
removeListener
in class WindowManager
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 java.awt.Rectangle getScreenBounds(Project project)
getScreenBounds
in class WindowManagerEx
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 void setWindowMask(java.awt.Window window, java.awt.Shape mask)
setWindowMask
in class WindowManagerEx
public void setWindowShadow(java.awt.Window window, WindowManagerEx.WindowShadowMode mode)
setWindowShadow
in class WindowManagerEx
public void resetWindow(java.awt.Window window)
resetWindow
in class WindowManagerEx
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 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 final void doNotSuggestAsParent(java.awt.Window window)
doNotSuggestAsParent
in class WindowManager
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.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 StatusBar getStatusBar(Project project)
WindowManager
getStatusBar
in class WindowManager
public StatusBar getStatusBar(java.awt.Component c, Project project)
getStatusBar
in class WindowManager
public IdeFrame findFrameFor(Project project)
findFrameFor
in class WindowManagerEx
public final IdeFrameImpl getFrame(Project project)
getFrame
in class WindowManagerEx
public ProjectFrameHelper getFrameHelper(Project project)
getFrameHelper
in class WindowManagerEx
public ProjectFrameHelper findFrameHelper(Project project)
WindowManagerEx
findFrameHelper
in class WindowManagerEx
public IdeRootPane getProjectFrameRootPane(Project project)
public IdeFrame getIdeFrame(Project project)
getIdeFrame
in class WindowManager
public ProjectFrameHelper removeAndGetRootFrame()
public void assignFrame(ProjectFrameHelper frameHelper, Project project)
public final ProjectFrameHelper allocateFrame(Project project)
public final ProjectFrameHelper allocateFrame(Project project, java.util.function.Supplier<? extends ProjectFrameHelper> projectFrameHelperFactory)
public final void releaseFrame(ProjectFrameHelper frameHelper)
releaseFrame
in class WindowManagerEx
public final void disposeRootFrame()
public final java.awt.Window getMostRecentFocusedWindow()
getMostRecentFocusedWindow
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 void noStateLoaded()
PersistentStateComponent
noStateLoaded
in interface PersistentStateComponent<Element>
public void loadState(Element state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public long getStateModificationCount()
getStateModificationCount
in interface PersistentStateComponentWithModificationTracker<Element>
public FrameInfo getDefaultFrameInfo()
public Element getState()
getState
in interface PersistentStateComponent<Element>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public final DesktopLayout getLayout()
getLayout
in class WindowManagerEx
public final void setLayout(DesktopLayout layout)
WindowManagerEx
layout
into internal default layout.setLayout
in class WindowManagerEx
public WindowWatcher getWindowWatcher()
public boolean isFullScreenSupportedInCurrentOS()
isFullScreenSupportedInCurrentOS
in class WindowManager
true
if full screen mode is supported in current OS.