com.alee.laf.rootpane
Class WebFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by com.alee.laf.rootpane.WebFrame
All Implemented Interfaces:
LanguageContainerMethods, LanguageMethods, SettingsMethods, SwingMethods, WindowMethods<WebFrame>, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
Direct Known Subclasses:
ImagePreviewFrame, LibraryInfoDialog, NinePatchEditorDialog, StyleEditor, TestFrame, WebLookAndFeelDemo

public class WebFrame
extends javax.swing.JFrame
implements LanguageMethods, LanguageContainerMethods, SettingsMethods, WindowMethods<WebFrame>

This JFrame extenstion class provides some additional methods and options to manipulate frame behavior.

Author:
Mikle Garin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean closeOnFocusLoss
          Whether should close frame on focus loss or not.
protected  DefaultFocusTracker focusTracker
          Window focus tracker.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebFrame()
           
WebFrame(java.awt.GraphicsConfiguration gc)
           
WebFrame(java.lang.String title)
           
WebFrame(java.lang.String title, java.awt.GraphicsConfiguration gc)
           
 
Method Summary
 WebFrame center()
          Centers window relative to screen center.
 WebFrame center(java.awt.Component relativeTo)
          Centers window relative to the specified component center.
 WebFrame center(java.awt.Component relativeTo, int width, int height)
          Changes window size and centers it relative to the specified component center.
 WebFrame center(int width, int height)
          Changes window size and centers it relative to screen center.
 java.lang.String getEmptyTitleText()
           
 int getInactiveShadeWidth()
           
 java.lang.String getLanguageContainerKey()
          Returns language container key for container which implements this interface.
 int getMaxTitleWidth()
           
 java.awt.Color getMiddleBg()
           
 WebResizeCorner getResizeCorner()
           
 int getRound()
           
 int getShadeWidth()
           
 javax.swing.JComponent getTitleComponent()
           
 java.awt.Color getTopBg()
           
 javax.swing.ImageIcon getWatermark()
           
 WebRootPaneUI getWebRootPaneUI()
           
 WebButtonGroup getWindowButtons()
           
 float getWindowOpacity()
          Returns window opacity.
protected  void initialize()
          Additional initializtion of WebFrame settings.
 boolean isAttachButtons()
           
 boolean isCloseOnFocusLoss()
          Returns whether should close frame on focus loss or not.
 boolean isDrawWatermark()
           
 boolean isGroupButtons()
           
 boolean isLanguageSet()
          Returns whether this component registered in LanguageManager or not.
 boolean isShowCloseButton()
           
 boolean isShowMaximizeButton()
           
 boolean isShowMenuBar()
           
 boolean isShowMinimizeButton()
           
 boolean isShowResizeCorner()
           
 boolean isShowTitleComponent()
           
 boolean isShowWindowButtons()
           
 boolean isWindowOpaque()
          Returns whether window is opaque or not.
 void loadSettings()
          Loads saved settings into the component if it is registered.
 WebFrame packAndCenter()
          Packs and centers window relative to old position.
 WebFrame packAndCenter(boolean animate)
          Packs and centers window relative to old position.
 WebFrame packToHeight(int height)
          Packs window to its preffered width and specified height.
 WebFrame packToWidth(int width)
          Packs window to its preffered height and specified width.
 void registerSettings(SettingsProcessor settingsProcessor)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, java.lang.Object defaultValue)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass)
          Registers component for settings auto-save.
<T extends DefaultValue>
void
registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue)
          Registers component for settings auto-save.
 void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
          Registers component for settings auto-save.
 void removeLanguage()
          Unregisters component from LanguageManager.
 void removeLanguageContainerKey()
          Removes language container key for container which implements this interface.
 void removeLanguageUpdater()
          Unregisters any custom language updater set for this component.
 void saveSettings()
          Saves component settings.
 void setAttachButtons(boolean attachButtons)
           
 void setCloseOnFocusLoss(boolean closeOnFocusLoss)
          Sets whether should close frame on focus loss or not.
 void setDrawWatermark(boolean drawWatermark)
           
 void setEmptyTitleText(java.lang.String text)
           
 void setGroupButtons(boolean groupButtons)
           
 void setInactiveShadeWidth(int inactiveShadeWidth)
           
 void setLanguage(java.lang.String key, java.lang.Object... data)
          Registers component in LanguageManager under specified key and with specified formatting data.
 void setLanguageContainerKey(java.lang.String key)
          Sets language container key for container which implements this interface.
 void setLanguageUpdater(LanguageUpdater updater)
          Registers custom language updater for this component.
 void setMaxTitleWidth(int width)
           
 void setMiddleBg(java.awt.Color middleBg)
           
 void setRound(int round)
           
 void setShadeWidth(int shadeWidth)
           
 void setShowCloseButton(boolean showCloseButton)
           
 void setShowMaximizeButton(boolean showMaximizeButton)
           
 void setShowMenuBar(boolean showMenuBar)
           
 void setShowMinimizeButton(boolean showMinimizeButton)
           
 void setShowResizeCorner(boolean showResizeCorner)
           
 void setShowTitleComponent(boolean showTitleComponent)
           
 void setShowWindowButtons(boolean showWindowButtons)
           
 void setTitleComponent(javax.swing.JComponent titleComponent)
           
 void setTopBg(java.awt.Color topBg)
           
 void setWatermark(javax.swing.ImageIcon watermark)
           
 WebFrame setWindowOpacity(float opacity)
          Sets window opacity if that option is supported by the underlying system.
 WebFrame setWindowOpaque(boolean opaque)
          Sets window opaque if that option is supported by the underlying system.
 void unregisterSettings()
          Unregisters component from settings auto-save.
 void updateLanguage(java.lang.Object... data)
          Updates component language and formatting data.
 void updateLanguage(java.lang.String key, java.lang.Object... data)
          Changes component language key and updates its language and formatting data.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

closeOnFocusLoss

protected boolean closeOnFocusLoss
Whether should close frame on focus loss or not.


focusTracker

protected DefaultFocusTracker focusTracker
Window focus tracker.

Constructor Detail

WebFrame

public WebFrame()

WebFrame

public WebFrame(java.awt.GraphicsConfiguration gc)

WebFrame

public WebFrame(java.lang.String title)

WebFrame

public WebFrame(java.lang.String title,
                java.awt.GraphicsConfiguration gc)
Method Detail

initialize

protected void initialize()
Additional initializtion of WebFrame settings.


isCloseOnFocusLoss

public boolean isCloseOnFocusLoss()
Returns whether should close frame on focus loss or not.

Returns:
true if should close frame on focus loss, false otherwise

setCloseOnFocusLoss

public void setCloseOnFocusLoss(boolean closeOnFocusLoss)
Sets whether should close frame on focus loss or not.

Parameters:
closeOnFocusLoss - whether should close frame on focus loss or not

getTopBg

public java.awt.Color getTopBg()

setTopBg

public void setTopBg(java.awt.Color topBg)

getMiddleBg

public java.awt.Color getMiddleBg()

setMiddleBg

public void setMiddleBg(java.awt.Color middleBg)

getShadeWidth

public int getShadeWidth()

setShadeWidth

public void setShadeWidth(int shadeWidth)

getInactiveShadeWidth

public int getInactiveShadeWidth()

setInactiveShadeWidth

public void setInactiveShadeWidth(int inactiveShadeWidth)

getRound

public int getRound()

setRound

public void setRound(int round)

isDrawWatermark

public boolean isDrawWatermark()

setDrawWatermark

public void setDrawWatermark(boolean drawWatermark)

getWatermark

public javax.swing.ImageIcon getWatermark()

setWatermark

public void setWatermark(javax.swing.ImageIcon watermark)

getMaxTitleWidth

public int getMaxTitleWidth()

setMaxTitleWidth

public void setMaxTitleWidth(int width)

getEmptyTitleText

public java.lang.String getEmptyTitleText()

setEmptyTitleText

public void setEmptyTitleText(java.lang.String text)

getTitleComponent

public javax.swing.JComponent getTitleComponent()

setTitleComponent

public void setTitleComponent(javax.swing.JComponent titleComponent)

getWindowButtons

public WebButtonGroup getWindowButtons()

getResizeCorner

public WebResizeCorner getResizeCorner()

isShowResizeCorner

public boolean isShowResizeCorner()

setShowResizeCorner

public void setShowResizeCorner(boolean showResizeCorner)

isShowTitleComponent

public boolean isShowTitleComponent()

setShowTitleComponent

public void setShowTitleComponent(boolean showTitleComponent)

isShowWindowButtons

public boolean isShowWindowButtons()

setShowWindowButtons

public void setShowWindowButtons(boolean showWindowButtons)

isShowMinimizeButton

public boolean isShowMinimizeButton()

setShowMinimizeButton

public void setShowMinimizeButton(boolean showMinimizeButton)

isShowMaximizeButton

public boolean isShowMaximizeButton()

setShowMaximizeButton

public void setShowMaximizeButton(boolean showMaximizeButton)

isShowCloseButton

public boolean isShowCloseButton()

setShowCloseButton

public void setShowCloseButton(boolean showCloseButton)

isGroupButtons

public boolean isGroupButtons()

setGroupButtons

public void setGroupButtons(boolean groupButtons)

isAttachButtons

public boolean isAttachButtons()

setAttachButtons

public void setAttachButtons(boolean attachButtons)

isShowMenuBar

public boolean isShowMenuBar()

setShowMenuBar

public void setShowMenuBar(boolean showMenuBar)

getWebRootPaneUI

public WebRootPaneUI getWebRootPaneUI()

setLanguage

public void setLanguage(java.lang.String key,
                        java.lang.Object... data)
Registers component in LanguageManager under specified key and with specified formatting data.

Specified by:
setLanguage in interface LanguageMethods
Parameters:
key - language record key
data - formatting data

updateLanguage

public void updateLanguage(java.lang.Object... data)
Updates component language and formatting data.

Specified by:
updateLanguage in interface LanguageMethods
Parameters:
data - new formatting data

updateLanguage

public void updateLanguage(java.lang.String key,
                           java.lang.Object... data)
Changes component language key and updates its language and formatting data.

Specified by:
updateLanguage in interface LanguageMethods
Parameters:
key - new language key
data - new formatting data

removeLanguage

public void removeLanguage()
Unregisters component from LanguageManager.

Specified by:
removeLanguage in interface LanguageMethods

isLanguageSet

public boolean isLanguageSet()
Returns whether this component registered in LanguageManager or not.

Specified by:
isLanguageSet in interface LanguageMethods
Returns:
true if component is registered in LanguageManager, false otherwise

setLanguageUpdater

public void setLanguageUpdater(LanguageUpdater updater)
Registers custom language updater for this component.

Specified by:
setLanguageUpdater in interface LanguageMethods
Parameters:
updater - component language updater

removeLanguageUpdater

public void removeLanguageUpdater()
Unregisters any custom language updater set for this component.

Specified by:
removeLanguageUpdater in interface LanguageMethods

setLanguageContainerKey

public void setLanguageContainerKey(java.lang.String key)
Sets language container key for container which implements this interface.

Specified by:
setLanguageContainerKey in interface LanguageContainerMethods
Parameters:
key - language container key

removeLanguageContainerKey

public void removeLanguageContainerKey()
Removes language container key for container which implements this interface.

Specified by:
removeLanguageContainerKey in interface LanguageContainerMethods

getLanguageContainerKey

public java.lang.String getLanguageContainerKey()
Returns language container key for container which implements this interface.

Specified by:
getLanguageContainerKey in interface LanguageContainerMethods
Returns:
language container key for container which implements this interface

registerSettings

public void registerSettings(java.lang.String key)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
key - component settings key
defaultValueClass - component default value class
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String key,
                             java.lang.Object defaultValue)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
defaultValue - component default value

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String group,
                                                      java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
group - component settings group
key - component settings key
defaultValueClass - component default value class
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key,
                             java.lang.Object defaultValue)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key
defaultValue - component default value

registerSettings

public void registerSettings(java.lang.String key,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass,
                                                      boolean loadInitialSettings,
                                                      boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
key - component settings key
defaultValueClass - component default value class
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String key,
                             java.lang.Object defaultValue,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
key - component settings key
defaultValue - component default value
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public <T extends DefaultValue> void registerSettings(java.lang.String group,
                                                      java.lang.String key,
                                                      java.lang.Class<T> defaultValueClass,
                                                      boolean loadInitialSettings,
                                                      boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Type Parameters:
T - default value type
Parameters:
group - component settings group
key - component settings key
defaultValueClass - component default value class
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not
See Also:
DefaultValue

registerSettings

public void registerSettings(java.lang.String group,
                             java.lang.String key,
                             java.lang.Object defaultValue,
                             boolean loadInitialSettings,
                             boolean applySettingsChanges)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
group - component settings group
key - component settings key
defaultValue - component default value
loadInitialSettings - whether to load initial available settings into the component or not
applySettingsChanges - whether to apply settings changes to the component or not

registerSettings

public void registerSettings(SettingsProcessor settingsProcessor)
Registers component for settings auto-save.

Also registered component will be: - listened for settings changes to save them when requested - automatically updated with any loaded settings for that key if requested - automatically updated with any changes made in its settings if requested

Specified by:
registerSettings in interface SettingsMethods
Parameters:
settingsProcessor - component settings processor

unregisterSettings

public void unregisterSettings()
Unregisters component from settings auto-save.

Specified by:
unregisterSettings in interface SettingsMethods

loadSettings

public void loadSettings()
Loads saved settings into the component if it is registered.

Specified by:
loadSettings in interface SettingsMethods

saveSettings

public void saveSettings()
Saves component settings.

Specified by:
saveSettings in interface SettingsMethods

setWindowOpaque

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

Specified by:
setWindowOpaque in interface WindowMethods<WebFrame>
Parameters:
opaque - whether should make window opaque or not

isWindowOpaque

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

Specified by:
isWindowOpaque in interface WindowMethods<WebFrame>
Returns:
true if window is opaque, false otherwise

setWindowOpacity

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

Specified by:
setWindowOpacity in interface WindowMethods<WebFrame>
Parameters:
opacity - new window opacity

getWindowOpacity

public float getWindowOpacity()
Returns window opacity.

Specified by:
getWindowOpacity in interface WindowMethods<WebFrame>
Returns:
window opacity

center

public WebFrame center()
Centers window relative to screen center.

Specified by:
center in interface WindowMethods<WebFrame>
Returns:
processed window

center

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

Specified by:
center in interface WindowMethods<WebFrame>
Parameters:
relativeTo - component used to center window
Returns:
processed window

center

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

Specified by:
center in interface WindowMethods<WebFrame>
Parameters:
width - new window width
height - new window height
Returns:
processed window

center

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

Specified by:
center in interface WindowMethods<WebFrame>
Parameters:
relativeTo - component used to center window
width - new window width
height - new window height
Returns:
processed window

packToWidth

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

Specified by:
packToWidth in interface WindowMethods<WebFrame>
Parameters:
width - new window width
Returns:
processed window

packToHeight

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

Specified by:
packToHeight in interface WindowMethods<WebFrame>
Parameters:
height - new window height
Returns:
processed window

packAndCenter

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

Specified by:
packAndCenter in interface WindowMethods<WebFrame>
Returns:
processed window

packAndCenter

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

Specified by:
packAndCenter in interface WindowMethods<WebFrame>
Parameters:
animate - whether should animate window size changes or not
Returns:
processed window