io.github.kusoroadeolu.clique.components.Tree .
Controls two aspects of tree rendering:
├─, └─, │) that link nodes in the rendered output.
Node labels are not affected.MarkupParser used to resolve inline markup tags
The DEFAULT constant provides a pre-built configuration with no connector
color and MarkupParser#DEFAULT as the parser.
This class is immutable and thread-safe. TreeConfigurationBuilder is
not thread-safe; external synchronization is required if a builder instance
is shared across threads.
Example:
TreeConfiguration config = TreeConfiguration.builder()
.connectorColor("[cyan]")
.parser(MarkupParser.NONE)
.build();
Tree tree = new Tree("root", config);
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final AnsiCode[] | |
| public static final TreeConfiguration | DEFAULT
A default |
| private final MarkupParser |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TreeConfiguration. | Returns: a newTreeConfigurationBuilderReturns a new builder for constructing a |
| public boolean | equals(Object object)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public AnsiCode[] | Returns: a copy of the connector color codes; nevernull, may be emptyReturns a copy of the ANSI codes applied to tree connector characters Returns an empty array if no connector color has been set. |
| public MarkupParser | Returns: the parser; nevernullReturns the |
| public int | |
| public String |
| connectorColor | back to summary |
|---|---|
| private final AnsiCode[] connectorColor | |
| DEFAULT | back to summary |
|---|---|
| public static final TreeConfiguration DEFAULT A default | |
| parser | back to summary |
|---|---|
| private final MarkupParser parser | |
| TreeConfiguration | back to summary |
|---|---|
| private TreeConfiguration() | |
| TreeConfiguration | back to summary |
|---|---|
| private TreeConfiguration(TreeConfiguration. | |
| builder | back to summary |
|---|---|
| public static TreeConfiguration. Returns a new builder for constructing a | |
| 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.
| |
| getConnectorColor | back to summary |
|---|---|
| public AnsiCode[] getConnectorColor() Returns a copy of the ANSI codes applied to tree connector characters Returns an empty array if no connector color has been set. A defensive copy is returned on each call.
| |
| getParser | back to summary |
|---|---|
| public MarkupParser getParser() Returns the
| |
| 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
| |
| 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-
| |
TreeConfiguration.
Default values match those of TreeConfiguration#DEFAULT. Methods may
be called in any order; each returns this for chaining.
This builder is not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private AnsiCode[] | |
| private MarkupParser |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TreeConfiguration | Returns: a new, immutableTreeConfigurationConstructs a new |
| public TreeConfiguration. | Returns: this builderone or more ANSI codes to apply to connectors;
must not be connectorColor)nullSets the ANSI color applied to tree connector characters ( |
| public TreeConfiguration. | Returns: this buildera markup string representing the desired connector color;
must not be connectorColor)nullSets the connector color by parsing a markup string using the currently configured parser. |
| public TreeConfiguration. | Returns: this builderthe parser to use; must not be parser)nullSets the |
| connectorColor | back to summary |
|---|---|
| private AnsiCode[] connectorColor | |
| parser | back to summary |
|---|---|
| private MarkupParser parser | |
| TreeConfigurationBuilder | back to summary |
|---|---|
| public TreeConfigurationBuilder() | |
| build | back to summary |
|---|---|
| public TreeConfiguration build() Constructs a new
| |
| connectorColor | back to summary |
|---|---|
| public TreeConfiguration. Sets the ANSI color applied to tree connector characters (
| |
| connectorColor | back to summary |
|---|---|
| public TreeConfiguration. Sets the connector color by parsing a markup string using the currently configured parser. The markup string is resolved against the parser set via
Equivalent to
| |
| parser | back to summary |
|---|---|
| public TreeConfiguration. Sets the
| |