todaysgogl.blogg.se

Jgrasp tutorial
Jgrasp tutorial













The left side of Figure 2-2 shows a physical felt board with a red rectangle and a green oval attached. The pieces stay where the child puts them because felt fibers interlock tightly enough for the pieces to stick together.

jgrasp tutorial

A child creates pictures by taking shapes of colored felt and sticking them onto a large felt board that serves as the background canvas for the picture as a whole.

jgrasp tutorial

In the acm.graphics package, there are counterparts for each of these graphical objects.Īnother metaphor that often helps students understand the conceptual model of the acm.graphics package is that of a felt board—the sort one might find in an elementary school classroom. In the world of the collage artist, those objects might be geometrical shapes, words clipped from newspapers, lines formed from bits of string, or images taken from magazines. The underlying model is similar to that of a collage in which an artist creates a composition by taking various objects and assembling them on a background canvas. When you create a picture using the acm.graphics package, you do so by arranging graphical objects at various positions on a background called a canvas. Class diagram for the acm.graphics package The following section describes the general model in more detail and the later sections offer a closer look at the individual classes in the package.įigure 2-1. When you use acm.graphics, you assemble a picture by constructing various GObjects and adding them to a GCanvas at the appropriate locations. Conceptually, GObject represents the universal class of graphical objects that can be displayed. Most of the classes in the package are subclasses of the abstract class GObject at the center of the diagram. The class structure of acm.graphics package appears in Figure 2-1.

jgrasp tutorial

Jgrasp tutorial how to#

The purpose of this chapter is to give you a working knowledge of the facilities available in the acm.graphics package and how to use them effectively. The HelloGraphics example in Chapter 1 offers a simple example of how to write graphical programs, but does not explain the details behind the methods it contains.













Jgrasp tutorial