The BLIMP utilities are a small group of classes for performing some math functions:
The utilities may be exercised via a SWING GUI. This GUI is actually a use of a general "UtilityShell" class, which provides a way of packaging a group of small test or utility dialogs together with a common text output area. As well as providing a useful program for doing these mathematical functions, the GUI is a short demo of my ability to do basic SWING coding, and design reusable swing abstractions. Command line options may be used to control the mode of execution, and add/remove cards. For instance, it can be brought up simply as the calculator without any of the other demos.
Pretty straight forward. There's a "card selection" choice at the top which allows you to choose which of the utilities you wish to exercise. For example, "Polynomials" is shown in the picture. That selection will bring up a group of controls in "Card Dialog" area specific to the selection. Those controls allow you to enter appropriate data, and perform desired operations. For example, in the case of polynomials, it has a history of polynomials you have entered or derived which you may access via the combo box. Entering a new one has an option to fit from entered data points, rather than simply specifying the polynomial. You may find values of the polynomial for a particular x value, find the real roots, multiply by another polynomial, or perform synthetic division by another polynomial.
Answers to operations appear in the scrolling "results window", which is cleared only by user control, so that you may accumulate the results of several operations. Underneath the results window are some controls allowing you to clear it, save the text to a file, or insert comments. You may also specify the font and colors for the results display.
A profile is saved which remembers your card selection, current entry, font and color selections, and size / position for the GUI.
The general idea is that UtilityShell is a subclass of JFrame which handles the card selection control and the results window interaction with the user. It is constructed with an array of UtilityCard instances which represent the choices for the card selection control, and provide the dialogs for card dialog area. UtilityCard is an abstract subclass of JPanel. The implementer must define the label for the selection control. The UtilityCard subclass provides the ability to send output to the UtilityShell results window via a buffered "transaction", access to the profile, and notification methods to be overridden to catch showing and hiding of your card by the UtilityShell (slightly more straightforward than writing your own listener for it).
© copyright, 2005-2022, Robert L. McQueer |
|