public abstract class LinearLayout extends Object implements LayoutManager
Modifier and Type | Class and Description |
---|---|
protected static class |
LinearLayout.LinearLayoutComponent |
LayoutManager.LaidOutComponent
Modifier and Type | Field and Description |
---|---|
static LayoutParameter |
GROWS_HORIZONTALLY |
static LayoutParameter |
GROWS_VERTICALLY |
static LayoutParameter |
MAXIMIZES_HORIZONTALLY |
static LayoutParameter |
MAXIMIZES_VERTICALLY |
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component,
LayoutParameter... layoutParameters)
Adds a component to the layout manager
|
protected abstract int |
getMajorAxis(TerminalSize terminalSize) |
protected abstract LayoutParameter |
getMajorGrowingParameter() |
protected abstract LayoutParameter |
getMajorMaximizesParameter() |
protected abstract int |
getMinorAxis(TerminalSize terminalSize) |
protected abstract LayoutParameter |
getMinorGrowingParameter() |
protected abstract LayoutParameter |
getMinorMaximizesParameter() |
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.
|
protected List<Panel> |
getSubPanels() |
List<? extends LayoutManager.LaidOutComponent> |
layout(TerminalSize layoutArea)
Given a size, lay out all the components on this area
|
boolean |
maximisesHorisontally() |
protected abstract boolean |
maximisesOnMajorAxis(Panel panel) |
protected abstract boolean |
maximisesOnMinorAxis(Panel panel) |
boolean |
maximisesVertically() |
void |
removeComponent(Component component)
Removes a component from the layout
|
protected abstract void |
setMajorAxis(TerminalPosition terminalPosition,
int majorAxisValue) |
protected abstract void |
setMajorAxis(TerminalSize terminalSize,
int majorAxisValue) |
protected abstract void |
setMinorAxis(TerminalSize terminalSize,
int minorAxisValue) |
void |
setPadding(int padding) |
public static final LayoutParameter MAXIMIZES_HORIZONTALLY
public static final LayoutParameter MAXIMIZES_VERTICALLY
public static final LayoutParameter GROWS_HORIZONTALLY
public static final LayoutParameter GROWS_VERTICALLY
public void addComponent(Component component, LayoutParameter... layoutParameters)
LayoutManager
addComponent
in interface LayoutManager
component
- Component to add to the layout managerlayoutParameters
- Parameters to associate with the component on this layoutpublic void removeComponent(Component component)
LayoutManager
removeComponent
in interface LayoutManager
component
- Component to removepublic void setPadding(int padding)
public 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 maximisesHorisontally()
maximisesHorisontally
in interface LayoutManager
public boolean maximisesVertically()
maximisesVertically
in interface LayoutManager
protected abstract boolean maximisesOnMajorAxis(Panel panel)
protected abstract boolean maximisesOnMinorAxis(Panel panel)
protected abstract void setMajorAxis(TerminalSize terminalSize, int majorAxisValue)
protected abstract void setMinorAxis(TerminalSize terminalSize, int minorAxisValue)
protected abstract void setMajorAxis(TerminalPosition terminalPosition, int majorAxisValue)
protected abstract int getMajorAxis(TerminalSize terminalSize)
protected abstract int getMinorAxis(TerminalSize terminalSize)
protected abstract LayoutParameter getMajorMaximizesParameter()
protected abstract LayoutParameter getMinorMaximizesParameter()
protected abstract LayoutParameter getMajorGrowingParameter()
protected abstract LayoutParameter getMinorGrowingParameter()
Copyright © 2015. All Rights Reserved.