# Integrating JClass BWT with Visual Cafe

## Introduction

It is now possible to add JClass BWT to the components inside Visual Cafe. A series of integration files have been provided by KL Group. They can be applied as a "patch" to any existing version of JClass BWT. The files are:

- .desc files
  A .desc file is provided for each BWT component that can be added to Visual Cafe. The .desc files describe BWT component properties to Visual Cafe. This list of files includes:
  - JCButton.desc
  - JCCheckbox.desc
  - JCCheckboxGroup.desc
  - JCComponent.desc
  - JCContainer.desc
  - JCGroupBox.desc
  - JCHeader.desc
  - JCLabel.desc
  - JCList.desc
  - JCMultiColumnList.desc
  - JCMultiColumnWindow.desc
  - JCOutliner.desc
  - JCScrollbar.desc
  - JCScrolledWindow.desc
  - JCTabManager.desc
- .ico files
  A .ico file is provided for each BWT component. The .ico files contains the icon that represents the component. The list of files includes:
  - JCButton.ico
  - JCCheckbox.ico
  - JCCheckboxGroup.ico
  - JCComponent.ico
  - JCContainer.ico
  - JCGroupBox.ico
  - JCHeader.ico
  - JCLabel.ico
  - JCList.ico
  - JCMultiColumnList.ico
  - JCMultiColumnWindow.ico
  - JCOutliner.ico
  - JCScrollbar.ico
  - JCScrolledWindow.ico
  - JCTabManager.ico
- vcbwt.html
  Installation notes and manual.

## Installation

Because of some problems with Visual Cafe, adding JClass BWT to the component palette is not straightforward. The procedure is outlined below. If you encounter any problems with the installation, please contact KL Group by sending e-mail to jclass_support@klg.com

#### Step One: Get The Files

Obtain the Visual Cafe patch from KL Group. You should have the following files:

- JCButton.desc
- JCCheckbox.desc
- JCCheckboxGroup.desc
- JCComponent.desc
- JCContainer.desc
- JCGroupBox.desc
- JCHeader.desc
- JCLabel.desc
- JCList.desc
- JCMultiColumnList.desc
- JCMultiColumnWindow.desc
- JCOutliner.desc
- JCScrollbar.desc
- JCScrolledWindow.desc
- JCTabManager.desc
- JCButton.ico
- JCCheckbox.ico
- JCCheckboxGroup.ico
- JCComponent.ico
- JCContainer.ico
- JCGroupBox.ico
- JCHeader.ico
- JCLabel.ico
- JCList.ico
- JCMultiColumnList.ico
- JCMultiColumnWindow.ico
- JCOutliner.ico
- JCScrollbar.ico
- JCScrolledWindow.ico
- JCTabManager.ico
- vcBWT.html

#### Step Two: Add To Visual Cafe Hierarchy

Add the files to the Visual Cafe hierarchy by placing them in Bin\Components. For example, if Visual Cafe was installed in a directory called VisualCafe:

         copy *.desc c:\VisualCafe\Bin\Components
         copy *.ico  c:\VisualCafe\Bin\Components

#### Step Three: Unarchive JClass BWT

If JClass BWT not been unarchived (i.e. expanded from its .zip file), please do so. Make sure that Visual Cafe can access JClass BWT by adding its directory to the CLASSPATH for Visual Cafe.

The CLASSPATH for Visual Cafe is controlled by the CLASSPATH line in Bin\sc.ini. If JClass BWT is unpacked into a directory called ThirdParty, then the CLASSPATH line in Bin\sc.ini should be:

       CLASSPATH=.;%@P%\..\JAVA\LIB;%@P%\..\JAVA\LIB\SYMCLASS.ZIP;
       %@P%\..\JAVA\LIB\VECCLASS.ZIP;%@P%\..\JAVA\LIB\SYMANTEC.ZIP;
       %@P%\..\JAVA\LIB\CLASSES.ZIP;c:\ThirdParty

#### Step Four: Reset Visual Cafe

Reset the Visual Cafe component environment by removing the *.rps, *.reg and *.vws files in the Bin directory. Note that this will uninstall any existing components. The current version of Visual Cafe does not allow users to import new third-party components without removing these files beforehand.

         cd c:\VisualCafe\Bin
         erase *.rps
         erase *.reg
         erase *.vws

Note: You must exit Visual Cafe before removing these files.

#### Step Five: Add Component To Palette

Add JCBWT to Visual Cafe by selecting "`Insert -> Component into Library`" from the top-level menu. A file dialog will appear. Use the file dialog to find and select the .class file for the component to be added. In the example from step 3, JCBButton.class will be found in c:\ThirdParty\jclass\bwt. Once JCButton.class has been found, hit the "Open" button.

At this point, you'll be presented with a dialog called "`Add to Library`". It should show a new folder called "`JClass`". Hit the `OK` button.

Unforunately, this this process will have to be repeated for all the components you want to add to Visual Cafe. (Actually, some of the components get added by default, and some need to be added. At the time of writing, it is not clear why Visual Cafe is inconsistent with respect to adding components by default).

## Using JClass BWT Inside Visual Cafe

### Exposed Properties

Once a JClass BWT component has been installed for use inside Visual Cafe, it can be used like any other component. This section outlines the properties exposed for each component. Note that the properties shown in the tables below are the properties added by BWT. The following tables do not show the properties inherited by each component.

#### Notes

Some properties are not currently supported by Visual Cafe, and appear in italics.

If you are generating code, you will have to edit enum properties. Visual Cafe assumes that all enums are contained in the component. JClass components optimize the number of enums by placing them in a common enum class. To work around this problem, change the enum specifier from `jclass.bwt.ComponentName.ENUM` to `jclass.bwt.BWTEnum.ENUM`.

#### JCButton

Property name | Description
--- | ---
| Double Buffering On | Specifies whether double buffering is used. | Highlight Color | Color used to show the component is highlighted.
Highlight Thickness | Thickness of the highlight rectangle drawn when the component has focus.
Traversable | Specifies whether the component can accept focus.

#### JCCheckbox

Property name | Description
--- | ---
| Double Buffering On | Specifies whether double buffering is used. | Highlight Color | Color used to show the component is highlighted.
Highlight Thickness | Thickness of the highlight rectangle drawn when the component has focus.
Traversable | Specifies whether the component can accept focus.

#### JCCheckboxGroup

Property name | Description
--- | ---
Shadow Thickness | Specifies the shadow thickness.
Title | Specifies a string to be used as the panel's title.
Orientation | Sets the layout direction: `VERTICAL` or `HORIZONTAL`.
Radio Behavior | If `true`, radiobox-type behavior is enforced on all checkboxes (only one may be selected at a time).

#### JCComponent

Property name | Description
--- | ---
| Double Buffering On | Specifies whether double buffering is used. | Highlight Color | Color used to show the component is highlighted.
Highlight Thickness | Thickness of the highlight rectangle drawn when the component has focus.
Traversable | Specifies whether the component can accept focus.

#### JCContainer

No properties added.

#### JCGroupBox

Property name | Description
--- | ---
Shadow Thickness | Specifies the shadow thickness.
Title | Specifies a string to be used as the panel's title.

#### JCHeader

Property name | Description
--- | ---
Number of Columns | Specifies the current number of columns.

#### JCLabel

Property name | Description
--- | ---
| Double Buffering On | Specifies whether double buffering is used. | Highlight Color | Color used to show the component is highlighted.
Highlight Thickness | Thickness of the highlight rectangle drawn when the component has focus.
Traversable | Specifies whether the component can accept focus.

#### JCList

Property name | Description
--- | ---
Scrollbar Display Policy | Specifies when to display the scrollbars: `DISPLAY_ALWAYS` means always displayed, `DISPLAY_AS_NEEDED` means display as necessary.
Scrollbar Offset | Specifies the distance between the scrollbars and the viewport.
Items | Sets the list's values as an array of `Strings`.
Auto Select | If `true`, the item which currently has focus is also selected.
Selected Background Color | Specifies the background color of selected items.
Selected Foreground Color | Specifies the foreground color of selected items.
Visible Rows | Specifies the number of visible rows. If set to `0`, the list will attempt to resize itself so that all its items are visible.
Top Row | Specifies the top-most visible row.
Allow Multiple Selection | Specifies whether to allow multiple selections.
Row Height | Specifies the height of each row. If the height is set to `-997`, the height is set to the height of the current font. If the height is set to `-998`, the height will be calculated for each row.
Spacing Between Items | Sets the spacing between items. This value increases the `HighlightThickness` value.

#### JCMultiColumnList

Property name | Description
--- | ---
Scrollbar Display Policy | Specifies when to display the scrollbars: `DISPLAY_ALWAYS` means always display, `DISPLAY_AS_NEEDED` means display as necessary.
Scrollbar Offset | Specifies the distance between the scrollbars and the viewport.
Column Labels | Specifies the column labels as an array of `Strings`.
Column Buttons | Specifies an array of strings to be used as button labels for each column.
Number of Columns | Specifies the current number of columns.
Items | Sets the list's values as an array of `Strings`.
Auto Select | If `true`, the item which currently has focus is also selected.
Selected Background Color | Specifies the background color of selected items.
Selected Foreground Color | Specifies the foreground color of selected items.
Visible Rows | Specifies the number of visible rows. If set to `0`, the list will attempt to resize itself so that all its items are visible.
Top Row | Specifies the top-most visible row.
Allow Multiple Selection | Specifies whether to allow multiple selections.
Row Height | Specifies the height of each row. If the height is set to `-997`, the height is set to the height of the current font. If the height is set to `-998`, the height will be calculated for each row.
Spacing Between Items | Sets the spacing between items. This value increases the `HighlightThickness` value.
Column Label Sort | Specifies whether a column is sorted when its button is clicked.

#### JCMultiColumnWindow

Property name | Description
--- | ---
Scrollbar Display Policy | Specifies when to display the scrollbars- `DISPLAY_ALWAYS` means always displayed, `DISPLAY_AS_NEEDED` means display as necessary.
Scrollbar Offset | Specifies the distance between the scrollbars and the viewport.
Column Labels | Specifies the column labels as an array of `Strings`.
Column Buttons | Specifies an array of strings to be used as button labels for each column.
Number of Columns | Specifies the current number of columns.

#### JCOutliner

Property name | Description
--- | ---
Scrollbar Display Policy | Specifies when to display the scrollbars- `DISPLAY_ALWAYS` means always displayed, `DISPLAY_AS_NEEDED` means display as necessary.
Scrollbar Offset | Specifies the distance between the scrollbars and the viewport.
Column Labels | Specifies the column labels as an array of `Strings`.
Column Buttons | Specifies an array of strings to be used as button labels for each column.
Number of Columns | Specifies the current number of columns.
Root Visible | If `true`, the root node is drawn.
Node Height | Specifies the height of each node in pixels. If `0`, the height is determined by using the largest font and image height in the list of node styles.
Auto Select | If `true`, the item which currently has focus is also selected.
Node Indentation | Sets the indentation of each node relative to its parent.
Spacing | Sets the spacing between items. This value increases the `HighlightThickness` value.
Visible Rows | Specifies the number of visible rows. If set to `0`, the list will attempt to resize itself so that all its items are visible.

#### JCScrollbar

Property name | Description
--- | ---
Orientation | Sets the layout direction: `VERTICAL` or `HORIZONTAL`.
Current Value | Specifies the current value of the slider.
Line Increment | Specifies the line increment. This is the amount that is scrolled up or down when the user clicks on the arrow buttons.
Page Increment | Sets the page increment. This is the amount that will be scrolled up or down when the user clicks above/below the slider.
Filter Time | Specifies the time interval within which to ignore drag events. To specify that no events are to be reported until the user releases the mouse, set to a very large number.

#### JCScrolledWindow

Property name | Description
--- | ---
Scrollbar Display Policy | Specifies when to display the scrollbars. `DISPLAY_ALWAYS` means always displayed, `DISPLAY_AS_NEEDED` means display as necessary.
Scrollbar Offset | Specifies the distance between the scrollbars and the viewport.

#### JCTabManager

Property name | Description
--- | ---
Alignment | Specifies the default position of the tab's label within its shadows. One of `TOPLEFT`, `TOPCENTER`, `TOPRIGHT`, `MIDDLELEFT`, `MIDDLECENTER`, `MIDDLERIGHT`, `BOTTOMLEFT`, `BOTTOMCENTER` and `BOTTOMRIGHT`.
Current Tab Font | Specifies the current tab's font.
Tab Style | Specifies the tab's corner style. Once of `ROUNDED`, `SQUARE`, `SLANTED` or `CHAMFERED`.
First Visible Tab | Specifies the first tab currently visible.
Tab Resize | Specifies whether all tabs should be resized to the width and height of the largest tab in the same row.
Stretch Tabs to Fit | Specifies whether all tabs should be stretched if necessary to fill the entire side. This resource is ignored when scrolling tabs.