Interface | Description |
---|---|
AppearanceChangeListener |
The listener interface for receiving appearanceChange events.
|
DragListener |
The listener interface for receiving drag events (dragStart, drag, dragEnd),
signalling that a SceneNode is being dragged (with some unspecified
input device).
|
MouseOverListener |
The listener interface for receiving events when the mouse (or some
other pointing device) has entered some part of a
SceneComponenty |
ViewportChangeListener |
The listener interface for receiving viewportChange events.
|
Class | Description |
---|---|
Annotation |
This class captures the information needed to decribe the textual
annotation (a finite number of text strings at given positions) of a scene
graph node.
|
AppearanceChangeEvent |
The event that signals that some element in the scene has changed its
appearance (and hence, for example, repainting the viewer windows is
needed).
|
CoordinateGrid |
A scene component whose geometry is a coordinate grid that fills a
rectangle in user space (usually the viewport of a viewer).
|
CoordinateGridBeanInfo | |
Icon2D | |
SceneComponent |
An implementation of the
SceneNode interface that provides bean
conform "get" and "set" methods for all properties. |
TransformedMouseEvent |
The event that signals that some scene node is being dragged.
|
Viewer2D |
This is a basic viewer for the 2D-scenes in this package.
|
ViewportChangeEvent |
The event that signals that the viewport of some viewer watching the scene
has changed.
|
This package provides a 2D scene graph api based on the rendering capabilities of java.awt.Graphics2D.
The basic element in the 2D scene is a SceneComponent
that provides
all ingredients necessary to draw it: a Shape
that can be filled
with a certain Paint
, whose outline can be drawn using a certain
Stroke
etc.
A Stroke
in Java2D provides a way to create a 2-dimensional
shape (that can be filled with a paint) out of the (in principle infinitely
thin) 1-dimensional outline of a shape, in order to make it visible. Thus,
Java2D provides ways to render 2- and 1-dimensional objects. In technical or
mathematical drawings often also 0-dimensional geometries (points) need
graphical representation. Points can be added to a SceneComponent
by adding them to the list returned by getPoints()
.
A SceneComponent
also can have a textual Annotation
which
is a collection of strings to be drawn at certain positions.
In addition, a SceneComponent
can have children, which allows for a
scene that is a directed acyclic graph. Each scene node can have an affine
transformation (java.awt.geom.AffineTransform
) that describes its
orientation with respect to its parents. All
attributes like paint, stroke, font etc. can be null
, which means
that they are inherited from the scene hierarchy.
To support dynamic and interactive behavior, you can register three types of event
listeners with a SceneComponent
:
AppearanceChangeEvent
is passed along the hierarchy up to its root
to inform viewers that some child SceneComponent
has changed
and therefore the scene needs repainting.The JComponent
Viewer2d
is provided to draw the java2d scene graph.
One can register with a Viewer2d
for the occurrence of a
ViewportChangeEvent
. This can be used to create viewport-dependent
geometries like coordinate axes.