Normand Briere
2019-11-17 cb37a129d1adb403019c96e798e86e2da9667f15
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Decompiled by Jad v1.5.7b. Copyright 1997-99 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   SphereEditor.java
 
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
 
import grafeme.ui.*;
 
class KleinEditor extends BiparamEditor implements ActionListener, ObjectUI
{
    KleinEditor(Klein inSph, GroupEditor callee)
    {
        super(inSph, callee); // false);
        //objEditor = new BiparamEditor(inSph, this, callee); // false);
        objEditor = callee.GetEditor();
       //parent = this;
        klein = inSph;
        
   SetupUI2(objEditor);
    }
   
    KleinEditor(Klein inSph, Object3D copy, GroupEditor callee)
    {
        super(inSph, copy, null, callee); // false);
        //objEditor = new BiparamEditor(inSph, copy, this, callee); // false);
       //parent = this;
        objEditor = this;
        klein = (Klein) copy;
       
       //SetupUI(objEditor);
    }
   
   void SetupUI2(ObjEditor oe)
   {
            super.SetupUI2(oe);
            
            radiusPanel = AddSlider(oe.ctrlPanel, "Radius:", 0, 20.0, klein.radius, 1);
            this.radiusField = (cNumberSlider)radiusPanel.getComponent(1);
            oe.ctrlPanel.Return();
        }
        
   void Clear()
   {
       objEditor.Clear();
       
       klein = null;
   }
   
    /*
    public void doLayout()
    {
        super.doLayout();
        labelAndField(centerLabel, centerField);
        labelAndField(radiusLabel, radiusField);
        widgetPos += 5;
    }
    */
 
   /**/    
//    public void actionPerformed(ActionEvent e)
//    {
//        if (e.getSource() == centerField ||
//            e.getSource() == radiusField)
//        {
//            applySelf();
//            refreshContents();
//        }
//        else
//            super.actionPerformed(e);
//    }
   /**/
    
   public void stateChanged(ChangeEvent e)
   {
       //System.out.println("Klein :: stateChanged");
       if (e.getSource() == radiusField)
       {
           applySelf();
           //super.applySelf();
           objEditor.refreshContents();
           //Refresh();
       }
       else
           super.stateChanged(e);
   }
   
    public void applySelf()
    {
        super.applySelf();
 
        klein.radius = radiusField.getFloat();
        klein.recalculate();
    }
 
    Klein klein;
    cNumberSlider radiusField;
    
    cGridBag radiusPanel;
 
   public ObjEditor GetEditor()
   {
            //new Exception().printStackTrace();
       return objEditor; // .GetEditor();
   }
   
   public void closeUI2()
   {
       objEditor.closeUI();
   }
 
   public void closeUI()
   {
                //Remove(radiusField);
                
       objEditor.ctrlPanel.remove(radiusPanel);
       super.closeUI();
   }
        
   void refreshContents2()
   {
       objEditor.refreshContents();
   }
   
   //BiparamEditor objEditor;
}