Java Version API Overview
Convert 1.1 is written in Java. This version is extensible. To allow conversion of a new VB control, a user or 3rd party vendor will provide a corresponding Java Class and a corresponding conversion class.
The converter interprets the Visual Basic Form and stores all of the information about the Controls. As the form is being converted, the tool reads the TYPE of control. These are things like CommandButton, Label, etc. The tool looks for a conversion class with a corresponding name. For CommandButton, the tool looks for bdcCommandButton. bdc stands for Black Dirt Convert. The conversion class describes the necessary transformation of the Visual Basic information into Java source code. In this manner, new controls can be converted without changing the tool. A class to convert SSTab (tabbed Dialogs), can be added by creating a conversion class called bdcSSTab.
Conversion classes all begin with the letters "bdc". Then the name of the VB control is appended. So I have bdcCommandButton, bdcListBox and so on. bdcCheckBox.java is a simple example. bdcTextBox.java will
create a TextField or TextArea depending on the VB setting of the multiline flag. bdcTextBox will also create a password field depending on the settings.
These classes are easy to create and customize. In these classes, you build the strings that will appear in the generated code.
If you are using a particular set of 3rd party java classes, it is easy to modify this product to generate code that corresponds to those classes. As we move forward, more conversion classes will be made available on the Black Dirt Web Site. The plan is that there will be no charge for most of these classes.
There are four important methods in each of these classes.
initialize
initializes the control, some customization can be done here if
needed. See bdcLabel.
declareString returns
Button Command3 = new Button("Command3");
addString returns
add(Command3);
Command3.reshape(8, 24, 177, 33);
controlArrayInitString produces
Command1[7] = new Button("Command1");
ControlArrayInitString is used in cases of control arrays on the Visual
Basic side.
View source code for conversion classes.
Remember bdc + VB Type for the class name, so bdcCommandButton will convert a
Command Button,
More details and a step by step discussion of a single conversion class will be added to the site.