Java Reference
In-Depth Information
Figure 19.1. This visualization adds machines at the top left location of the panel and lets
a user drag machines into place. Users can undo either drags or adds.
The
com.oozinoz.visualization
package contains the classes that support
the visualization. An executable
Visualization
class subclasses from
the
MouseInputAdapter
class, from
java.swing.event
, to simplify listening to mouse
events. The
Visualization
class relies on a
machine.gif
file that must lie in its class
path. Both this class and a
VizPanel
class rely on a
FactoryModel
object that contains
the machine images and their locations. Figure 19.2 shows the classes in the visualization
package.