// 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.*;
|
|
class SphereEditor extends BiparamEditor implements ActionListener, ObjectUI
|
{
|
SphereEditor(Sphere inSph, GroupEditor callee)
|
{
|
super(inSph, callee); // false);
|
//objEditor = new BiparamEditor(inSph, this, callee); // false);
|
objEditor = callee.GetEditor();
|
//parent = this;
|
sphere = inSph;
|
|
SetupUI2(objEditor);
|
}
|
|
SphereEditor(Sphere inSph, Object3D copy, GroupEditor callee)
|
{
|
super(inSph, copy, null, callee); // false);
|
//objEditor = new BiparamEditor(inSph, copy, this, callee); // false);
|
//parent = this;
|
objEditor = this;
|
sphere = (Sphere) copy;
|
|
//SetupUI(objEditor);
|
}
|
|
/*
|
void SetupUI(ObjEditor oe)
|
{
|
// super.SetupUI(oe);
|
oe.ctrlPanel.add(centerLabel = new JLabel("Center"), oe.aConstraints);
|
oe.aConstraints.gridx += 1;
|
oe.aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
|
oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
|
oe.ctrlPanel.add(centerField = new NumberField(), oe.aConstraints);
|
centerField.setVector(sphere.center);
|
centerField.addActionListener(this);
|
oe.aConstraints.gridwidth = 1;
|
oe.aConstraints.gridx = 0;
|
oe.aConstraints.gridy += 1;
|
oe.aConstraints.fill = GridBagConstraints.NONE;
|
oe.ctrlPanel.add(radiusLabel = new JLabel("Radius"), oe.aConstraints);
|
oe.aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
|
oe.aConstraints.gridx += 1;
|
oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
|
oe.ctrlPanel.add(radiusField = new NumberField(), oe.aConstraints);
|
//radiusField.setFloat(sphere.radius);
|
radiusField.addActionListener(this);
|
oe.aConstraints.fill = GridBagConstraints.NONE;
|
oe.aConstraints.gridwidth = 1;
|
oe.aConstraints.gridx = 0;
|
oe.aConstraints.gridy += 1;
|
}
|
*/
|
void Clear()
|
{
|
objEditor.Clear();
|
|
sphere = 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 applySelf()
|
{
|
super.applySelf();
|
//centerField.getVector(sphere.center);
|
//sphere.radius = radiusField.getFloat(1, 10000);
|
sphere.recalculate();
|
}
|
|
Sphere sphere;
|
JLabel centerLabel;
|
JLabel radiusLabel;
|
NumberField centerField;
|
NumberField radiusField;
|
|
public ObjEditor GetEditor()
|
{
|
//new Exception().printStackTrace();
|
return objEditor; // .GetEditor();
|
}
|
|
public void closeUI2()
|
{
|
objEditor.closeUI();
|
}
|
|
void refreshContents2()
|
{
|
objEditor.refreshContents();
|
}
|
|
//BiparamEditor objEditor;
|
}
|