| Table of contents |
Library Overview
Java provides powerful functionality for 2-dimensional graphics, usually summarized under the name "Java2D". Since Java2D works like a rendering pipeline (geometry, colors etc. are just sequentially handed to the rendering engine), it is too low level to be directly used for describing an interactive 2D-scene in an Oorange network. This is why Oorange, for the purpose of examples, ships with a class library java2d that offers a simple scenegraph api based on Java2D.
A java2d scene is a directed graph without directed cycles whose vertices implement the interface SceneNode. Scene nodes describe a geometric shape with all information like outline, transformation, color, textual annotation etc. Scene nodes can be added to appropriate viewer windows to display them (and all their descendents in the scene hierarchy). For more information we refer to the documentation of the java2d package.
Node Descriptions
Area
This node takes ajava2d.SceneNode and extracts its shape as a java.awt.geom.Area (an object that just describes a subset of the plane in a form suitable in computational geometry algorithms).
| Ingredient ports:
|
Disk
This node represents a java2d.SceneComponent with the circular unit disk as its shape.
| Suggested modifications:
|
SceneComponentForArea
This node takes an java.awt.geom.Area (an object that just describes a subset of the plane in a form suitable in computational geometry algorithms) and uses it as the shape of a java2d.SceneComponent. This adds graphical properties (color, outline etc.) to the area that are needed for drawing it using a Viewer2D.
| Ingredient ports:
|
Viewer2D
This node represents an viewer widget for java2d scenes.
| Ingredient ports:
|
Viewer2DWithGrid
This node represents an viewer widget for java2d scenes. In addition it displays in the background a coordinate grid for better orientation.
| Ingredient ports:
|