// 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: ConeEditor.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import grafeme.ui.*; class ConeEditor extends BiparamEditor implements ChangeListener, ObjectUI { /* ConeEditor(Cone inCone, Object3D copy, GroupEditor callee) { super(inCone, copy, null, callee); // true); //parent = this; cone = (Cone) copy; SetupWindow(); SetupUI2(this); } */ ConeEditor(Cone inCone, GroupEditor callee) { super(inCone, callee); //objEditor = new BiparamEditor(inCone, this, callee); objEditor = callee.GetEditor(); this.cone = inCone; SetupUI2(GetEditor()); } ConeEditor(Cone t, Object3D copy, GroupEditor callee) { super(t, copy, callee); // false); //objEditor = new BiparamEditor(t, copy, this, callee); objEditor = this; cone = (Cone) copy; SetupUI2(GetEditor()); } void SetupUI2(ObjEditor oe) { super.SetupUI2(oe); /* ctrlPanel.add(baseLabel = new JLabel("Base"), aConstraints); aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; ctrlPanel.add(baseField = new NumberField(), aConstraints); baseField.setVector(cone.base); baseField.addActionListener(this); */ topPanel = new cGridBag(); topPanel.add(baseRadLabel = new JLabel("Top")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); topPanel.add(baseRadField = new cNumberSlider(this, 0.001,10,1)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); baseRadField.setFloat(cone.baseRadius); oe.ctrlPanel.add(topPanel); oe.ctrlPanel.Return(); /* aConstraints.fill = 0; aConstraints.gridx -= 1; aConstraints.gridy += 1; aConstraints.gridwidth = 1; ctrlPanel.add(apexLabel = new JLabel("Apex"), aConstraints); aConstraints.fill = GridBagConstraints.HORIZONTAL; aConstraints.gridx += 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; ctrlPanel.add(apexField = new NumberField(), aConstraints); apexField.setVector(cone.apex); apexField.addActionListener(this); */ basePanel = new cGridBag(); basePanel.add(apexRadLabel = new JLabel("Base")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); basePanel.add(apexRadField = new cNumberSlider(this, 0.001,10,1)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); apexRadField.setFloat(cone.apexRadius); oe.ctrlPanel.add(basePanel); oe.ctrlPanel.Return(); } public void closeUI() { ObjEditor oe = GetEditor(); apexRadField.removeChangeListener(this); baseRadField.removeChangeListener(this); // oe.ctrlPanel.remove(apexRadField); // oe.ctrlPanel.remove(baseRadField); // oe.ctrlPanel.remove(apexRadLabel); // oe.ctrlPanel.remove(baseRadLabel); oe.ctrlPanel.remove(topPanel); oe.ctrlPanel.remove(basePanel); //oe.ctrlPanel.repaint(); super.closeUI(); } public ObjEditor GetEditor2() { return objEditor.GetEditor(); } void refreshContents2() { objEditor.refreshContents(); } void Clear() { super.Clear(); cone = null; } public void actionPerformed(ActionEvent e) { if (//e.getSource() == apexField || //e.getSource() == baseField || e.getSource() == apexRadField || e.getSource() == baseRadField) { applySelf(); refreshContents(); } else //assert false; super.actionPerformed(e); } public void stateChanged(ChangeEvent e) { if (//e.getSource() == apexField || //e.getSource() == baseField || e.getSource() == apexRadField || e.getSource() == baseRadField) { applySelf(); objEditor.refreshContents(); } else // assert false; super.stateChanged(e); } /* public void doLayout() { super.doLayout(); labelAndField(baseLabel, baseField); labelAndField(baseRadLabel, baseRadField); labelAndField(apexLabel, apexField); labelAndField(apexRadLabel, apexRadField); widgetPos += 5; } */ public void applySelf() { super.applySelf(); //baseField.getVector(cone.base); cone.baseRadius = apexRadField.getFloat(); //apexField.getVector(cone.apex); cone.apexRadius = baseRadField.getFloat(); //cone.orient(); cone.recalculate(); } Cone cone; JLabel baseLabel; JLabel apexLabel; JLabel baseRadLabel; JLabel apexRadLabel; //NumberField baseField; //NumberField apexField; cNumberSlider baseRadField; cNumberSlider apexRadField; cGridBag topPanel; cGridBag basePanel; //BiparamEditor objEditor; }