BoxLayout implements Layout
Read onlyYes
FinalYes
Boxes on a grid: a node sits above its first child, later children to the right, joined by a line from the node's right edge.
Interfaces
Methods
- box() : void
- content() : array<int, string>
- links() : void
- Draws the line from a box's right edge to each child after the first; the first child sits right below it.
- place() : void
- render() : string
- span() : int
- wrap() : array<int, string>
- write() : void
Methods
box()
public
box(array<int, array<int, string>> &$canvas, RenderedNode $entry, int $x, int $y, int $height, bool $hasParent) : void
Parameters
- $canvas : array<int, array<int, string>>
- $entry : RenderedNode
- $x : int
- $y : int
- $height : int
- $hasParent : bool
content()
public
content(RenderedNode $entry) : array<int, string>
Parameters
- $entry : RenderedNode
Return values
array<int, string>links()
Draws the line from a box's right edge to each child after the first; the first child sits right below it.
public
links(array<int, array<int, string>> &$canvas, RenderedNode, column: int, depth: int, parent: ?int} $box, array<int, RenderedNode, column: int, depth: int, parent: ?int}> $boxes, int $top, int $height) : void
Parameters
- $canvas : array<int, array<int, string>>
- $box : RenderedNode, column: int, depth: int, parent: ?int}
- $boxes : array<int, RenderedNode, column: int, depth: int, parent: ?int}>
- $top : int
- $height : int
place()
public
place(RenderedNode $entry, int $column, int $depth, int|null $parent, array<int, RenderedNode, column: int, depth: int, parent: ?int}> &$boxes) : void
Parameters
- $entry : RenderedNode
- $column : int
- $depth : int
- $parent : int|null
- $boxes : array<int, RenderedNode, column: int, depth: int, parent: ?int}>
render()
public
render(RenderedNode $root) : string
Parameters
- $root : RenderedNode
Return values
stringspan()
public
span(RenderedNode $entry) : int
Parameters
- $entry : RenderedNode
Return values
intwrap()
public
wrap(string $text) : array<int, string>
Parameters
- $text : string
Return values
array<int, string>write()
public
write(array<int, array<int, string>> &$canvas, int $x, int $y, string $text) : void
Parameters
- $canvas : array<int, array<int, string>>
- $x : int
- $y : int
- $text : string