I copied the code in section 6.3 (Application Example: Collaborative
Example), and I am getting an unusual runtime error. Here is the error:
Exception in thread "main" visad.TypeException: FunctionType: domain must be
RealTupleType or RealType
at visad.FunctionType.<init>(FunctionType.java:76)
at reader2.<init>(reader2.java:26)
at reader2.main(reader2.java:73)
Here's the code as I wrote it:
public class reader2
{
private RealType reala, realb, realc; //note that these three variables
have been declared as 'ReaTypes'
private DisplayImpl display1;
private GraphicsModeControl mode;
private DataReferenceImpl ref_real, ref_real_tuple, ref_field;
public reader2() throws VisADException, RemoteException
{
FunctionType field_type = new FunctionType(reala, realb); //this is
line 26, and this is where it complains
FlatField field = FlatField.makeField(field_type, 64, false);
Real real = new Real(reala, 2.0);
Real[] reals3 = {new Real(reala, 1.0), new Real(realb, 2.0), new
Real(realc, 1.0)};
RealTuple real_tuple = new RealTuple(reals3);
display1 = new DisplayImplJ3D("display1");
display1.addMap(new ScalarMap(reala, Display.XAxis));
display1.addMap(new ScalarMap(reala, Display.YAxis));
display1.addMap(new ScalarMap(reala, Display.ZAxis));
mode = display1.getGraphicsModeControl();
mode.setPointSize(5.0f);
ref_real = new DataReferenceImpl("ref_real");
ref_real.setData(real);
display1.addReferences(new DirectManipulationRendererJ3D(), new
DataReference[] {ref_real});
ref_real_tuple = new DataReferenceImpl("ref_real_tuple");
ref_real_tuple.setData(real_tuple);
display1.addReferences(new DirectManipulationRendererJ3D(), new
DataReference[] {ref_real_tuple});
ref_field = new DataReferenceImpl("ref_field");
ref_field.setData(field);
display1.addReferences(new DirectManipulationRendererJ3D(), new
DataReference[] {ref_field});
JFrame jframe = new JFrame("Remote Display Example");
jframe.getContentPane().add(display1.getComponent());
jframe.setSize(640, 480);
jframe.setVisible(true);
}
public static void main(String[] args) throws VisADException,
RemoteException
{
new reader2();
}
}
What could be causing this problem? The according what I've written, reala,
realb, and realc *are* RealTypes.