To convert from AWT to AFC, instances of java.awt.BorderLayout should be transformed into instances of com.ms.ui.UIBorderLayout.
BorderLayout implements LayoutManager2: be sure to see its changes.
UIBorderLayout is a replacement for BorderLayout as part of the improved UILayoutManager. The changes are minimal: UIBorderLayout allows you to use LEFT, RIGHT, TOP, and BOTTOM as well as the compass points WEST, EAST, NORTH, and SOUTH.
This is the set of changes you need to make to port all BorderLayout methods to UIBorderLayout methods. Any method not listed here or below does not need to be changed.
AWT Code | AFC Code |
BorderLayout() or BorderLayout(int, int) |
UIBorderLayout() or UIBorderLayout(int, int) |
invalidateLayout(Container) | (Container).invalidateAll() |
maximumLayoutSize(Container) | (Container).getMaximumSize() |
minimumLayoutSize(Container) | (Container).getMinimumSize() |
preferredLayoutSize(Container) | (Container).getPreferredSize() |
Some methods in java.awt.BorderLayout are not directly supported in com.ms.ui.UIBorderLayout. Those methods and suggested changes are described here.
AWT Code/Suggested AFC Code | Comments |
removeLayoutComponent(Component) remove(UIComponent) |
Use this method in the Container containing UIBorderLayout. |
addLayoutComponent(Component,
Object) addLayoutComponent(IUIContainer, IUIComponent, Object) |
IUIContainer refers to the Container to which this Object is being added. |
addLayoutComponent(String,
Component) addLayoutComponent(IUIContainer, IUIComponent, Object) |
IUIContainer refers to the Container to which the Object is being added, and the Object is the String representing the constraints. |
getLayoutAlignmentX(Container) getLayoutAlignmentY(Container) (no suggestions) |