A technical program might employ Java graphics for a number of possible
tasks including :
- Data charting as in a histogram,
pie chart, or other arrangement that summarizes the data in some way.
- Plotting variables against each other as in, for example, a
trajectory showing the coordinates of a ballistic projectile in altitude
versus horizontal distances.
- Animating a simulation of some device or physical process.
- Image processing to bring out features of interest.
A graphical display program would also typically include various control
and data entry components to provide a graphical user interface
(GUI) that allows the user to interact with the presentation. As we saw
in the other sections of this chapter, Java provides lots of tools and
components for building such graphical displays and interfaces.
Of course, many other programs also provide for data display and manipulations,
why use Java for this?
With Java you can build custom graphical programs for tasks where you
can integrate all of the Java features together. For example, an application
program to control and monitor a remote experiment via the web could use
both the graphical and networking capabilities of Java (see Chapter
13). Other examples include applets for technical demonstrations and
interfaces to a database.
Note that you can now obtain libraries,
both commercial and freeware, that provide Java classes and visible components
for charting, image processing, and other graphics related tasks. However,
you will still find it useful to know how to write your own graphics classes
for specialized purposes.