diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34a1efa --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Maven template +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + diff --git a/src/main/java/com/anas/jcolorfulconsole/ConsoleManager.java b/src/main/java/com/anas/jcolorfulconsole/ConsoleManager.java index 1792b92..0ce268e 100644 --- a/src/main/java/com/anas/jcolorfulconsole/ConsoleManager.java +++ b/src/main/java/com/anas/jcolorfulconsole/ConsoleManager.java @@ -4,9 +4,10 @@ import com.anas.jcolorfulconsole.color.BackgroundColor; import com.anas.jcolorfulconsole.color.TextColor; public interface ConsoleManager { - void setColor(TextColor textColor); + void setTextColor(TextColor textColor); void setBackgroundColor(BackgroundColor backgroundColor); - void setProperty(ConsoleProperty property); + void addProperty(ConsoleProperty property); + void removeProperty(ConsoleProperty property); void print(String text); void print(String text, ConsoleProperty... properties); diff --git a/src/main/java/com/anas/jcolorfulconsole/color/ASCIIColor.java b/src/main/java/com/anas/jcolorfulconsole/color/ASCIIColor.java index 26d6bd8..dc94e69 100644 --- a/src/main/java/com/anas/jcolorfulconsole/color/ASCIIColor.java +++ b/src/main/java/com/anas/jcolorfulconsole/color/ASCIIColor.java @@ -9,7 +9,7 @@ public class ASCIIColor implements ConsoleProperty { this.code = code; } - public static final ASCIIColor RESET = new ASCIIColor((short)0); + public static final ASCIIColor DEFAULT = new ASCIIColor((short)-1); @Override public short getCode() { diff --git a/src/main/java/com/anas/jcolorfulconsole/color/BackgroundColor.java b/src/main/java/com/anas/jcolorfulconsole/color/BackgroundColor.java index 028d6ee..d3cfdbc 100644 --- a/src/main/java/com/anas/jcolorfulconsole/color/BackgroundColor.java +++ b/src/main/java/com/anas/jcolorfulconsole/color/BackgroundColor.java @@ -23,6 +23,8 @@ public class BackgroundColor extends ASCIIColor { public static final BackgroundColor LIGHT_WHITE = new BackgroundColor((short)7); public static final BackgroundColor LIGHT_GRAY = new BackgroundColor((short)107); + public static final BackgroundColor DEFAULT = new BackgroundColor(ASCIIColor.DEFAULT.getCode()); + protected BackgroundColor(short code) { super(code); } diff --git a/src/main/java/com/anas/jcolorfulconsole/color/TextColor.java b/src/main/java/com/anas/jcolorfulconsole/color/TextColor.java index 2fa6451..e27fa3c 100644 --- a/src/main/java/com/anas/jcolorfulconsole/color/TextColor.java +++ b/src/main/java/com/anas/jcolorfulconsole/color/TextColor.java @@ -23,6 +23,9 @@ public class TextColor extends ASCIIColor { public static final TextColor LIGHT_CYAN = new TextColor((short)96); public static final TextColor LIGHT_GRAY = new TextColor((short)97); + public static final TextColor DEFAULT = new TextColor(ASCIIColor.DEFAULT.getCode()); + + protected TextColor(short code) { super(code); }