|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cs101.awt.Line
Implements a 4-coordinate (+ optional Color) line abstraction with its own drawing method. Also, implements a translation between Line objects and String objects for handling by less intelligent protocols.
Copyright 1996 Massachusetts Institute of Technology
Graphics
Field Summary | |
static java.awt.Color |
DEFAULT_COLOR
This specifies the default color for a line. |
Constructor Summary | |
Line(int startX,
int startY,
int endX,
int endY)
Construct a line, specifying all 4 coordinates and using the default color. |
|
Line(int startX,
int startY,
int endX,
int endY,
java.awt.Color c)
Construct a line, specifying all 4 coordinates and a specific color. |
Method Summary | |
void |
drawOn(java.awt.Graphics g)
|
static Line |
extractLine(java.lang.String s)
Given a String that was originally created by packLine, this function will return a reference to a new Line object that represents the original Line. |
static java.lang.String |
packLine(Line l)
This method converts a Line into a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Color DEFAULT_COLOR
Constructor Detail |
public Line(int startX, int startY, int endX, int endY)
public Line(int startX, int startY, int endX, int endY, java.awt.Color c)
Color
Method Detail |
public void drawOn(java.awt.Graphics g)
public static Line extractLine(java.lang.String s)
packLine(cs101.awt.Line)
public static java.lang.String packLine(Line l)
extractLine(java.lang.String)
|
Scribble Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |