Package gr.zeus.ui.mdi
Class WindowManager
- java.lang.Object
-
- gr.zeus.ui.mdi.WindowManager
-
public final class WindowManager extends java.lang.ObjectA JDesktop window manager.Major functions implemented:
- close()
- closeAll()
- minimize()
- minimizeAll()
- maximize()
- maximizeAll()
- restore()
- restoreAll()
- hide()
- hideAll()
- selectNext()
- selectPrevious()
- reset()
- resetAll()
- tileHorizontally()
- tileVertically()
- tile()
- cascade()
- Since:
- 1.04
- Author:
- Gregory Kotsaftis
-
-
Constructor Summary
Constructors Constructor Description WindowManager(javax.swing.JDesktopPane d, javax.swing.JMenu windowsMenu)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcascade()Cascades all frames.voidclose()Closes the selected frame if it is closable.voidcloseAll()Closes all frames that are closable.intcountFrames()Counts all frames, even those that are closed withDefaultCloseOperation = HIDE_ON_CLOSEintcountVisibleFrames()Counts only visible frames.booleangetAutoPositionPolicy()Gets the auto position frames policy.booleangetClosePolicy()Gets the close policy.booleangetDeiconifiablePolicy()Gets the de-iconifiable policy.booleangetOutlineDragMode()Gets frames' drawing strategy.voidhide()Hides a frame.voidhideAll()Hides all frames.voidmaximize()Maximizes the selected frame if it is not already maximized.voidmaximizeAll()Maximizes all frames that are not already maximized.voidminimize()Minimizes the selected frame if it is iconifiable.voidminimizeAll()Minimizes all frames that are iconifiable.voidreset()Resets the frame to it's original preferred size of its components.voidresetAll()Resets all frames to their original preferred size of their components.voidrestore()Restores the selected frame from it's maximized state.voidrestoreAll()Restores all frames from their maximized state.voidselectNext()Selects the next internal frame.voidselectPrevious()Selects the previous internal frame.voidsetAutoPositionPolicy(boolean p)Sets the auto position frames policy.voidsetClosePolicy(boolean p)Sets the close policy.voidsetDeiconifiablePolicy(boolean p)Sets de-iconifiable policy.voidsetOutlineDragMode(boolean outline)Selects frames' drawing strategy.voidtile()Tiles all windows equally.voidtileHorizontally()Tiles all windows horizontally.voidtileVertically()Tiles all windows vertically.
-
-
-
Method Detail
-
setOutlineDragMode
public void setOutlineDragMode(boolean outline)
Selects frames' drawing strategy.- Parameters:
outline-trueto enableJDesktopPane.OUTLINE_DRAG_MODE, orfalseto enableJDesktopPane.LIVE_DRAG_MODE.
-
getOutlineDragMode
public boolean getOutlineDragMode()
Gets frames' drawing strategy.- Returns:
trueif desktop'sDragModeisJDesktopPane.OUTLINE_DRAG_MODEorfalseif desktop'sDragModeisJDesktopPane.LIVE_DRAG_MODE.
-
setDeiconifiablePolicy
public void setDeiconifiablePolicy(boolean p)
Sets de-iconifiable policy. Should we force a frame to de-iconify if it is iconified, during cascade operations?- Parameters:
p-trueif force,falseotherwise.
-
getDeiconifiablePolicy
public boolean getDeiconifiablePolicy()
Gets the de-iconifiable policy.- Returns:
- The de-iconifiable policy.
-
setClosePolicy
public void setClosePolicy(boolean p)
Sets the close policy. Should we do default close operation per frame or force close it?- Parameters:
p-trueto force close,falsedo default close operation.
-
getClosePolicy
public boolean getClosePolicy()
Gets the close policy.- Returns:
truefor force close,falsefor default close operation.
-
setAutoPositionPolicy
public void setAutoPositionPolicy(boolean p)
Sets the auto position frames policy. Should we auto position the new frames in the desktop or not?- Parameters:
p-truefor auto-position,falsefor none.
-
getAutoPositionPolicy
public boolean getAutoPositionPolicy()
Gets the auto position frames policy.- Returns:
- The auto-position policy.
-
countFrames
public int countFrames()
Counts all frames, even those that are closed withDefaultCloseOperation = HIDE_ON_CLOSENOTEUse this method in order to understand how many "ghost" frames remain within the desktop.
- Returns:
- The number of frames.
-
countVisibleFrames
public int countVisibleFrames()
Counts only visible frames.- Returns:
- The number of visible frames.
-
close
public void close()
Closes the selected frame if it is closable.
-
closeAll
public void closeAll()
Closes all frames that are closable.
-
minimize
public void minimize()
Minimizes the selected frame if it is iconifiable.
-
minimizeAll
public void minimizeAll()
Minimizes all frames that are iconifiable.
-
restore
public void restore()
Restores the selected frame from it's maximized state.
-
restoreAll
public void restoreAll()
Restores all frames from their maximized state.
-
maximize
public void maximize()
Maximizes the selected frame if it is not already maximized.
-
maximizeAll
public void maximizeAll()
Maximizes all frames that are not already maximized.
-
reset
public void reset()
Resets the frame to it's original preferred size of its components.
-
resetAll
public void resetAll()
Resets all frames to their original preferred size of their components.
-
hide
public void hide()
Hides a frame. The hidden frame is added to the menu with disabled-like color.
-
hideAll
public void hideAll()
Hides all frames. The hidden frames are added to the menu with disabled-like color.
-
selectNext
public void selectNext()
Selects the next internal frame.
-
selectPrevious
public void selectPrevious()
Selects the previous internal frame.
-
cascade
public void cascade()
Cascades all frames. If De-iconifiablePolicy is false, minimized frames stay minimized.During cascade, it also sorts frames based on their title.
-
tileVertically
public void tileVertically()
Tiles all windows vertically.
-
tileHorizontally
public void tileHorizontally()
Tiles all windows horizontally.
-
tile
public void tile()
Tiles all windows equally.
-
-