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
-
BIG_BUFFER
-
-
borderHeight
- Height of the text boxes on the bottom.
-
borderWidth
- Width of the objects on the right.
-
BUTTON_HEIGHT
-
-
BUTTONS
-
-
buttonWidth
- Width of the buttons.
-
grid
- The dimensions of the robot grid.
-
LABEL_HEIGHT
-
-
LABEL_WIDTH
-
-
margin
- The margins around the inside of the window.
-
MIN_BORDER_HEIGHT
-
-
MIN_BORDER_WIDTH
-
-
MIN_GRID_DIM
-
-
SMALL_BUFFER
-
-
things
- The list of components.
-
RobotlLayout()
-
-
addLayoutComponent(String, Component)
- Adds
c to things.
-
calcDimensions(Container)
- Calculates
margin, grid, borderWidth,
borderHeight and buttonHeight.
-
layoutContainer(Container)
-
-
minimumLayoutSize(Container)
-
-
preferredLayoutSize(Container)
-
-
removeLayoutComponent(Component)
- Removes
c from things.
BIG_BUFFER
private static final int BIG_BUFFER
SMALL_BUFFER
private static final int SMALL_BUFFER
MIN_GRID_DIM
private static final int MIN_GRID_DIM
LABEL_HEIGHT
private static final int LABEL_HEIGHT
LABEL_WIDTH
private static final int LABEL_WIDTH
BUTTONS
private static final int BUTTONS
MIN_BORDER_HEIGHT
private static final int MIN_BORDER_HEIGHT
MIN_BORDER_WIDTH
private static final int MIN_BORDER_WIDTH
BUTTON_HEIGHT
private static final int BUTTON_HEIGHT
things
Component things[]
- The list of components.
grid
Dimension grid
- The dimensions of the robot grid. Calculated by calcDimensions().
margin
Insets margin
- The margins around the inside of the window.
borderWidth
int borderWidth
- Width of the objects on the right.
borderHeight
int borderHeight
- Height of the text boxes on the bottom.
buttonWidth
int buttonWidth
- Width of the buttons.
RobotlLayout
public RobotlLayout()
addLayoutComponent
public void addLayoutComponent(String name,
Component c)
- Adds
c to things.
removeLayoutComponent
public void removeLayoutComponent(Component c)
- Removes
c from things.
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.
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
layoutContainer
public void layoutContainer(Container parent)