1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 | package Torello.Browser;
import static Torello.Java.C.*;
import Torello.Java.StrIndent;
import Torello.Java.StringParse;
import java.util.function.Consumer;
/** Simple printer for the example classes in this package */
public class Printing
{
private Printing() { }
/** Used to print a Yellow Line across the Screen. */
public static final String YELLOW_LINE =
BYELLOW_BKGND +
StringParse.nChars(' ', 60) +
RESET + '\n';
/** Used to print a Title-Bar with a Notice, as each Step in this Example-Class is executed */
public static void notice(String msg)
{
System.out.println(
'\n' +
YELLOW_LINE +
BYELLOW_BKGND + ' ' + RESET + ' ' +
StringParse.rightSpacePad(msg, 57) +
BYELLOW_BKGND + ' ' + RESET + '\n' +
YELLOW_LINE
);
}
/**
* A Handler which prints events and Data-Grams that are emitted by the Browser Connection &
* Browser-Connection Generated Web-Socket.
*/
public static void printObj(Object o)
{
System.out.println(
'\n' + BCYAN + "Example0(?).java: " + RESET +
BPURPLE_BKGND + " Handler 1 " + RESET +
" Browser Connection Handler has Received: " +
BPURPLE_BKGND + ' ' + o.getClass().getSimpleName() + ' ' + RESET + '\n' +
StrIndent.indent(o.toString(), 4)
);
}
}
|