Hyper Beans 1: Hyper Style
We wanna style our documents and reports using neutral Java objects, to generate output artifacts eg. HTML with CSS, and/or other formats, eg. PDF and Excel (for reports). We model our style objects after CSS, eg. font-family, font-weight, text-decoration, et al.
Click here to read "Hyper Style"
The debut of the "Hyper Beans" series
We implement style objects for generating
this series
of articles, and also
Gooey Beans,
using quitehyper.
where we statically import style enums and constants, eg. lightgrayColor, dashedLine,
boldFontWeight, et al.
Code Snippet
public class GooeyBeansStyleManager extends QStyleManager {
QStyle javaStyle = createStyle("javaStyle");
QStyle paragraphStyle = createStyle("paragraphStyle");
QStyle sectionStyle = createStyle("sectionStyle");
QStyle subsectionStyle = createStyle("subsectionStyle");
...
List<QFontFamily> courier = Arrays.asList(newCourierFontFamily,
courierFontFamily, monospacedFontFamily);
List<QFontFamily> verdana = Arrays.asList(verdanaFontFamily,
helveticaFontFamily, arialFontFamily, sansserifFontFamily);
public GooeyArticleStyleManager() {
javaStyle.setFontFamily(courier);
javaStyle.setFontSize(11);
javaStyle.setBorder(dashedLine, 1);
javaStyle.setBorderColor(lightgrayColor);
javaStyle.setPadding(4, leftLocation);
javaStyle.setWidth(800);
javaStyle.setBackgroundColor(0xf4f4f4);
paragraphStyle.setFontFamily(verdana);
paragraphStyle.setFontSize(10);
sectionStyle.setFontFamily(verdana);
sectionStyle.setFontWeight(boldFontWeight);
sectionStyle.setFontStyle(italicFontStyle);
...
}
...
}





