Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
Reworked the entire consolewindow system.
  • Loading branch information
e3ndr committed Nov 10, 2020
1 parent 9986e2e commit a976180
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 114 deletions.
32 changes: 21 additions & 11 deletions ...java/xyz/e3ndr/consoleutil/ColorTest.java → WindowExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

import java.io.IOException;

public class ColorTest {
import xyz.e3ndr.consoleutil.ansi.ConsoleAttribute;
import xyz.e3ndr.consoleutil.ansi.ConsoleColor;
import xyz.e3ndr.fastloggingframework.FastLoggingFramework;
import xyz.e3ndr.fastloggingframework.logging.LogLevel;

public class WindowExample {

public static void main(String[] args) throws IOException, InterruptedException {
// FastLoggingFramework.setDefaultLevel(LogLevel.DEBUG);
FastLoggingFramework.setDefaultLevel(LogLevel.DEBUG);

ConsoleUtil.summonConsoleWindow();

ConsoleWindow window = new ConsoleWindow();

window.cursorTo(0, 0);
window.setAutoFlushing(false).clearScreen().cursorTo(0, 0);

for (ConsoleColor color : ConsoleColor.values()) {
if (!color.isLight()) {
Expand All @@ -33,17 +38,22 @@ public static void main(String[] args) throws IOException, InterruptedException

window.setBackgroundColor(ConsoleColor.BLACK).setTextColor(ConsoleColor.WHITE);

window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.BOLD).write("BOLD ");
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.STRIKETHROUGH).write("STRIKETHROUGH ");
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.ITALIC).write("ITALIC ");
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.UNDERLINE).write("UNDERLINE ");

window.setAttributes(ConsoleAttribute.CUSTOR_BLINK_OFF);
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.BOLD).write("BOLD").cursorRight(1);
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.STRIKETHROUGH).write("STRIKETHROUGH").cursorRight(1);
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.ITALIC).write("ITALIC").cursorRight(1);
window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.UNDERLINE).write("UNDERLINE").cursorRight(1);

window.setAttributes(ConsoleAttribute.RESET, ConsoleAttribute.CURSOR_BLINK_OFF);
window.update();

Thread.sleep(1000000);

while (true) {
for (ConsoleColor color : ConsoleColor.values()) {
window.cursorTo(4, 6).setBackgroundColor(color).write(" ").setBackgroundColor(ConsoleColor.BLACK);
window.cursorTo(4, 7).setBackgroundColor(color).write(" ").setBackgroundColor(ConsoleColor.BLACK);
window.update();
Thread.sleep(150);
}
}
}

}
28 changes: 0 additions & 28 deletions src/main/java/xyz/e3ndr/consoleutil/ConsoleAttribute.java

This file was deleted.

Loading

0 comments on commit a976180

Please sign in to comment.