Package de.linusdev.lutils.ansi.sgr
Class SGR
java.lang.Object
de.linusdev.lutils.ansi.sgr.SGR
Select Graphic Rendition for Consoles. This class can
Example usage:
construct control sequences to set display
attributes of consoles and terminals.Example usage:
SGR sgr = new SGR(SGRParameters.FOREGROUND_RED);
System.out.println(sgr.construct() + "Some text in red." + SGR.reset());
System.out.println("Normal text.")
This will give the following output: Some text in red.
Normal text- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSGR()SGR(@NotNull SGRParameter sgrParam, @NotNull String @NotNull ... params) SGR(@NotNull String delimiter, @NotNull SGRParameter sgrParam, @NotNull String @NotNull ... params) -
Method Summary
Modifier and TypeMethodDescriptionadd(@NotNull SGRParameter sgrParam, @NotNull String @NotNull ... params) Adds givenSGRParameterto thisSGR.@NotNull StringConstructs the control sequence.static @NotNull Stringreset()
-
Field Details
-
SGR_START_CODE
- See Also:
-
SGR_PARAMETER_DELIMITER
- See Also:
-
SGR_END_CODE
- See Also:
-
RESET_CONSTRUCTED
-
-
Constructor Details
-
SGR
- Parameters:
delimiter- delimiter used to seperated arguments.
-
SGR
public SGR() -
SGR
public SGR(@NotNull @NotNull String delimiter, @NotNull @NotNull SGRParameter sgrParam, @NotNull @NotNull String @NotNull ... params) - Parameters:
delimiter- delimiter used to seperated arguments.sgrParam- firstSGRParameterparams- parameters forsgrParam
-
SGR
-
-
Method Details
-
reset
-
add
public SGR add(@NotNull @NotNull SGRParameter sgrParam, @NotNull @NotNull String @NotNull ... params) Adds givenSGRParameterto thisSGR.- Parameters:
sgrParam-SGRParameterto add.params- parameters forsgrParam- Returns:
- this
-
construct
Constructs the control sequence.- Returns:
- the constructed control sequence
-