Now the function area can be used from the out side more easily as it now provides additional settings.
This commit is contained in:
		@@ -2,12 +2,22 @@ package eva2.gui;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import java.awt.*;
 | 
			
		||||
 | 
			
		||||
import java.awt.BasicStroke;
 | 
			
		||||
import java.awt.Graphics2D;
 | 
			
		||||
import java.awt.Point;
 | 
			
		||||
import java.awt.Stroke;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
 | 
			
		||||
import eva2.tools.IntegerArrayList;
 | 
			
		||||
import eva2.tools.chart2d.*;
 | 
			
		||||
import eva2.tools.chart2d.DArray;
 | 
			
		||||
import eva2.tools.chart2d.DBorder;
 | 
			
		||||
import eva2.tools.chart2d.DComponent;
 | 
			
		||||
import eva2.tools.chart2d.DIntDoubleMap;
 | 
			
		||||
import eva2.tools.chart2d.DMeasures;
 | 
			
		||||
import eva2.tools.chart2d.DPoint;
 | 
			
		||||
import eva2.tools.chart2d.DPointIcon;
 | 
			
		||||
import eva2.tools.chart2d.DPointSet;
 | 
			
		||||
import eva2.tools.chart2d.DRectangle;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -21,32 +31,86 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
{
 | 
			
		||||
    //~ Instance fields ////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    protected ArrayList<DPointIcon> m_IconsMI = new ArrayList<DPointIcon>();
 | 
			
		||||
    protected DIntDoubleMap xMI;
 | 
			
		||||
    protected DIntDoubleMap yMI;
 | 
			
		||||
    /**
 | 
			
		||||
     * this class stores the jump positions (see this.jump)
 | 
			
		||||
     */
 | 
			
		||||
    class JumpManager
 | 
			
		||||
    {
 | 
			
		||||
        protected int index = -1;
 | 
			
		||||
        protected IntegerArrayList jumps = new IntegerArrayList();
 | 
			
		||||
 | 
			
		||||
        public void addJump()
 | 
			
		||||
        {
 | 
			
		||||
            jumps.add(getSize());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public boolean hasMoreIntervals()
 | 
			
		||||
        {
 | 
			
		||||
            return index < jumps.size();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public int[] nextInterval()
 | 
			
		||||
        {
 | 
			
		||||
            int no_jumps = jumps.size();
 | 
			
		||||
 | 
			
		||||
            if (index >= no_jumps)
 | 
			
		||||
            {
 | 
			
		||||
                throw new ArrayIndexOutOfBoundsException(
 | 
			
		||||
                    "No more intervals in JumpManager");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            int[] inter = new int[2];
 | 
			
		||||
 | 
			
		||||
            if (index == -1)
 | 
			
		||||
            {
 | 
			
		||||
                inter[0] = 0;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                inter[0] = jumps.get(index);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            index++;
 | 
			
		||||
 | 
			
		||||
            if (index < no_jumps)
 | 
			
		||||
            {
 | 
			
		||||
                inter[1] = jumps.get(index);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                inter[1] = getSize();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return inter;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void reset()
 | 
			
		||||
        {
 | 
			
		||||
            index = -1;
 | 
			
		||||
            jumps.clear();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void restore()
 | 
			
		||||
        {
 | 
			
		||||
            index = -1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    protected boolean connectedMI;
 | 
			
		||||
    protected DPointIcon iconMI = null;
 | 
			
		||||
    protected DPointSetMultiIcon.JumpManager jumperMI = new DPointSetMultiIcon.JumpManager();
 | 
			
		||||
    protected ArrayList<DPointIcon> m_IconsMI = new ArrayList<DPointIcon>();
 | 
			
		||||
    protected Stroke strokeMI = new BasicStroke();
 | 
			
		||||
    protected boolean connectedMI;
 | 
			
		||||
    protected DIntDoubleMap xMI;
 | 
			
		||||
 | 
			
		||||
    //~ Constructors ///////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    protected DIntDoubleMap yMI;
 | 
			
		||||
 | 
			
		||||
    public DPointSetMultiIcon()
 | 
			
		||||
    {
 | 
			
		||||
        this(10, 2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public DPointSetMultiIcon(int initial_capacity)
 | 
			
		||||
    {
 | 
			
		||||
        this(initial_capacity, 2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public DPointSetMultiIcon(int initial_capacity, int length_multiplier)
 | 
			
		||||
    {
 | 
			
		||||
        this(new DArray(initial_capacity, length_multiplier),
 | 
			
		||||
            new DArray(initial_capacity, length_multiplier));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public DPointSetMultiIcon(DIntDoubleMap x_values, DIntDoubleMap y_values)
 | 
			
		||||
    {
 | 
			
		||||
        if (x_values.getSize() != y_values.getSize())
 | 
			
		||||
@@ -61,37 +125,30 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        setDBorder(new DBorder(1, 1, 1, 1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //~ Methods ////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    public void setConnected(boolean aFlag)
 | 
			
		||||
    public DPointSetMultiIcon(int initial_capacity)
 | 
			
		||||
    {
 | 
			
		||||
        boolean changed = !(aFlag == connectedMI);
 | 
			
		||||
        connectedMI = aFlag;
 | 
			
		||||
 | 
			
		||||
        if (changed)
 | 
			
		||||
        {
 | 
			
		||||
            repaint();
 | 
			
		||||
        }
 | 
			
		||||
        this(initial_capacity, 2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method puts the given DPoint at the given position in the set
 | 
			
		||||
     *
 | 
			
		||||
     * @param index the index of the point
 | 
			
		||||
     * @param p     the point to insert
 | 
			
		||||
     */
 | 
			
		||||
    public void setDPoint(int index, DPoint p)
 | 
			
		||||
    {
 | 
			
		||||
        if (index >= xMI.getSize())
 | 
			
		||||
        {
 | 
			
		||||
            throw new ArrayIndexOutOfBoundsException(index);
 | 
			
		||||
        }
 | 
			
		||||
    //~ Methods ////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    public DPointSetMultiIcon(int initial_capacity, int length_multiplier)
 | 
			
		||||
    {
 | 
			
		||||
        this(new DArray(initial_capacity, length_multiplier),
 | 
			
		||||
            new DArray(initial_capacity, length_multiplier));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void addDPoint(double x, double y)
 | 
			
		||||
    {
 | 
			
		||||
        addDPoint(new DPoint(x, y));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void addDPoint(DPoint p)
 | 
			
		||||
    {
 | 
			
		||||
        xMI.addImage(p.x);
 | 
			
		||||
        yMI.addImage(p.y);
 | 
			
		||||
        m_IconsMI.add(p.getIcon());
 | 
			
		||||
        rectangle.insert(p);
 | 
			
		||||
        xMI.setImage(index, p.x);
 | 
			
		||||
        yMI.setImage(index, p.y);
 | 
			
		||||
        m_IconsMI.set(index, p.getIcon());
 | 
			
		||||
        restore();
 | 
			
		||||
        repaint();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -120,29 +177,6 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        return new DPointSet(xMI, yMI);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public ArrayList<DPointIcon> getIconsMI() {
 | 
			
		||||
        return this.m_IconsMI;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method sets an icon for a better displaying of the point set
 | 
			
		||||
     *
 | 
			
		||||
     * @param icon the DPointIcon
 | 
			
		||||
     */
 | 
			
		||||
    public void setIcon(DPointIcon icon)
 | 
			
		||||
    {
 | 
			
		||||
        this.iconMI = icon;
 | 
			
		||||
 | 
			
		||||
        if (icon == null)
 | 
			
		||||
        {
 | 
			
		||||
            setDBorder(new DBorder(1, 1, 1, 1));
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            setDBorder(icon.getDBorder());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method returns the current icon of the point set
 | 
			
		||||
     *
 | 
			
		||||
@@ -153,6 +187,10 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        return iconMI;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public ArrayList<DPointIcon> getIconsMI() {
 | 
			
		||||
        return this.m_IconsMI;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method returns the nearest <code>DPoint</code> in this <code>DPointSet</code>.
 | 
			
		||||
     *
 | 
			
		||||
@@ -213,23 +251,6 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        return size;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *  method sets the stroke of the line
 | 
			
		||||
     *  if the points were not connected, they now will be connected
 | 
			
		||||
     *
 | 
			
		||||
     * @param s the new stroke
 | 
			
		||||
     */
 | 
			
		||||
    public void setStroke(Stroke s)
 | 
			
		||||
    {
 | 
			
		||||
        if (s == null)
 | 
			
		||||
        {
 | 
			
		||||
            s = new BasicStroke();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        strokeMI = s;
 | 
			
		||||
        repaint();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method returns the current stroke of the line
 | 
			
		||||
     *
 | 
			
		||||
@@ -240,20 +261,6 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        return strokeMI;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void addDPoint(DPoint p)
 | 
			
		||||
    {
 | 
			
		||||
        xMI.addImage(p.x);
 | 
			
		||||
        yMI.addImage(p.y);
 | 
			
		||||
        m_IconsMI.add(p.getIcon());
 | 
			
		||||
        rectangle.insert(p);
 | 
			
		||||
        repaint();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void addDPoint(double x, double y)
 | 
			
		||||
    {
 | 
			
		||||
        addDPoint(new DPoint(x, y));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * This method causes the DPointSet to interupt the connected painting at the
 | 
			
		||||
     * current position.
 | 
			
		||||
@@ -398,20 +405,6 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        jumperMI.reset();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        String text = "eva2.tools.chart2d.DPointSet[size:" + getSize();
 | 
			
		||||
 | 
			
		||||
        for (int i = 0; i < xMI.getSize(); i++)
 | 
			
		||||
        {
 | 
			
		||||
            text += (",(" + xMI.getImage(i) + "," + yMI.getImage(i) + ")");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        text += "]";
 | 
			
		||||
 | 
			
		||||
        return text;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected void restore()
 | 
			
		||||
    {
 | 
			
		||||
        if (getSize() == 0)
 | 
			
		||||
@@ -428,71 +421,88 @@ public class DPointSetMultiIcon extends DComponent
 | 
			
		||||
        rectangle = new DRectangle(min_x, min_y, max_x - min_x, max_y - min_y);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //~ Inner Classes //////////////////////////////////////////////////////////
 | 
			
		||||
    public void setConnected(boolean aFlag)
 | 
			
		||||
    {
 | 
			
		||||
        boolean changed = !(aFlag == connectedMI);
 | 
			
		||||
        connectedMI = aFlag;
 | 
			
		||||
 | 
			
		||||
        if (changed)
 | 
			
		||||
        {
 | 
			
		||||
            repaint();
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * this class stores the jump positions (see this.jump)
 | 
			
		||||
     * method puts the given DPoint at the given position in the set
 | 
			
		||||
     *
 | 
			
		||||
     * @param index the index of the point
 | 
			
		||||
     * @param p     the point to insert
 | 
			
		||||
     */
 | 
			
		||||
    class JumpManager
 | 
			
		||||
    public void setDPoint(int index, DPoint p)
 | 
			
		||||
    {
 | 
			
		||||
        protected IntegerArrayList jumps = new IntegerArrayList();
 | 
			
		||||
        protected int index = -1;
 | 
			
		||||
 | 
			
		||||
        public void addJump()
 | 
			
		||||
        if (index >= xMI.getSize())
 | 
			
		||||
        {
 | 
			
		||||
            jumps.add(getSize());
 | 
			
		||||
            throw new ArrayIndexOutOfBoundsException(index);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public boolean hasMoreIntervals()
 | 
			
		||||
        rectangle.insert(p);
 | 
			
		||||
        xMI.setImage(index, p.x);
 | 
			
		||||
        yMI.setImage(index, p.y);
 | 
			
		||||
        m_IconsMI.set(index, p.getIcon());
 | 
			
		||||
        restore();
 | 
			
		||||
        repaint();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * method sets an icon for a better displaying of the point set
 | 
			
		||||
     *
 | 
			
		||||
     * @param icon the DPointIcon
 | 
			
		||||
     */
 | 
			
		||||
    public void setIcon(DPointIcon icon)
 | 
			
		||||
    {
 | 
			
		||||
        this.iconMI = icon;
 | 
			
		||||
 | 
			
		||||
        if (icon == null)
 | 
			
		||||
        {
 | 
			
		||||
            return index < jumps.size();
 | 
			
		||||
            setDBorder(new DBorder(1, 1, 1, 1));
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            setDBorder(icon.getDBorder());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     *  method sets the stroke of the line
 | 
			
		||||
     *  if the points were not connected, they now will be connected
 | 
			
		||||
     *
 | 
			
		||||
     * @param s the new stroke
 | 
			
		||||
     */
 | 
			
		||||
    public void setStroke(Stroke s)
 | 
			
		||||
    {
 | 
			
		||||
        if (s == null)
 | 
			
		||||
        {
 | 
			
		||||
            s = new BasicStroke();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public int[] nextInterval()
 | 
			
		||||
        strokeMI = s;
 | 
			
		||||
        repaint();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //~ Inner Classes //////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        String text = "eva2.tools.chart2d.DPointSet[size:" + getSize();
 | 
			
		||||
 | 
			
		||||
        for (int i = 0; i < xMI.getSize(); i++)
 | 
			
		||||
        {
 | 
			
		||||
            int no_jumps = jumps.size();
 | 
			
		||||
 | 
			
		||||
            if (index >= no_jumps)
 | 
			
		||||
            {
 | 
			
		||||
                throw new ArrayIndexOutOfBoundsException(
 | 
			
		||||
                    "No more intervals in JumpManager");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            int[] inter = new int[2];
 | 
			
		||||
 | 
			
		||||
            if (index == -1)
 | 
			
		||||
            {
 | 
			
		||||
                inter[0] = 0;
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                inter[0] = jumps.get(index);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            index++;
 | 
			
		||||
 | 
			
		||||
            if (index < no_jumps)
 | 
			
		||||
            {
 | 
			
		||||
                inter[1] = jumps.get(index);
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                inter[1] = getSize();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return inter;
 | 
			
		||||
            text += (",(" + xMI.getImage(i) + "," + yMI.getImage(i) + ")");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void reset()
 | 
			
		||||
        {
 | 
			
		||||
            index = -1;
 | 
			
		||||
            jumps.clear();
 | 
			
		||||
        }
 | 
			
		||||
        text += "]";
 | 
			
		||||
 | 
			
		||||
        public void restore()
 | 
			
		||||
        {
 | 
			
		||||
            index = -1;
 | 
			
		||||
        }
 | 
			
		||||
        return text;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 
 | 
			
		||||
@@ -950,6 +950,22 @@ public class FunctionArea extends DArea implements Serializable {
 | 
			
		||||
		repaint();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Shows the legend or switches it off.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param on
 | 
			
		||||
	 */
 | 
			
		||||
	public void showLegend(boolean on) {
 | 
			
		||||
		m_legend = on;
 | 
			
		||||
		if (on) {
 | 
			
		||||
			if (legendBox == null)
 | 
			
		||||
				legendBox = new GraphPointSetLegend(m_PointSetContainer);
 | 
			
		||||
		} else {
 | 
			
		||||
			legendBox = null;
 | 
			
		||||
		}
 | 
			
		||||
		repaint();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	  *
 | 
			
		||||
	  */
 | 
			
		||||
 
 | 
			
		||||
@@ -33,23 +33,86 @@ import eva2.tools.math.Mathematics;
 | 
			
		||||
  *
 | 
			
		||||
  */
 | 
			
		||||
public class GraphPointSet {
 | 
			
		||||
	private String m_InfoString = "Incomplete_Run";
 | 
			
		||||
	private int m_GraphLabel;
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 */
 | 
			
		||||
	class PointSet implements Serializable {
 | 
			
		||||
		/**
 | 
			
		||||
		 * Generated serial version identifier
 | 
			
		||||
		 */
 | 
			
		||||
		private static final long serialVersionUID = -5863595580492128866L;
 | 
			
		||||
		private Color m_Color;
 | 
			
		||||
		private double[] m_X;
 | 
			
		||||
		private double[] m_Y;
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @param pointset
 | 
			
		||||
		 */
 | 
			
		||||
		public PointSet(DPointSet pointset) {
 | 
			
		||||
			m_Color = pointset.getColor();
 | 
			
		||||
			m_X = new double[pointset.getSize()];
 | 
			
		||||
			m_Y = new double[pointset.getSize()];
 | 
			
		||||
			for (int i = 0; i < pointset.getSize(); i++) {
 | 
			
		||||
				DPoint point = pointset.getDPoint(i);
 | 
			
		||||
				m_X[i] = point.x;
 | 
			
		||||
				m_Y[i] = point.y;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @return
 | 
			
		||||
		 */
 | 
			
		||||
		public DPointSet getDPointSet() {
 | 
			
		||||
			DPointSet ret = new DPointSet(100);
 | 
			
		||||
			ret.setColor(m_Color);
 | 
			
		||||
			for (int i = 0; i < m_X.length; i++)
 | 
			
		||||
				ret.addDPoint(m_X[i], m_Y[i]);
 | 
			
		||||
			return ret;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @return
 | 
			
		||||
		 */
 | 
			
		||||
		public int getSize() {
 | 
			
		||||
			return m_X.length;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// /**
 | 
			
		||||
		// *
 | 
			
		||||
		// */
 | 
			
		||||
		// public DPointSet printPoints() {
 | 
			
		||||
		// for (int i = 0; i < m_ConnectedPointSet.getSize();i++) {
 | 
			
		||||
		// DPoint p = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
		// double x = p.x;
 | 
			
		||||
		// double y = p.y;
 | 
			
		||||
		// //System.out.println("point "+i+ " x= "+x+"y= "+y);
 | 
			
		||||
		// }
 | 
			
		||||
		// return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
		// }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private int colorOffset = 0;
 | 
			
		||||
	private ArrayList<PointSet> m_PointSetContainer = new ArrayList<PointSet>();
 | 
			
		||||
	private float m_Stroke = (float) 1.0;
 | 
			
		||||
	private boolean m_isStatisticsGraph = false;
 | 
			
		||||
	// private DPointSet m_PointSet_1;
 | 
			
		||||
	// private DPointSet m_PointSet_2;
 | 
			
		||||
	// private DPointSet m_PointSet_3;
 | 
			
		||||
	private DPointSetMultiIcon m_ConnectedPointSet;
 | 
			
		||||
	private DArea m_Area;
 | 
			
		||||
	private Color m_Color;
 | 
			
		||||
	private DPointIcon m_Icon;
 | 
			
		||||
	private int m_CacheIndex = 0;
 | 
			
		||||
	private int m_CacheSize = 0;
 | 
			
		||||
	private double[] m_cachex;
 | 
			
		||||
	private double[] m_cachey;
 | 
			
		||||
	private Color m_Color;
 | 
			
		||||
	// private DPointSet m_PointSet_1;
 | 
			
		||||
	// private DPointSet m_PointSet_2;
 | 
			
		||||
	// private DPointSet m_PointSet_3;
 | 
			
		||||
	private DPointSetMultiIcon m_ConnectedPointSet;
 | 
			
		||||
	private int m_GraphLabel;
 | 
			
		||||
	private DPointIcon m_Icon;
 | 
			
		||||
	private String m_InfoString = "Incomplete_Run";
 | 
			
		||||
	private boolean m_isStatisticsGraph = false;
 | 
			
		||||
	private ArrayList<PointSet> m_PointSetContainer = new ArrayList<PointSet>();
 | 
			
		||||
 | 
			
		||||
	private float m_Stroke = (float) 1.0;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
   *
 | 
			
		||||
@@ -87,61 +150,6 @@ public class GraphPointSet {
 | 
			
		||||
		initGraph(Area);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param index
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	private Color indexToColor(int index) {
 | 
			
		||||
		Color c = Color.black;
 | 
			
		||||
		int k = index % 10;
 | 
			
		||||
		switch (k) {
 | 
			
		||||
		case 0:
 | 
			
		||||
			c = Color.black;
 | 
			
		||||
			break;
 | 
			
		||||
		case 1:
 | 
			
		||||
			c = Color.red;
 | 
			
		||||
			break;
 | 
			
		||||
		case 2:
 | 
			
		||||
			c = Color.blue;
 | 
			
		||||
			break;
 | 
			
		||||
		case 3:
 | 
			
		||||
			c = Color.pink;
 | 
			
		||||
			break;
 | 
			
		||||
		case 4:
 | 
			
		||||
			c = Color.green;
 | 
			
		||||
			break;
 | 
			
		||||
		case 5:
 | 
			
		||||
			c = Color.gray;
 | 
			
		||||
			break;
 | 
			
		||||
		case 6:
 | 
			
		||||
			c = Color.magenta;
 | 
			
		||||
			break;
 | 
			
		||||
		case 7:
 | 
			
		||||
			c = Color.cyan;
 | 
			
		||||
			break;
 | 
			
		||||
		case 8:
 | 
			
		||||
			c = Color.orange;
 | 
			
		||||
			break;
 | 
			
		||||
		case 9:
 | 
			
		||||
			c = Color.darkGray;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		return c;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Increase the color sequentially.
 | 
			
		||||
	 */
 | 
			
		||||
	public void incColor() {
 | 
			
		||||
		colorOffset++;
 | 
			
		||||
		setColor(indexToColor(m_GraphLabel + colorOffset));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void setColorByIndex(int i) {
 | 
			
		||||
		setColor(indexToColor(i));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param size
 | 
			
		||||
@@ -184,107 +192,6 @@ public class GraphPointSet {
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSet printPoints() {
 | 
			
		||||
		for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) {
 | 
			
		||||
			DPoint p = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
			double x = p.x;
 | 
			
		||||
			double y = p.y;
 | 
			
		||||
			System.out.println("point " + i + " x = " + x + "y = " + y);
 | 
			
		||||
		}
 | 
			
		||||
		return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public Color getColor() {
 | 
			
		||||
		return m_ConnectedPointSet.getColor();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param c
 | 
			
		||||
	 */
 | 
			
		||||
	public void setColor(Color c) {
 | 
			
		||||
		m_Color = c;
 | 
			
		||||
		m_ConnectedPointSet.setColor(m_Color);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSet getConnectedPointSet() {
 | 
			
		||||
		return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSetMultiIcon getReference2ConnectedPointSet() {
 | 
			
		||||
		return m_ConnectedPointSet;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param Area
 | 
			
		||||
	 */
 | 
			
		||||
	public void initGraph(DArea Area) {
 | 
			
		||||
		m_Area = Area;
 | 
			
		||||
		m_Area.addDElement(m_ConnectedPointSet);
 | 
			
		||||
		((FunctionArea) m_Area).addGraphPointSet(this);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_1);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_2);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_3);
 | 
			
		||||
		// DPointIcon icon1 = new DPointIcon(){
 | 
			
		||||
		// public void paint( Graphics g ){
 | 
			
		||||
		// g.drawLine(-2, 0, 2, 0);
 | 
			
		||||
		// g.drawLine(0, 0, 0, 4);
 | 
			
		||||
		// }
 | 
			
		||||
		// public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); }
 | 
			
		||||
		// };
 | 
			
		||||
		// DPointIcon icon2 = new DPointIcon(){
 | 
			
		||||
		// public void paint( Graphics g ){
 | 
			
		||||
		// g.drawLine(-2, 0, 2, 0);
 | 
			
		||||
		// g.drawLine(0, 0, 0, -4);
 | 
			
		||||
		// }
 | 
			
		||||
		// public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); }
 | 
			
		||||
		// };
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPoint getNearestDPoint(DPoint p) {
 | 
			
		||||
		return m_ConnectedPointSet.getNearestDPoint(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Causes the PointSet to interupt the connected painting at the current
 | 
			
		||||
	 * position.
 | 
			
		||||
	 */
 | 
			
		||||
	public void jump() {
 | 
			
		||||
		m_ConnectedPointSet.jump();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 */
 | 
			
		||||
	public void removeAllPoints() {
 | 
			
		||||
		m_ConnectedPointSet.removeAllPoints();
 | 
			
		||||
		// m_PointSet_1.removeAllPoints();
 | 
			
		||||
		// m_PointSet_2.removeAllPoints();
 | 
			
		||||
		// m_PointSet_3.removeAllPoints();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param x
 | 
			
		||||
@@ -313,67 +220,6 @@ public class GraphPointSet {
 | 
			
		||||
		m_ConnectedPointSet.addDPoint(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 */
 | 
			
		||||
	public void setIcon(DPointIcon p) {
 | 
			
		||||
		this.m_Icon = p;
 | 
			
		||||
		this.m_ConnectedPointSet.setIcon(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 */
 | 
			
		||||
	public void setConnectedMode(boolean p) {
 | 
			
		||||
		m_ConnectedPointSet.setConnected(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public boolean isStatisticsGraph() {
 | 
			
		||||
		return m_isStatisticsGraph;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public int getPointCount() {
 | 
			
		||||
		return m_ConnectedPointSet.getSize();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public PointSet getPointSet() {
 | 
			
		||||
		return new PointSet(this.m_ConnectedPointSet.getDPointSet());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param x
 | 
			
		||||
	 */
 | 
			
		||||
	public void removePoint(DPoint x) {
 | 
			
		||||
		System.out.println("removePoint " + x.x + " " + x.y);
 | 
			
		||||
		DPoint[] buf = new DPoint[m_ConnectedPointSet.getSize()];
 | 
			
		||||
		for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) {
 | 
			
		||||
			buf[i] = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
		}
 | 
			
		||||
		m_ConnectedPointSet.removeAllPoints();
 | 
			
		||||
		for (int i = 0; i < buf.length; i++) {
 | 
			
		||||
			if (buf[i].x == x.x && buf[i].y == x.y)
 | 
			
		||||
				System.out.println("point found");
 | 
			
		||||
			else
 | 
			
		||||
				m_ConnectedPointSet.addDPoint(buf[i]);
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Add a graph to another one forming a statistics graph if it isnt one
 | 
			
		||||
	 * already.
 | 
			
		||||
@@ -474,6 +320,22 @@ public class GraphPointSet {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public Color getColor() {
 | 
			
		||||
		return m_ConnectedPointSet.getColor();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSet getConnectedPointSet() {
 | 
			
		||||
		return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
@@ -495,6 +357,207 @@ public class GraphPointSet {
 | 
			
		||||
		return m_InfoString;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPoint getNearestDPoint(DPoint p) {
 | 
			
		||||
		return m_ConnectedPointSet.getNearestDPoint(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public int getPointCount() {
 | 
			
		||||
		return m_ConnectedPointSet.getSize();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public PointSet getPointSet() {
 | 
			
		||||
		return new PointSet(this.m_ConnectedPointSet.getDPointSet());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSetMultiIcon getReference2ConnectedPointSet() {
 | 
			
		||||
		return m_ConnectedPointSet;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Increase the color sequentially.
 | 
			
		||||
	 */
 | 
			
		||||
	public void incColor() {
 | 
			
		||||
		colorOffset++;
 | 
			
		||||
		setColor(indexToColor(m_GraphLabel + colorOffset));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param index
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	private Color indexToColor(int index) {
 | 
			
		||||
		Color c = Color.black;
 | 
			
		||||
		int k = index % 10;
 | 
			
		||||
		switch (k) {
 | 
			
		||||
		case 0:
 | 
			
		||||
			c = Color.black;
 | 
			
		||||
			break;
 | 
			
		||||
		case 1:
 | 
			
		||||
			c = Color.red;
 | 
			
		||||
			break;
 | 
			
		||||
		case 2:
 | 
			
		||||
			c = Color.blue;
 | 
			
		||||
			break;
 | 
			
		||||
		case 3:
 | 
			
		||||
			c = Color.pink;
 | 
			
		||||
			break;
 | 
			
		||||
		case 4:
 | 
			
		||||
			c = Color.green;
 | 
			
		||||
			break;
 | 
			
		||||
		case 5:
 | 
			
		||||
			c = Color.gray;
 | 
			
		||||
			break;
 | 
			
		||||
		case 6:
 | 
			
		||||
			c = Color.magenta;
 | 
			
		||||
			break;
 | 
			
		||||
		case 7:
 | 
			
		||||
			c = Color.cyan;
 | 
			
		||||
			break;
 | 
			
		||||
		case 8:
 | 
			
		||||
			c = Color.orange;
 | 
			
		||||
			break;
 | 
			
		||||
		case 9:
 | 
			
		||||
			c = Color.darkGray;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		return c;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param Area
 | 
			
		||||
	 */
 | 
			
		||||
	public void initGraph(DArea Area) {
 | 
			
		||||
		m_Area = Area;
 | 
			
		||||
		m_Area.addDElement(m_ConnectedPointSet);
 | 
			
		||||
		((FunctionArea) m_Area).addGraphPointSet(this);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_1);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_2);
 | 
			
		||||
		// m_Area.addDElement(m_PointSet_3);
 | 
			
		||||
		// DPointIcon icon1 = new DPointIcon(){
 | 
			
		||||
		// public void paint( Graphics g ){
 | 
			
		||||
		// g.drawLine(-2, 0, 2, 0);
 | 
			
		||||
		// g.drawLine(0, 0, 0, 4);
 | 
			
		||||
		// }
 | 
			
		||||
		// public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); }
 | 
			
		||||
		// };
 | 
			
		||||
		// DPointIcon icon2 = new DPointIcon(){
 | 
			
		||||
		// public void paint( Graphics g ){
 | 
			
		||||
		// g.drawLine(-2, 0, 2, 0);
 | 
			
		||||
		// g.drawLine(0, 0, 0, -4);
 | 
			
		||||
		// }
 | 
			
		||||
		// public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); }
 | 
			
		||||
		// };
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public boolean isStatisticsGraph() {
 | 
			
		||||
		return m_isStatisticsGraph;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Causes the PointSet to interupt the connected painting at the current
 | 
			
		||||
	 * position.
 | 
			
		||||
	 */
 | 
			
		||||
	public void jump() {
 | 
			
		||||
		m_ConnectedPointSet.jump();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public DPointSet printPoints() {
 | 
			
		||||
		for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) {
 | 
			
		||||
			DPoint p = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
			double x = p.x;
 | 
			
		||||
			double y = p.y;
 | 
			
		||||
			System.out.println("point " + i + " x = " + x + "y = " + y);
 | 
			
		||||
		}
 | 
			
		||||
		return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 */
 | 
			
		||||
	public void removeAllPoints() {
 | 
			
		||||
		m_ConnectedPointSet.removeAllPoints();
 | 
			
		||||
		// m_PointSet_1.removeAllPoints();
 | 
			
		||||
		// m_PointSet_2.removeAllPoints();
 | 
			
		||||
		// m_PointSet_3.removeAllPoints();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param x
 | 
			
		||||
	 */
 | 
			
		||||
	public void removePoint(DPoint x) {
 | 
			
		||||
		System.out.println("removePoint " + x.x + " " + x.y);
 | 
			
		||||
		DPoint[] buf = new DPoint[m_ConnectedPointSet.getSize()];
 | 
			
		||||
		for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) {
 | 
			
		||||
			buf[i] = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
		}
 | 
			
		||||
		m_ConnectedPointSet.removeAllPoints();
 | 
			
		||||
		for (int i = 0; i < buf.length; i++) {
 | 
			
		||||
			if (buf[i].x == x.x && buf[i].y == x.y)
 | 
			
		||||
				System.out.println("point found");
 | 
			
		||||
			else
 | 
			
		||||
				m_ConnectedPointSet.addDPoint(buf[i]);
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param c
 | 
			
		||||
	 */
 | 
			
		||||
	public void setColor(Color c) {
 | 
			
		||||
		m_Color = c;
 | 
			
		||||
		m_ConnectedPointSet.setColor(m_Color);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void setColorByIndex(int i) {
 | 
			
		||||
		setColor(indexToColor(i));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 */
 | 
			
		||||
	public void setConnectedMode(boolean p) {
 | 
			
		||||
		m_ConnectedPointSet.setConnected(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param p
 | 
			
		||||
	 */
 | 
			
		||||
	public void setIcon(DPointIcon p) {
 | 
			
		||||
		this.m_Icon = p;
 | 
			
		||||
		this.m_ConnectedPointSet.setIcon(p);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param x
 | 
			
		||||
@@ -505,66 +568,4 @@ public class GraphPointSet {
 | 
			
		||||
		m_Stroke = stroke;
 | 
			
		||||
		// setStroke(new BasicStroke( m_Stroke ));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 
 | 
			
		||||
	 */
 | 
			
		||||
	class PointSet implements Serializable {
 | 
			
		||||
		/**
 | 
			
		||||
		 * Generated serial version identifier
 | 
			
		||||
		 */
 | 
			
		||||
		private static final long serialVersionUID = -5863595580492128866L;
 | 
			
		||||
		private double[] m_X;
 | 
			
		||||
		private double[] m_Y;
 | 
			
		||||
		private Color m_Color;
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @param pointset
 | 
			
		||||
		 */
 | 
			
		||||
		public PointSet(DPointSet pointset) {
 | 
			
		||||
			m_Color = pointset.getColor();
 | 
			
		||||
			m_X = new double[pointset.getSize()];
 | 
			
		||||
			m_Y = new double[pointset.getSize()];
 | 
			
		||||
			for (int i = 0; i < pointset.getSize(); i++) {
 | 
			
		||||
				DPoint point = pointset.getDPoint(i);
 | 
			
		||||
				m_X[i] = point.x;
 | 
			
		||||
				m_Y[i] = point.y;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @return
 | 
			
		||||
		 */
 | 
			
		||||
		public DPointSet getDPointSet() {
 | 
			
		||||
			DPointSet ret = new DPointSet(100);
 | 
			
		||||
			ret.setColor(m_Color);
 | 
			
		||||
			for (int i = 0; i < m_X.length; i++)
 | 
			
		||||
				ret.addDPoint(m_X[i], m_Y[i]);
 | 
			
		||||
			return ret;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/**
 | 
			
		||||
		 * 
 | 
			
		||||
		 * @return
 | 
			
		||||
		 */
 | 
			
		||||
		public int getSize() {
 | 
			
		||||
			return m_X.length;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// /**
 | 
			
		||||
		// *
 | 
			
		||||
		// */
 | 
			
		||||
		// public DPointSet printPoints() {
 | 
			
		||||
		// for (int i = 0; i < m_ConnectedPointSet.getSize();i++) {
 | 
			
		||||
		// DPoint p = m_ConnectedPointSet.getDPoint(i);
 | 
			
		||||
		// double x = p.x;
 | 
			
		||||
		// double y = p.y;
 | 
			
		||||
		// //System.out.println("point "+i+ " x= "+x+"y= "+y);
 | 
			
		||||
		// }
 | 
			
		||||
		// return m_ConnectedPointSet.getDPointSet();
 | 
			
		||||
		// }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user