The abstract shape class
Example 23.13: The abstract shape class
package elharo.vrml;
public abstract class shape {
double x = 0.0;
double y = 0.0;
double z = 0.0;
public void moveTo(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public void moveRelative(double x, double y, double z) {
this.x += x;
this.y += y;
this.z += z;
}
public abstract String draw() ;
}
This class is subclassed to provide implementations for specific shapes like cubes, spheres and cones.
Copyright 1996 Elliotte Rusty Harold
elharo@sunsite.unc.edu
This Chapter
Examples
Home
Wyszukiwarka