|
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.Scene
public class Scene
The scene is a widget which also controls and represents whole rendered area.
After all changes in a scene is done, the validate method have to be called for validating changed and calculating new locations and boundaries of all modified widgets.
The scene allows to create a view JComponent which can be used anywhere in Swing based application. Only one view can be created using the createView method. The scene allows to create multiple satellite views using the createSatelliteView method. The satellite view is just showing the scene and allows quick navigator and panning using a mouse.
The scene contains additional scene-specific properties like lookFeel, activeTool, defaultFont, animator.
It is able to create a widget-specific hover action.
Nested Class Summary | |
---|---|
static interface |
Scene.SceneListener
The scene listener which is notified about repainting, validating progress. |
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget |
---|
Widget.Dependency |
Constructor Summary | |
---|---|
Scene()
Creates a scene. |
Method Summary | |
---|---|
void |
addSceneListener(Scene.SceneListener listener)
Registers a scene listener. |
Point |
convertSceneToView(Point sceneLocation)
Converts a location in the scene coordination system to the view coordination system. |
Rectangle |
convertSceneToView(Rectangle sceneRectangle)
Converts a rectangle in the scene coordination system to the view coordination system. |
Point |
convertViewToScene(Point viewLocation)
Converts a location in the view coordination system to the scene coordination system. |
JComponent |
createSatelliteView()
Creates a satellite view. |
JComponent |
createView()
Creates a view. |
WidgetAction |
createWidgetHoverAction()
Creates a widget-specific hover action. |
String |
getActiveTool()
Returns an active tool of the scene. |
Font |
getDefaultFont()
Returns a default font of the scene. |
Widget |
getFocusedWidget()
Returns a focused widget of the scene. |
Graphics2D |
getGraphics()
Returns an instance of Graphics2D which is used for calculating boundaries and rendering all widgets in the scene. |
EventProcessingType |
getKeyEventProcessingType()
Returns a key events processing type of the scene. |
LookFeel |
getLookFeel()
Returns a look'n'feel of the scene. |
Rectangle |
getMaximumBounds()
Returns maximum bounds of the scene. |
WidgetAction.Chain |
getPriorActions()
Returns a prior actions. |
SceneAnimator |
getSceneAnimator()
Returns a scene animator of the scene. |
JComponent |
getView()
Returns an instance of created view |
double |
getZoomFactor()
Returns a zoom factor. |
protected boolean |
isRepaintRequiredForRevalidating()
Returns whether the layer widget requires to repainted after revalidation. |
boolean |
isValidated()
Returns whether the whole scene is validated and there is no widget or region that has to be revalidated. |
void |
paint(Graphics2D graphics)
Paints the whole scene into the graphics instance. |
void |
removeSceneListener(Scene.SceneListener listener)
Unregisters a scene listener. |
void |
setActiveTool(String activeTool)
Sets an active tool. |
void |
setFocusedWidget(Widget focusedWidget)
Sets a focused widget of the scene. |
void |
setKeyEventProcessingType(EventProcessingType keyEventProcessingType)
Sets a key events processing type of the scene. |
void |
setLookFeel(LookFeel lookFeel)
Sets a look'n'feel of the scene. |
void |
setMaximumBounds(Rectangle maximumBounds)
Sets maximum bounds of the scene. |
void |
setZoomFactor(double zoomFactor)
Sets a zoom factor for the scene. |
void |
validate()
Validates all widget in the whole scene. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scene()
Method Detail |
---|
public JComponent createView()
public JComponent getView()
public JComponent createSatelliteView()
public final Graphics2D getGraphics()
getGraphics
in class Widget
public final void paint(Graphics2D graphics)
graphics
- the Graphics2D instance where the scene is going to be paintedpublic final Rectangle getMaximumBounds()
public final void setMaximumBounds(Rectangle maximumBounds)
maximumBounds
- the non-null maximum boundspublic Font getDefaultFont()
public boolean isValidated()
isValidated
in class Widget
protected boolean isRepaintRequiredForRevalidating()
isRepaintRequiredForRevalidating
in class Widget
public final void validate()
public final EventProcessingType getKeyEventProcessingType()
public final void setKeyEventProcessingType(EventProcessingType keyEventProcessingType)
keyEventProcessingType
- the processing type for key eventspublic final WidgetAction.Chain getPriorActions()
public final Widget getFocusedWidget()
public final void setFocusedWidget(Widget focusedWidget)
focusedWidget
- the focused widget; if null, then the scene itself is taken as the focused widgetpublic final double getZoomFactor()
public final void setZoomFactor(double zoomFactor)
zoomFactor
- the zoom factorpublic final SceneAnimator getSceneAnimator()
public final LookFeel getLookFeel()
public final void setLookFeel(LookFeel lookFeel)
lookFeel
- the look'n'feelpublic final String getActiveTool()
public void setActiveTool(String activeTool)
activeTool
- the active tool; if null, then the active tool is unset and only default action chain of widgets will be usedpublic final void addSceneListener(Scene.SceneListener listener)
listener
- the scene listenerpublic final void removeSceneListener(Scene.SceneListener listener)
listener
- the scene listenerpublic final Point convertSceneToView(Point sceneLocation)
sceneLocation
- the scene location
public final Rectangle convertSceneToView(Rectangle sceneRectangle)
sceneRectangle
- the scene rectangle
public Point convertViewToScene(Point viewLocation)
viewLocation
- the view location
public WidgetAction createWidgetHoverAction()
|
org.netbeans.api.visual 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |