|
Demo Readme
|
Mathematic Bean Suite Version 1.0
This demo shows, how you can create applications for work
with mathematical abstractions and operations.
To see the wiring and
run the application in VisualAge for Java 2.0, import the Bean Suite jar
files (in the lib directory) and the demo dat file (in the demo
directory) into VisualAge for Java 2.0. The dat file contains a demo package
that you can add to any project in your VisualAge workspace. Use VisualAge's "Check
Class Path..." option to compute the correct CLASSPATH setting before you run the
demo application. This will ensure that VisualAge can locate all the classes needed to run
the application.
How to Run This Demo
- First, make sure the Mathematic Bean Suite is properly
installed, as described in the documentation provided
with this package.
- Change to the demo directory and type java runDemo at the
command prompt. This starts the demo.
What the Demo Does
The given application shows how the arithmetic
and other operations are calculated. The result of the demo is shown in Figure 1.

Figure 1 - The MathematicDemo
Wiring Instructions
To build an application, you should execute the following
steps:
- Create a new class with the Frame superclass.
- Put on the frame:
- TextField for an operand A (set the "A:"
label);
- TextField for an operand B (set the "B:"
label);
- TextField for result of a BinaryArithmeticOperator bean (set
the "A+B=" label);
- TextField for result of a ComplexOperator bean (set the "Im(1
-1i)=" label);
- TextField for result of a ScalarFunction bean (set the "sin(A)="
label);
- TextField for result of a DegreeOperator bean (set the "pow(B,
3)=" label);
- TextField for result of a UnaryArithmeticOperator bean (set
the "-(-1)=" label);
- TextField for result of a Constant bean (set the "E="
label);
- TextField for an operand C (set the "C:"
label);
- TextField for result of a MatrixOperator bean (set the "transpose(C)="
label);
- Put on the design surface:
- Visualizer for processing operand A;
- Visualizer for processing operand B;
- Visualizer for processing operand C;
- The BinaryArithmeticOperator bean (set operation as ADD);
- The ComplexOperator bean (set operation as IMAGE);
- The ScalarFunction bean (set operation as SIN);
- The DegreeOperator bean (set operation as POW, and degree to
3);
- The UnaryArithmeticOperator bean (set operation as NEGATE);
- The Constant bean (set constant as E);
- The MatrixOperator bean (set operation as TRANSPOSE);
- The Complex bean (set real to 1, image to -1);
- The Decimal bean (set value to -1);
Do the following connections:
- Wire the "A:" TextField.text
property to the Visualizer1.inputString property and set "Source event" as
"textValueChanged" in the property panel of this connection;
- Wire the "B:" TextField.text
property to the Visualizer2.inputString property and set "Source event" as
"textValueChanged" in the property panel of this connection;
- Wire the "C:" TextField.text
property to the Visualizer3.inputString property and set "Source event" as
"textValueChanged" in the property panel of this connection;
- Wire the Visualizer1.resultElement property to the
BinaryArithmeticOperator1.inputFirstArg property;
- Wire the Visualizer2.resultElement property to the
BinaryArithmeticOperator1.inputSecondArg property;
- Wire the BinaryArithmeticOperator1.result property to the "A+B="
TextField.text property;
- Wire the Complex1.this property to the ComplexOperator1.inputArg
property;
- Wire the ComplexOperator1.result property to the "Im(1
-1i)=" TextField.text property;
- Wire the Visualizer1.resultElement property to the
ScalarFunction1.inputArg property;
- Wire the ScalarFunction1.result property to the "sin(A)="
TextField.text property;
- Wire the Visualizer2.resultElement property to the
DegreeOperator1.inputArg property;
- Wire the DegreeOperator1.result property to the "pow(B,
3) =" TextField.text property;
- Wire the Decimal1.this property to the
UnaryArithmeticOperator1.inputArg property;
- Wire the UnaryArithmeticOperator1.result property to the "-(-1)="
TextField.text property;
- Wire the Constant1.value property to the "E="
TextField.text property;
- Wire the Visualizer3.resultElement property to the
MatrixOperator1.inputArg property;
- Wire the MatrixOperator1.result property to the "transpose(C)="
TextField.text property;
- Wire the Frame1.windowClosing event to the Frame1.dispose()
method.
Refer to Figure 2 for the wiring diagram of the MathematicDemo.

Figure 2 - The MathematicDemo wiring
diagram