Component instances,
each independently aligned within the frame.
Width resolution order:
width(int) has been set, that value is used as the total inner width.Content width must not exceed frameWidth - (padding * 2); if it does,
io. is thrown
at render time.
This class is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private final BorderChars | |
| private final FrameConfiguration | |
| private static final int | |
| private final List | |
| private static final String | |
| private String | |
| private FrameAlign | |
| private final BoxType | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| pack-priv int | |
| pack-priv static int | |
| public String | Returns: the fully rendered frame as a multi-line string, terminated with a newlineImplements io. Builds the frame and all its nested nodes to a string. |
| public int | |
| public Frame | Returns: this frame, for chainingthe string to nest; must not be str)nullAppends a string node to this frame using the alignment configured in
|
| public Frame | Returns: this frame, for chainingthe string to nest; must not be str, FrameAlign nullthe horizontal alignment of the string within the frame; must not be align)nullAppends a string node to this frame with the specified alignment. |
| public Frame | Returns: this frame, for chainingthe component to nest; must not be component)null and must not be this frameAppends a |
| public Frame | Returns: this frame, for chainingthe component to nest; must not be component, FrameAlign null and must not be this framethe horizontal alignment within the frame; must not be align)nullAppends a |
| pack-priv boolean | |
| public Frame | Returns: this frame, for chainingthe title text; must not be title, FrameAlign nullthe horizontal placement of the title; must not be titleAlign)nullSets the frame title and its horizontal alignment within the top border. |
| public Frame | |
| public String | |
| pack-priv void | |
| public Frame | Returns: this frame, for chainingthe total inner width; must be greater than zero width)Sets the total inner width of the frame in characters, excluding the border columns. |
| borderChars | back to summary |
|---|---|
| private final BorderChars borderChars | |
| configuration | back to summary |
|---|---|
| private final FrameConfiguration configuration | |
| NO_WIDTH_SET | back to summary |
|---|---|
| private static final int NO_WIDTH_SET | |
| nodes | back to summary |
|---|---|
| private final List<FrameNode> nodes | |
| NULL_FRAME_ALIGN | back to summary |
|---|---|
| private static final String NULL_FRAME_ALIGN | |
| title | back to summary |
|---|---|
| private String title | |
| titleAlign | back to summary |
|---|---|
| private FrameAlign titleAlign | |
| type | back to summary |
|---|---|
| private final BoxType type | |
| width | back to summary |
|---|---|
| private int width | |
| Frame | back to summary |
|---|---|
| public Frame(FrameConfiguration configuration, BoxType type) | |
| Frame | back to summary |
|---|---|
| public Frame() | |
| Frame | back to summary |
|---|---|
| public Frame(BoxType type) | |
| Frame | back to summary |
|---|---|
| public Frame(FrameConfiguration configuration) | |
| align | back to summary |
|---|---|
| pack-priv void align(FrameNode node, int availableWidth, StringBuilder sb) | |
| appendTitleToBox | back to summary |
|---|---|
| pack-priv void appendTitleToBox(Cell parsedTitle, int givenWidth, int titleWidth, StringBuilder sb) | |
| assertNotSelf | back to summary |
|---|---|
| pack-priv void assertNotSelf(Component component) | |
| colorBorders | back to summary |
|---|---|
| pack-priv void colorBorders(BorderChars borderChar) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| findNodesMaxWidth | back to summary |
|---|---|
| pack-priv int findNodesMaxWidth() | |
| findTitleBlockOffset | back to summary |
|---|---|
| pack-priv static int findTitleBlockOffset(int givenWidth, int titleWidth, FrameAlign align) | |
| get | back to summary |
|---|---|
| public String get() Implements io. Builds the frame and all its nested nodes to a string. Width resolution, title placement, content alignment, and border drawing all occur during this call. No state is cached; each invocation performs a full render.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| nest | back to summary |
|---|---|
| public Frame nest(String str) Appends a string node to this frame using the alignment configured in
Equivalent to
| |
| nest | back to summary |
|---|---|
| public Frame nest(String str, FrameAlign align) Appends a string node to this frame with the specified alignment.
| |
| nest | back to summary |
|---|---|
| public Frame nest(Component component) Appends a Equivalent to
| |
| nest | back to summary |
|---|---|
| public Frame nest(Component component, FrameAlign align) Appends a A frame cannot nest itself. Attempting to do so throws
| |
| noWidthSet | back to summary |
|---|---|
| pack-priv boolean noWidthSet() | |
| title | back to summary |
|---|---|
| public Frame title(String title, FrameAlign titleAlign) Sets the frame title and its horizontal alignment within the top border. The title is rendered inline with the top border line. If a color parser is configured, a reset sequence is automatically appended to prevent color bleed into the border.
| |
| title | back to summary |
|---|---|
| public Frame title(String title) Sets the frame title with center alignment. Equivalent to
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| validateTitleWidth | back to summary |
|---|---|
| pack-priv void validateTitleWidth(int titleWidth, int resolvedWidth) | |
| width | back to summary |
|---|---|
| public Frame width(int width) Sets the total inner width of the frame in characters, excluding the border columns. When set, this width overrides auto-sizing. The available content width is
| |