Package edu.wisc.game.formatter
Class Fmter
java.lang.Object
edu.wisc.game.formatter.Fmter
- Direct Known Subclasses:
HTMLFmter
public class Fmter extends Object
Auxiliary class for formatting output as plain text of HTML.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Fmter()
-
Method Summary
Modifier and Type Method Description String
a(String url, String text)
String
a(String url, String text, String extraClauses)
String
br()
String
brHtml()
Generates a BR in HTML mode, and a space otherwise.String
button(String text)
String
code(String text)
String
colored(String color, String text)
String
ei(String text)
Font emphasis for texts that are "CHEETA inference"String
em(String text)
String
h1(String text)
String
h2(String text)
String
h3(String text)
String
h4(String text)
String
h5(String text)
String
hr()
String
hrThin()
String
html(String title, String body)
String
para(String text)
String
paraEi(String text)
String
pre(String text)
String
row(String... cols)
Generates a table row (a TR element).String
row(Vector<String> cols)
String
rowExtra(String extra, String... cols)
String
rowExtra(String extra, Vector<String> cols)
String
rowTh(String key, String tdExtra, String... cols)
String
rowTh(String key, String tdExtra, Vector<String> cols)
void
setColor(boolean _color)
This only affects HTML, not plain textString
small(String text)
String
space()
String
space(int n)
String
sprintf(String fmt, Object... data)
String
src(String text)
Font emphasis for text directly sourced from the rap sheetString
strong(String text)
String
style()
String
table(String extra, String... rows)
Generates a TABLE ...String
table(String extra, Vector<String> rows)
String
td(String text)
String
td(String extra, String text)
String
th(String text)
String
th(String extra, String text)
String
tr(String text)
String
tt(String text)
String
wrap(String wrap, String text)
String
wrap(String wrap, String extra, String text)
String
wrap2(String wrap, String text)
String
wrap2(String wrap, String extra, String text)
-
Field Details
-
Constructor Details
-
Fmter
public Fmter()
-
-
Method Details
-
style
-
setColor
public void setColor(boolean _color)This only affects HTML, not plain text -
br
-
brHtml
Generates a BR in HTML mode, and a space otherwise. Handy for breaks in table headers. -
hr
-
hrThin
-
space
-
space
-
wrap
-
wrap
-
wrap2
-
wrap2
-
code
-
tt
-
em
-
strong
-
small
-
ei
Font emphasis for texts that are "CHEETA inference" -
src
Font emphasis for text directly sourced from the rap sheet -
button
-
para
-
paraEi
-
td
-
th
-
th
-
td
-
tr
-
table
Generates a TABLE ... /TABLE structure.- Parameters:
extra
- E.g. "border=\"1\""rows
- Each one is a TR ... /TR
-
table
-
h1
-
h2
-
h3
-
h4
-
h5
-
pre
-
a
-
a
-
colored
-
row
-
rowExtra
-
row
Generates a table row (a TR element).- Parameters:
cols
- The content of columns (without the TD wrapping; the wrapping will be done in this method)
-
rowTh
-
rowTh
-
rowExtra
-
html
-
sprintf
-