Normand Briere
2019-09-28 57f4646563d6757f65ddc00ca38975c352d76de7
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
// 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:   CSGEditor.java
 
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
 
import java.util.Vector;
 
class AttributeEditor extends ObjEditor implements ChangeListener, ActionListener, ObjectUI
{
    
   AttributeEditor(Attribute t, GroupEditor callee)
   {
            super(t, callee);
       //objEditor = new GroupEditor(t, this, callee);
       objEditor = callee.GetEditor();
       
       attribute = t;
       
       SetupUI2(GetEditor());
   }
   
   AttributeEditor(Attribute t, Object3D copy, GroupEditor callee)
   {
       super(t, copy, callee);
                
       //objEditor = new GroupEditor(t, copy, callee);
       objEditor = this;
                
        attribute = (Attribute) copy;
       
       SetupUI2(GetEditor());
        }
        
        void SetupUI2(ObjEditor oe)
        {
                super.SetupUI2(oe); // Shows composite UI !!
                //super.SetupName(oe);
                
//                oe.aConstraints.weighty = 0;
//                
//        oe.aConstraints.gridwidth = 1;
//        oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
//                oe.aConstraints.gridwidth = 1;
//                oe.aConstraints.anchor = GridBagConstraints.WEST;
                oe.ctrlPanel.add(cleardepth = new JCheckBox("Clear Depth", attribute.cleardepth)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
 
                oe.ctrlPanel.Return();
//                oe.aConstraints.gridx += 1;
//                oe.ctrlPanel.add(passtest = new JCheckBox("Write depth", attribute.passtest), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
//                oe.aConstraints.gridx += 1;
                oe.ctrlPanel.add(passtest = new JCheckBox("Pass Test", attribute.passtest)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
                oe.ctrlPanel.Return();
//                oe.aConstraints.gridx += 1;
                oe.ctrlPanel.add(backfacecull = new JCheckBox("Backface Cull", attribute.backfacecull)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
                oe.ctrlPanel.Return();
//                oe.aConstraints.gridx += 1;
                
       cleardepth.addItemListener(this);
       passtest.addItemListener(this);
       backfacecull.addItemListener(this);
        }
   
   public ObjEditor GetEditor()
   {
       return objEditor.GetEditor();
   }
 
   void Clear()
   {
       objEditor.Clear();
 
       attribute = null;
   }
   
   public void closeUI()
   {
       ObjEditor oe = GetEditor();
       
                //if (oe == null)
                //    return;
                
       cleardepth.removeItemListener(this);
                oe.ctrlPanel.remove(cleardepth);
       passtest.removeItemListener(this);
                oe.ctrlPanel.remove(passtest);
       backfacecull.removeItemListener(this);
                oe.ctrlPanel.remove(backfacecull);
       
       super.closeUI();
   }
   
        public void itemStateChanged(ItemEvent e)
        {
            attribute.cleardepth = cleardepth.isSelected();
            attribute.passtest = passtest.isSelected();
            attribute.backfacecull = backfacecull.isSelected();
        }
    
//    public void applySelf()
//    {
//            super.applySelf();
//
//            itemStateChanged(null);
//    }
   
   Attribute attribute;
        
        JCheckBox cleardepth;
//        JCheckBox writedepth;
        JCheckBox passtest;
        JCheckBox backfacecull;
}