001/*
002 * SVG Salamander
003 * Copyright (c) 2004, Mark McKay
004 * All rights reserved.
005 *
006 * Redistribution and use in source and binary forms, with or 
007 * without modification, are permitted provided that the following
008 * conditions are met:
009 *
010 *   - Redistributions of source code must retain the above 
011 *     copyright notice, this list of conditions and the following
012 *     disclaimer.
013 *   - Redistributions in binary form must reproduce the above
014 *     copyright notice, this list of conditions and the following
015 *     disclaimer in the documentation and/or other materials 
016 *     provided with the distribution.
017 *
018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
019 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
020 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
021 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
022 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
023 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
025 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
026 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
029 * OF THE POSSIBILITY OF SUCH DAMAGE. 
030 * 
031 * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
032 * projects can be found at http://www.kitfox.com
033 *
034 * Created on January 26, 2004, 9:18 PM
035 */
036package com.kitfox.svg.pathcmd;
037
038import java.awt.geom.Point2D;
039
040/**
041 * When building a path from command segments, most need to cache information
042 * (such as the point finished at) for future commands. This structure allows
043 * that
044 *
045 * @author Mark McKay
046 * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
047 */
048public class BuildHistory
049{
050
051//    Point2D.Float[] history = new Point2D.Float[2];
052//    Point2D.Float[] history = {new Point2D.Float(), new Point2D.Float()};
053//    Point2D.Float start = new Point2D.Float();
054    Point2D.Float startPoint = new Point2D.Float();
055    Point2D.Float lastPoint = new Point2D.Float();
056    Point2D.Float lastKnot = new Point2D.Float();
057    boolean init;
058    //int length = 0;
059
060    /**
061     * Creates a new instance of BuildHistory
062     */
063    public BuildHistory()
064    {
065    }
066    
067    public void setStartPoint(float x, float y)
068    {
069        startPoint.setLocation(x, y);
070    }
071    
072    public void setLastPoint(float x, float y)
073    {
074        lastPoint.setLocation(x, y);
075    }
076    
077    public void setLastKnot(float x, float y)
078    {
079        lastKnot.setLocation(x, y);
080    }
081//    public void setPoint(float x, float y)
082//    {
083//        history[0].setLocation(x, y);
084//        length = 1;
085//    }
086//    public void setStart(float x, float y)
087//    {
088//        start.setLocation(x, y);
089//    }
090//    public void setPointAndKnot(float x, float y, float kx, float ky)
091//    {
092//        history[0].setLocation(x, y);
093//        history[1].setLocation(kx, ky);
094//        length = 2;
095//    }
096}