|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.api.visual.widget.Widget
org.netbeans.api.visual.widget.ComponentWidget
public class ComponentWidget
This widget allows to use an AWT/Swing component in the scene. The widget itself just represents and reserve the place occupied by the component. When a component is resized, then reserved place is recalculated. The component placement is automatically update based on the placement of the widget. The widget also paints the component in the satelite views.
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget |
---|
Widget.Dependency |
Constructor Summary | |
---|---|
ComponentWidget(Scene scene,
Component component)
Creates a component widget. |
Method Summary | |
---|---|
protected Rectangle |
calculateClientArea()
Calculates a client area from the preferred size of the component. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentWidget(Scene scene, Component component)
scene
- the scenecomponent
- the AWT/Swing componentMethod Detail |
---|
public final Component getComponent()
public final boolean isComponentVisible()
public final void setComponentVisible(boolean componentVisible)
componentVisible
- if true, then the component is visibleprotected final void notifyAdded()
Widget
notifyAdded
in class Widget
protected final void notifyRemoved()
Widget
notifyRemoved
in class Widget
protected final Rectangle calculateClientArea()
calculateClientArea
in class Widget
protected final void paintWidget()
paintWidget
in class Widget
|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |