summaryrefslogtreecommitdiff
path: root/sources/ch/epfl/lamp
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2003-08-26 15:42:18 +0000
committermichelou <michelou@epfl.ch>2003-08-26 15:42:18 +0000
commitd7b4fc3e6975a1ec2ca4100d4c82017e8b3fbf74 (patch)
tree5abcdb8e271d87fbe60c273665f05cbcd91d2dbd /sources/ch/epfl/lamp
parent2b1afe846e3b1632538cf8135a20c64339c7b759 (diff)
downloadscala-d7b4fc3e6975a1ec2ca4100d4c82017e8b3fbf74.tar.gz
scala-d7b4fc3e6975a1ec2ca4100d4c82017e8b3fbf74.tar.bz2
scala-d7b4fc3e6975a1ec2ca4100d4c82017e8b3fbf74.zip
- improved javadoc comments
Diffstat (limited to 'sources/ch/epfl/lamp')
-rw-r--r--sources/ch/epfl/lamp/util/XHTMLPrinter.java89
1 files changed, 73 insertions, 16 deletions
diff --git a/sources/ch/epfl/lamp/util/XHTMLPrinter.java b/sources/ch/epfl/lamp/util/XHTMLPrinter.java
index 86fde04ad2..1b7707acff 100644
--- a/sources/ch/epfl/lamp/util/XHTMLPrinter.java
+++ b/sources/ch/epfl/lamp/util/XHTMLPrinter.java
@@ -10,73 +10,130 @@ package ch.epfl.lamp.util;
import java.io.Writer;
-/** This class provides methods to print XHTML document.
+/**
+ * This class provides methods to print XHTML document.
+ *
+ * @author Stephane Micheloud
+ * @version 1.1
*/
public class XHTMLPrinter extends HTMLPrinter {
//########################################################################
// Public Constructors
- /** Creates a new instance */
+ /**
+ * Creates a new instance.
+ *
+ * @param writer
+ * @param title
+ * @param repr
+ */
public XHTMLPrinter(Writer writer, String title, HTMLRepresentation repr) {
super(writer, title, repr);
}
- /** Creates a new instance */
+ /**
+ * Creates a new instance with "XHTML 1.0 Transitional" as default document type.
+ *
+ * @param writer
+ * @param title
+ * @param encoding
+ */
public XHTMLPrinter(Writer writer, String title, String encoding) {
- super(writer, title, encoding);
+ this(writer, title, new HTMLRepresentation("XHTML 1.0 Transitional", encoding));
}
- /** Creates a new instance */
+ /**
+ * Creates a new instance with "utf-8" as default character encoding.
+ *
+ * @param writer
+ * @param title
+ */
public XHTMLPrinter(Writer writer, String title) {
- super(writer, title, "utf-8");
+ this(writer, title, "utf-8");
}
//########################################################################
- // Public Methods
+ // Public Methods - Printing simple values followed by a new line
- /** Prints text 'text' in bold followed by a new line. */
+ /**
+ * Prints text <code>text</code> in bold followed by a new line.
+ *
+ * @param text
+ */
public HTMLPrinter printlnBold(String text) {
return printlnTag("span",
new XMLAttribute[]{ new XMLAttribute("style", "font-weight:bold;") },
text);
}
- /** Prints text 'text' in bold. */
+ /**
+ * Prints an horizontal line separator followed by a new line.
+ */
+ public HTMLPrinter printlnHLine() {
+ printOTag("div", new XMLAttribute[] {
+ new XMLAttribute("style", "border:1px solid #aaaaaa; " +
+ "margin:10px 0px 5px 0px;height:1px;") });
+ return printlnCTag("div");
+ }
+
+ //########################################################################
+ // Public Methods - Printing simple values
+
+ /**
+ * Prints text <code>text</code> in bold.
+ *
+ * @param text
+ */
public HTMLPrinter printBold(String text) {
return printTag("span",
new XMLAttribute[]{ new XMLAttribute("style", "font-weight:bold;") },
text);
}
- /** Prints an horizontal line separator
- * @ param n gives the number of printed blank spaces
+ /**
+ * Prints an horizontal line separator
*/
public HTMLPrinter printHLine() {
printOTag("div", new XMLAttribute[] {
new XMLAttribute("style", "border:1px solid #aaaaaa; " +
"margin:10px 0px 5px 0px;height:1px;") });
- return printlnCTag("div");
+ return printCTag("div");
}
- /** Prints an horizontal line separator with attributes 'attrs'. */
+ /**
+ * Prints an horizontal line separator with attributes <code>attrs</code>.
+ *
+ * @param attrs
+ */
public HTMLPrinter printHLine(XMLAttribute[] attrs) {
return printHLine();
}
- /** Prints the <meta/> tag with attributes 'attrs' followed by a new line. */
+ /**
+ * Prints the &lt;meta/&gt; tag with attributes <code>attrs</code>
+ * followed by a new line.
+ *
+ * @param attrs
+ */
public HTMLPrinter printlnMeta(XMLAttribute[] attrs) {
return printlnSTag("meta", attrs);
}
- /** Prints the <link> tag with attributes 'attrs' followed by a new line. */
+ /**
+ * Prints the &lt;link&gt; tag with attributes <code>attrs</code>
+ * followed by a new line.
+ *
+ * @param attrs
+ */
public HTMLPrinter printlnLink(XMLAttribute[] attrs) {
return printlnSTag("link", attrs);
}
//########################################################################
- /** Prints XHTML preamble.
+ /**
+ * Prints XHTML preamble.
*/
protected void printPreamble() {
println("<!--");