Class SFrame
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.dialog.Dialog
com.vaadin.swingbridge.surrogates.SWindow
com.vaadin.swingbridge.surrogates.SFrame
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasAriaRole, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.dialog.DialogVariant>, ComponentMixin, ContainerMixin, JComponentMixin, Serializable
Surrogate for
Frame. Extends SWindow (the
Window-level peer-sync, owner tree, listener families, lifecycle) and
adds the Frame-specific surface: title (mirrored to
Dialog.setHeaderTitle(String)), the close-X icon in the Dialog header
(Frame chrome — JDK Window has no chrome by default; only Frame and
Dialog do), and the AWT-Frame state stubs (state / resizable /
undecorated). The JFrame-shaped layer (default close operation,
content-pane routing, JRootPane holder) lives on SJFrame.
Owner type
SFrame's owner-taking ctor acceptsSFrame owner for backward
compatibility (callers existed before SWindow landed). The underlying
field is SWindow.owner typed SWindow; SWindow.getOwner()
inherits from SWindow and returns SWindow. Tests that assert
frame.getOwner() == otherFrame work because the comparison is
by reference, not by static type. JDK shape is Frame.getOwner inheriting
Window.getOwner returning Window; ours matches.
Add / remove on a bare SFrame
SFrame.add(component) routes through Dialog's default
add, which puts the child in the overlay's content slot. There is no
intermediate content-pane — JDK Container.add(Component) also adds
directly without a content-pane indirection (the contentPane indirection
is JFrame's). SJFrame overrides add/remove to route through its
own contentPane, matching JFrame's post-Java-5 contract.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.dialog.Dialog
com.vaadin.flow.component.dialog.Dialog.ClosedEvent, com.vaadin.flow.component.dialog.Dialog.DialogCloseActionEvent, com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent, com.vaadin.flow.component.dialog.Dialog.DialogFooter, com.vaadin.flow.component.dialog.Dialog.DialogHeader, com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent, com.vaadin.flow.component.dialog.Dialog.OpenedChangeEventNested classes/interfaces inherited from interface JComponentMixin
JComponentMixin.ActionStandin -
Field Summary
Fields inherited from interface JComponentMixin
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintBitmask form ofgetState().EverySFramereachable from the currentUI.Subset ofgetFrames()withowner == null.intgetState()AWT legacy state: NORMAL (0) or ICONIFIED (1).getTitle()Never-null per AWT contract.static booleanAWT default: false — JFrames normally use OS-native chrome unless the L&F opts in.booleanWhether the end user may resize this frame by dragging its edges.booleanVaadin-first read-back ofsetUndecorated(boolean).Chain super (SWindow.paramString()= "visible=...") and prepend the title.static voidsetDefaultLookAndFeelDecorated(boolean b) WARN ontrue; matchessetUndecorated(boolean).voidsetExtendedState(int state) WARN on non-NORMAL; silent on NORMAL.voidsetResizable(boolean b) Drive the native VaadinDialog.setResizable(boolean)and fire the"resizable"property changejava.awt.Frame.setResizablefires.voidsetState(int state) WARN on non-NORMAL; silent on NORMAL (redundant set).voidAWT's Frame coerces null title to empty string, and getTitle is documented as never-null.voidsetUndecorated(boolean b) Strip (or restore) the window chrome viaSWindow.setUndecoratedChrome(boolean)— hides the header (title + close-X), zeroes padding and border radius.Methods inherited from class SWindow
addComponentListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, centerOnScreen, createBufferStrategy, createBufferStrategy, dispose, fireClosedEvent, fireClosingEvent, fireOpenedEvent, fireWindowEvent, fireWindowFocusEvent, fireWindowStateEvent, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isUndecoratedChrome, isValidateRoot, pack, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setAutoRequestFocus, setBounds, setEnabled, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setOpacity, setShape, setSize, setUndecoratedChrome, setVisible, toBack, toFrontMethods inherited from class com.vaadin.flow.component.dialog.Dialog
addAttachListener, addClosedListener, addComponentAtIndex, addDetachListener, addDialogCloseActionListener, addDraggedListener, addOpenedChangeListener, addResizeListener, bindChildren, bindHeight, bindVisible, bindWidth, close, getAriaLabel, getChildren, getFooter, getHeader, getHeaderTitle, getHeight, getLeft, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getModality, getOverlayRole, getRole, getStyle, getTop, getWidth, isAutofocus, isCloseOnEsc, isCloseOnOutsideClick, isDraggable, isFocusTrap, isKeepInViewport, isModal, isOpened, onAttach, open, removeAll, setAriaLabel, setAutofocus, setCloseOnEsc, setCloseOnOutsideClick, setDraggable, setFocusTrap, setHeaderTitle, setHeight, setKeepInViewport, setLeft, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setModal, setModality, setOpened, setOverlayRole, setRole, setTop, setWidthMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, whenAttachedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ComponentMixin
_installSwingClass, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, dispatchEvent, doLayout, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getComponentListeners, getCursor, getFocusListeners, getFont, getForeground, getGraphics, getHierarchyBoundsListeners, getHierarchyListeners, getKeyListeners, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getName, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolTipText, getX, getY, grabFocus, hasFocus, invalidate, isDisplayable, isFocusable, isFocusOwner, isShowing, paint, paintAll, print, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setCursor, setFocusable, setFont, setForeground, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validateMethods inherited from interface ContainerMixin
addContainerListener, getContainerListeners, getLayout, paintComponents, printComponents, removeContainerListener, setLayoutMethods inherited from interface com.vaadin.flow.component.HasAriaRole
getAriaRole, setAriaRoleMethods inherited from interface com.vaadin.flow.component.HasComponents
addMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
add, add, addComponentAsFirst, getComponentAt, getComponentCount, indexOf, remove, remove, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface JComponentMixin
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paintImmediately, paintImmediately, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateUI
-
Constructor Details
-
SFrame
public SFrame()Untitled, no owner. -
SFrame
Titled, no owner. Null title coerces to empty string. -
SFrame
Untitled, with owner. Null owner is a top-level frame. -
SFrame
-
-
Method Details
-
getTitle
Never-null per AWT contract. -
setTitle
AWT's Frame coerces null title to empty string, and getTitle is documented as never-null. MirrorsDialog.setHeaderTitle(String)on every set; fires"title"PCE. -
getFrames
-
getOwnerlessFrames
Subset ofgetFrames()withowner == null. -
getState
public int getState()AWT legacy state: NORMAL (0) or ICONIFIED (1). Always NORMAL here. -
setState
public void setState(int state) WARN on non-NORMAL; silent on NORMAL (redundant set). -
getExtendedState
public int getExtendedState()Bitmask form ofgetState(). Always NORMAL — browser tabs don't iconify or maximize in the AWT sense. -
setExtendedState
public void setExtendedState(int state) WARN on non-NORMAL; silent on NORMAL. -
isResizable
public boolean isResizable()Whether the end user may resize this frame by dragging its edges. Reads the native VaadinDialog.isResizable()— the frame renders as a Dialog overlay, and Vaadin Dialog draws drag-to-resize grips when resizable. Seeded totruein the ctor to match AWT's resizable-by-default Frame/Dialog.- Overrides:
isResizablein classcom.vaadin.flow.component.dialog.Dialog
-
setResizable
public void setResizable(boolean b) Drive the native VaadinDialog.setResizable(boolean)and fire the"resizable"property changejava.awt.Frame.setResizablefires. Not a no-op: the "browser resizes the viewport regardless" premise holds for the OS window but not for a frame, which renders as a fixed-size Dialog overlay whose own resize affordance Vaadin exposes right here — honoring the flag keeps a resizable Swing window resizable in the browser.Because the effect is fully honoured, there is no R_vaadin_first drop to hide behind: the property is real here, so its notification is owed (SD_property_fanout_audit).
- Overrides:
setResizablein classcom.vaadin.flow.component.dialog.Dialog
-
isUndecorated
public boolean isUndecorated()Vaadin-first read-back ofsetUndecorated(boolean). -
setUndecorated
public void setUndecorated(boolean b) Strip (or restore) the window chrome viaSWindow.setUndecoratedChrome(boolean)— hides the header (title + close-X), zeroes padding and border radius. Unlike JDKFrame.setUndecoratedthis doesn't throw when the window is displayable — the CSS class toggles live, so the JDK's not-while-displayable restriction would only add a failure mode we don't have; the displayable-time throw stays on the emulator layer where the JDK contract is the API surface. -
isDefaultLookAndFeelDecorated
public static boolean isDefaultLookAndFeelDecorated()AWT default: false — JFrames normally use OS-native chrome unless the L&F opts in. We have no L&F layer at all (R_layouts_close_enough) and the Dialog peer always renders Vaadin's overlay chrome, so false is both the honest post-construction answer and the correct one for any code branching on "am I drawing my own chrome?". -
setDefaultLookAndFeelDecorated
public static void setDefaultLookAndFeelDecorated(boolean b) WARN ontrue; matchessetUndecorated(boolean). -
paramString
Chain super (SWindow.paramString()= "visible=...") and prepend the title.SJFrame.paramString()extends this with the defaultCloseOperation report.- Overrides:
paramStringin classSWindow
-