Blame java/SpiroCP.java

rpm-build 8267b0
/*
rpm-build 8267b0
libspiro - conversion between spiro control points and bezier's
rpm-build 8267b0
Copyright (C) 2007 Raph Levien
rpm-build 8267b0
              2009 converted to Java by George Williams
rpm-build 8267b0
rpm-build 8267b0
This program is free software; you can redistribute it and/or
rpm-build 8267b0
modify it under the terms of the GNU General Public License
rpm-build 8267b0
as published by the Free Software Foundation; either version 2
rpm-build 8267b0
of the License, or (at your option) any later version.
rpm-build 8267b0
rpm-build 8267b0
This program is distributed in the hope that it will be useful,
rpm-build 8267b0
but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build 8267b0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rpm-build 8267b0
GNU General Public License for more details.
rpm-build 8267b0
rpm-build 8267b0
You should have received a copy of the GNU General Public License
rpm-build 8267b0
along with this program; if not, write to the Free Software
rpm-build 8267b0
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
rpm-build 8267b0
02110-1301, USA.
rpm-build 8267b0
rpm-build 8267b0
*/
rpm-build 8267b0
rpm-build 8267b0
package net.sourceforge.libspiro;
rpm-build 8267b0
rpm-build 8267b0
import static net.sourceforge.libspiro.SpiroPointType.*;
rpm-build 8267b0
rpm-build 8267b0
public class SpiroCP {
rpm-build 8267b0
    public double x,y;
rpm-build 8267b0
    SpiroPointType type;
rpm-build 8267b0
rpm-build 8267b0
    public SpiroCP(double xx, double yy, SpiroPointType ty) {
rpm-build 8267b0
	x = xx; y = yy; type = ty;
rpm-build 8267b0
    }
rpm-build 8267b0
rpm-build 8267b0
    public String toString() {
rpm-build 8267b0
	return( String.format("(%c %g %g)",
rpm-build 8267b0
		    type==CORNER ? 'v' :
rpm-build 8267b0
		    type==G4     ? 'o' :
rpm-build 8267b0
		    type==G2     ? 'c' :
rpm-build 8267b0
		    type==LEFT   ? '[' :
rpm-build 8267b0
		    type==RIGHT  ? ']' :
rpm-build 8267b0
		    type==OPEN   ? '{' :
rpm-build 8267b0
		    type==OPEN_END ? '}' :
rpm-build 8267b0
		         'z',
rpm-build 8267b0
		    x, y ));
rpm-build 8267b0
    }
rpm-build 8267b0
}