|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window javax.swing.JWindow com.alee.laf.rootpane.WebWindow
public class WebWindow
This JWindow extenstion class provides some additional methods and options to manipulate window behavior.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JWindow |
---|
javax.swing.JWindow.AccessibleJWindow |
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 window on focus loss or not. |
protected DefaultFocusTracker |
focusTracker
Window focus tracker. |
Fields inherited from class javax.swing.JWindow |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WebWindow()
Creates a window with no specified owner. |
|
WebWindow(java.awt.Component owner)
Creates a window with the owner window from the specified component. |
|
WebWindow(java.awt.Frame owner)
Creates a window with the specified owner frame. |
|
WebWindow(java.awt.GraphicsConfiguration gc)
Creates a window with the specified GraphicsConfiguration of a screen device. |
|
WebWindow(java.awt.Window owner)
Creates a window with the specified owner window. |
|
WebWindow(java.awt.Window owner,
java.awt.GraphicsConfiguration gc)
Creates a window with the specified owner window and GraphicsConfiguration of a screen device. |
Method Summary | ||
---|---|---|
WebWindow |
center()
Centers window relative to screen center. |
|
WebWindow |
center(java.awt.Component relativeTo)
Centers window relative to the specified component center. |
|
WebWindow |
center(java.awt.Component relativeTo,
int width,
int height)
Changes window size and centers it relative to the specified component center. |
|
WebWindow |
center(int width,
int height)
Changes window size and centers it relative to screen center. |
|
java.lang.String |
getLanguageContainerKey()
Returns language container key for container which implements this interface. |
|
float |
getWindowOpacity()
Returns window opacity. |
|
protected void |
initialize()
Additional initializtion of WebWindow settings. |
|
boolean |
isCloseOnFocusLoss()
Returns whether should close window on focus loss or not. |
|
boolean |
isWindowOpaque()
Returns whether window is opaque or not. |
|
void |
loadSettings()
Loads saved settings into the component if it is registered. |
|
WebWindow |
packAndCenter()
Packs and centers window relative to old position. |
|
WebWindow |
packAndCenter(boolean animate)
Packs and centers window relative to old position. |
|
WebWindow |
packToHeight(int height)
Packs window to its preffered width and specified height. |
|
WebWindow |
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. |
|
|
registerSettings(java.lang.String key,
java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save. |
|
|
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. |
|
|
registerSettings(java.lang.String group,
java.lang.String key,
java.lang.Class<T> defaultValueClass)
Registers component for settings auto-save. |
|
|
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 |
removeLanguageContainerKey()
Removes language container key for container which implements this interface. |
|
void |
saveSettings()
Saves component settings. |
|
void |
setCloseOnFocusLoss(boolean closeOnFocusLoss)
Sets whether should close window on focus loss or not. |
|
void |
setLanguageContainerKey(java.lang.String key)
Sets language container key for container which implements this interface. |
|
WebWindow |
setWindowOpacity(float opacity)
Sets window opacity if that option is supported by the underlying system. |
|
WebWindow |
setWindowOpaque(boolean opaque)
Sets window opaque if that option is supported by the underlying system. |
|
void |
unregisterSettings()
Unregisters component from settings auto-save. |
Methods inherited from class javax.swing.JWindow |
---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit |
Methods inherited from class java.awt.Window |
---|
addNotify, 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, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, 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, remove, 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 |
Field Detail |
---|
protected boolean closeOnFocusLoss
protected DefaultFocusTracker focusTracker
Constructor Detail |
---|
public WebWindow()
JComponent.getDefaultLocale
.
public WebWindow(java.awt.GraphicsConfiguration gc)
GraphicsConfiguration
of a screen device. This window will not be focusable.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
gc
- the GraphicsConfiguration
that is used to construct the new window with; if gc is null
,
the system default GraphicsConfiguration
is assumedpublic WebWindow(java.awt.Frame owner)
owner
is null
, the shared owner will be used and this window will not be focusable.
Also, this window will not be focusable unless its owner is showing on the screen.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- the frame from which the window is displayedpublic WebWindow(java.awt.Component owner)
owner
is null
, the shared owner will be used and this window will not be focusable.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- the componnt from which parent window this window is displayedpublic WebWindow(java.awt.Window owner)
owner
is null
, the shared owner will be used and this window will not be focusable.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- the window from which the window is displayedpublic WebWindow(java.awt.Window owner, java.awt.GraphicsConfiguration gc)
GraphicsConfiguration
of a screen device.
If owner
is null
, the shared owner will be used and this window will not be focusable.
This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale
.
owner
- the window from which the window is displayedgc
- the GraphicsConfiguration
that is used to construct the new window with; if gc is null
,
the system default GraphicsConfiguration
is assumed, unless owner
is also null, in which
case the GraphicsConfiguration
from the shared owner frame will be usedMethod Detail |
---|
protected void initialize()
public boolean isCloseOnFocusLoss()
public void setCloseOnFocusLoss(boolean closeOnFocusLoss)
closeOnFocusLoss
- whether should close window on focus loss or notpublic void setLanguageContainerKey(java.lang.String key)
setLanguageContainerKey
in interface LanguageContainerMethods
key
- language container keypublic void removeLanguageContainerKey()
removeLanguageContainerKey
in interface LanguageContainerMethods
public java.lang.String getLanguageContainerKey()
getLanguageContainerKey
in interface LanguageContainerMethods
public void registerSettings(java.lang.String key)
registerSettings
in interface SettingsMethods
key
- component settings keypublic <T extends DefaultValue> void registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass)
registerSettings
in interface SettingsMethods
T
- default value typekey
- component settings keydefaultValueClass
- component default value classDefaultValue
public void registerSettings(java.lang.String key, java.lang.Object defaultValue)
registerSettings
in interface SettingsMethods
key
- component settings keydefaultValue
- component default valuepublic void registerSettings(java.lang.String group, java.lang.String key)
registerSettings
in interface SettingsMethods
group
- component settings groupkey
- component settings keypublic <T extends DefaultValue> void registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass)
registerSettings
in interface SettingsMethods
T
- default value typegroup
- component settings groupkey
- component settings keydefaultValueClass
- component default value classDefaultValue
public void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue)
registerSettings
in interface SettingsMethods
group
- component settings groupkey
- component settings keydefaultValue
- component default valuepublic void registerSettings(java.lang.String key, boolean loadInitialSettings, boolean applySettingsChanges)
registerSettings
in interface SettingsMethods
key
- component settings keyloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notpublic <T extends DefaultValue> void registerSettings(java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
registerSettings
in interface SettingsMethods
T
- default value typekey
- component settings keydefaultValueClass
- component default value classloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notDefaultValue
public void registerSettings(java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
registerSettings
in interface SettingsMethods
key
- component settings keydefaultValue
- component default valueloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notpublic <T extends DefaultValue> void registerSettings(java.lang.String group, java.lang.String key, java.lang.Class<T> defaultValueClass, boolean loadInitialSettings, boolean applySettingsChanges)
registerSettings
in interface SettingsMethods
T
- default value typegroup
- component settings groupkey
- component settings keydefaultValueClass
- component default value classloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notDefaultValue
public void registerSettings(java.lang.String group, java.lang.String key, java.lang.Object defaultValue, boolean loadInitialSettings, boolean applySettingsChanges)
registerSettings
in interface SettingsMethods
group
- component settings groupkey
- component settings keydefaultValue
- component default valueloadInitialSettings
- whether to load initial available settings into the component or notapplySettingsChanges
- whether to apply settings changes to the component or notpublic void registerSettings(SettingsProcessor settingsProcessor)
registerSettings
in interface SettingsMethods
settingsProcessor
- component settings processorpublic void unregisterSettings()
unregisterSettings
in interface SettingsMethods
public void loadSettings()
loadSettings
in interface SettingsMethods
public void saveSettings()
saveSettings
in interface SettingsMethods
public WebWindow setWindowOpaque(boolean opaque)
setWindowOpaque
in interface WindowMethods<WebWindow>
opaque
- whether should make window opaque or notpublic boolean isWindowOpaque()
isWindowOpaque
in interface WindowMethods<WebWindow>
public WebWindow setWindowOpacity(float opacity)
setWindowOpacity
in interface WindowMethods<WebWindow>
opacity
- new window opacitypublic float getWindowOpacity()
getWindowOpacity
in interface WindowMethods<WebWindow>
public WebWindow center()
center
in interface WindowMethods<WebWindow>
public WebWindow center(java.awt.Component relativeTo)
center
in interface WindowMethods<WebWindow>
relativeTo
- component used to center window
public WebWindow center(int width, int height)
center
in interface WindowMethods<WebWindow>
width
- new window widthheight
- new window height
public WebWindow center(java.awt.Component relativeTo, int width, int height)
center
in interface WindowMethods<WebWindow>
relativeTo
- component used to center windowwidth
- new window widthheight
- new window height
public WebWindow packToWidth(int width)
packToWidth
in interface WindowMethods<WebWindow>
width
- new window width
public WebWindow packToHeight(int height)
packToHeight
in interface WindowMethods<WebWindow>
height
- new window height
public WebWindow packAndCenter()
packAndCenter
in interface WindowMethods<WebWindow>
public WebWindow packAndCenter(boolean animate)
packAndCenter
in interface WindowMethods<WebWindow>
animate
- whether should animate window size changes or not
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |