com.alee.utils.swing
Interface WindowMethods<W extends java.awt.Window>

Type Parameters:
W - window type
All Superinterfaces:
SwingMethods
All Known Implementing Classes:
ImagePreviewFrame, LibraryInfoDialog, NinePatchEditorDialog, StyleEditor, TestFrame, WebColorChooserDialog, WebDialog, WebDirectoryChooser, WebDynamicMenu, WebExtendedOptionPane, WebFadeDialog, WebFrame, WebHeavyWeightPopup, WebLookAndFeelDemo, WebPopOver, WebProgressDialog, WebWindow

public interface WindowMethods<W extends java.awt.Window>
extends SwingMethods

This interface provides a set of methods that should be added into components that support custom window methods.

Author:
Mikle Garin
See Also:
SwingMethods, WindowUtils

Method Summary
 W center()
          Centers window relative to screen center.
 W center(java.awt.Component relativeTo)
          Centers window relative to the specified component center.
 W center(java.awt.Component relativeTo, int width, int height)
          Changes window size and centers it relative to the specified component center.
 W center(int width, int height)
          Changes window size and centers it relative to screen center.
 float getWindowOpacity()
          Returns window opacity.
 boolean isWindowOpaque()
          Returns whether window is opaque or not.
 W packAndCenter()
          Packs and centers window relative to old position.
 W packAndCenter(boolean animate)
          Packs and centers window relative to old position.
 W packToHeight(int height)
          Packs window to its preffered width and specified height.
 W packToWidth(int width)
          Packs window to its preffered height and specified width.
 W setWindowOpacity(float opacity)
          Sets window opacity if that option is supported by the underlying system.
 W setWindowOpaque(boolean opaque)
          Sets window opaque if that option is supported by the underlying system.
 

Method Detail

setWindowOpaque

W setWindowOpaque(boolean opaque)
Sets window opaque if that option is supported by the underlying system.

Parameters:
opaque - whether should make window opaque or not

isWindowOpaque

boolean isWindowOpaque()
Returns whether window is opaque or not.

Returns:
true if window is opaque, false otherwise

setWindowOpacity

W setWindowOpacity(float opacity)
Sets window opacity if that option is supported by the underlying system.

Parameters:
opacity - new window opacity

getWindowOpacity

float getWindowOpacity()
Returns window opacity.

Returns:
window opacity

center

W center()
Centers window relative to screen center.

Returns:
processed window

center

W center(java.awt.Component relativeTo)
Centers window relative to the specified component center.

Parameters:
relativeTo - component used to center window
Returns:
processed window

center

W center(int width,
         int height)
Changes window size and centers it relative to screen center.

Parameters:
width - new window width
height - new window height
Returns:
processed window

center

W center(java.awt.Component relativeTo,
         int width,
         int height)
Changes window size and centers it relative to the specified component center.

Parameters:
relativeTo - component used to center window
width - new window width
height - new window height
Returns:
processed window

packToWidth

W packToWidth(int width)
Packs window to its preffered height and specified width.

Parameters:
width - new window width
Returns:
processed window

packToHeight

W packToHeight(int height)
Packs window to its preffered width and specified height.

Parameters:
height - new window height
Returns:
processed window

packAndCenter

W packAndCenter()
Packs and centers window relative to old position.

Returns:
processed window

packAndCenter

W packAndCenter(boolean animate)
Packs and centers window relative to old position.

Parameters:
animate - whether should animate window size changes or not
Returns:
processed window