// 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: SuperEditor.java
|
|
import java.awt.*;
|
import java.awt.event.*;
|
import javax.swing.*;
|
import javax.swing.event.*;
|
|
import grafeme.ui.*;
|
|
class SuperEditor extends BiparamEditor implements ChangeListener, ObjectUI // ActionListener
|
{
|
/*
|
SuperEditor(Superellipsoid inSuper, Object3D copy, GroupEditor callee)
|
{
|
super(inSuper, copy, null, callee); // false);
|
//parent = this;
|
superE = (Superellipsoid) copy;
|
|
SetupWindow();
|
SetupUI2(this);
|
}
|
*/
|
SuperEditor(Superellipsoid t, GroupEditor callee)
|
{
|
super(t, callee); // false);
|
//objEditor = new BiparamEditor(t, this, callee);
|
objEditor = callee;
|
|
this.superE = t;
|
|
SetupUI2(GetEditor());
|
}
|
|
SuperEditor(Superellipsoid t, Object3D copy, GroupEditor callee)
|
{
|
super(t, copy, callee); // false);
|
//objEditor = new BiparamEditor(t, copy, this, callee);
|
|
superE = (Superellipsoid) copy;
|
|
SetupUI2(GetEditor());
|
}
|
|
|
void SetupUI2(ObjEditor oe)
|
{
|
super.SetupUI2(oe);
|
|
northPanel = new cGridBag();
|
|
northPanel.add(northLabel = new JLabel("XY factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
|
northPanel.add(northField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
|
oe.ctrlPanel.add(northPanel);
|
|
oe.ctrlPanel.Return();
|
eastPanel = new cGridBag();
|
eastPanel.add(eastLabel = new JLabel("Z factor")); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
|
eastPanel.add(eastField = new cNumberSlider(this, 0.0001,20, -1)); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
|
oe.ctrlPanel.add(eastPanel);
|
|
oe.ctrlPanel.Return();
|
// ObjEditor.aConstraints.anchor = GridBagConstraints.WEST;
|
oe.ctrlPanel.add(optionCB = new JCheckBox("Reverse", (superE.radius<0))); //, ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount()-2);
|
optionCB.addItemListener(this);
|
|
oe.ctrlPanel.Return();
|
|
northField.setFloat(superE.north);
|
eastField.setFloat(superE.east);
|
}
|
|
public void closeUI()
|
{
|
ObjEditor oe = GetEditor();
|
|
northField.removeChangeListener(this);
|
eastField.removeChangeListener(this);
|
optionCB.removeItemListener(this);
|
oe.ctrlPanel.remove(optionCB);
|
oe.ctrlPanel.remove(northPanel);
|
oe.ctrlPanel.remove(eastPanel);
|
// oe.ctrlPanel.remove(northField);
|
// oe.ctrlPanel.remove(eastField);
|
// oe.ctrlPanel.remove(northLabel);
|
// oe.ctrlPanel.remove(eastLabel);
|
//oe.ctrlPanel.repaint();
|
|
super.closeUI();
|
}
|
|
public ObjEditor GetEditor()
|
{
|
return objEditor.GetEditor();
|
}
|
|
void refreshContents()
|
{
|
super.refreshContents();
|
}
|
|
void Clear()
|
{
|
objEditor.Clear();
|
|
superE = null;
|
}
|
|
/*
|
public void actionPerformed(ActionEvent e)
|
{
|
if (e.getSource() == northField ||
|
e.getSource() == eastField)
|
{
|
//System.out.println(e);
|
applySelf();
|
refreshContents();
|
//client.refreshEditWindow();
|
}
|
else
|
//assert false;
|
super.actionPerformed(e);
|
}
|
*/
|
public void itemStateChanged(ItemEvent e)
|
{
|
//System.out.println(e);
|
// Reverse
|
if (//e.getSource() == nameField ||
|
e.getSource() == optionCB)
|
{
|
superE.radius = -superE.radius;
|
biparam.retile();
|
applySelf();
|
objEditor.refreshContents();
|
}
|
else
|
{
|
super.itemStateChanged(e);
|
}
|
}
|
|
|
public void stateChanged(ChangeEvent e)
|
{
|
if (e.getSource() == northField ||
|
e.getSource() == eastField)
|
{
|
//System.out.println(e);
|
applySelf();
|
objEditor.refreshContents();
|
//client.refreshEditWindow();
|
}
|
else
|
//assert false;
|
super.stateChanged(e);
|
}
|
|
/*
|
public void doLayout()
|
{
|
super.doLayout();
|
labelAndField(northLabel, northField);
|
labelAndField(eastLabel, eastField);
|
widgetPos += 5;
|
}
|
*/
|
|
public void applySelf()
|
{
|
super.applySelf();
|
superE.north = northField.getFloat();
|
superE.east = eastField.getFloat();
|
superE.recalculate();
|
}
|
|
Superellipsoid superE;
|
JLabel northLabel;
|
JLabel eastLabel;
|
cNumberSlider northField;
|
cNumberSlider eastField;
|
|
cGridBag northPanel;
|
cGridBag eastPanel;
|
//BiparamEditor objEditor;
|
}
|