Coalevo Logo

net.coalevo.text.util
Class ANSIHelper

java.lang.Object
  extended by net.coalevo.text.util.ANSIHelper

public class ANSIHelper
extends java.lang.Object

Provides standard ANSI Terminal colors and styles.

Version:
1.0.0 (10/02/2009)
Author:
Dieter Wimberger (wimpi)

Field Summary
static java.lang.Character BLACK
          Defines the markup representation of the color black.
static java.lang.Character BLINK
          Defines the markup representation of the activator for style blinking.
static java.lang.Character BLUE
          Defines the markup representation of the color blue.
static java.lang.Character BOLD
          Defines the markup representation of the activator for style bold (normally represented by high intensity).
static java.lang.Character CYAN
          Defines the markup representation of the color cyan.
static java.lang.Character GREEN
          Defines the markup representation of the color green.
static java.lang.Character ITALIC
          Defines the markup representation of the activator for style italic.
static java.lang.Character MAGENTA
          Defines the markup representation of the color magenta.
static java.lang.Character RED
          Defines the markup representation of the color red.
static java.lang.Character UNDERLINED
          Defines the markup representation of the activator for style underlined.
static java.lang.Character WHITE
          Defines the markup representation of the color white.
static java.lang.Character YELLOW
          Defines the markup representation of the color yellow.
 
Constructor Summary
ANSIHelper()
           
 
Method Summary
 java.lang.String endBgColor()
           
 java.lang.String endFgColor()
           
 java.lang.String endStyle()
           
static java.lang.Character getColor(java.lang.String color)
           
static int getVisibleLength(java.lang.String str)
          Returns the length of the visible string calculated from the internal marked-up string passed as parameter.
static void main(java.lang.String[] args)
           
 java.lang.String resetAll()
           
 java.lang.String startBgColor(java.lang.Character color)
           
 java.lang.String startFgColor(java.lang.Character color)
           
 java.lang.String startStyle(java.lang.Character style)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLACK

public static final java.lang.Character BLACK
Defines the markup representation of the color black.


RED

public static final java.lang.Character RED
Defines the markup representation of the color red.


GREEN

public static final java.lang.Character GREEN
Defines the markup representation of the color green.


YELLOW

public static final java.lang.Character YELLOW
Defines the markup representation of the color yellow.


BLUE

public static final java.lang.Character BLUE
Defines the markup representation of the color blue.


MAGENTA

public static final java.lang.Character MAGENTA
Defines the markup representation of the color magenta.


CYAN

public static final java.lang.Character CYAN
Defines the markup representation of the color cyan.


WHITE

public static final java.lang.Character WHITE
Defines the markup representation of the color white.


BOLD

public static final java.lang.Character BOLD
Defines the markup representation of the activator for style bold (normally represented by high intensity).


ITALIC

public static final java.lang.Character ITALIC
Defines the markup representation of the activator for style italic.


UNDERLINED

public static final java.lang.Character UNDERLINED
Defines the markup representation of the activator for style underlined.


BLINK

public static final java.lang.Character BLINK
Defines the markup representation of the activator for style blinking.

Constructor Detail

ANSIHelper

public ANSIHelper()
Method Detail

resetAll

public java.lang.String resetAll()

startFgColor

public java.lang.String startFgColor(java.lang.Character color)

endFgColor

public java.lang.String endFgColor()

startBgColor

public java.lang.String startBgColor(java.lang.Character color)

endBgColor

public java.lang.String endBgColor()

startStyle

public java.lang.String startStyle(java.lang.Character style)

endStyle

public java.lang.String endStyle()

getColor

public static final java.lang.Character getColor(java.lang.String color)

getVisibleLength

public static int getVisibleLength(java.lang.String str)
Returns the length of the visible string calculated from the internal marked-up string passed as parameter.

Parameters:
str - String with internal color/style markups.
Returns:
long Representing the length of the visible string..

main

public static void main(java.lang.String[] args)

Coalevo Logo

(c) 2004-2009 VFI (http://www.vfi.or.at)