View Javadoc

1   package edu.sc.seis.TauP;
2   
3   import java.awt.Graphics;
4   import java.util.Vector;
5   import javax.swing.JPanel;
6   
7   /*
8     The TauP Toolkit: Flexible Seismic Travel-Time and Raypath Utilities.
9     Copyright (C) 1998-2000 University of South Carolina
10  
11    This program is free software; you can redistribute it and/or
12    modify it under the terms of the GNU General Public License
13    as published by the Free Software Foundation; either version 2
14    of the License, or (at your option) any later version.
15  
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License for more details.
20  
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  
25    The current version can be found at
26    <A HREF="www.seis.sc.edu">http://www.seis.sc.edu</A>
27  
28    Bug reports and comments should be directed to
29    H. Philip Crotwell, crotwell@seis.sc.edu or
30    Tom Owens, owens@seis.sc.edu
31  
32  */
33  
34  /***
35   * ArrivalPlot.java
36   *
37   *
38   * Created: Thu Jun 22 13:04:16 EDT 2000
39   *
40   * @author Philip Crotwell
41   * @version 1.1.3 Wed Jul 18 15:00:35 GMT 2001
42  
43  
44  
45   */
46  
47  public abstract class ArrivalPlot extends JPanel {
48  
49      public void setSelectedIndex(int index) {
50      this.selectedIndex = index;
51      repaint();
52      }
53  
54      public void addElement(Arrival a) {
55      arrivals.addElement(a);
56      }
57  
58      public void removeAllElements() {
59      arrivals.removeAllElements();
60      repaint();
61      }
62  
63      public void setTauModel(TauModel tMod) {
64      this.tMod = tMod;
65      }
66  
67      public abstract void paintBackground(Graphics g);
68  
69      public abstract void paintArrivals(Graphics g);
70  
71      public abstract void paintForeground(Graphics g);
72  
73      public void paintComponent(Graphics g) {
74      super.paintComponent(g);
75          paintBackground(g);
76          paintArrivals(g);
77          paintForeground(g);
78      }
79  
80      protected Vector arrivals = new Vector();
81      protected TauModel tMod;
82      protected int selectedIndex = -1;
83  
84  } // ArrivalPlot