aboutsummaryrefslogtreecommitdiff
path: root/src/Graph2DOptionFrame.java
blob: 6421ed9e133cc3d6cdb5a53cb2ac9e366f84db1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*    */ import java.awt.Dimension;
/*    */ import java.awt.FlowLayout;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import javax.swing.BoxLayout;
/*    */ import javax.swing.JButton;
/*    */ import javax.swing.JComboBox;
/*    */ import javax.swing.JDialog;
/*    */ import javax.swing.JFrame;
/*    */ import javax.swing.JPanel;
/*    */ 
/*    */ public class Graph2DOptionFrame extends JDialog
/*    */   implements ActionListener
/*    */ {
/*    */   private static final long serialVersionUID = 1255261492376898359L;
/*    */   private JPanel panel;
/*    */   private JPanel buttonHolder;
/*    */   private JComboBox comboBox;
/*    */   private Point2DMaker[] link;
/*    */   private String[] keys;
/*    */   private JButton ok;
/*    */   private JButton cancel;
/*    */ 
/*    */   public Graph2DOptionFrame(JFrame owner)
/*    */   {
/* 28 */     super(owner, true);
/* 29 */     this.panel = new JPanel();
/* 30 */     this.panel.setLayout(new BoxLayout(this.panel, 1));
/* 31 */     this.buttonHolder = new JPanel(new FlowLayout());
/* 32 */     this.keys = new String[] { 
/* 33 */       "Euclidean", 
/* 34 */       "Polar", 
/* 35 */       "X Equals" };
/*    */ 
/* 37 */     this.link = new Point2DMaker[] { 
/* 38 */       new Euclidean2DPointMaker(), 
/* 39 */       new Polar2DPointMaker(), 
/* 40 */       new ReverseEuclidean2DPointMaker() };
/*    */ 
/* 43 */     this.comboBox = new JComboBox(this.keys);
/* 44 */     this.ok = new JButton("Apply");
/* 45 */     this.cancel = new JButton("Cancel");
/*    */ 
/* 47 */     this.ok.addActionListener(this);
/* 48 */     this.cancel.addActionListener(this);
/*    */ 
/* 50 */     this.buttonHolder.add(this.ok);
/* 51 */     this.buttonHolder.add(this.cancel);
/*    */ 
/* 53 */     this.panel.add(this.comboBox);
/* 54 */     this.panel.add(this.buttonHolder);
/* 55 */     this.panel.setPreferredSize(new Dimension(200, 50));
/* 56 */     add(this.panel);
/* 57 */     pack();
/*    */   }
/*    */ 
/*    */   public void actionPerformed(ActionEvent arg0)
/*    */   {
/* 62 */     setVisible(false);
/* 63 */     if (arg0.getSource() == this.ok)
/* 64 */       GraphTypeHolder.getInstance().setGraphPointMaker(this.link[this.comboBox.getSelectedIndex()]);
/*    */   }
/*    */ }

/* Location:           Modulus.jar
 * Qualified Name:     Graph2DOptionFrame
 * JD-Core Version:    0.6.2
 */