/
dot-dot
dot
Title:TThier/Languages/java/AWTdemos/AWTdemo03/
Author: Dan Bikle
This page contains a demonstration of AWT which is a technology designed
for developers who want to GUI Java objects. The first class in this demonstration
is listed below:
MainHolder.java
The above class is only used to call main() which instantiates the FrameHolder class
which is displayed below:
FrameHolder.java
The FrameHolder class does a little more but not much. Its primary purpose is to
hold a frame named BikleFrame which is displayed below:
BikleFrame.java
The BikleFrame class is a little bit like the FrameHolder class. It
contains an object. Instead of a Frame object, however, it holds a
java.awt.ScrollPane object. This ScrollPane object is also like the
FrameHolder class because it also holds an object. The object it
holds is a BikleCanvas object. The BikleCanvas class is displayed below:
BikleCanvas.java
When we compare FrameHolder.java to BikleFrame.java we see that they both
make a call to the setSize() method:
FrameHolder.java: aBikleFrame.setSize(500, 500);
BikleFrame.java: aBikleCanvas.setSize(700,2400);
Notice that although aBikleCanvas is larger than aBikleFrame,
we may put aBikleCanvas inside aBikleFrame due to how we make use of
aScrollPane. It is actually quite simple. Instead of directly placing
aBikleCanvas in aBikleFrame, we place aBikleCanvas in aScrollPane and
then put aScrollPane in aBikleFrame:
So, the AWT portion of this demonstration is simple. What makes the demonstration a bit
more interesting is what I call the data portion.
I begin a discussion about the data portion with a simple ASCII diagram which contains
hyper text links to descriptive files. It is obvious from the diagram below that
the data begins in a file named periodicTable.xml and travels through three layers
of objects before it is displayed in aBikleCanvas object:
periodicTable.xml
|
| dataMovement1.html
|
V
org.w3c.dom.Document
|
| dataMovement2.html
|
V
PeriodicTableInXML.java
|
| dataMovement3.html
|
V
PeriodicTable.java
|
| dataMovement4.html
|
V
BikleCanvas.java
The diagram tells us that aBikleCanvas object obtains its data from aPeriodicTable object which
gets its data from an XML document named periodicTable.xml
An image of the resulting BikleCanvas object is displayed below:
aBikleCanvas.png
A demonstration of creating a BikleCanvas object from a Linux command line is linked below:
createABikleCanvas.html
A more portable method, based on Ant, which demonstrates creating a BikleCanvas object is linked below:
antABikleCanvas.html
Javadoc for all of the classes is linked below:
javadoc/index.html
The script I used to create the above javadoc is linked below:
javaDoc.sh
A screen dump from the above script is linked below:
javaDocSD.txt
A UML diagram showing relationships between the classes is linked below:
AWTdemo03.jpg
The above diagram tells you that PeriodicTable depends on PeriodicTableInXML.
Then, it tells you that most of the other classes depend on PeriodicTable.
|