All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface pub.java.gui.builders.BuilderLayoutBeanInfo

public interface BuilderLayoutBeanInfo
This is the BeanInfo Interface needed for building JForge-friendly Layout Manager BeanInfos.

You should either subclass the appropriate BeanInfo of a LayoutManager, or subclass SimpleBeanInfo, and implement this Interface.

This code is Copyright (c)1998, Cameron Newham.


Method Index

 o addLayout(Container)
Layouts are always added via this method.
 o compare(LayoutManager, LayoutManager)
Compares two Layouts, value by value.
 o getJavaConstructorString(LayoutManager)
Returns a string that would create a new instance of the layout when compiled and run.
 o getJavaInitializationStrings(Container)
Returns an array of strings.
 o newInstance()
Returns a new instance of the layout.

Methods

 o newInstance
 public abstract LayoutManager newInstance()
Returns a new instance of the layout. For simple layout this could be: return new MyLayout(); For layouts with non-zero argument constructors, return the component after doing initialisation.

Returns:
a new instance of the layout.
 o getJavaConstructorString
 public abstract String getJavaConstructorString(LayoutManager layout)
Returns a string that would create a new instance of the layout when compiled and run. A return value of null indicates that the Builder should use its own code generation code to construct the layout constructor. The string should be of the form new myLayout(). If getJavaInitializationStrings does not return null, this method is ignored (the constructor is assumed to be generated in that method).

Parameters:
layout - the layout to generate Java code for.
Returns:
a String representing a new instance of the layout.
 o getJavaInitializationStrings
 public abstract String[] getJavaInitializationStrings(Container container)
Returns an array of strings. The strings should provide the correct source code lines needed to add the components in the container to the container using the layout manager associated with the container. The names of the container and components are given by the getName() method. The name of the layout should be of the form Layout, which can be produced with: "myLayout"+container.getName(). A return value of null indicates that the Builder should use its own code generation code to write out the layout.

Parameters:
container - the container associated with the layout.
Returns:
an array of Strings representing usage of the layout on the component.
 o addLayout
 public abstract void addLayout(Container container)
Layouts are always added via this method. For simple layouts, this would be something like: container.setLayout(new myLayout());

Parameters:
container - the container for which a layout needs to be added.
 o compare
 public abstract boolean compare(LayoutManager layout1,
                                 LayoutManager layout2)
Compares two Layouts, value by value. It should first check to see if both arguments are of this type of layout bean and if not then this method should return false). The layout fields should be compared for equality. If the layouts are contextually the same then the method should return true, otherwise false. Note: the comparison shouldn't include the components that are being managed by the layout.

Parameters:
layout1 - the first layout.
layout2 - the second layout.
Returns:
true if they are equal in type and fields.

All Packages  Class Hierarchy  This Package  Previous  Next  Index