/* * Coriolis.java * * Created on March 10, 2001, 12:40 AM */ /** * * @author * * @version */ import java.util.*; import java.awt.*; import javax.swing.*; // import com.bruceeckel.swing.*; class Coord { Coord(double xx, double yy){ x=xx; y=yy; } double x,y; } class DrawTrajectory extends JPanel { DrawTrajectory(Coriolis cor) { coriolis=cor; maxW_half=maxWidth/2; RecomputeCoords(); // repaint(); } public void RestoreDefaults() { r=500; vertvel=7; vert_angle=0; RecomputeCoords(); } public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.white); g.drawLine(maxW_half-5,(int)(maxHeight-3-scale), maxW_half+5,(int)(maxHeight-3-scale)); int i; for(i=0;ixmax) xmax=Math.abs(((Coord)ct.get(i)).x); if(((Coord)ct.get(i)).y>ymax) ymax=((Coord)ct.get(i)).y; } coriolis.UpdateMaxes(xmax,ymax); // cout<<"Max height: "<ymax) { a=2*xmax; scale = (maxWidth-5)/a; } int i; for(i=0;i