package vgp.tutor.height;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import jv.object.PsUpdateIf;
import jv.project.PjProject_IP;
/**
* Info panel of project to select among different scalar fields on the surface.
*
* @author Konrad Polthier
* @version 23.10.99, 1.30 revised (kp) Variable m_scalarName removed.
* 20.08.99, 1.20 revised (kp) Textfield replaced with Choice to select field.
* 15.08.99, 1.10 revised (kp) Updated to AWT1.1
* 00.00.98, 1.00 created (kp)
*/
public class PjHeight_IP extends PjProject_IP implements ItemListener {
protected PjHeight m_pjHeight;
protected Choice m_scalarChoice;
public PjHeight_IP() {
super();
if (getClass() == PjHeight_IP.class) {
init();
}
}
public void init() {
super.init();
addTitle("");
Panel surfPanel = new Panel();
{
surfPanel.setLayout(new GridLayout(1,2));
surfPanel.add(new Label("Scalar Field: "));
m_scalarChoice = new Choice();
m_scalarChoice.addItemListener(this);
surfPanel.add(m_scalarChoice);
}
add(surfPanel);
}
/**
* Set parent of panel which supplies the data inspected by the panel.
*/
public void setParent(PsUpdateIf parent) {
super.setParent(parent);
m_pjHeight = (PjHeight)parent;
m_scalarChoice.removeAll();
String [] listScalarFields = m_pjHeight.m_scalarFields;
if (listScalarFields != null) {
int len = listScalarFields.length;
for (int i=0; i