Package com.oorian.html.layout
Class RegionLayout
java.lang.Object
A layout with named regions similar to classic desktop BorderLayout.
RegionLayout provides a flexible structure with five named regions: north, south, east, west, and center. This pattern is familiar to Java Swing developers and works well for desktop-style application layouts.
Structure:
┌──────────────────────────────────────┐ │ NORTH │ ├────────┬─────────────────┬───────────┤ │ │ │ │ │ WEST │ CENTER │ EAST │ │ │ │ │ │ │ │ │ ├────────┴─────────────────┴───────────┤ │ SOUTH │ └──────────────────────────────────────┘
Features:
- Five named regions: north, south, east, west, center
- Center region expands to fill available space
- Configurable region sizes
- Regions are optional - only shown when content is set
- Uses VStack/HStack internally for reliable layout ordering
Usage:
// Basic layout with all regions
RegionLayout layout = new RegionLayout();
layout.north(header)
.west(navigation)
.center(mainContent)
.east(sidebar)
.south(footer);
// Minimal layout (header + content + footer)
RegionLayout layout = new RegionLayout();
layout.north(header)
.center(content)
.south(footer);
// With custom sizes
RegionLayout layout = new RegionLayout();
layout.setWestWidth(280)
.setEastWidth(300)
.setNorthHeight(64)
.setSouthHeight(48)
.north(toolbar)
.west(nav)
.center(content);
// Full viewport
layout.fillViewport();
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the center region content.Sets the east region content.Returns the center region for advanced customization.Returns the east region for advanced customization.Returns the middle row container for advanced customization.Returns the north region for advanced customization.Returns the south region for advanced customization.Returns the west region for advanced customization.protected voidBuilds the element tree for the layout.Sets the north region content.setCenterBackground(String color) Sets the center region background color.setCenterPadding(int padding) Sets padding for the center region.setCenterPadding(String padding) Sets padding for the center region.setEastBackground(String color) Sets the east region background color.setEastPadding(int padding) Sets padding for the east region.setEastPadding(String padding) Sets padding for the east region.setEastWidth(int width) Sets the east region width.setEastWidth(String width) Sets the east region width.setNorthBackground(String color) Sets the north region background color.setNorthHeight(int height) Sets the north region height.setNorthHeight(String height) Sets the north region height.setNorthPadding(int padding) Sets padding for the north region.setNorthPadding(String padding) Sets padding for the north region.setSouthBackground(String color) Sets the south region background color.setSouthHeight(int height) Sets the south region height.setSouthHeight(String height) Sets the south region height.setSouthPadding(int padding) Sets padding for the south region.setSouthPadding(String padding) Sets padding for the south region.setWestBackground(String color) Sets the west region background color.setWestPadding(int padding) Sets padding for the west region.setWestPadding(String padding) Sets padding for the west region.setWestWidth(int width) Sets the west region width.setWestWidth(String width) Sets the west region width.Sets the south region content.Sets the west region content.Methods inherited from class com.oorian.html.layout.PageLayout
createPane, createPane, fillParent, fillViewport, setBackgroundColor, setMinHeightMethods inherited from class com.oorian.html.StyledElement
addClass, addStyle, addStyle, addStyleAttribute, addTransition, animate, clearTransitions, getActiveStyle, getCssClass, getDisabledStyle, getFocusStyle, getFocusVisibleStyle, getHoverStyle, getHtml, getStyle, getStyleAttribute, hidden, hide, isDisplayed, isTransitionForwardActive, onHide, onRemovedFromPage, onShow, removeClass, setActiveStyle, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackdropFilter, setBackdropFilter, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBlur, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setBrightness, setClass, setClear, setClear, setClip, setClipPath, setClipPath, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnGap, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setContrast, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledStyle, setDisplay, setDisplay, setFilter, setFilter, setFilterOpacity, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFocusStyle, setFocusVisibleStyle, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setGrayscale, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHoverStyle, setHueRotate, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setInvert, setJustifyContent, setJustifyContent, setKeyFrames, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxHeightToWindowHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMaxWidthToWindowWidth, setMinHeight, setMinHeight, setMinHeightToWindowHeight, setMinWidth, setMinWidth, setMinWidth, setMinWidthToWindowWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setObjectFit, setObjectPosition, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateTo, setOnDblClick, setOnDblClickChange, setOpacity, setOpacity, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setQuotes, setResize, setResize, setResizeToWindowHeight, setResizeToWindowHeight, setResizeToWindowWidth, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRotate, setRotate, setRowGap, setRowGap, setSaturate, setScale, setScale, setSepia, setShow, setSize, setSize, setSize, setSkewX, setSkewY, setStyle, setStyle, setTabSize, setTabSize, setTabSize, setTabSize, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTranslateX, setTranslateY, setTranslateZ, setUnicodeBidi, setUnicodeBidi, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, show, shown, stopAnimation, transitionForward, transitionForward, transitionReverse, transitionReverse, updateStyle, updateStyle, updateStyleIfChangedMethods inherited from class com.oorian.html.VisualElement
clearOnClick, click, disable, enable, getAccessKey, getAutoCapitalize, getEnterKeyHint, getInputMode, getPopover, getRole, getTabIndex, getTitle, isAutoFocus, isContentEditable, isDisabled, isDraggable, isHidden, isInert, isSpellCheck, onDisabled, onEnabled, setAccessKey, setAriaAtomic, setAriaBusy, setAriaChecked, setAriaCheckedMixed, setAriaControls, setAriaCurrent, setAriaDescribedBy, setAriaDisabled, setAriaErrorMessage, setAriaExpanded, setAriaHasPopup, setAriaHasPopup, setAriaHidden, setAriaInvalid, setAriaLabel, setAriaLabelledBy, setAriaLevel, setAriaLive, setAriaModal, setAriaOwns, setAriaPressed, setAriaRequired, setAriaSelected, setAriaValueRange, setAriaValueText, setAutoCapitalize, setAutoFocus, setConsumeEvent, setContentEditable, setDisabled, setDraggable, setDropAllowed, setEnterKeyHint, setFocus, setHidden, setInert, setInputMode, setOnAnimationCancel, setOnAnimationEnd, setOnAnimationIteration, setOnAnimationStart, setOnAuxClick, setOnBeforeInput, setOnBeforeToggle, setOnBlur, setOnChange, setOnClick, setOnClickChange, setOnCompositionEnd, setOnCompositionStart, setOnCompositionUpdate, setOnContextMenu, setOnCopy, setOnCut, setOnDocumentResize, setOnFocus, setOnFocusIn, setOnFocusOut, setOnFormData, setOnGotPointerCapture, setOnInput, setOnInvalid, setOnKeyDown, setOnKeyPressed, setOnKeyUp, setOnLostPointerCapture, setOnMouseDown, setOnMouseEnter, setOnMouseLeave, setOnMouseMove, setOnMouseOut, setOnMouseOutChangeClass, setOnMouseOutChangeStyle, setOnMouseOutChangeStyle, setOnMouseOver, setOnMouseOverChangeClass, setOnMouseOverChangeStyle, setOnMouseOverChangeStyle, setOnMouseOverShow, setOnMouseUp, setOnPageLoad, setOnPaste, setOnPointerCancel, setOnPointerDown, setOnPointerEnter, setOnPointerLeave, setOnPointerMove, setOnPointerOut, setOnPointerOver, setOnPointerUp, setOnResize, setOnScroll, setOnScrollEnd, setOnSelect, setOnSelectionChange, setOnSelectStart, setOnToggle, setOnTouchCancel, setOnTouchEnd, setOnTouchMove, setOnTouchStart, setOnTransitionCancel, setOnTransitionEnd, setOnTransitionRun, setOnTransitionStart, setOnWheel, setOnWindowResize, setPopover, setRole, setRole, setSpellCheck, setTabIndex, setTitle, setTooltipMethods inherited from class com.oorian.html.Element
addAttribute, addAttribute, addAttribute, addAttribute, addElement, addLineBreak, addLineOfText, addLineOfText, addLineOfText, addParagraph, addParagraph, addSpacer, addText, addText, addText, addText, assignId, containsElement, containsElement, create, dispatchEvent, dispatchEvent, dispatchEvent, dispatchEvent, equals, excludeId, executeJs, executeJs, executeJs, getAccept, getAllElements, getAncestor, getAttribute, getAttributes, getComponent, getDir, getElement, getElementById, getElementCount, getElementCount, getElements, getElements, getElementsByComponentName, getElementsByTagName, getHtml, getId, getInnerHtml, getInnerHtml, getIs, getItemId, getItemProp, getItemRef, getItemType, getLang, getNextSibling, getPage, getParent, getPart, getPrevSibling, getSlot, getTagName, getTextContent, getUrl, hasAttribute, hasElements, insertElement, isChildOf, isClosedTag, isCreated, isDescendantOf, isDescendantOf, isInitialized, isItemScope, isTranslate, onCallback, onCreated, onElementAdded, onElementRemoved, onHashChange, onHidden, onInitialized, onJsReturn, onPageLoaded, onPageUnloaded, onRefresh, onShown, onUpdated, onUserEvent, prewrite, recreate, refresh, refresh, registerAddition, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerSubtraction, registerUpdate, removeAllElements, removeAttribute, removeAttribute, removeElement, removeElement, removeFromParent, requestCallback, requestCallback, requestCallback, requestCallback, resetId, scrollTo, scrollToBottom, scrollToTop, self, sendCommand, sendUpdate, setAccept, setComponent, setDir, setDir, setElement, setId, setIs, setItemId, setItemProp, setItemRef, setItemScope, setItemType, setLang, setOnError, setOnLoad, setPage, setParent, setPart, setSlot, setTagName, setText, setText, setText, setText, setTranslate, toString, unregisterListener, update, updateAttributes
-
Constructor Details
-
RegionLayout
public RegionLayout()Constructs a RegionLayout with default configuration.
-
-
Method Details
-
initialize
protected void initialize()Builds the element tree for the layout.- Overrides:
initializein classStyledElement<RegionLayout>
-
north
Sets the north region content.- Parameters:
content- the north region content (header, toolbar, etc.)- Returns:
- this RegionLayout for method chaining
-
south
Sets the south region content.- Parameters:
content- the south region content (footer, status bar, etc.)- Returns:
- this RegionLayout for method chaining
-
west
Sets the west region content.- Parameters:
content- the west region content (navigation, sidebar, etc.)- Returns:
- this RegionLayout for method chaining
-
east
Sets the east region content.- Parameters:
content- the east region content (sidebar, properties panel, etc.)- Returns:
- this RegionLayout for method chaining
-
center
Sets the center region content.- Parameters:
content- the center region content (main content area)- Returns:
- this RegionLayout for method chaining
-
setNorthHeight
Sets the north region height.- Parameters:
height- the height in pixels- Returns:
- this RegionLayout for method chaining
-
setNorthHeight
Sets the north region height.- Parameters:
height- the height value (e.g., "64px", "auto")- Returns:
- this RegionLayout for method chaining
-
setSouthHeight
Sets the south region height.- Parameters:
height- the height in pixels- Returns:
- this RegionLayout for method chaining
-
setSouthHeight
Sets the south region height.- Parameters:
height- the height value (e.g., "48px", "auto")- Returns:
- this RegionLayout for method chaining
-
setWestWidth
Sets the west region width.- Parameters:
width- the width in pixels- Returns:
- this RegionLayout for method chaining
-
setWestWidth
Sets the west region width.- Parameters:
width- the width value (e.g., "280px", "20%")- Returns:
- this RegionLayout for method chaining
-
setEastWidth
Sets the east region width.- Parameters:
width- the width in pixels- Returns:
- this RegionLayout for method chaining
-
setEastWidth
Sets the east region width.- Parameters:
width- the width value (e.g., "300px", "25%")- Returns:
- this RegionLayout for method chaining
-
setNorthBackground
Sets the north region background color.- Parameters:
color- the background color- Returns:
- this RegionLayout for method chaining
-
setSouthBackground
Sets the south region background color.- Parameters:
color- the background color- Returns:
- this RegionLayout for method chaining
-
setWestBackground
Sets the west region background color.- Parameters:
color- the background color- Returns:
- this RegionLayout for method chaining
-
setEastBackground
Sets the east region background color.- Parameters:
color- the background color- Returns:
- this RegionLayout for method chaining
-
setCenterBackground
Sets the center region background color.- Parameters:
color- the background color- Returns:
- this RegionLayout for method chaining
-
setNorthPadding
Sets padding for the north region.- Parameters:
padding- the padding in pixels- Returns:
- this RegionLayout for method chaining
-
setNorthPadding
Sets padding for the north region.- Parameters:
padding- the padding value (e.g., "16px", "1rem")- Returns:
- this RegionLayout for method chaining
-
setSouthPadding
Sets padding for the south region.- Parameters:
padding- the padding in pixels- Returns:
- this RegionLayout for method chaining
-
setSouthPadding
Sets padding for the south region.- Parameters:
padding- the padding value (e.g., "16px", "1rem")- Returns:
- this RegionLayout for method chaining
-
setWestPadding
Sets padding for the west region.- Parameters:
padding- the padding in pixels- Returns:
- this RegionLayout for method chaining
-
setWestPadding
Sets padding for the west region.- Parameters:
padding- the padding value (e.g., "16px", "1rem")- Returns:
- this RegionLayout for method chaining
-
setEastPadding
Sets padding for the east region.- Parameters:
padding- the padding in pixels- Returns:
- this RegionLayout for method chaining
-
setEastPadding
Sets padding for the east region.- Parameters:
padding- the padding value (e.g., "16px", "1rem")- Returns:
- this RegionLayout for method chaining
-
setCenterPadding
Sets padding for the center region.- Parameters:
padding- the padding in pixels- Returns:
- this RegionLayout for method chaining
-
setCenterPadding
Sets padding for the center region.- Parameters:
padding- the padding value (e.g., "24px", "1.5rem")- Returns:
- this RegionLayout for method chaining
-
getNorthRegion
Returns the north region for advanced customization.- Returns:
- the north region div
-
getSouthRegion
Returns the south region for advanced customization.- Returns:
- the south region div
-
getWestRegion
Returns the west region for advanced customization.- Returns:
- the west region div
-
getEastRegion
Returns the east region for advanced customization.- Returns:
- the east region div
-
getCenterRegion
Returns the center region for advanced customization.- Returns:
- the center region div
-
getMiddleContainer
Returns the middle row container for advanced customization.- Returns:
- the middle row HStack
-