Class Window
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.awt.Window
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Emulator for
Window. Thin shell over SWindow.- See Also:
-
Field Summary
Fields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindow(com.vaadin.flow.component.Component peer) protectedOwner-aware peer-injection seam, mirroringDialog(com.vaadin.flow.component.Component, vaadinx.awt.Window, String, Dialog.ModalityType).Window(Window arg0, GraphicsConfiguration arg1) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddPropertyChangeListener(String arg0, PropertyChangeListener arg1) voidvoidvoidvoidapplyResourceBundle(String arg0) voidprotected final voidapplyVisibleToPeer(boolean b) Apply visibility to the peer in response tosetVisible(boolean).protected voidapplyVisibleToPeerImpl(boolean b) The peer write itself, already on the UI thread and inside thepreventPeerEventsguard.protected booleanblocksAfterVisibilityChange(boolean b) Whether the caller will block on a browser round-trip once this visibility change has been applied —trueonly for a modalDialog.show(), which parks until the user answers.voidcreateBufferStrategy(int arg0) voidcreateBufferStrategy(int arg0, BufferCapabilities arg1) voiddispose()protected voidTear down the peer in response todispose().protected voidfireWindowEvent(int id) protected voidfireWindowFocusEvent(int id, Window opposite) protected voidfireWindowStateEvent(int oldState, int newState) booleanfinal ContainergetFocusTraversalKeys(int arg0) intgetLocation(Point rv) floatWindow[]getOwner()static Window[]getShape()getSize()final StringintgetWidth()static Window[]intgetX()intgetY()voidhide()booleanisActive()final booleanbooleanbooleanfinal booleanfinal booleanbooleanbooleanbooleanisOpaque()booleanvoidpack()voidbooleanDeprecated.protected voidprotected voidprotected voidprotected voidvoidvoidvoidvoidvoidreshape(int x, int y, int width, int height) Deprecated AWT 1.0 alias — in the JDK this is the actual worker setBounds delegates to; we invert the delegation so the modern name carries the implementation.final voidsetAlwaysOnTop(boolean b) voidsetAutoRequestFocus(boolean b) voidsetBackground(Color arg0) voidsetBounds(int x, int y, int width, int height) Place + size in one call.voidvoidvoidsetFocusableWindowState(boolean focusableWindowState) final voidsetFocusCycleRoot(boolean b) voidsetIconImage(Image image) voidsetIconImages(List<? extends Image> icons) voidsetLayout(LayoutManager mgr) Stores the manager and invalidates as AWT does, minus the CSS dispatch — seewindowLayout.voidsetLocation(int x, int y) R_swing_is_truth mirror ofsetSize(int, int)for placement: store, push to the SWindow peer's top/left channel (which takes the Dialog overlay out of its default centered position), fire COMPONENT_MOVED on actual change.voidsetLocation(Point p) voidsetLocationByPlatform(boolean b) voidAWT:nullcenters on screen, a visible component centers over that component.voidsetMinimumSize(Dimension arg0) voidsetOpacity(float arg0) AWT's other two throws are not reproduced, and deliberately: both ask the platform whether it can do translucency at all — a browser can, so the answers would be "yes, supported" and the throws unreachable.voidvoidsetSize(int width, int height) R_swing_is_truth mirror: store the Swing-side size, push to the SWindow peer's width/height channel, fire COMPONENT_RESIZED when the value actually changed.voidvoidsetVisible(boolean b) voidshow()voidtoBack()voidtoFront()Methods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, peerContentElement, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, update, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isThemeDefault, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Constructor Details
-
Window
-
Window
-
Window
-
Window
Owner-aware peer-injection seam, mirroringDialog(com.vaadin.flow.component.Component, vaadinx.awt.Window, String, Dialog.ModalityType).vaadinx.swing.JWindowthreads itsSJWindowpeer plus an emulator-side owner through in one step — the public owner-taking ctors here can't be reused because they hardcodeSWindowas the peer. -
Window
protected Window(com.vaadin.flow.component.Component peer)
-
-
Method Details
-
getLayout
-
setLayout
Stores the manager and invalidates as AWT does, minus the CSS dispatch — seewindowLayout. -
isOpaque
-
isActive
public boolean isActive() -
getOwner
-
getLocale
-
setSize
public void setSize(int width, int height) R_swing_is_truth mirror: store the Swing-side size, push to the SWindow peer's width/height channel, fire COMPONENT_RESIZED when the value actually changed. Non-SWindow peers (JFrame's InlineStrategy / SJPanel) skip the peer write — an inline main window keeps its viewport-fill stance per D_inline_route_sizing; the field shadow + event still happen so user code sees consistent Swing state. -
setSize
-
dispose
public void dispose() -
disposePeer
protected void disposePeer()Tear down the peer in response todispose(). Default delegates toSWindow.dispose()when the peer is an SWindow (the standard SFrame / SJFrame / SDialog path). Subclasses with non-SWindow peers — notably JFrame's InlineStrategy with an SJPanel peer — override to detach from the route's div. Called under thepreventPeerEventsguard so a peer-originated OpenedChangeEvent doesn't double-fire WINDOW_CLOSING. -
getShape
-
getToolkit
- Overrides:
getToolkitin classComponent
-
setLocation
public void setLocation(int x, int y) R_swing_is_truth mirror ofsetSize(int, int)for placement: store, push to the SWindow peer's top/left channel (which takes the Dialog overlay out of its default centered position), fire COMPONENT_MOVED on actual change. Same non-SWindow-peer skip as setSize.- Overrides:
setLocationin classComponent
-
setLocation
- Overrides:
setLocationin classComponent
-
setLocationByPlatform
public void setLocationByPlatform(boolean b) - Throws:
IllegalComponentStateException- ifband the window is already showing, as AWT's own body does before it stores
-
isAlwaysOnTop
public final boolean isAlwaysOnTop() -
setAlwaysOnTop
public final void setAlwaysOnTop(boolean b) -
setIconImages
-
addNotify
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classContainer
-
setMinimumSize
- Overrides:
setMinimumSizein classComponent
-
reshape
-
setBounds
-
setBounds
-
getLocation
- Overrides:
getLocationin classComponent
-
getLocation
- Overrides:
getLocationin classComponent
-
getSize
-
getSize
-
getBounds
-
getBounds
-
getX
-
getY
-
getWidth
-
getHeight
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein classComponent
-
show
-
hide
-
applyVisibleToPeer
protected final void applyVisibleToPeer(boolean b) Apply visibility to the peer in response tosetVisible(boolean). Default delegates toSWindow.setVisible(boolean)when the peer is an SWindow (standard Dialog-backed shape); falls through toComponent.setVisible(boolean)for non-SWindow peers as defensive coverage. Subclasses with bespoke peer-attach semantics — notably JFrame's InlineStrategy with an SJPanel peer attached to a route's div — override to substitute their own peer manipulation. Called under thepreventPeerEventsguard so a peer-originated OpenedChangeEvent doesn't double-fire.- Overrides:
applyVisibleToPeerin classComponent
-
blocksAfterVisibilityChange
protected boolean blocksAfterVisibilityChange(boolean b) Whether the caller will block on a browser round-trip once this visibility change has been applied —trueonly for a modalDialog.show(), which parks until the user answers. Decided on our side rather than the migrator's, which is what makes it answerable at all; the set is small and closed.- Parameters:
b- the visibility being applied, since only a show can be followed by a park
-
applyVisibleToPeerImpl
protected void applyVisibleToPeerImpl(boolean b) The peer write itself, already on the UI thread and inside thepreventPeerEventsguard. Subclasses with bespoke peer-attach semantics — notably JFrame's InlineStrategy with an SJPanel peer attached to a route's div — override this rather thanapplyVisibleToPeer(boolean), so the hop and the guard cannot be bypassed by forgetting to callsuper. -
toFront
public void toFront() -
postEvent
Deprecated.- Specified by:
postEventin interfaceMenuContainer- Overrides:
postEventin classComponent
-
toBack
public void toBack() -
setCursor
-
getWindows
-
getOwnedWindows
-
processWindowEvent
-
processWindowFocusEvent
-
processWindowStateEvent
-
processEvent
- Overrides:
processEventin classContainer
-
fireWindowEvent
protected void fireWindowEvent(int id) -
fireWindowFocusEvent
-
fireWindowStateEvent
protected void fireWindowStateEvent(int oldState, int newState) -
isAlwaysOnTopSupported
public boolean isAlwaysOnTopSupported() -
isFocused
public boolean isFocused() -
getFocusOwner
-
getMostRecentFocusOwner
-
isFocusableWindow
public final boolean isFocusableWindow() -
getFocusableWindowState
public boolean getFocusableWindowState() -
setFocusableWindowState
public void setFocusableWindowState(boolean focusableWindowState) -
addPropertyChangeListener
- Overrides:
addPropertyChangeListenerin classContainer
-
addPropertyChangeListener
- Overrides:
addPropertyChangeListenerin classContainer
-
applyResourceBundle
-
applyResourceBundle
-
addWindowListener
-
addWindowFocusListener
-
addWindowStateListener
-
createBufferStrategy
- Throws:
AWTException
-
createBufferStrategy
public void createBufferStrategy(int arg0) -
getBufferStrategy
-
setOpacity
public void setOpacity(float arg0) AWT's other two throws are not reproduced, and deliberately: both ask the platform whether it can do translucency at all — a browser can, so the answers would be "yes, supported" and the throws unreachable. What is declined is the peer push, so the window renders fully opaque.- Parameters:
arg0- in[0, 1]- Throws:
IllegalArgumentException- outside that range, as AWT does
-
getBackground
- Overrides:
getBackgroundin classComponent
-
setBackground
- Overrides:
setBackgroundin classComponent
-
paint
-
getIconImages
-
setIconImage
-
pack
public void pack() -
getWarningString
-
getInputContext
- Overrides:
getInputContextin classComponent
-
getOwnerlessWindows
-
removeWindowListener
-
removeWindowStateListener
-
removeWindowFocusListener
-
getWindowListeners
-
getWindowFocusListeners
-
getWindowStateListeners
-
getFocusTraversalKeys
- Overrides:
getFocusTraversalKeysin classContainer
-
setFocusCycleRoot
public final void setFocusCycleRoot(boolean b) - Overrides:
setFocusCycleRootin classContainer
-
isFocusCycleRoot
public final boolean isFocusCycleRoot()- Overrides:
isFocusCycleRootin classContainer
-
getFocusCycleRootAncestor
- Overrides:
getFocusCycleRootAncestorin classComponent
-
setAutoRequestFocus
public void setAutoRequestFocus(boolean b) -
isAutoRequestFocus
public boolean isAutoRequestFocus() -
isValidateRoot
public boolean isValidateRoot()- Overrides:
isValidateRootin classContainer
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-
setLocationRelativeTo
AWT:nullcenters on screen, a visible component centers over that component. Both map to viewport-centering here — seeSWindow.setLocationRelativeTo(Component)for the R_layouts_close_enough close-enough rationale. Clears the explicit-location shadow (the window is centered again, not at the last set coordinates); fires COMPONENT_MOVED only if an explicit placement was in effect, since a still-centered window didn't move. -
isLocationByPlatform
public boolean isLocationByPlatform() -
getOpacity
public float getOpacity() -
setShape
-