org.nukesoft.bot2.botutil
Class VerboseConsole

java.lang.Object
  |
  +--org.nukesoft.bot2.botutil.VerboseConsole

public class VerboseConsole
extends Object

The VerboseConsole class is used to dynamicaly define the verbosity of all console output. This class can be used as a substitute to System.out. Class constants can be used to implement ANSI colors and text effects.

Author:
Ryan Michela

Field Summary
static int CRITICAL
           
static int HIGH
           
static int LOW
           
static int MEDIUM
           
static int SILENT
           
 
Constructor Summary
VerboseConsole()
           
VerboseConsole(int level)
           
 
Method Summary
static String BLACK_BACK()
           
static String BLACK_TEXT()
           
static String BLINK_OFF()
           
static String BLINK_ON()
           
static String BLUE_BACK()
           
static String BLUE_TEXT()
           
static String BOLD_OFF()
           
static String BOLD_ON()
           
static String BROWN_BACK()
           
static String BROWN_TEXT()
           
static String CYAN_BACK()
           
static String CYAN_TEXT()
           
static void enableANSI(boolean isOn)
          Enables or disables ANSI color.
static String GRAY_TEXT()
           
static String GREEN_BACK()
           
static String GREEN_TEXT()
           
static String MAGENTA_BACK()
           
static String MAGENTA_TEXT()
           
static void main(String[] args)
          Does a demo of what ANSI color can do.
static void print(String s)
          Print a string at the default level.
static void print(String s, int level)
          Print a string at a given level.
static void println(String s)
          Print a string at the default level.
static void println(String s, int level)
          Print a string at a given level.
static String RED_BACK()
           
static String RED_TEXT()
           
static String RESET_COLORS()
           
static String REVERSE_OFF()
           
static String REVERSE_ON()
           
static void setLevel(int level)
          Sets the verbocity level of the console.
static String WHITE_BACK()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SILENT

public static final int SILENT
See Also:
Constant Field Values

LOW

public static final int LOW
See Also:
Constant Field Values

MEDIUM

public static final int MEDIUM
See Also:
Constant Field Values

HIGH

public static final int HIGH
See Also:
Constant Field Values

CRITICAL

public static final int CRITICAL
See Also:
Constant Field Values
Constructor Detail

VerboseConsole

public VerboseConsole()

VerboseConsole

public VerboseConsole(int level)
Method Detail

setLevel

public static void setLevel(int level)
Sets the verbocity level of the console. Only output with a level equal to or higher to the target level will be displayed.

Parameters:
level - The target verbocity level.

enableANSI

public static void enableANSI(boolean isOn)
Enables or disables ANSI color. ANSI is off by default.

Parameters:
isOn - TRUE = on, FALSE = off.

print

public static void print(String s,
                         int level)
Print a string at a given level. Equivilent to System.out.print();

Parameters:
s - The string to print.
level - The level of this message.

print

public static void print(String s)
Print a string at the default level. Equivilent to System.out.print();

Parameters:
s - The string to print.

println

public static void println(String s,
                           int level)
Print a string at a given level. Equivilent to System.out.println();

Parameters:
s - The string to print.
level - The level of this message.

println

public static void println(String s)
Print a string at the default level. Equivilent to System.out.println();

Parameters:
s - The string to print.

BLACK_TEXT

public static final String BLACK_TEXT()

RED_TEXT

public static final String RED_TEXT()

GREEN_TEXT

public static final String GREEN_TEXT()

BROWN_TEXT

public static final String BROWN_TEXT()

BLUE_TEXT

public static final String BLUE_TEXT()

MAGENTA_TEXT

public static final String MAGENTA_TEXT()

CYAN_TEXT

public static final String CYAN_TEXT()

GRAY_TEXT

public static final String GRAY_TEXT()

BLACK_BACK

public static final String BLACK_BACK()

RED_BACK

public static final String RED_BACK()

GREEN_BACK

public static final String GREEN_BACK()

BROWN_BACK

public static final String BROWN_BACK()

BLUE_BACK

public static final String BLUE_BACK()

MAGENTA_BACK

public static final String MAGENTA_BACK()

CYAN_BACK

public static final String CYAN_BACK()

WHITE_BACK

public static final String WHITE_BACK()

RESET_COLORS

public static final String RESET_COLORS()

BOLD_ON

public static final String BOLD_ON()

BLINK_ON

public static final String BLINK_ON()

REVERSE_ON

public static final String REVERSE_ON()

BOLD_OFF

public static final String BOLD_OFF()

BLINK_OFF

public static final String BLINK_OFF()

REVERSE_OFF

public static final String REVERSE_OFF()

main

public static void main(String[] args)
Does a demo of what ANSI color can do.

Parameters:
args - Optionaly, the verbosity level to use.