- /**
- * Write a description of class FreehandLine here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- import objectdraw.*;
- public class FreehandLine
- {
- private static final int MAXSEGMENTS = 1000;
- private int numSegments = 0;
- /**
- * Constructor for objects of class FreehandLine
- */
- public FreehandLine()
- {
- }
- if (numSegments < MAXSEGMENTS) {
- segments[numSegments] = someLine;
- numSegments++;
- }
- }
- public void hide() {
- for (int i = 0; i < numSegments; i++) {
- segments[i].hide();
- }
- }
- }
Raw Paste