|
[Top]
[Next]
1.
An overview of JFDraw architecture
Before
you start your own graph drawing application via JFDraw binary library
or source code. You can take a quick view of JFDraw architecture.
Overview
of JFDraw Binary Library and Source Code architecture.
A JFDraw library is consisted by JFDraw GUI, JFGraph infrustructure,
JFDraw Utilities and 3rd party utilities.
- JFDraw
GUI contains the top level visiable frames, panels and drawing
canvas.
- JFGraph
infrustructure is used for the basic graph processing.
- JFDraw
Utilities are other assistance for drawing and calculating.
- And
with 3rd party libraries for some external file formats output,
such as eps, swf,cgm,etc.
A graph demonstration of this architecture.

(Click on image to enlarge
it)
MVC
architecture in JFDraw.
Three major parts of JFDraw,JFDraw Canvas & GUI, JFDraw Event
and Action dispatcher and JFDraw Infrustructure, consisted the MVC
architecture.

Class
diagram of JFDraw.
The diagram below is a simple and not complete UML class
diagram for JFDraw.
- As
described on the diagram, you can use both CADPane
or DrawPane
class to build your own vector drawing applications. And There
are already some samples in this developer's guide that based
on DrawPane.
- All
shapes will be drawn on DrawCanvas
class, a
DrawCanvas is just a subclass of JPanel.
- All
shapes are stored temporary in a JFPage
object, a JFPage
class is used to represent a JFD/JFX JFDraw file in memory and
objects model.
- JFLayer
class is used to seperate different layers within one JFPage.
- All
shapes are subclasses that are derived from AbstractShape.
- An
AbstractShape object will always has a NodeList,
a PortList,
and a Label
defined internally.
- A NodeList
is used to define the outline of a shape. And a
PortList is used to define the necessary ports to
connect other shapes. And a Label
is just a movable text tag for a shape.
- Some
shapes, e.g. AbstractRectangle,
will assemble some internal basic graph objects, such as Rect,
LineSeg,JFPoint
for graph calculating and processing.

(Click on image to enlarge
it)
[Top]
[Next]
|