Class JComponent
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
- Direct Known Subclasses:
AbstractButton, Box, Box.Filler, JColorChooser, JComboBox, JFileChooser, JInternalFrame, JInternalFrame.JDesktopIcon, JLabel, JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPopupMenu, JProgressBar, JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSpinner, JSplitPane, JTabbedPane, JTable, JTableHeader, JTextComponent, JToolBar, JTree, JViewport
Emulator for
JComponent.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClient-property key the tooltip text is stored under, as in the JDK — which is also why"ToolTipText"is the bound-property namesetToolTipText(String)fires: it fires becauseputClientProperty(Object, Object)fires, not on its own account (D_property_fanout_audit).static final intstatic final intstatic final intstatic final intFields 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 TypeMethodDescriptionvoidvoidvoidvoidcomputeVisibleRect(Rectangle arg0) booleancontains(int arg0, int arg1) voiddisable()voidenable()voidfirePropertyChange(String arg0, boolean arg1, boolean arg2) voidfirePropertyChange(String arg0, char arg1, char arg2) voidfirePropertyChange(String arg0, int arg1, int arg2) protected voidfireVetoableChange(String arg0, Object arg1, Object arg2) getActionForKeyStroke(KeyStroke stroke) final ActionMapfloatfloatbooleanintgetBaseline(int arg0, int arg1) final ObjectgetClientProperty(Object arg0) protected GraphicsgetComponentGraphics(Graphics arg0) intgetConditionForKeyStroke(KeyStroke stroke) intstatic LocaleThe locale everyJFrame/JDialog/JWindowis born with — theirframeInit/dialogInit/windowInitall open by callingsetLocale(JComponent.getDefaultLocale()), as the JDK's do.getFontMetrics(Font arg0) intbooleanfinal InputMapfinal InputMapgetInputMap(int condition) <T extends EventListener>
T[]getListeners(Class<T> arg0) getLocation(Point arg0) Deprecated.getPopupLocation(MouseEvent arg0) getToolTipLocation(MouseEvent arg0) getToolTipText(MouseEvent arg0) getUI()booleanintgetWidth()intgetX()intgetY()voidvoidhide()booleanstatic booleanbooleanbooleanisOpaque()booleanfinal booleanprotected booleanbooleanbooleanbooleanvoidprotected voidpaintBorder(Graphics arg0) protected voidpaintChildren(Graphics arg0) protected voidpaintComponent(Graphics arg0) voidpaintImmediately(int arg0, int arg1, int arg2, int arg3) voidpaintImmediately(Rectangle arg0) protected Stringvoidvoidprotected voidprintBorder(Graphics arg0) protected voidprintChildren(Graphics arg0) protected voidprintComponent(Graphics arg0) protected voidprotected booleanprocessKeyBinding(KeyStroke arg0, KeyEvent arg1, int arg2, boolean arg3) final voidputClientProperty(Object arg0, Object arg1) voidregisterKeyboardAction(ActionListener listener, String command, KeyStroke stroke, int condition) voidregisterKeyboardAction(ActionListener listener, KeyStroke stroke, int condition) voidvoidvoidvoidrepaint(long arg0, int arg1, int arg2, int arg3, int arg4) voidbooleanvoidbooleanrequestFocus(boolean temporary) The legacy "temporary focus" overload.booleanprotected booleanrequestFocusInWindow(boolean temporary) voidvoidreshape(int arg0, int arg1, int arg2, int arg3) voidvoidscrollRectToVisible(Rectangle arg0) final voidsetActionMap(ActionMap map) voidsetAlignmentX(float arg0) voidsetAlignmentY(float arg0) voidsetAutoscrolls(boolean arg0) voidsetBackground(Color arg0) voidvoidsetComponentPopupMenu(JPopupMenu popup) voidsetDebugGraphicsOptions(int arg0) static voidsetDefaultLocale(Locale arg0) Stored on the current UI, which isgetDefaultLocale()'s scope; the JVM default is never touched, since it is the *server's* and shared by every session.voidsetDoubleBuffered(boolean arg0) voidsetEnabled(boolean arg0) voidsetFocusTraversalKeys(int arg0, Set<? extends AWTKeyStroke> arg1) voidvoidsetForeground(Color arg0) voidsetInheritsPopupMenu(boolean arg0) Stores the flag and fires"inheritsPopupMenu"; the inheritance itself is not modelled — a VaadinContextMenubinds to one target element, and walking to an ancestor's menu on a bare right-click has no counterpart.final voidsetInputMap(int condition, InputMap map) voidsetInputVerifier(InputVerifier newVerifier) voidsetMaximumSize(Dimension arg0) voidsetMinimumSize(Dimension arg0) voidDeprecated.voidsetOpaque(boolean arg0) voidsetPreferredSize(Dimension arg0) voidsetRequestFocusEnabled(boolean arg0) voidsetToolTipText(String text) voidsetTransferHandler(TransferHandler newHandler) protected voidsetUI(ComponentUI arg0) voidsetVerifyInputWhenFocusTarget(boolean arg0) Stores the flag and fires"verifyInputWhenFocusTarget"; the gate it controls is not modelled.voidsetVisible(boolean arg0) voidunregisterKeyboardAction(KeyStroke stroke) voidvoidupdateUI()Methods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, 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, getAccessibleContext, 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, 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
-
WHEN_FOCUSED
public static final int WHEN_FOCUSED- See Also:
-
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
public static final int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT- See Also:
-
WHEN_IN_FOCUSED_WINDOW
public static final int WHEN_IN_FOCUSED_WINDOW- See Also:
-
UNDEFINED_CONDITION
public static final int UNDEFINED_CONDITION- See Also:
-
TOOL_TIP_TEXT_KEY
Client-property key the tooltip text is stored under, as in the JDK — which is also why"ToolTipText"is the bound-property namesetToolTipText(String)fires: it fires becauseputClientProperty(Object, Object)fires, not on its own account (D_property_fanout_audit).- See Also:
-
-
Constructor Details
-
JComponent
public JComponent() -
JComponent
protected JComponent(com.vaadin.flow.component.Component peer)
-
-
Method Details
-
update
-
contains
-
getBounds
-
getLocation
- Overrides:
getLocationin classComponent
-
print
-
getSize
-
setOpaque
public void setOpaque(boolean arg0) -
paramString
- Overrides:
paramStringin classContainer
-
isOpaque
-
enable
-
getGraphics
- Overrides:
getGraphicsin classComponent
-
getRootPane
-
firePropertyChange
- Overrides:
firePropertyChangein classComponent
-
firePropertyChange
- Overrides:
firePropertyChangein classComponent
-
firePropertyChange
- Overrides:
firePropertyChangein classComponent
-
getInheritsPopupMenu
public boolean getInheritsPopupMenu()- Returns:
- what
setInheritsPopupMenu(boolean)stored; Swing's default isfalse. Reports the request faithfully even though the inheritance has no effect — see the setter.
-
getComponentPopupMenu
-
isManagingFocus
public boolean isManagingFocus() -
getDefaultLocale
The locale everyJFrame/JDialog/JWindowis born with — theirframeInit/dialogInit/windowInitall open by callingsetLocale(JComponent.getDefaultLocale()), as the JDK's do.Real Swing scopes this to an
AppContext— per *app*, not per JVM — so answering per-UI is that scoping reproduced rather than invented (same reasoning as D_window_registry's tab scope). The JVM default would name the *server's* locale, making every user of a multi-user app see whatever the host happens to run under.- Returns:
- what
setDefaultLocale(Locale)last stored on this UI; failing that the browser's locale (Accept-Language, via the current UI), and outside a Vaadin request the JVM default
-
revalidate
public void revalidate()- Overrides:
revalidatein classComponent
-
repaint
-
repaint
-
putClientProperty
-
setFont
-
isOptimizedDrawingEnabled
public boolean isOptimizedDrawingEnabled() -
getWidth
-
getHeight
-
isLightweightComponent
-
paint
-
printAll
-
getBorder
-
paintBorder
-
getComponentGraphics
-
isDoubleBuffered
public boolean isDoubleBuffered()- Overrides:
isDoubleBufferedin classComponent
-
paintComponent
-
printComponent
-
printBorder
-
paintChildren
-
printChildren
-
getNextFocusableComponent
Deprecated. -
setNextFocusableComponent
Deprecated.Stored as the JDK's"nextFocus"client property rather than a field, which is what makes the"nextFocus"PropertyChangeEventfire —putClientProperty(Object, Object)fires it, here as in the JDK. What drops is the traversal effect: the JDK's register/deregister pair hands the component to the focus subsystem, andtransferFocushere walks the emulator tree instead (D_focus_managers).- Parameters:
arg0-nullclears the override
-
getClientProperty
-
requestFocus
public void requestFocus()- Overrides:
requestFocusin classComponent
-
requestFocus
public boolean requestFocus(boolean temporary) Description copied from class:ComponentThe legacy "temporary focus" overload. Our peers can't distinguish temporary from permanent focus (the browser has no such concept), so this is the no-arg variant.- Overrides:
requestFocusin classComponent- Returns:
- whether the request reached the peer, not whether the browser accepted it
-
requestFocusInWindow
public boolean requestFocusInWindow()- Overrides:
requestFocusInWindowin classComponent
-
requestFocusInWindow
protected boolean requestFocusInWindow(boolean temporary) - Overrides:
requestFocusInWindowin classComponent
-
getFontMetrics
- Overrides:
getFontMetricsin classComponent
-
setPreferredSize
- Overrides:
setPreferredSizein classComponent
-
getPreferredSize
- Overrides:
getPreferredSizein classContainer
-
setMaximumSize
- Overrides:
setMaximumSizein classComponent
-
getMaximumSize
- Overrides:
getMaximumSizein classContainer
-
setMinimumSize
- Overrides:
setMinimumSizein classComponent
-
getMinimumSize
- Overrides:
getMinimumSizein classContainer
-
getInsets
-
getInsets
-
getAlignmentY
public float getAlignmentY()- Overrides:
getAlignmentYin classContainer
-
getAlignmentX
public float getAlignmentX()- Overrides:
getAlignmentXin classContainer
-
getInputMap
-
getInputMap
-
getActionMap
-
registerKeyboardAction
-
registerKeyboardAction
public void registerKeyboardAction(ActionListener listener, String command, KeyStroke stroke, int condition) -
unregisterKeyboardAction
-
getRegisteredKeyStrokes
-
getConditionForKeyStroke
-
getActionForKeyStroke
-
resetKeyboardActions
public void resetKeyboardActions() -
setInputMap
-
setActionMap
-
getBaseline
public int getBaseline(int arg0, int arg1) - Overrides:
getBaselinein classComponent
-
setVisible
public void setVisible(boolean arg0) - Overrides:
setVisiblein classComponent
-
setEnabled
public void setEnabled(boolean arg0) - Overrides:
setEnabledin classComponent
-
setForeground
- Overrides:
setForegroundin classComponent
-
setBackground
- Overrides:
setBackgroundin classComponent
-
setDefaultLocale
Stored on the current UI, which isgetDefaultLocale()'s scope; the JVM default is never touched, since it is the *server's* and shared by every session. Two consequences of the narrower scope: an F5 lands on a fresh UI and reads the browser's locale again (real Swing'sAppContextwould have survived), and a call with no current UI has nowhere to store and WARNs.- Parameters:
arg0-nullresets to the browser's locale, as the JDK'snullresets to the JVM default
-
processComponentKeyEvent
-
processKeyBinding
-
getToolTipText
-
getToolTipText
-
getX
-
getY
-
scrollRectToVisible
-
disable
-
setAutoscrolls
public void setAutoscrolls(boolean arg0) -
setFocusTraversalKeys
- Overrides:
setFocusTraversalKeysin classContainer
-
reshape
-
computeVisibleRect
-
fireVetoableChange
protected void fireVetoableChange(String arg0, Object arg1, Object arg2) throws PropertyVetoException - Throws:
PropertyVetoException
-
addVetoableChangeListener
-
removeVetoableChangeListener
-
getVetoableChangeListeners
-
addAncestorListener
-
removeAncestorListener
-
getAncestorListeners
-
getListeners
- Overrides:
getListenersin classComponent
-
addNotify
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classContainer
-
paintImmediately
public void paintImmediately(int arg0, int arg1, int arg2, int arg3) -
paintImmediately
-
isPaintingOrigin
protected boolean isPaintingOrigin() -
getUIClassID
-
hide
-
setInheritsPopupMenu
public void setInheritsPopupMenu(boolean arg0) Stores the flag and fires"inheritsPopupMenu"; the inheritance itself is not modelled — a VaadinContextMenubinds to one target element, and walking to an ancestor's menu on a bare right-click has no counterpart. State and notification are owed regardless (R_decline_effect_only, D_owed_events): the flag was previously dropped, sogetInheritsPopupMenucontradicted the setter and no listener ever fired. -
setComponentPopupMenu
-
updateUI
public void updateUI() -
getUI
-
setUI
-
isPaintingTile
public boolean isPaintingTile() -
isPaintingForPrint
public final boolean isPaintingForPrint() -
setRequestFocusEnabled
public void setRequestFocusEnabled(boolean arg0) -
isRequestFocusEnabled
public boolean isRequestFocusEnabled() -
grabFocus
public void grabFocus() -
setVerifyInputWhenFocusTarget
public void setVerifyInputWhenFocusTarget(boolean arg0) Stores the flag and fires"verifyInputWhenFocusTarget"; the gate it controls is not modelled.setInputVerifier(InputVerifier)itself is wired (BlurNotifier-driven), but the JDK applies this flag during focus traversal — asking the component losing focus to verify before the target accepts it — and SB-Emulators has no traversal pipeline to gate (D_focus_managers). State and notification are owed regardless (R_decline_effect_only, D_owed_events). -
getVerifyInputWhenFocusTarget
public boolean getVerifyInputWhenFocusTarget()- Returns:
- what
setVerifyInputWhenFocusTarget(boolean)stored; Swing's default istrue
-
setBorder
-
setAlignmentY
public void setAlignmentY(float arg0) - Parameters:
arg0- clamped into[0, 1], as the JDK's privatevalidateAlignmentdoes —2.0freads back as1.0f
-
setAlignmentX
public void setAlignmentX(float arg0) - Parameters:
arg0- clamped into[0, 1]— seesetAlignmentY(float).
-
setInputVerifier
-
getInputVerifier
-
setDebugGraphicsOptions
public void setDebugGraphicsOptions(int arg0) - Parameters:
arg0- a positive bitmask stores;0is ignored and a negative value clears —DebugGraphicsInfo.setDebugOptions' three branches, measured on JDK 25, whereNONE_OPTION(0) leaves the previous options standing rather than switching debugging off
-
getDebugGraphicsOptions
public int getDebugGraphicsOptions() -
requestDefaultFocus
public boolean requestDefaultFocus() -
setToolTipText
-
getToolTipLocation
-
getPopupLocation
-
createToolTip
-
getAutoscrolls
public boolean getAutoscrolls() -
setTransferHandler
-
getTransferHandler
-
getVisibleRect
-
getTopLevelAncestor
-
isValidateRoot
public boolean isValidateRoot()- Overrides:
isValidateRootin classContainer
-
setDoubleBuffered
public void setDoubleBuffered(boolean arg0)
-