public class ComponentWidget extends Widget
When a widget is added into the scene, it has to attach a scene listener for automatic recalculation. The attaching is done automatically for the first time.
Widget.Dependency| Constructor | Description |
|---|---|
ComponentWidget(Scene scene,
java.awt.Component component) |
Creates a component widget.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected java.awt.Rectangle |
calculateClientArea() |
Calculates a client area from the preferred size of the component.
|
java.awt.Component |
getComponent() |
Returns a AWT/Swing component.
|
boolean |
isComponentVisible() |
Returns whether the component should be visible.
|
protected void |
notifyAdded() |
This method is called to notify that the view is shown.
|
protected void |
notifyRemoved() |
This method is called to notify that the view is hidden.
|
protected void |
paintWidget() |
Paints the component widget.
|
void |
setComponentVisible(boolean componentVisible) |
Sets whether the component should be visible.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChild, addChild, addChild, addChild, addChildren, addDependency, bringToBack, bringToFront, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getChildConstraint, getChildren, getClientArea, getCursor, getCursorAt, getDependencies, getFont, getForeground, getGraphics, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getResourceTable, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isRepaintRequiredForRevalidating, isValidated, isVisible, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, notifyStateChanged, paint, paintBackground, paintBorder, paintChildren, removeChild, removeChildren, removeChildren, removeDependency, removeFromParent, repaint, resolveBounds, revalidate, revalidate, setAccessibleContext, setBackground, setBackgroundFromResource, setBorder, setBorder, setCheckClipping, setChildConstraint, setCursor, setEnabled, setFont, setFontFromResource, setForeground, setForegroundFromResource, setLayout, setMaximumSize, setMinimumSize, setOpaque, setPreferredBounds, setPreferredLocation, setPreferredSize, setResourceTable, setState, setToolTipText, setVisible, updateResourcespublic ComponentWidget(Scene scene, java.awt.Component component)
scene - the scenecomponent - the AWT/Swing componentpublic final java.awt.Component getComponent()
public final boolean isComponentVisible()
public final void setComponentVisible(boolean componentVisible)
componentVisible - if true, then the component is visibleprotected final void notifyAdded()
WidgetnotifyAdded in class Widgetprotected final void notifyRemoved()
WidgetnotifyRemoved in class Widgetprotected final java.awt.Rectangle calculateClientArea()
calculateClientArea in class Widgetprotected final void paintWidget()
paintWidget in class WidgetBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.