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, requestUserAttentiongetInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeComponentpublic ProjectFrameHelper [] getAllProjectFrames()
getAllProjectFrames in class WindowManagerpublic java.util.List<ProjectFrameHelper> getProjectFrameHelpers()
getProjectFrameHelpers in class WindowManagerExpublic javax.swing.JFrame findVisibleFrame()
findVisibleFrame in class WindowManagerpublic IdeFrameEx findFirstVisibleFrameHelper()
WindowManagerExfindFirstVisibleFrameHelper in class WindowManagerExpublic void addListener(WindowManagerListener listener)
addListener in class WindowManagerpublic void removeListener(WindowManagerListener listener)
removeListener in class WindowManagerpublic final java.awt.Rectangle getScreenBounds()
getScreenBounds in class WindowManagerExx 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 WindowManagerExpublic final boolean isInsideScreenBounds(int x,
int y,
int width)
WindowManagerMethod 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 WindowManagerpublic final boolean isAlphaModeSupported()
isAlphaModeSupported in class WindowManagertrue 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)
WindowManagerwindow.
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 WindowManagerwindow - 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 WindowManagerExpublic void setWindowShadow(java.awt.Window window,
WindowManagerEx.WindowShadowMode mode)
setWindowShadow in class WindowManagerExpublic void resetWindow(java.awt.Window window)
resetWindow in class WindowManagerExpublic final boolean isAlphaModeEnabled(java.awt.Window window)
isAlphaModeEnabled in class WindowManagertrue if specified window is currently is alpha mode.public final void setAlphaModeEnabled(java.awt.Window window,
boolean state)
WindowManagerwindow.
If alpha mode isn't supported by the underlying windowing system, then the method does nothing.setAlphaModeEnabled in class WindowManagerwindow - window which mode to be set.state - determines the new alpha mode.public void hideDialog(javax.swing.JDialog dialog,
Project project)
WindowManagerExhideDialog in class WindowManagerExdialog - 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 WindowManagerExpublic final void doNotSuggestAsParent(java.awt.Window window)
doNotSuggestAsParent in class WindowManagerpublic final void dispatchComponentEvent(java.awt.event.ComponentEvent e)
WindowManagerExIdeEventQueue to notify window manager that
some window activity happens. Do not invoke it in other places!!!dispatchComponentEvent in class WindowManagerExpublic final java.awt.Window suggestParentWindow(Project project)
WindowManagerDialog or Frame.suggestParentWindow in class WindowManagernull if there is no currently active window or there is no window that can be the parent.public StatusBar getStatusBar(Project project)
WindowManagergetStatusBar in class WindowManagerpublic StatusBar getStatusBar(java.awt.Component c, Project project)
getStatusBar in class WindowManagerpublic IdeFrame findFrameFor(Project project)
findFrameFor in class WindowManagerExpublic final IdeFrameImpl getFrame(Project project)
getFrame in class WindowManagerExpublic ProjectFrameHelper getFrameHelper(Project project)
getFrameHelper in class WindowManagerExpublic ProjectFrameHelper findFrameHelper(Project project)
WindowManagerExfindFrameHelper in class WindowManagerExpublic IdeRootPane getProjectFrameRootPane(Project project)
public IdeFrame getIdeFrame(Project project)
getIdeFrame in class WindowManagerpublic 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 WindowManagerExpublic final void disposeRootFrame()
public final java.awt.Window getMostRecentFocusedWindow()
getMostRecentFocusedWindow in class WindowManagerExpublic final java.awt.Component getFocusedComponent(java.awt.Window window)
getFocusedComponent in class WindowManagerExpublic final java.awt.Component getFocusedComponent(Project project)
getFocusedComponent in class WindowManagerExproject - may be null when no project is opened.null.public void noStateLoaded()
PersistentStateComponentnoStateLoaded in interface PersistentStateComponent<Element>public void loadState(Element state)
PersistentStateComponentState 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.XmlSerializerpublic final DesktopLayout getLayout()
getLayout in class WindowManagerExpublic final void setLayout(DesktopLayout layout)
WindowManagerExlayout into internal default layout.setLayout in class WindowManagerExpublic WindowWatcher getWindowWatcher()
public boolean isFullScreenSupportedInCurrentOS()
isFullScreenSupportedInCurrentOS in class WindowManagertrue if full screen mode is supported in current OS.