Class JRootPane
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
vaadinx.swing.JRootPane
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Emulator for
JRootPane — a thin shell over
SJRootPane (SD_sjframe): the surrogate carries the Enter-
shortcut install and its own "defaultButton" PCE; the
emulator keeps its AWT-typed content / layered / glass pane holders
and its own listener chain so migrated code registered at the
vaadinx.swing.JRootPane layer hears events on its own side
(same two-layer convention as SJSlider / SJSpinner / SFrame).
Structural, and the containment is the JDK's
This root pane sits between the window and its content pane, as Swing's does, and holds the JDK's own chain:
JRootPane
├── glassPane (index 0, as in the JDK)
└── JLayeredPane
├── JMenuBar
└── contentPane
The menu bar belongs to the layered pane, not to this pane —
javax.swing.JRootPane's class doc states it outright, and both of the
layered pane's children go into the same FRAME_CONTENT_LAYER, so the
layering is not what stacks them. RootLayout stacks them in y,
reaching through the layered pane to do it; SB-Emulators spells that as CSS on the
surrogate chain. The three panes are built in the constructor through the
JDK's own createGlassPane / createLayeredPane /
createContentPane hooks, in the JDK's order — which is what makes a
migrator's override of any of them actually run (R_no_vaadin_in_api limb 2).
What is not reproduced is the layered pane's z-ordering: layer
constants round-trip but reorder nothing, since Vaadin renders in DOM order
and JInternalFrame renders as a Dialog overlay instead (D_internal_frames).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected Containerprotected JButtonstatic final intstatic final intstatic final intprotected Componentstatic final intprotected JLayeredPaneprotected JMenuBarstatic final intstatic final intstatic final intstatic final intFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThe JDK's body verbatim: add normally, then re-assert the glass pane at index 0 if it slipped.protected ContainerFactory for the default content pane, called from the constructor.protected ComponentFactory for the default glass pane, called from the constructor.protected JLayeredPaneFactory for the default layered pane, called from the constructor.nulluntilsetJMenuBar(JMenuBar)plants one.JDK alias forgetJMenuBar(), deprecated there since 1.1.voidsetContentPane(Container content) The JDK's body: detach the outgoing pane from the layered pane, then add the incoming one there.voidsetDefaultButton(JButton button) Installbuttonas the root pane's default button — Enter anywhere inside the enclosing window triggers its click.voidsetGlassPane(Component glass) Plantglassas this pane's first child — the JDK's index as well as its containment (rootPane.add(glassPane, 0)), so a latergetGlassPane().setVisible(true)renders a curtain that blocks mouse input beneath it (D_glasspane_structural/SD_glasspane_structural).voidsetJMenuBar(JMenuBar bar) Plantbarin the layered pane atFRAME_CONTENT_LAYER, above the content pane — the JDK's own containment (layeredPane.add(menuBar, FRAME_CONTENT_LAYER)).voidsetLayeredPane(JLayeredPane layered) Faithfully does not migrate the menu bar or content pane into the new pane — the JDK'ssetLayeredPaneswaps only its own child, leaving them parented to the outgoing pane, which is why nothing but a look-and-feel calls it.voidsetMenuBar(JMenuBar bar) JDK alias forsetJMenuBar(JMenuBar), deprecated there since 1.1.Methods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, 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, getUI, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, 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, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
contentPane
-
layeredPane
-
glassPane
-
defaultButton
-
NONE
public static final int NONE- See Also:
-
FRAME
public static final int FRAME- See Also:
-
PLAIN_DIALOG
public static final int PLAIN_DIALOG- See Also:
-
INFORMATION_DIALOG
public static final int INFORMATION_DIALOG- See Also:
-
ERROR_DIALOG
public static final int ERROR_DIALOG- See Also:
-
COLOR_CHOOSER_DIALOG
public static final int COLOR_CHOOSER_DIALOG- See Also:
-
FILE_CHOOSER_DIALOG
public static final int FILE_CHOOSER_DIALOG- See Also:
-
QUESTION_DIALOG
public static final int QUESTION_DIALOG- See Also:
-
WARNING_DIALOG
public static final int WARNING_DIALOG- See Also:
-
-
Constructor Details
-
JRootPane
public JRootPane()Peers on its ownSJRootPane. A window'ssetRootPanehands that same surrogate to the window's surrogate, so both layers share one root pane and the Enter shortcutsetDefaultButtoninstalls follows the window through a single listener.
-
-
Method Details
-
createContentPane
Factory for the default content pane, called from the constructor. Real Swing returns aJPanelwith aBorderLayout; the built-in BorderLayout writes its CSS ontoContainer.peerContentElement()either way, so a plain Div-backed Container is equivalent here. -
createLayeredPane
Factory for the default layered pane, called from the constructor. -
createGlassPane
Factory for the default glass pane, called from the constructor. Invisible as in the JDK, so a latersetVisible(true)is what curtains the window. -
getContentPane
-
setContentPane
The JDK's body: detach the outgoing pane from the layered pane, then add the incoming one there. Children are not migrated — callers that want to keep content must re-add to the new pane. -
getLayeredPane
-
setLayeredPane
Faithfully does not migrate the menu bar or content pane into the new pane — the JDK'ssetLayeredPaneswaps only its own child, leaving them parented to the outgoing pane, which is why nothing but a look-and-feel calls it. -
getGlassPane
-
setGlassPane
Plantglassas this pane's first child — the JDK's index as well as its containment (rootPane.add(glassPane, 0)), so a latergetGlassPane().setVisible(true)renders a curtain that blocks mouse input beneath it (D_glasspane_structural/SD_glasspane_structural). -
getJMenuBar
nulluntilsetJMenuBar(JMenuBar)plants one. -
getMenuBar
JDK alias forgetJMenuBar(), deprecated there since 1.1. -
setJMenuBar
Plantbarin the layered pane atFRAME_CONTENT_LAYER, above the content pane — the JDK's own containment (layeredPane.add(menuBar, FRAME_CONTENT_LAYER)). Passnullto detach. Fires nothing: neitherJFramenorJDialognorJRootPanefires a bound property for the menu bar (D_window_fanout);JInternalFrameis the solejavax.swingclass that does. -
setMenuBar
JDK alias forsetJMenuBar(JMenuBar), deprecated there since 1.1. -
addImpl
The JDK's body verbatim: add normally, then re-assert the glass pane at index 0 if it slipped. Deliberately does not redirect into the content pane —rootPane.add(child)adds a direct child of the root pane in Swing too, which is whyJRootPane's own class doc tells callers to add togetContentPane()instead. The redirect belongs toJFrame/JDialog/JWindow, which is whererootPaneCheckingEnabledlives;JRootPanehas no such flag. -
getDefaultButton
-
setDefaultButton
Installbuttonas the root pane's default button — Enter anywhere inside the enclosing window triggers its click. Browser-side shortcut install is delegated to theSJRootPanepeer (which owns theShortcutRegistrationand its button-tied lifecycle). The emulator fires its own"defaultButton"PCE on this layer — the surrogate fires its own independently. -
getUIClassID
- Overrides:
getUIClassIDin classJComponent
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-