/Users/lyon/j4p/src/sound/DualTraceOscope.java

1    package sound; 
2     
3    /** 
4     * Created by 
5     * User: lyon 
6     * Date: Nov 29, 2003 
7     * Time: 11:11:38 AM 
8     * 
9     */ 
10    
11   import bookExamples.ch27BusinessGraphics.charts.BarGraph; 
12   import bookExamples.ch27BusinessGraphics.charts.DoubleDataBean; 
13   import gui.run.RunScroll; 
14   import java.awt.*; 
15   import javax.swing.JPanel; 
16   import java.awt.BorderLayout; 
17   import java.awt.Component; 
18   import java.awt.Container; 
19   import java.awt.Graphics; 
20   import java.awt.GridLayout; 
21    
22   public class DualTraceOscope 
23           extends JPanel { 
24       DualOscopePanel osp1 = new DualOscopePanel(); 
25    
26       DualTraceOscope() { 
27           setLayout(new BorderLayout()); 
28           add(getTopSbPanel(), BorderLayout.NORTH); 
29           add(getBottomSbPanel(), BorderLayout.SOUTH); 
30           add(getLeftSbPanel(), BorderLayout.WEST); 
31           add(getRightSbPanel(), BorderLayout.EAST); 
32    
33           add(getTracePanel(), BorderLayout.CENTER); 
34       } 
35          public JPanel getTracePanel(){ 
36           Component tracePanel = osp1.getTracePanel(); 
37              JPanel jp = new JPanel(); 
38               jp.setLayout(new GridLayout(0,1)); 
39              jp.add(tracePanel); 
40              return jp; 
41          } 
42       public JPanel getRightSbPanel() { 
43           JPanel jp = new JPanel(); 
44           jp.setLayout(new GridLayout(0, 2)); 
45           jp.add(osp1.getRightSb()); 
46           jp.add(osp1.getRightSb2()); 
47           return jp; 
48       } 
49    
50       public JPanel getLeftSbPanel() { 
51           JPanel jp = new JPanel(); 
52           jp.setLayout(new GridLayout(0, 2)); 
53           jp.add(osp1.getLeftSb2()); 
54           jp.add(osp1.getLeftSb()); 
55           return jp; 
56       } 
57    
58       public JPanel getBottomSbPanel() { 
59           JPanel jp = new JPanel(); 
60           jp.setLayout(new GridLayout(2, 0)); 
61           jp.add(osp1.getBottomSb()); 
62           jp.add(osp1.getBottomSb2()); 
63           return jp; 
64       } 
65    
66       public JPanel getTopSbPanel() { 
67           JPanel jp = new JPanel(); 
68           jp.setLayout(new GridLayout(1, 0)); 
69           RunScroll topSb = osp1.getTopSb(); 
70           jp.add(topSb); 
71           return jp; 
72       } 
73    
74       public static void main(String args[]) { 
75           DualTraceOscope dtosp = new DualTraceOscope(); 
76           gui.ClosableJFrame cf = new gui.ClosableJFrame(); 
77           Container c = cf.getContentPane(); 
78           c.add(dtosp); 
79           c.setLayout(new GridLayout(1, 0)); 
80           cf.setSize(400, 400); 
81           cf.show(); 
82       } 
83   } 
84    
85