Class BorderLayout
java.lang.Object
vaadinx.awt.BorderLayout
- All Implemented Interfaces:
Serializable, CssEmittingLayoutManager, LayoutManager, LayoutManager2
public class BorderLayout
extends Object
implements LayoutManager2, CssEmittingLayoutManager, Serializable
Emulator for
BorderLayout. Under D_layout_css_on_content,
LayoutManager.layoutContainer(Container) writes
display: grid; grid-template-columns: auto 1fr auto;
grid-template-rows: auto 1fr auto; grid-template-areas: …; gap: …
to the container's peer content element, and
addLayoutComponent(Component, Object) writes a per-child
grid-area matching the Swing constraint.
Hand-written rather than generator-emitted for the same reason
FlowLayout is — the generator's root-class detection would attach a
peer field to a LayoutManager.
LINE_START / LINE_END caveat. Real Swing's BorderLayout
flips LINE_START between west and east based on the
container's ComponentOrientation. CSS grid-area
names aren't orientation-aware, and re-writing the area name on
every orientation change would require tracking orientation at
layoutContainer time. We pin the LTR mapping
(LINE_START → west, LINE_END → east) and document
the limitation; R_layouts_close_enough applies.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutComponent(String name, Component comp) voidaddLayoutComponent(Component comp, Object constraints) Per-child CSS for onechildofparent;null(the default) means the child needs none.containerCss(Container parent) Container-wide CSS forparent's peer content element (its<div>).getConstraints(Component comp) intgetHgap()floatgetLayoutAlignmentX(Container parent) floatgetLayoutAlignmentY(Container parent) getLayoutComponent(Object constraints) getLayoutComponent(Container target, Object constraints) intgetVgap()voidinvalidateLayout(Container target) maximumLayoutSize(Container target) minimumLayoutSize(Container parent) preferredLayoutSize(Container parent) voidvoidsetHgap(int hgap) voidsetVgap(int vgap) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CssEmittingLayoutManager
cssLayoutName, layoutContainer
-
Field Details
-
CENTER
- See Also:
-
NORTH
- See Also:
-
SOUTH
- See Also:
-
EAST
- See Also:
-
WEST
- See Also:
-
BEFORE_FIRST_LINE
- See Also:
-
AFTER_LAST_LINE
- See Also:
-
BEFORE_LINE_BEGINS
- See Also:
-
AFTER_LINE_ENDS
- See Also:
-
PAGE_START
- See Also:
-
PAGE_END
- See Also:
-
LINE_START
- See Also:
-
LINE_END
- See Also:
-
-
Constructor Details
-
BorderLayout
public BorderLayout() -
BorderLayout
public BorderLayout(int hgap, int vgap)
-
-
Method Details
-
getHgap
public int getHgap() -
setHgap
public void setHgap(int hgap) -
getVgap
public int getVgap() -
setVgap
public void setVgap(int vgap) -
addLayoutComponent
- Specified by:
addLayoutComponentin interfaceLayoutManager
-
addLayoutComponent
- Specified by:
addLayoutComponentin interfaceLayoutManager2
-
removeLayoutComponent
- Specified by:
removeLayoutComponentin interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSizein interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSizein interfaceLayoutManager
-
maximumLayoutSize
- Specified by:
maximumLayoutSizein interfaceLayoutManager2
-
getLayoutAlignmentX
- Specified by:
getLayoutAlignmentXin interfaceLayoutManager2
-
getLayoutAlignmentY
- Specified by:
getLayoutAlignmentYin interfaceLayoutManager2
-
invalidateLayout
- Specified by:
invalidateLayoutin interfaceLayoutManager2
-
childCss
Description copied from interface:CssEmittingLayoutManagerPer-child CSS for onechildofparent;null(the default) means the child needs none. Called once per child per pass, afterCssEmittingLayoutManager.containerCss(Container)(see the call-order contract).- Specified by:
childCssin interfaceCssEmittingLayoutManager
-
containerCss
Description copied from interface:CssEmittingLayoutManagerContainer-wide CSS forparent's peer content element (its<div>).- Specified by:
containerCssin interfaceCssEmittingLayoutManager- Returns:
- property→value map; a
nullvalue removes the property, an absent key is left untouched.
-
getLayoutComponent
-
getLayoutComponent
-
getConstraints
-
toString
-