|
In this section we look at adding graphics to our Java Tech programs.
The sections include:
- Java Tech Graphics -
overview of graphics in technical programs and what Java offers
to this area.
- Building a plotting package
- we will start here to develop several graphics classes in
the next few chapters that we can use for data plotting in the
programs in the rest of the course.
The demo program here will use
the abstract class PlotPanel
that extends JPanel
and provides a frame with title, horizontal label and scale values
for the axes. The subclass DemoPanel
draws data points within the frame provided by methods in PlotPanel.
The class PlotFormat
uses the DecimalFormat
class to format the axes scale numbers.
- Histogram Display - use a
histogram to illustrate the display of data on a JPanel
component. The demo
applet uses a HistPanel
component class that we will use in subsequent programs.
This component also takes advantage of the formatting
techniques discussed in Chapter
5: Tech for the display of the values on the coordinate axes.
A Histogram
class provides various methods for access to and modification
of the histogram parameters and data.
- Drawing Panel - Polymorphism in action
- the DrawPanel
class takes advantage of polymorphic techniques to overlay drawings
made by instances of DrawFunction
subclasses.
- Exercises - expand on the
demo programs.
|
|
|