/** * InputScreen.java * * copyright 2004, Daniel Heller * * http://www.dan-is-online.com/software/peelingdepthexplorer * * This program is free software; * you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation; * either version 2 of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. * See the GNU General Public License * at http://www.gnu.org/copyleft/gpl.html for more details. * **/ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.Point; import java.awt.geom.GeneralPath; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.swing.JFrame; import javax.swing.JPanel; public class InputScreen extends JPanel { public static final int POINT_WIDTH = 2; private List points; private List hulls; private List listeners; private InputScreenMouseListener mouseListener; public InputScreen() { listeners = new ArrayList(); points = new ArrayList(); hulls = new ArrayList(); mouseListener = new InputScreenMouseListener(this); addMouseListener(mouseListener); } public InputScreen(final List points) { this(); this.points = points; } public void paintComponent(Graphics g) { g.setColor(Color.white); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(Color.black); for(int i=0;i2) { PlanePointList ppl = new PlanePointList(currPoints); List hull = ppl.getBoundary(); hulls.add(hull); GeneralPath gp = new GeneralPath(); for(int i=0;i