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 Stringa(String url, String text)Stringa(String url, String text, String extraClauses)Stringbr()StringbrHtml()Generates a BR in HTML mode, and a space otherwise.Stringbutton(String text)Stringcode(String text)Stringcolored(String color, String text)Stringei(String text)Font emphasis for texts that are "CHEETA inference"Stringem(String text)Stringh1(String text)Stringh2(String text)Stringh3(String text)Stringh4(String text)Stringh5(String text)Stringhr()StringhrThin()Stringhtml(String title, String body)Stringpara(String text)StringparaEi(String text)Stringpre(String text)Stringrow(String... cols)Generates a table row (a TR element).Stringrow(Vector<String> cols)StringrowExtra(String extra, String... cols)StringrowExtra(String extra, Vector<String> cols)StringrowTh(String key, String tdExtra, String... cols)StringrowTh(String key, String tdExtra, Vector<String> cols)voidsetColor(boolean _color)This only affects HTML, not plain textStringsmall(String text)Stringspace()Stringspace(int n)Stringsprintf(String fmt, Object... data)Stringsrc(String text)Font emphasis for text directly sourced from the rap sheetStringstrong(String text)Stringstyle()Stringtable(String extra, String... rows)Generates a TABLE ...Stringtable(String extra, Vector<String> rows)Stringtd(String text)Stringtd(String extra, String text)Stringth(String text)Stringth(String extra, String text)Stringtr(String text)Stringtt(String text)Stringwrap(String wrap, String text)Stringwrap(String wrap, String extra, String text)Stringwrap2(String wrap, String text)Stringwrap2(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
-