TOC
GraphicRending module:

The GraphicRendering module is responsible for the applet screen updating. This module uses the Composite pattern and it contains the GraphicComponent.java class and GraphicComposite.java class. The GraphicComponent.java is a superclass and the GraphicComposite.java inherites from it. The GraphicComponent.java class implements the IGraphicComponent.java interface. This way, all the Graphics in the applet conform to the IGrpahicComponent.java interface.

When designing the applet, the programmer may see the entire applet screen as a single top-lelvel GraphicComposite. The applet screen then can be divided into some small parts. Each part of the applet screen should be a logical functional unit in the applet simualtion. For example, in the Single-Stage Common-Emitter Amplifier applet, the entire applet screen is the top-level GraphicComposite, which is the MainPanel.java. We have divided the entire applet screen into tow parts. The upper part of the applet is the Amplifier Circuit and the lower part of the applet is the Characteristic Curve part. Each of these parts then is analyzed and to see if itself contains some smaller functional units that can be graphically independent. If so, we can further divide it into smaller parts. In the example applet, the amplifier circuit part is further divided into a circuit, which is sitting in the central area and two moving waveforms -- the input waveform and the output waveform. The lower part is further divided into a set of characteristic curve and also two moving waveforms (input and output waveforms). This procedure is kept going on utill all of the graphical units are logically undivided. This way, all of the graphical units make up a tree structure. On the top is the top-level GraphicComposite, which usually is a subclass of Penal.java. At the end of each branch is a leaf of the tree.

Each of the graphical units except the bottom level leaves should inherite GraphicComposite.java and all the leaves should inherite the GraphicComponent.java. Whenever, there is the need to update the applet screen, we just need to have the top-level GraphicComposite update itself. This top-level GraphicComposite will call its children GraphicComposite and GraphicComponents to update themselves. Recursively all the GraphicComponents will be reached and the entire applet is updated.

The applet's graphics hierarchy is shown in the figure.