Class RobotlLayout

java.lang.Object
   |
   +----RobotlLayout

public class RobotlLayout
extends Object
implements LayoutManager
The layout manager for the main interface window.

Author:
Peter Sagerson, petersag@wpi.edu

Variable Index

 o BIG_BUFFER
 o borderHeight
Height of the text boxes on the bottom.
 o borderWidth
Width of the objects on the right.
 o BUTTON_HEIGHT
 o BUTTONS
 o buttonWidth
Width of the buttons.
 o grid
The dimensions of the robot grid.
 o LABEL_HEIGHT
 o LABEL_WIDTH
 o margin
The margins around the inside of the window.
 o MIN_BORDER_HEIGHT
 o MIN_BORDER_WIDTH
 o MIN_GRID_DIM
 o SMALL_BUFFER
 o things
The list of components.

Constructor Index

 o RobotlLayout()

Method Index

 o addLayoutComponent(String, Component)
Adds c to things.
 o calcDimensions(Container)
Calculates margin, grid, borderWidth, borderHeight and buttonHeight.
 o layoutContainer(Container)
 o minimumLayoutSize(Container)
 o preferredLayoutSize(Container)
 o removeLayoutComponent(Component)
Removes c from things.

Variables

 o BIG_BUFFER
 private static final int BIG_BUFFER
 o SMALL_BUFFER
 private static final int SMALL_BUFFER
 o MIN_GRID_DIM
 private static final int MIN_GRID_DIM
 o LABEL_HEIGHT
 private static final int LABEL_HEIGHT
 o LABEL_WIDTH
 private static final int LABEL_WIDTH
 o BUTTONS
 private static final int BUTTONS
 o MIN_BORDER_HEIGHT
 private static final int MIN_BORDER_HEIGHT
 o MIN_BORDER_WIDTH
 private static final int MIN_BORDER_WIDTH
 o BUTTON_HEIGHT
 private static final int BUTTON_HEIGHT
 o things
 Component things[]
The list of components.

 o grid
 Dimension grid
The dimensions of the robot grid. Calculated by calcDimensions().

 o margin
 Insets margin
The margins around the inside of the window.

 o borderWidth
 int borderWidth
Width of the objects on the right.

 o borderHeight
 int borderHeight
Height of the text boxes on the bottom.

 o buttonWidth
 int buttonWidth
Width of the buttons.

Constructors

 o RobotlLayout
 public RobotlLayout()

Methods

 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component c)
Adds c to things.

 o removeLayoutComponent
 public void removeLayoutComponent(Component c)
Removes c from things.

 o calcDimensions
 private void calcDimensions(Container parent)
Calculates margin, grid, borderWidth, borderHeight and buttonHeight.

The grid becomes as large as possible while still remaining square and leaving the minimum amount of room for the components on the sides. Those components take up whatever room is left.

 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container parent)
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container parent)
 o layoutContainer
 public void layoutContainer(Container parent)