@BeanSettings(acceptChildren=true, useXdevCustomizer=true) public class XdevWindow extends XdevComponent implements LockTimeMonitor
XdevRootPaneContainer
.
Don't confuse XdevWindow with JWindow
, see XdevScreen
.
XdevComponent
,
XdevRootPaneContainer
,
XDEV.OpenWindow(xdev.lang.cmd.OpenWindow)
,
Serialized FormJPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
alpha, alphaColors, alphaCondition, alphaFilter, alphaTolerance, clip, filteredImage, imageBounds, remakeImages, style, useAlphaFilter
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DATA_FIELD, FORMULAR_CONDITION_FILTER, FORMULAR_CONDITION_PRECISION, FORMULAR_FILTER_OPERATOR, FORMULAR_SKIP, FORMULAR_VERIFIER, TAG_DATA
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XdevWindow()
Create a new
XdevWindow with no layout manager. |
XdevWindow(LayoutManager layout)
Create a new
XdevWindow with the specified layout manager. |
Modifier and Type | Method and Description |
---|---|
void |
addWindowListener(WindowListener listener)
Adds the specified window listener to receive window events of this
XdevWindow . |
void |
cleanUp()
Removes all the components from this window.
|
void |
close()
Hides this
XdevWindow . |
protected Component |
createLockPanel() |
void |
fireWindowOpened(WindowEvent event)
Invokes
WindowListener.windowOpened(WindowEvent) of all
registered WindowListener s. |
JButton |
getDefaultButton()
Returns the value of the
defaultButton property. |
int |
getExtendedState()
Gets the state of this window.
|
int |
getHorizontalBlockIncrement()
Returns the horizontal block increment
|
int |
getHorizontalScrollBarPolicy()
Returns the horizontal scroll bar policy value.
|
int |
getHorizontalUnitIncrement()
Returns the horizontal unit increment
|
Icon |
getIcon()
Returns this window's icon.
|
JMenuBar |
getJMenuBar()
Returns the
menubar set on this window. |
Component |
getLockPanel()
Gets the lock panel of the window.
|
XdevRootPaneContainer |
getOwner()
Gets the container of this
XdevWindow . |
Object |
getParameter()
Gets the
parameter of the window. |
Object |
getResponseValue()
Gets the
response value of the window. |
String |
getTitle()
Gets the title of the window.
|
int |
getVerticalBlockIncrement()
Returns the vertical block increment
|
int |
getVerticalScrollBarPolicy()
Returns the vertical scroll bar policy value.
|
int |
getVerticalUnitIncrement()
Returns the vertical unit increment
|
WindowListener[] |
getWindowListeners()
Returns an array of all the window listeners registered on this
XdevWindow . |
boolean |
isResizable()
Returns
true if this XdevWindow is resizeable by the
user. |
boolean |
isResponseOK()
Returns the value of the
responseState . |
char |
localizeChar(String str)
Returns the localized version of the given
String
str as char if the result is a 1-length String, '\0'
otherwise. |
String |
localizeString(String str)
Returns the localized version of the given
String
str . |
void |
maximize()
This method indicates that the window is fully maximized (that is both
horizontally and vertically).
|
void |
openInCurrentWindow(XdevWindow window)
Open the window in the current window.
|
JDialog |
openInDialog(XdevWindow window,
boolean modal)
Open the
window in a new XdevDialog . |
JDialog |
openInDialog(XdevWindow window,
boolean modal,
Component owner)
Open the
window in a new XdevDialog . |
JFrame |
openInFrame(XdevWindow window)
Open the
window in a new XdevFrame . |
JWindow |
openInScreen(XdevWindow window,
boolean modal)
Open the
window in a new XdevScreen . |
JWindow |
openInScreen(XdevWindow window,
boolean modal,
Component owner)
Open the
window in a new XdevScreen . |
void |
pack() |
protected void |
paintImage(Graphics2D g)
TODO
|
void |
removeWindowListener(WindowListener listener)
Removes the specified window listener so that it no longer receives
window events from this
XdevWindow . |
void |
setDefaultButton(JButton defaultButton)
Sets the
defaultButton property, which determines the
current default button for this window. |
void |
setEnabled(boolean enabled) |
void |
setExtendedState(int extendedState)
Sets the state of this window.
|
void |
setFont(Font font) |
void |
setForeground(Color fg) |
void |
setHorizontalBlockIncrement(int horizontalBlockIncrement)
Set the horizontal block increment
|
void |
setHorizontalScrollBarPolicy(int horizontalScrollBarPolicy)
Determines when the horizontal scrollbar appears in the scrollpane.
|
void |
setHorizontalUnitIncrement(int horizontalUnitIncrement)
Set the horizontal unit increment
|
void |
setIcon(Icon icon)
Defines the icon this window's parent (dialog,frame,...) will display.
|
void |
setJMenuBar(JMenuBar menuBar)
Sets the
menubar for this window. |
void |
setLockPanel(Component lockPanel) |
void |
setOwner(XdevRootPaneContainer owner)
Sets the owner of this window.
|
void |
setParameter(Object o)
Sets the
parameter of the window. |
void |
setResizable(boolean resizable)
Sets whether this
XdevWindow is resizable by the user. |
void |
setResponseState(boolean responseState)
Sets the
response state of the window. |
void |
setResponseValue(Object responseValue)
Sets the
response value of the window. |
void |
setTitle(String title)
Sets the title of the window.
|
void |
setVerticalBlockIncrement(int verticalBlockIncrement)
Set the vertical block increment
|
void |
setVerticalScrollBarPolicy(int verticalScrollBarPolicy)
Determines when the vertical scrollbar appears in the scrollpane.
|
void |
setVerticalUnitIncrement(int verticalUnitIncrement)
Set the vertical unit increment
|
void |
updateContext(Countdown countdown,
long remainingTime)
Updates the monitors display context.
|
checkAlphaUse, createG2D, drawTexture, forcePaint, getAlpha, getAlphaColors, getAlphaCondition, getAlphaTolerance, getBackgroundType, getBorderInsets, getGradientAlign, getGradientColor1, getGradientColor2, getSizeForFilter, getTexture, getTextureOption, getTexturePath, isOpaque, paintBackground, paintComponent, paintComponent, setAlpha, setAlphaColors, setAlphaCondition, setAlphaTolerance, setBackgroundType, setBorderTitle, setGradientAlign, setGradientColor1, setGradientColor2, setTexture, setTextureOption, setTexturePath, toString, update
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public XdevWindow()
XdevWindow
with no layout manager.
Alias for XdevWindow(null)
XdevWindow(LayoutManager)
public XdevWindow(LayoutManager layout)
XdevWindow
with the specified layout manager.layout
- the LayoutManager to usepublic void addWindowListener(WindowListener listener)
XdevWindow
.listener
- the window listenerremoveWindowListener(WindowListener)
,
getWindowListeners()
public void removeWindowListener(WindowListener listener)
XdevWindow
.listener
- the window listener to removeaddWindowListener(WindowListener)
,
getWindowListeners()
public WindowListener[] getWindowListeners()
XdevWindow
.WindowListener
s or an empty
array if no window listeners are currently registeredaddWindowListener(WindowListener)
,
removeWindowListener(WindowListener)
public void fireWindowOpened(WindowEvent event)
WindowListener.windowOpened(WindowEvent)
of all
registered WindowListener
s.event
- the window eventgetWindowListeners()
public void setOwner(XdevRootPaneContainer owner)
owner
- the XdevRootPaneContainer
to set as ownergetOwner()
public XdevRootPaneContainer getOwner()
XdevWindow
.XdevWindow
as
XdevRootPaneContainer
. The owner may be
null
.setOwner(XdevRootPaneContainer)
public void setTitle(String title)
title
- the title displayed in the dialog's or frame's border; a null
value results in an empty titlegetTitle()
public String getTitle()
null
.setTitle(String)
public void setJMenuBar(JMenuBar menuBar)
menubar
for this window.menuBar
- the menubar
being placed in the windowgetJMenuBar()
public JMenuBar getJMenuBar()
menubar
set on this window.JMenuBar
of this XdevWindow
setJMenuBar(JMenuBar)
public void setDefaultButton(JButton defaultButton)
defaultButton
property, which determines the
current default button for this window. The default button is the button
which will be activated when a UI-defined activation event (typically the
Enter key) occurs in the root pane regardless of whether or not
the button has keyboard focus (unless there is another component within
the window which consumes the activation event, such as a
JTextPane
). For default activation to work, the button must
be an enabled descendent of the window when activation occurs. To remove
a default button from this window, set this property to null
.defaultButton
- the JButton
which is to be the default buttonJButton.isDefaultButton()
public JButton getDefaultButton()
defaultButton
property.JButton
which is currently the default buttonsetDefaultButton(JButton)
public void setParameter(Object o)
parameter
of the window.o
- the Object
to set as parametergetParameter()
public Object getParameter()
parameter
of the window.null
.setParameter(Object)
public void setResponseValue(Object responseValue)
response value
of the window.responseValue
- the Object
to set as response valuegetResponseValue()
public Object getResponseValue()
response value
of the window.null
.setResponseValue(Object)
public void setResponseState(boolean responseState)
response state
of the window.responseState
- the response state valueisResponseOK()
public boolean isResponseOK()
responseState
. The default value is
false
responseState
setResponseState(boolean)
public void setIcon(Icon icon)
icon
- the icon to displaypublic Icon getIcon()
null
public void setResizable(boolean resizable)
XdevWindow
is resizable by the user.resizable
- true
if the user can resize this
XdevWindow
; false
otherwise.isResizable()
public boolean isResizable()
true
if this XdevWindow
is resizeable by the
user.true
if the user can resize this XdevWindow
; false
otherwise.setResizable(boolean)
public void setVerticalScrollBarPolicy(int verticalScrollBarPolicy) throws IllegalArgumentException
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED
ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
verticalScrollBarPolicy
- one of the three values listed aboveIllegalArgumentException
- if policy
is not one of the legal values shown
abovegetVerticalScrollBarPolicy()
public int getVerticalScrollBarPolicy()
setVerticalScrollBarPolicy(int)
public void setVerticalUnitIncrement(int verticalUnitIncrement) throws IllegalArgumentException
verticalUnitIncrement
- the vertical unit incrementIllegalArgumentException
- if policy
is not positive or 0.getVerticalUnitIncrement()
public int getVerticalUnitIncrement()
setVerticalUnitIncrement(int)
public void setHorizontalScrollBarPolicy(int horizontalScrollBarPolicy) throws IllegalArgumentException
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
horizontalScrollBarPolicy
- one of the three values listed aboveIllegalArgumentException
- if policy
is not one of the legal values shown
abovegetHorizontalScrollBarPolicy()
public int getHorizontalScrollBarPolicy()
setHorizontalScrollBarPolicy(int)
public void setHorizontalUnitIncrement(int horizontalUnitIncrement)
horizontalUnitIncrement
- the horizontal unit incrementIllegalArgumentException
- if policy
is not possitive or 0.getHorizontalUnitIncrement()
public int getHorizontalUnitIncrement()
setHorizontalUnitIncrement(int)
public int getVerticalBlockIncrement()
#VerticalBlockIncrement(int)
public void setVerticalBlockIncrement(int verticalBlockIncrement)
verticalBlockIncrement
- the vertical block incrementIllegalArgumentException
- if policy
is not positive or 0.getVerticalBlockIncrement()
public int getHorizontalBlockIncrement()
setHorizontalBlockIncrement(int)
public void setHorizontalBlockIncrement(int horizontalBlockIncrement)
horizontalBlockIncrement
- the horizontal block incrementIllegalArgumentException
- if policy
is not possitive or 0.getHorizontalBlockIncrement()
public void setExtendedState(int extendedState)
extendedState
- a bitwise mask of frame state constantsgetExtendedState()
,
XdevRootPaneContainer.setExtendedState(int)
public int getExtendedState()
setExtendedState(int)
public void maximize()
Note that if the state is not supported on a given platform, nothing will happen.
Frame.setExtendedState(int)
,
Frame.MAXIMIZED_BOTH
public void pack()
public void cleanUp()
removeLayoutComponent
method.Container.removeAll()
,
Application.gc()
protected void paintImage(Graphics2D g)
paintImage
in class XdevComponent
public String localizeString(String str)
String
str
.
This method is an alias for
ResourceUtils#optLocalizeString(str, this)
.
str
- to localizestr
.Locale
,
ResourceUtils.optLocalizeString(String, Object)
,
ResourceUtils.optLocalizeChar(String, Object)
public char localizeChar(String str)
String
str
as char if the result is a 1-length String, '\0'
otherwise.
This method is an alias for
ResourceUtils#optLocalizeChar(str,this);
.
str
- to localizestr
or '\0'.Locale
,
ResourceUtils.optLocalizeString(String, Object)
,
ResourceUtils.optLocalizeChar(String, Object)
public void openInCurrentWindow(XdevWindow window)
window
- the XdevWindow
to openpublic JDialog openInDialog(XdevWindow window, boolean modal)
window
in a new XdevDialog
. XdevWindow
is used as owner
.
This method is an alias for openInDialog(window,modal,this);
.
window
- the XdevWindow
to openmodal
- specifies whether dialog blocks user input to other top-level
windows when shown.JDialog
public JDialog openInDialog(XdevWindow window, boolean modal, Component owner)
window
in a new XdevDialog
.window
- the XdevWindow
to openmodal
- specifies whether dialog blocks user input to other top-level
windows when shown.owner
- the Component
from which the dialog is displayed
or null
if this dialog has no ownerJDialog
public JWindow openInScreen(XdevWindow window, boolean modal) throws HeadlessException
window
in a new XdevScreen
. XdevWindow
is used as owner
.
This method is an alias for openInWindow(window,modal,this);
.
window
- the content of this windowmodal
- specifies whether window blocks user input to other top-level
windows when shown.JWindow
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns
true.public JWindow openInScreen(XdevWindow window, boolean modal, Component owner) throws HeadlessException
window
in a new XdevScreen
.window
- the content of this windowmodal
- specifies whether window blocks user input to other top-level
windows when shown.owner
- component to get Window ancestor ofJWindow
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns
true.public JFrame openInFrame(XdevWindow window)
window
in a new XdevFrame
.window
- the XdevWindow
to openJFrame
public void close()
XdevWindow
.public Component getLockPanel()
Component
protected Component createLockPanel()
public void setLockPanel(Component lockPanel)
lockPanel
- public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void setForeground(Color fg)
setForeground
in class JComponent
public void setFont(Font font)
setFont
in class JComponent
public void updateContext(Countdown countdown, long remainingTime)
updateContext
in interface LockTimeMonitor
countdown
- to get the lock countown duration.remainingTime
- the remaining lock time.Copyright © 2003–2021 XDEV Software. All rights reserved.