diff --git a/README.md b/README.md index 6d133c0..6ec629a 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,187 @@ -![rsz_j4](https://user-images.githubusercontent.com/45015114/139809463-417377ca-2eef-4cec-9689-bd841b0ce5db.png) -# -**JTerminal** is an easy to use library for printing custom outouts on terminal. +

+ JTerminal +

JTerminal

+

Is an easy to use library for printing custom outouts on terminal!

+

+

+ + + + + + + + code factor + + + Contributors + + + License + +
+
+ + + + + + +

+

+ If you like this project, help me by giving me a star =))<3 +

+ +## What is in V1.0.0 +- Print and println with foreground and background color. +- Support 8-bit 0-255 XTerm colors. +- Get colors by name and theire XTerm code. +- TextEntity class for assign different styles to a single string. +- clear the terminal. +- delete lines. ## Hello Terminal To use JTerminal you just need to make a static call to your desired API. For example: -![Screenshot from یب11-01 22-18-31](https://user-images.githubusercontent.com/45015114/139813499-0b40be90-62d6-4f02-b771-4d47f0d66c16.png) +![ezgif com-gif-maker](https://user-images.githubusercontent.com/45015114/140813186-1326fb9b-decc-4182-bf3c-19a4b0e04c24.gif) -The above image was the result of running this piece of code: +The above gif was the result of running this piece of code: ```java +import java.util.List; + import io.github.shuoros.jterminal.JTerminal; import io.github.shuoros.jterminal.ansi.Color; +import io.github.shuoros.jterminal.util.TextEntity; public class Main { public static void main(String[] args) { - JTerminal.print("Hello", Color.YELLOW); - JTerminal.println("Terminal", Color.GREEN); - JTerminal.print("i'm JTerminal", Color.ORANGE); - JTerminal.println("!", Color.RED); + // Clear screen with timer + JTerminal.println("Screen must clear after one second"); + JTerminal.clear(1000); + + // Delete line + JTerminal.println("The line below must be deleted after one second"); + JTerminal.println("I should be deleted in a second"); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + JTerminal.delete(); + JTerminal.clear(1000); + + // Print with default foreground and background colors + JTerminal.println("Hello I'm in your terminal's default foreground and background color"); + JTerminal.println("\n"); + + // Print with foreground or background color + JTerminal.println("I'm an orange text with default background", Color.ORANGE); + JTerminal.println("I'm an orange text with white background", Color.ORANGE, Color.WHITE); + JTerminal.println("\n"); + + // Use custom XTerm code + JTerminal.println("I'm printed with 201 XTerm code", Color.xTerm(201)); + JTerminal.println("\n"); + + // Print with TextEntity + JTerminal.println("My colors were set with TextEntity", List.of(// + new TextEntity(0, 24, Color.BLUE), // + new TextEntity(24, 33, Color.YELLOW, Color.RED))); + JTerminal.println("\n"); + + // All suppoerted XTerm colors (8-bit 0-255) + JTerminal.println("All suppoerted XTerm colors (8-bit 0-255) ->", List.of(// + new TextEntity(0, 27, Color.WHITE), // + new TextEntity(27, 42, Color.RED), // + new TextEntity(42, 44, Color.WHITE, Color.ORANGE))); + JTerminal.println(""); + for (Color color : Color.values()) { + JTerminal.print(color.toString(), color); + JTerminal.print(" "); + } + JTerminal.println("\n"); + + // Credits + JTerminal.println(">JTerminal:~ 1.0.0", List.of(// + new TextEntity(0, 1, Color.DARK_SEA_GREEN_7), // + new TextEntity(1, 10, Color.ORANGE), // + new TextEntity(10, 12, Color.DARK_SEA_GREEN_7), // + new TextEntity(12, 18, Color.WHITE))); + JTerminal.println("By Soroush Shemshadi", Color.ORANGE); } } ``` -To see color cheat sheet please check [color docs](https://github.com/shuoros/JTerminal/blob/main/doc/colors) +#### To see color cheat sheet please check [docs](https://github.com/shuoros/JTerminal/blob/main/doc). + +## Installation +You can use **JTerminal** with any project management tool: + +### Maven + +```xml + + + io.github.shuoros + JTerminal + 1.0.0 + +``` + +### Gradle + +```gradle +// https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +implementation group: 'io.github.shuoros', name: 'JTerminal', version: '1.0.0' +``` +Or + +```gradle +// https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +implementation 'io.github.shuoros:JTerminal:1.0.0' +``` + +And in **Kotlin** + +```gradle +// https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +implementation("io.github.shuoros:JTerminal:1.0.0") +``` + +### SBT + +```sbt +// https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +libraryDependencies += "io.github.shuoros" % "JTerminal" % "1.0.0" +``` + +### Ivy + +```xml + + +``` + +### Grape + +```java +// https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +@Grapes( + @Grab(group='io.github.shuoros', module='JTerminal', version='1.0.0') +) +``` + +### Leiningen + +```clj +;; https://mvnrepository.com/artifact/io.github.shuoros/JTerminal +[io.github.shuoros/JTerminal "1.0.0"] +``` ## Authors JTerminal is developed by [Soroush Shemshadi](https://github.com/shuoros) and [contributors](https://github.com/shuoros/JTerminal/blob/main/CONTRIBUTORS.md). @@ -43,3 +197,6 @@ If you encounter a bug or vulnerability, please read the [issue policy](https:// ## Documentation To learn how to work with JTerminal, please take a look at the [/doc](https://github.com/shuoros/JTerminal/tree/main/doc) folder. + +## Acknowledgement +A greate thanks to [@sarahrajabi](https://github.com/sarahrajabi) for designing the logo. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 199e2a6..63e5d73 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,6 +2,15 @@ ## next release +## 1.0.0 (2021-11-08) +### New Features +- Implement clear feature to clean whole terminal. +- Implement delete feature to delete lines in terminal. +- Fix default foreground and background color for terminals which not have black background. +- Add unit tests. +- Add TextEntity support. +- Add custom Xterm code support. + ## 0.1.1 (2021-11-01) ### New Features - Implement print and println features to print strings on terminal with customizable foreground and background color. diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..8906f54 --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ +# TODO + +- Add font support. +- Add RGB support. +- Add windows command prompt support. \ No newline at end of file diff --git a/doc/APIs/01print.md b/doc/APIs/01print.md index 09ec437..7525b1c 100644 --- a/doc/APIs/01print.md +++ b/doc/APIs/01print.md @@ -1,7 +1,9 @@ # Print And Println + To print or println your string on terminal, You can make a static call to JTerminal print and println API. -## ‍‍‍`print(String string)‍‍` -It's print out your string‍‍‍‍ on terminal with JTerminals default foreground and background color. + +## `print(String string) +It's print out your string on terminal with JTerminals default foreground and background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -16,7 +18,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of the default background and foreground color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET`. ```java /** @@ -27,15 +28,13 @@ First of all, the ANSI code of the default background and foreground color are g */ public static void print(String string) { System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", defaultForeground, "background", defaultBackground))); - System.out.print(string); - System.out.print(AnsiUtils.RESET); + AnsiUtils.generateCode(// + string, List.of(new TextEntity()))); } ``` ## `println(String string)` -It's print out your string‍‍‍‍ on terminal with end line and JTerminals default foreground and background color. +It's print out your string on terminal with end line and JTerminals default foreground and background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -50,7 +49,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of the default background and foreground color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET` and end line. ```java /** @@ -60,16 +58,90 @@ First of all, the ANSI code of the default background and foreground color are g * @param string : A string you want to print on terminal. */ public static void println(String string) { + System.out.println(// + AnsiUtils.generateCode(// + string, List.of(new TextEntity()))); +} +``` + +## `print(String string, , List textEnitities)` +It's print out your string on terminal with your given list of entities. + +Read more about [TextEntity](https://github.com/shuoros/JTerminal/blob/main/doc/Utils/00textEntity.md) + +```java +import io.github.shuoros.jterminal.JTerminal; + +public class Main { + + public static void main(String[] args) { + JTerminal.print("Hello!", List.of(// + new TextEntity(Color.ORANGE)); + } + +} +``` + +#### Implementation + +```java +/** +* Prints your given string on terminal with list of your +* {@link io.github.shuoros.jterminal.util.TextEntity}s. +* +* @param string : A string you want to print on termina +* @param textEnitities : A List of +* {@link io.github.shuoros.jterminal.util.TextEntity} +* which each of them can contain setting for a range of +* your given string. +*/ +public static void print(String string, List textEnitities) { System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", defaultForeground, "background", defaultBackground))); - System.out.print(string); - System.out.println(AnsiUtils.RESET); + AnsiUtils.generateCode(// + string, textEnitities)); +} +``` + +## `println(String string, , List textEnitities)` +It's print out your string on terminal with end line and your given list of entities. + +Read more about [TextEntity](https://github.com/shuoros/JTerminal/blob/main/doc/Utils/00textEntity.md) + +```java +import io.github.shuoros.jterminal.JTerminal; + +public class Main { + + public static void main(String[] args) { + JTerminal.println("Hello!", List.of(// + new TextEntity(Color.ORANGE)); + } + +} +``` + +#### Implementation + +```java +/** +* Prints your given string with end line on terminal list of your +* {@link io.github.shuoros.jterminal.util.TextEntity}s. +* +* @param string : A string you want to print on termina +* @param textEnitities : A List of +* {@link io.github.shuoros.jterminal.util.TextEntity} +* which each of them can contain setting for a range of +* your given string. +*/ +public static void println(String string, List textEnitities) { + System.out.println(// + AnsiUtils.generateCode(// + string, textEnitities)); } ``` ## `print(String string, Color foreground)` -It's print out your string‍‍‍‍ on terminal with your given foreground color and JTerminals default background color. +It's print out your string on terminal with your given foreground color and JTerminals default background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -85,7 +157,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of the default background and given foreground color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET`. ```java /** @@ -98,16 +169,14 @@ First of all, the ANSI code of the default background and given foreground color * want print your string whit it on terminal. */ public static void print(String string, Color foreground) { - System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", foreground, "background", defaultBackground))); - System.out.print(string); - System.out.print(AnsiUtils.RESET); + System.out.print(// + AnsiUtils.generateCode(// + string, List.of(new TextEntity(foreground)))); } ``` ## `println(String string, Color foreground)` -It's print out your string‍‍‍‍ on terminal with end line and your given foreground color and JTerminals default background color. +It's print out your string on terminal with end line and your given foreground color and JTerminals default background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -123,7 +192,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of the default background and given foreground color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET` and end line. ```java /** @@ -136,16 +204,14 @@ First of all, the ANSI code of the default background and given foreground color * want print your string whit it on terminal. */ public static void println(String string, Color foreground) { - System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", foreground, "background", defaultBackground))); - System.out.print(string); - System.out.println(AnsiUtils.RESET); + System.out.println(// + AnsiUtils.generateCode(// + string, List.of(new TextEntity(foreground)))); } ``` ## `print(String string, Color foreground, Color background)` -It's print out your string‍‍‍‍ on terminal with your given foreground and background color. +It's print out your string on terminal with your given foreground and background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -161,7 +227,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of given foreground and background color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET`. ```java /** @@ -179,15 +244,13 @@ First of all, the ANSI code of given foreground and background color are generat */ public static void print(String string, Color foreground, Color background) { System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", foreground, "background", background))); - System.out.print(string); - System.out.print(AnsiUtils.RESET); + AnsiUtils.generateCode(// + string, List.of(new TextEntity(foreground, background)))); } ``` ## `println(String string, Color foreground, Color background)` -It's print out your string‍‍‍‍ on terminal with end line and your given foreground and background color. +It's print out your string on terminal with end line and your given foreground and background color. ```java import io.github.shuoros.jterminal.JTerminal; @@ -203,7 +266,6 @@ public class Main { ``` #### Implementation -First of all, the ANSI code of given foreground and background color are generate and print out using `AnsiUtils.generateCode`, Therefore, the next string that is sent to the terminal for printing has the desired colors. At the end terminal will be reset using ANSI reset escape code with `AnsiUtils.RESET` and end line. ```java /** @@ -220,10 +282,8 @@ First of all, the ANSI code of given foreground and background color are generat * terminal. */ public static void println(String string, Color foreground, Color background) { - System.out.print(// - AnsiUtils.generateCode(// - Map.of("foreground", foreground, "background", background))); - System.out.print(string); - System.out.println(AnsiUtils.RESET); + System.out.println(// + AnsiUtils.generateCode(// + string, List.of(new TextEntity(foreground, background)))); } ``` diff --git a/doc/APIs/02clear.md b/doc/APIs/02clear.md new file mode 100644 index 0000000..ab75682 --- /dev/null +++ b/doc/APIs/02clear.md @@ -0,0 +1,64 @@ +# Clear + +To clear terminal, You can make a static call to JTerminal clear API. + +## `clear()` +It's clears whole terminal. + +```java +import io.github.shuoros.jterminal.JTerminal; + +public class Main { + + public static void main(String[] args) { + JTerminal.println("Screen must clear"); + JTerminal.clear(); + } + +} +``` + +#### Implementation + +```java +/** +* Clear the terminal. +*/ +public static void clear() { + System.out.print("\033\143"); +} +``` + +## `clear(long sleep)` +It's clears whole terminal after sleep in `long sleep` seconds. + +```java +import io.github.shuoros.jterminal.JTerminal; + +public class Main { + + public static void main(String[] args) { + JTerminal.println("Screen must clear after one second"); + JTerminal.clear(1000); + } + +} +``` + +#### Implementation + +```java +/** +* Call the {@code clear()} after sleep for {@code sleep} milliseconds. +* +* @param sleep : Sleep time in milliseconds. +*/ +public static void clear(long sleep) { + try { + Thread.sleep(sleep); + } catch (InterruptedException e) { + e.printStackTrace(); + } + clear(); +} +``` \ No newline at end of file diff --git a/doc/APIs/03delete.md b/doc/APIs/03delete.md new file mode 100644 index 0000000..5e28823 --- /dev/null +++ b/doc/APIs/03delete.md @@ -0,0 +1,71 @@ +# Delete + +To delete line or lines in terminal, You can make a static call to JTerminal delete API. + +## `delete()` +It deletes one line before cursor. + +```java +import io.github.shuoros.jterminal.JTerminal; + +public class Main { + + public static void main(String[] args) { + JTerminal.println("The line below must be deleted after one second"); + JTerminal.println("I should be deleted in a second"); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + JTerminal.delete(); + } + +} +``` + +#### Implementation + +```java +/** +* Deletes the last line befour cursor. +*/ +public static void delete() { + int line = 1; + System.out.print(String.format("\033[%dA", line)); // Move up + System.out.print("\033[2K"); // Erase line content +} +``` + +## `delete(int line)` +it deletes `int line` lines before cursor. + +public class Main { + + public static void main(String[] args) { + JTerminal.println("The line below and I must be deleted after one second"); + JTerminal.println("I should be deleted in a second"); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + JTerminal.delete(2); + } + +} +``` + +#### Implementation + +```java +/** +* Delete last given {@code line}s befour cursor. +* +* @param line : Lines number you want to delete. +*/ +public static void delete(int line) { + System.out.print(String.format("\033[%dA", line)); // Move up + System.out.print("\033[2K"); // Erase line content +} +``` \ No newline at end of file diff --git a/doc/APIs/README.md b/doc/APIs/README.md index a599841..b5376a7 100644 --- a/doc/APIs/README.md +++ b/doc/APIs/README.md @@ -2,3 +2,5 @@ - [defaults](https://github.com/shuoros/JTerminal/blob/main/doc/APIs/00defaults.md) - [print and println](https://github.com/shuoros/JTerminal/blob/main/doc/APIs/01print.md) +- [clear](https://github.com/shuoros/JTerminal/blob/main/doc/APIs/02clear.md) +- [delete](https://github.com/shuoros/JTerminal/blob/main/doc/APIs/03delete.md) diff --git a/doc/Colors/00cheatsheet.md b/doc/Colors/00cheatsheet.md index df291a3..9e7c28e 100644 --- a/doc/Colors/00cheatsheet.md +++ b/doc/Colors/00cheatsheet.md @@ -264,3 +264,5 @@ For each color you can use its "Enum Name" like `Color.*` 255Grey93#eeeeeergb(238,238,238)hsl(0,0%,93%) + +Table credit by @jonasjacek \ No newline at end of file diff --git a/doc/Colors/01xterm.md b/doc/Colors/01xterm.md new file mode 100644 index 0000000..69f6847 --- /dev/null +++ b/doc/Colors/01xterm.md @@ -0,0 +1,18 @@ +# Xterm Colors + +To use colors by theire XTerm code you can call `xterm()` method in Color and give it XTerm code of color you want: + +```java +import io.github.shuoros.jterminal.JTerminal; +import io.github.shuoros.jterminal.ansi.Color; + +public class Main { + + public static void main(String[] args) { + JTerminal.print("Hello!", Color.xTerm(214); + } + +} +``` + +**The printed "Hello!" will have orange foreground.** \ No newline at end of file diff --git a/doc/Colors/xterm.md b/doc/Colors/xterm.md deleted file mode 100644 index b85fe3f..0000000 --- a/doc/Colors/xterm.md +++ /dev/null @@ -1 +0,0 @@ -# Xterm Colors \ No newline at end of file diff --git a/doc/README.md b/doc/README.md index c4ef998..a199274 100644 --- a/doc/README.md +++ b/doc/README.md @@ -3,4 +3,5 @@ ## Table of content - [APIs](https://github.com/shuoros/JTerminal/tree/main/doc/APIs) -- [Colors](https://github.com/shuoros/JTerminal/tree/main/doc/Colors) \ No newline at end of file +- [Colors](https://github.com/shuoros/JTerminal/tree/main/doc/Colors) +- [Utils](https://github.com/shuoros/JTerminal/tree/main/doc/Utils) \ No newline at end of file diff --git a/doc/Utils/00textEntity.md b/doc/Utils/00textEntity.md new file mode 100644 index 0000000..5dd03be --- /dev/null +++ b/doc/Utils/00textEntity.md @@ -0,0 +1,29 @@ +# TextEntity + +TextEntity is a model to represent entity of a given text to generate ANSI code based on that entities. + +In TextEntity you can define the range of your entity on text and then set the foreground and background color for the selected range. + +Example: + +```java +import java.util.List; + +import io.github.shuoros.jterminal.JTerminal; +import io.github.shuoros.jterminal.ansi.Color; +import io.github.shuoros.jterminal.util.TextEntity; + +public class Main { + + public static void main(String[] args) { + JTerminal.println(">JTerminal:~ 1.0.0", List.of(// + new TextEntity(0, 1, Color.DARK_SEA_GREEN_7), // + new TextEntity(1, 10, Color.ORANGE), // + new TextEntity(10, 12, Color.DARK_SEA_GREEN_7), // + new TextEntity(12, 18, Color.WHITE))); + } + +} +``` + +**Please consider that ranges must not overlap and for now give your list of entities in order of ranges and you must cover all of your string with TextEnity/TextEnities(0 -> text.length()). this shortcomes (ranges order and full coverage) will be solve in next versions.** \ No newline at end of file diff --git a/doc/Utils/README.md b/doc/Utils/README.md new file mode 100644 index 0000000..7cbc766 --- /dev/null +++ b/doc/Utils/README.md @@ -0,0 +1,3 @@ +# Documentation > Utils + +- [TextEntity](https://github.com/shuoros/JTerminal/blob/main/doc/Utils/00textEntity.md) \ No newline at end of file diff --git a/javadoc/allclasses-index.html b/javadoc/allclasses-index.html index 3953aa0..cc8638c 100644 --- a/javadoc/allclasses-index.html +++ b/javadoc/allclasses-index.html @@ -2,10 +2,10 @@ - + All Classes (JTerminal 0.0.1-SNAPSHOT API) - + @@ -27,8 +27,8 @@ catch(err) { } //--> -var data = {"i0":2,"i1":4,"i2":4,"i3":2,"i4":2}; -var tabs = {65535:["t0","All Classes"],2:["t2","Class Summary"],4:["t3","Enum Summary"]}; +var data = {"i0":2,"i1":4,"i2":4,"i3":8,"i4":8,"i5":2,"i6":2,"i7":2}; +var tabs = {65535:["t0","All Classes"],2:["t2","Class Summary"],4:["t3","Enum Summary"],8:["t4","Exception Summary"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; @@ -106,7 +106,7 @@

All Classes

diff --git a/javadoc/allclasses.html b/javadoc/allclasses.html index 05752b3..fc8a178 100644 --- a/javadoc/allclasses.html +++ b/javadoc/allclasses.html @@ -2,10 +2,10 @@ - + All Classes (JTerminal 0.0.1-SNAPSHOT API) - + @@ -24,8 +24,11 @@

All Classes

  • AnsiUtils
  • Attribute
  • Color
  • +
  • EntitiesRangeOverlapException
  • +
  • IncorrectXTermException
  • JTerminal
  • Main
  • +
  • TextEntity
  • diff --git a/javadoc/allpackages-index.html b/javadoc/allpackages-index.html index 667b178..2f42040 100644 --- a/javadoc/allpackages-index.html +++ b/javadoc/allpackages-index.html @@ -2,10 +2,10 @@ - + All Packages (JTerminal 0.0.1-SNAPSHOT API) - + @@ -115,6 +115,10 @@

    All Packages

      +io.github.shuoros.jterminal.exception +  + + io.github.shuoros.jterminal.util   diff --git a/javadoc/constant-values.html b/javadoc/constant-values.html index 3ad29c6..a9e516e 100644 --- a/javadoc/constant-values.html +++ b/javadoc/constant-values.html @@ -2,10 +2,10 @@ - + Constant Field Values (JTerminal 0.0.1-SNAPSHOT API) - + diff --git a/javadoc/deprecated-list.html b/javadoc/deprecated-list.html index dc57d81..fd2867f 100644 --- a/javadoc/deprecated-list.html +++ b/javadoc/deprecated-list.html @@ -2,10 +2,10 @@ - + Deprecated List (JTerminal 0.0.1-SNAPSHOT API) - + diff --git a/javadoc/element-list b/javadoc/element-list index 0c27c6c..f7000f9 100644 --- a/javadoc/element-list +++ b/javadoc/element-list @@ -1,3 +1,4 @@ io.github.shuoros.jterminal io.github.shuoros.jterminal.ansi +io.github.shuoros.jterminal.exception io.github.shuoros.jterminal.util diff --git a/javadoc/help-doc.html b/javadoc/help-doc.html index c60c3b4..4ae232b 100644 --- a/javadoc/help-doc.html +++ b/javadoc/help-doc.html @@ -2,10 +2,10 @@ - + API Help (JTerminal 0.0.1-SNAPSHOT API) - + diff --git a/javadoc/index-all.html b/javadoc/index-all.html index 6ba3f08..a7d3a29 100644 --- a/javadoc/index-all.html +++ b/javadoc/index-all.html @@ -2,10 +2,10 @@ - + Index (JTerminal 0.0.1-SNAPSHOT API) - + @@ -93,7 +93,7 @@
    -
    A B C D F G H I J K L M N O P R S T V W Y 
    All Classes All Packages +
    A B C D E F G H I J K L M N O P R S T V W X Y 
    All Classes All Packages

    A

    @@ -137,6 +137,10 @@

    B

    48;5; Set background color
    +
    BACKGROUND_RGB - io.github.shuoros.jterminal.ansi.Attribute
    +
    +
    48;2; Set background color in RGB
    +
    BLACK - io.github.shuoros.jterminal.ansi.Color
    Black - Xterm:0 - HEX:#000000 - RGB:0,0,0
    @@ -199,6 +203,14 @@

    C

    Chartreuse5 - Xterm:82 - HEX:#5fff00 - RGB:95,255,0
    +
    clear() - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Clear the terminal.
    +
    +
    clear(long) - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Call the clear() after sleep for sleep milliseconds.
    +
    CLEAR - io.github.shuoros.jterminal.ansi.Attribute
    0 Reset / Normal
    @@ -425,6 +437,18 @@

    D

    DeepSkyBlue6 - Xterm:23 - HEX:#005f5f - RGB:0,95,95
    +
    DEFAULT - io.github.shuoros.jterminal.ansi.Color
    +
    +
    Default color of your terminal
    +
    +
    delete() - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Deletes the last line befour cursor.
    +
    +
    delete(int) - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Delete last given lines befour cursor.
    +
    DODGER_BLUE - io.github.shuoros.jterminal.ansi.Color
    DodgerBlue - Xterm:33 - HEX:#0087ff - RGB:0,135,255
    @@ -438,6 +462,20 @@

    D

    DodgerBlue2 - Xterm:26 - HEX:#005fd7 - RGB:0,95,215
    + + + +

    E

    +
    +
    EntitiesRangeOverlapException - Exception in io.github.shuoros.jterminal.exception
    +
    +
    Exception class for entities overlap.
    +
    +
    EntitiesRangeOverlapException() - Constructor for exception io.github.shuoros.jterminal.exception.EntitiesRangeOverlapException
    +
     
    +
    EntitiesRangeOverlapException(String) - Constructor for exception io.github.shuoros.jterminal.exception.EntitiesRangeOverlapException
    +
     
    +
    @@ -445,7 +483,11 @@

    F

    FOREGROUND - io.github.shuoros.jterminal.ansi.Attribute
    -
    38;55 Set foreground color
    +
    38;5; Set foreground color
    +
    +
    FOREGROUND_RGB - io.github.shuoros.jterminal.ansi.Attribute
    +
    +
    38;2; Set foreground color in RGB
    FUCHISA - io.github.shuoros.jterminal.ansi.Color
    @@ -457,10 +499,14 @@

    F

    G

    -
    generateCode(Map<String, Color>) - Static method in class io.github.shuoros.jterminal.util.AnsiUtils
    +
    generateCode(String, List<TextEntity>) - Static method in class io.github.shuoros.jterminal.util.AnsiUtils
    -
    Generates ANSI escape sequences from options given by you.
    +
    Generates ANSI escape sequences from given text and list of entities.
    +
    getBackground() - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    getBegin() - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    getDefaultBackground() - Static method in class io.github.shuoros.jterminal.JTerminal
    Getter of default background.
    @@ -469,6 +515,10 @@

    G

    Getter of default foreground.
    +
    getEnd() - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    getForeground() - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    GOLD - io.github.shuoros.jterminal.ansi.Color
    Gold - Xterm:220 - HEX:#ffd700 - RGB:255,215,0
    @@ -669,6 +719,14 @@

    H

    I

    +
    IncorrectXTermException - Exception in io.github.shuoros.jterminal.exception
    +
    +
    Exception class for incorrect XTerm code.
    +
    +
    IncorrectXTermException() - Constructor for exception io.github.shuoros.jterminal.exception.IncorrectXTermException
    +
     
    +
    IncorrectXTermException(String) - Constructor for exception io.github.shuoros.jterminal.exception.IncorrectXTermException
    +
     
    INDIAN_RED - io.github.shuoros.jterminal.ansi.Color
    IndianRed - Xterm:167 - HEX:#d75f5f - RGB:215,95,95
    @@ -689,6 +747,8 @@

    I

     
    io.github.shuoros.jterminal.ansi - package io.github.shuoros.jterminal.ansi
     
    +
    io.github.shuoros.jterminal.exception - package io.github.shuoros.jterminal.exception
    +
     
    io.github.shuoros.jterminal.util - package io.github.shuoros.jterminal.util
     
    @@ -1072,6 +1132,11 @@

    P

    Prints your given string on terminal with your given foreground color and background color.
    +
    print(String, List<TextEntity>) - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Prints your given string on terminal with list of your + TextEntitys.
    +
    println(String) - Static method in class io.github.shuoros.jterminal.JTerminal
    Prints your given string with end line on terminal with default foreground @@ -1087,6 +1152,11 @@

    P

    Prints your given string with end line on terminal with your given foreground color and background color.
    +
    println(String, List<TextEntity>) - Static method in class io.github.shuoros.jterminal.JTerminal
    +
    +
    Prints your given string with end line on terminal with list of your + TextEntitys.
    +
    PURPLE - io.github.shuoros.jterminal.ansi.Color
    Purple - Xterm:5 - HEX:#800080 - RGB:128,0,128
    @@ -1175,6 +1245,10 @@

    S

    SeaGreen3 - Xterm:78 - HEX:#5fd787 - RGB:95,215,135
    +
    setBackground(Color) - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    setBegin(int) - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    setDefaultBackground(Color) - Static method in class io.github.shuoros.jterminal.JTerminal
    Setter of default background.
    @@ -1183,6 +1257,10 @@

    S

    Setter of default foreground.
    +
    setEnd(int) - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    setForeground(Color) - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    SILVER - io.github.shuoros.jterminal.ansi.Color
    Silver - Xterm:7 - HEX:#c0c0c0 - RGB:192,192,192
    @@ -1265,6 +1343,20 @@

    T

    Teal - Xterm:6 - HEX:#008080 - RGB:0,128,128
    +
    TextEntity - Class in io.github.shuoros.jterminal.util
    +
    +
    Model of entity for texts.
    +
    +
    TextEntity() - Constructor for class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    TextEntity(int, int, Color) - Constructor for class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    TextEntity(int, int, Color, Color) - Constructor for class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    TextEntity(Color) - Constructor for class io.github.shuoros.jterminal.util.TextEntity
    +
     
    +
    TextEntity(Color, Color) - Constructor for class io.github.shuoros.jterminal.util.TextEntity
    +
     
    THISTLE - io.github.shuoros.jterminal.ansi.Color
    Thistle - Xterm:225 - HEX:#ffd7ff - RGB:255,215,255
    @@ -1281,6 +1373,8 @@

    T

    Return a string representation of this Xterm code.
    +
    toString() - Method in class io.github.shuoros.jterminal.util.TextEntity
    +
     
    TURQUOISE - io.github.shuoros.jterminal.ansi.Color
    Turquoise - Xterm:45 - HEX:#00d7ff - RGB:0,215,255
    @@ -1336,6 +1430,16 @@

    W

    White - Xterm:15 - HEX:#ffffff - RGB:255,255,255
    + + + +

    X

    +
    +
    xTerm(int) - Static method in enum io.github.shuoros.jterminal.ansi.Color
    +
    +
    Creates a color based on your given XTerm code.
    +
    +
    @@ -1370,7 +1474,7 @@

    Y

    Yellow6 - Xterm:100 - HEX:#878700 - RGB:135,135,0
    -A B C D F G H I J K L M N O P R S T V W Y 
    All Classes All Packages
    +A B C D E F G H I J K L M N O P R S T V W X Y 
    All Classes All Packages