Normand Briere
2019-09-10 5e1c410f8b99d246d1bbf828bbd8445bb716feeb
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
// 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:   BoxEditor.java
 
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
class BoxEditor extends ObjEditor
{
    BoxEditor(Box inBox, GroupEditor callee)
    {
        super(inBox, callee);
 
        //objEditor = new BiparamEditor(inCone, this, callee);
        objEditor = callee.GetEditor();
 
        this.box = inBox;
 
        SetupUI2(GetEditor());
    }
   
   
    BoxEditor(Box inBox, Object3D copy, GroupEditor callee)
    {
        super(inBox, copy, callee);
        
        new Exception().printStackTrace();
        
        box = (Box) copy;
//        ctrlPanel.add(minLabel = new JLabel("Minima"), aConstraints);
//        aConstraints.gridx += 1;
//        aConstraints.fill = GridBagConstraints.HORIZONTAL;
//        aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
//        ctrlPanel.add(minimaField = new NumberField(), aConstraints);
//        aConstraints.gridwidth = 1;
//        minimaField.setVector(box.minima);
//        aConstraints.gridx = 0;
//        aConstraints.gridy += 1;
//        aConstraints.fill = GridBagConstraints.NONE;
//        ctrlPanel.add(maxLabel = new JLabel("Maxima"), aConstraints);
//        aConstraints.gridx += 1;
//        aConstraints.fill = GridBagConstraints.HORIZONTAL;
//        aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
//        ctrlPanel.add(maximaField = new NumberField(), aConstraints);
//        aConstraints.gridwidth = 1;
//        maximaField.setVector(box.maxima);
//        aConstraints.fill = GridBagConstraints.NONE;
//        aConstraints.gridx = 0;
//        aConstraints.gridy += 1;
    }
   
   void Clear()
   {
       super.Clear();
 
       box = null;
   }
   
    /*
    public void doLayout()
    {
        super.doLayout();
        labelAndField(minLabel, minimaField);
        labelAndField(maxLabel, maximaField);
        widgetPos += 5;
    }
    */
    
   void SetupUI2(ObjEditor oe)
   {
            super.SetupUI2(oe);
            
            oe.ctrlPanel.add(optionCB = new JCheckBox("Close Surface", !box.open)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2);
            optionCB.addItemListener(this);
            oe.ctrlPanel.Return();
        }
        
   public void itemStateChanged(ItemEvent e)
   {
       if (//e.getSource() == nameField ||
                e.getSource() == optionCB)
       {
                    box.open = (e.getStateChange() != ItemEvent.SELECTED);
                    
                    applySelf();
                    
                    objEditor.refreshContents();
                }
                else
                {
                    super.itemStateChanged(e);
                }
   }
   
   
   public void closeUI()
   {
            ObjEditor oe = GetEditor();
 
            oe.ctrlPanel.remove(optionCB);
 
            super.closeUI();
   }
   
    public void applySelf()
    {
// june 2013        super.applySelf();
//        minimaField.getVector(box.minima);
//        maximaField.getVector(box.maxima);
        box.recalculate();
    }
   
    Box box;
    
//    JLabel minLabel;
//    JLabel maxLabel;
//    NumberField minimaField;
//    NumberField maximaField;
    
    JCheckBox optionCB;
}