public class BorderLayout extends Object implements LayoutManager
LayoutManager.LaidOutComponent
Modifier and Type | Field and Description |
---|---|
static LayoutParameter |
BOTTOM |
static LayoutParameter |
CENTER |
static LayoutParameter |
LEFT |
static LayoutParameter |
RIGHT |
static LayoutParameter |
TOP |
Constructor and Description |
---|
BorderLayout() |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component,
LayoutParameter... parameters)
Adds a component to the layout manager
|
TerminalSize |
getPreferredSize()
Calculates the optimal size of the container this layout manager is
controlling by asking every component controlled by the manager how big
they would like to be.
|
List<? extends LayoutManager.LaidOutComponent> |
layout(TerminalSize layoutArea)
Given a size, lay out all the components on this area
|
boolean |
maximisesHorisontally() |
boolean |
maximisesVertically() |
void |
removeComponent(Component component)
Removes a component from the layout
|
public static final LayoutParameter CENTER
public static final LayoutParameter LEFT
public static final LayoutParameter RIGHT
public static final LayoutParameter TOP
public static final LayoutParameter BOTTOM
public void addComponent(Component component, LayoutParameter... parameters)
LayoutManager
addComponent
in interface LayoutManager
component
- Component to add to the layout managerparameters
- Parameters to associate with the component on this layoutpublic void removeComponent(Component component)
LayoutManager
removeComponent
in interface LayoutManager
component
- Component to removepublic TerminalSize getPreferredSize()
LayoutManager
getPreferredSize
in interface LayoutManager
public List<? extends LayoutManager.LaidOutComponent> layout(TerminalSize layoutArea)
LayoutManager
layout
in interface LayoutManager
layoutArea
- Size that the layout is allowed to usepublic boolean maximisesVertically()
maximisesVertically
in interface LayoutManager
public boolean maximisesHorisontally()
maximisesHorisontally
in interface LayoutManager
Copyright © 2015. All Rights Reserved.