01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.casetool.patternimplementor;
12:
13: import java.awt.event.ActionEvent;
14:
15: import javax.swing.BorderFactory;
16: import javax.swing.BoxLayout;
17: import javax.swing.JPanel;
18:
19: public class PIParameterGUIGroup extends PIParameterGUI {
20:
21: public PIParameterGUIGroup(PIParameterGroup pip) {
22: super (pip);
23: }
24:
25: protected void buildGUI() {
26: content = new JPanel();
27:
28: updateGUI();
29: }
30:
31: public void actionPerformed(ActionEvent e) {
32: //Object source = e.getSource();
33: //System.out.println("actionPerformed on: " + pip.getName());
34: }
35:
36: protected void updateGUI() {
37: //System.out.println("GUI.updateGUI "+pip.getName());
38: content.setVisible(false);
39:
40: ((JPanel) content).removeAll();
41: content.setBorder(BorderFactory.createTitledBorder(pip
42: .getName()));
43: this .add(content);
44: content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
45:
46: for (int i = 0; i < ((PIParameterGroup) pip).size(); i++) {
47: if (((PIParameterGroup) pip).get(i) instanceof PIParameterVoid) {
48: content.add(new PIParameterGUIVoid(
49: (PIParameterVoid) ((PIParameterGroup) pip)
50: .get(i)));
51: } else if (((PIParameterGroup) pip).get(i) instanceof PIParameterBoolean) {
52: content.add(new PIParameterGUIBoolean(
53: (PIParameterBoolean) ((PIParameterGroup) pip)
54: .get(i)));
55: } else if (((PIParameterGroup) pip).get(i) instanceof PIParameterString) {
56: content.add(new PIParameterGUIString(
57: (PIParameterString) ((PIParameterGroup) pip)
58: .get(i)));
59: } else if (((PIParameterGroup) pip).get(i) instanceof PIParameterGroup) {
60: content.add(new PIParameterGUIGroup(
61: (PIParameterGroup) ((PIParameterGroup) pip)
62: .get(i)));
63: }
64: }
65:
66: content.setVisible(true);
67:
68: //System.out.println(content);
69: }
70: }
|