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

  1. First, make sure the Mathematic Bean Suite is properly installed, as described in the documentation provided with this package.
  2. 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.

ArithmeticDemo

Figure 1 - The MathematicDemo

Wiring Instructions

To build an application, you should execute the following steps:

  1. Create a new class with the Frame superclass.
  2. Put on the frame:
    1. TextField for an operand A (set the "A:" label);
    2. TextField for an operand B (set the "B:" label);
    3. TextField for result of a BinaryArithmeticOperator bean (set the "A+B=" label);
    4. TextField for result of a ComplexOperator bean (set the "Im(1 -1i)=" label);
    5. TextField for result of a ScalarFunction bean (set the "sin(A)=" label);
    6. TextField for result of a DegreeOperator bean (set the "pow(B, 3)=" label);
    7. TextField for result of a UnaryArithmeticOperator bean (set the "-(-1)=" label);
    8. TextField for result of a Constant bean (set the "E=" label);
    9. TextField for an operand C (set the "C:" label);
    10. TextField for result of a MatrixOperator bean (set the "transpose(C)=" label);
  3. Put on the design surface:
    1. Visualizer for processing operand A;
    2. Visualizer for processing operand B;
    3. Visualizer for processing operand C;
    4. The BinaryArithmeticOperator bean (set operation as ADD);
    5. The ComplexOperator bean (set operation as IMAGE);
    6. The ScalarFunction bean (set operation as SIN);
    7. The DegreeOperator bean (set operation as POW, and degree to 3);
    8. The UnaryArithmeticOperator bean (set operation as NEGATE);
    9. The Constant bean (set constant as E);
    10. The MatrixOperator bean (set operation as TRANSPOSE);
    11. The Complex bean (set real to 1, image to -1);
    12. The Decimal bean (set value to -1);

Do the following connections:

  1. Wire the "A:" TextField.text property to the Visualizer1.inputString property and set "Source event" as "textValueChanged" in the property panel of this connection;
  2. Wire the "B:" TextField.text property to the Visualizer2.inputString property and set "Source event" as "textValueChanged" in the property panel of this connection;
  3. Wire the "C:" TextField.text property to the Visualizer3.inputString property and set "Source event" as "textValueChanged" in the property panel of this connection;
  4. Wire the Visualizer1.resultElement property to the BinaryArithmeticOperator1.inputFirstArg property;
  5. Wire the Visualizer2.resultElement property to the BinaryArithmeticOperator1.inputSecondArg property;
  6. Wire the BinaryArithmeticOperator1.result property to the "A+B=" TextField.text property;
  7. Wire the Complex1.this property to the ComplexOperator1.inputArg property;
  8. Wire the ComplexOperator1.result property to the "Im(1 -1i)=" TextField.text property;
  9. Wire the Visualizer1.resultElement property to the ScalarFunction1.inputArg property;
  10. Wire the ScalarFunction1.result property to the "sin(A)=" TextField.text property;
  11. Wire the Visualizer2.resultElement property to the DegreeOperator1.inputArg property;
  12. Wire the DegreeOperator1.result property to the "pow(B, 3) =" TextField.text property;
  13. Wire the Decimal1.this property to the UnaryArithmeticOperator1.inputArg property;
  14. Wire the UnaryArithmeticOperator1.result property to the "-(-1)=" TextField.text property;
  15. Wire the Constant1.value property to the "E=" TextField.text property;
  16. Wire the Visualizer3.resultElement property to the MatrixOperator1.inputArg property;
  17. Wire the MatrixOperator1.result property to the "transpose(C)=" TextField.text property;
  18. Wire the Frame1.windowClosing event to the Frame1.dispose() method.

Refer to Figure 2 for the wiring diagram of the MathematicDemo.

MathematicDemo wiring diagram

Figure 2 - The MathematicDemo wiring diagram