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 package net.sourceforge.kamiwaai;
60 import java.awt.Color;
61 import java.awt.FlowLayout;
62 import java.awt.GridLayout;
63 import java.awt.event.WindowAdapter;
64 import java.awt.event.WindowEvent;
65 import java.util.HashMap;
66 import java.util.HashSet;
67 import java.util.LinkedList;
68
69 import javax.swing.ButtonGroup;
70 import javax.swing.JFrame;
71 import javax.swing.JPanel;
72 import javax.swing.JRadioButton;
73
74
75
76 public class KamiWaAi extends JFrame
77 {
78 KamiWaAiCanvas m_malflaeche;
79 KamiWaAiCanvas m_malflaecheZ;
80
81 Color circlecolor = Color.red;
82 Color spherecolor = Color.yellow;
83 Color linecolor = new Color(176,176,255);
84 ButtonGroup ModeChoice;
85
86 boolean sideview = false;
87 HashMap ENames = new HashMap();
88 LinkedList Clist = new LinkedList();
89 HashSet rdlist = new HashSet();
90 HashSet vdlist = new HashSet();
91
92
93
94 int pnum = 0;
95 int lnum = 0;
96 int cnum = 0;
97 int snum = 0;
98
99 String selectedPoint = " ";
100 String selectedLine = " ";
101 String selectedSphere = " ";
102 String selectedSphere1 = " ";
103 String selectedSphere2 = " ";
104 String mvdPoint = " ";
105 String LinePoints[] = new String[2];
106 String CirclePoints[] = new String[3];
107 String SpherePoints[] = new String[4];
108
109
110
111
112 public static void main(String[] args)
113 {
114 KamiWaAi Fenster = new KamiWaAi("KamiWaAi 0.0.4 beta");
115 Fenster.pack();
116 Fenster.setSize(830,340);
117 Fenster.setResizable(false);
118 Fenster.show();
119 }
120
121
122
123
124 private KamiWaAi(String titel)
125 {
126 super(titel);
127
128
129 getContentPane().setLayout(new FlowLayout());
130
131
132 m_malflaeche = new CMeineCanvas(this);
133 getContentPane().add(m_malflaeche);
134
135 m_malflaecheZ = new CMeineCanvasZ(this);
136 getContentPane().add(m_malflaecheZ);
137
138
139
140 JPanel panel = new JPanel();
141
142 panel.setLayout(new GridLayout(6,2,20,20));
143
144
145 ModeChoice = new ButtonGroup();
146
147
148 JRadioButton opt1 =
149 new JRadioButton("point",true);
150 JRadioButton opt2 =
151 new JRadioButton("move",false);
152 JRadioButton opt3 =
153 new JRadioButton("circle",false);
154 JRadioButton opt4 =
155 new JRadioButton("sphere",false);
156 JRadioButton opt5 =
157 new JRadioButton("sphere C,r",false);
158 JRadioButton opt6 =
159 new JRadioButton("S int l",false);
160 JRadioButton opt7 =
161 new JRadioButton("S int c",false);
162 JRadioButton opt8 =
163 new JRadioButton("S int S",false);
164 JRadioButton opt9 =
165 new JRadioButton("match",false);
166 JRadioButton opt10 =
167 new JRadioButton("line",false);
168 JRadioButton opt11 =
169 new JRadioButton("segment",false);
170
171
172 opt1.setActionCommand("point" );
173 opt2.setActionCommand("move" );
174 opt3.setActionCommand("circle" );
175 opt4.setActionCommand("sphere" );
176 opt5.setActionCommand("sphere C,r");
177 opt6.setActionCommand("S int l" );
178 opt7.setActionCommand("S int c" );
179 opt8.setActionCommand("S int S" );
180 opt9.setActionCommand("match" );
181 opt10.setActionCommand("line" );
182 opt11.setActionCommand("segment" );
183
184
185
186 ModeChoice.add(opt1);
187 ModeChoice.add(opt2);
188 ModeChoice.add(opt3);
189 ModeChoice.add(opt4);
190 ModeChoice.add(opt5);
191 ModeChoice.add(opt6);
192 ModeChoice.add(opt7);
193 ModeChoice.add(opt8);
194 ModeChoice.add(opt9);
195 ModeChoice.add(opt10);
196 ModeChoice.add(opt11);
197
198
199 panel.add(opt1);
200 panel.add(opt4);
201 panel.add(opt10);
202 panel.add(opt2);
203 panel.add(opt3);
204 panel.add(opt6);
205 panel.add(opt5);
206
207 panel.add(opt8);
208
209
210
211 getContentPane().add(panel);
212
213
214 class CMeinWindowAdapter extends WindowAdapter
215 {
216 public void windowClosing(WindowEvent e)
217 {
218 System.exit(0);
219 }
220 }
221
222 addWindowListener(new CMeinWindowAdapter());
223 }
224
225
226
227
228
229
230 }
231