Summary

 

Bob has five main windows:

 

 

You can normally rely on drag-and-drop when using Bob. Most things can be dragged around inside and between its various windows. You can also drag XML files (only those which are readable by XMLDecoder), classes and icons from the operating system’s file browser (some other applications, like Winzip, work too). Using different modifiers you can change what it means to drag a component or a property from one place to another.

 

Here is a summary:

 

 

How to:

Gesture

1

Create a new design

Click on “File/New/Design”

2

Add a component to a design

Find the palette on the toolbar and expose it. Drag components from palette to the design window.

3

Change a property value of a component

Edit it in the Inspector by double-clicking the code in the tree.

4

Expose a hidden property of an object in the Inspector.

Right-click on the object in the Inspector to edit its BeanInfo. Check the “display” attribute of the property to be displayed.

5

Make a property transient (i.e. not appear in the XML archive).

Check the “transient” attribute of the appropriate property in the class’s BeanInfo.

 

6

Allow your class to be controlled by this user interface.

Click on the “Run/Class path…” menu item to add the class path of your project to the builder so that it can instantiate your class.

Click on the “Run/Add root…” menu item to add your root object (normally a controller). The controller should have a nullary constructor, expose any state through public setters and getters and issue property change events when they change.

7

To make a component (e.g. Button) call a nullary method in your class

Drag the method from the Inspector to the to the component.

Normally, a nullary method would be linked to a JButton or a JMenuItem.

8

Copy a property value from your class to the user interface.

Drag the property value from the inspector to the appropriate component in the design window.

9

Make a component call a setter method in your class.

NEW! If the component is of type: Boolean, string, int, listModel, treeModel or tableModel you can drap the property value directly onto a Jpanel or Jmenu (or JpopupMenu) and the appropriate component will be instantiated and wrired up to your bean.

 

To add a method to an existing component – drag the method and drop it onto the component.

 

This drag and drop operation will attempt to do three things:

a)     Copy the value from your object to the user interface component. 

b)    Install a listener so that when the user interface component changes its value your property value will be kept in synch – by calling a public setter method.

c)     Install a property change listener from your component to the UI component.

 

After such an operation a dialog’s is displayed that will allow you to selected which of the above listeners, if any, should be installed.

10

Change a value in the user interface.

Make a property for the value, implement the propertyChangeListener interface for your bean and fire notification when the setter is called. In the builder, if the property is a String you can just drag it to the user interface and it will be set up correctly as a Jlabel with the appropriate listener. Otherwise, just drag the property to an existing component as above.

11

Control the layout of components.

Bob has ‘on screen’ support for all of the AWT/swing layout managers in common use including:

  • Null
  • BoxLayout
  • BorderLayout
  • FlowLayout
  • GridBagLayout
  • SpringLayout.

 

Bob has farily comprehensive support for SpringLayout – swing ‘s new ‘builder friendly’ layout manager. SpringLayout lets you lay about a form by specifying the distance between the edges of the components in the form. Bob depicts these Springs graphically, drawing them over the components in the Bob’s design window.

 

To connect two edges with a spring,:

  • click on the edge whose position is to be calculated from some another edge
  • drag the ‘anchor’ of that spring and drop it on edge that it should be relative to.

 

 

Application state – use of the file system

 

Other than explicit saving operations, Bob limits its write access to the file system to its own application profile area. On Windows this is typically: C:\WINNT\profiles\<your user name>\.bob. In this directory you’ll find records of the changes you’ve made to the default DefaultBeanInfo files provided with the application, and the name of last file you worked on.

 

Back to top.