Back to index

moin  1.9.0~rc2
LineFigure.java
Go to the documentation of this file.
00001 /*
00002  * @(#)LineFigure.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.figures;
00007 
00008 import java.awt.*;
00009 import java.util.*;
00010 import java.io.IOException;
00011 import CH.ifa.draw.framework.*;
00012 import CH.ifa.draw.util.*;
00013 
00017 public  class LineFigure extends PolyLineFigure {
00018 
00019     /*
00020      * Serialization support.
00021      */
00022     private static final long serialVersionUID = 511503575249212371L;
00023     private int lineFigureSerializedDataVersion = 1;
00024 
00028     public LineFigure() {
00029         addPoint(0, 0);
00030         addPoint(0, 0);
00031     }
00032 
00036     public Point startPoint() {
00037         return pointAt(0);
00038     }
00039 
00043     public Point endPoint() {
00044         return pointAt(1);
00045     }
00046 
00050     public void  startPoint(int x, int y) {
00051         setPointAt(new Point(x,y), 0);
00052     }
00053 
00057     public void  endPoint(int x, int y) {
00058         setPointAt(new Point(x,y), 1);
00059     }
00060 
00064     public void setPoints(Point start, Point end) {
00065         setPointAt(start, 0);
00066         setPointAt(end, 1);
00067     }
00068 
00069     public void basicDisplayBox(Point origin, Point corner) {
00070         setPoints(origin, corner);
00071     }
00072 
00073 }