本文整理汇总了Java中org.odftoolkit.odfdom.dom.style.OdfStyleFamily类的典型用法代码示例。如果您正苦于以下问题:Java OdfStyleFamily类的具体用法?Java OdfStyleFamily怎么用?Java OdfStyleFamily使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OdfStyleFamily类属于org.odftoolkit.odfdom.dom.style包,在下文中一共展示了OdfStyleFamily类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpCoreStyle
import org.odftoolkit.odfdom.dom.style.OdfStyleFamily; //导入依赖的package包/类
private void setUpCoreStyle() throws Throwable {
OdfOfficeAutomaticStyles styles = doc.getContentDom().getOrCreateAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.TableCell);
style.setProperty(OdfTableCellProperties.Border, "0.035cm solid #000000");
style.setProperty(OdfTableCellProperties.WrapOption, "wrap");
style.setProperty(OdfTableCellProperties.BackgroundColor, "#ffffff");
style.setProperty(OdfTableCellProperties.VerticalAlign, "middle");
style.setProperty(OdfParagraphProperties.TextAlign, "left");
style.setProperty(OdfParagraphProperties.MarginBottom, "0.2cm");
style.setProperty(OdfParagraphProperties.MarginTop, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingTop, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingBottom, "0.2cm");
style.setProperty(OdfTableCellProperties.PaddingLeft, "0.2cm");
style.setProperty(OdfTextProperties.FontWeight, "Regular");
style.setProperty(OdfTextProperties.FontSize, "10pt");
coreCellStyle = style.getStyleNameAttribute();
}
示例2: addFamily
import org.odftoolkit.odfdom.dom.style.OdfStyleFamily; //导入依赖的package包/类
/**
* We know the named family is in the document styles
*
* @param name
* @param family
*/
public void addFamily(String name, OdfStyleFamily family) {
OdfeStyleFamily sFamily = styleFamiliesMap.get(name);
if(sFamily == null) {
//create our own object to tree the styles
OdfeStyleFamily styleFamily = new OdfeStyleFamily(name, family);
styleFamiliesMap.put(name, styleFamily);
}
else {
//log that we have found the same family again?
//Need to do this if we are to aggregate or diff
}
}
示例3: prepareCoreStyle
import org.odftoolkit.odfdom.dom.style.OdfStyleFamily; //导入依赖的package包/类
public static String prepareCoreStyle(final SpreadsheetDocument doc) throws Throwable {
OdfOfficeAutomaticStyles styles = doc.getContentDom().getOrCreateAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.TableCell);
for (OdfStyleProperty property : styleMap.keySet()) {
style.setProperty(property, styleMap.get(property));
}
coreStyleName = style.getStyleNameAttribute();
return coreStyleName;
}
示例4: OdfeStyleFamily
import org.odftoolkit.odfdom.dom.style.OdfStyleFamily; //导入依赖的package包/类
public OdfeStyleFamily(String name, OdfStyleFamily family) {
this.name = name;
}
示例5: addAutomaticStyles
import org.odftoolkit.odfdom.dom.style.OdfStyleFamily; //导入依赖的package包/类
void addAutomaticStyles() {
OdfStyle style;
// Column style (all columns same width)
style = contentAutoStyles.newStyle(OdfStyleFamily.TableColumn);
columnStyleName = style.getStyleNameAttribute();
style.setProperty(OdfTableColumnProperties.ColumnWidth, "2.5cm");
// Row style
style = contentAutoStyles.newStyle(OdfStyleFamily.TableRow);
rowStyleName = style.getStyleNameAttribute();
style.setProperty(OdfTableRowProperties.RowHeight, "0.5cm");
// bold centered cells (for first row)
style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
headingStyleName = style.getStyleNameAttribute();
style.setProperty(OdfParagraphProperties.TextAlign, "center");
setFontWeight(style, "bold");
// Create the date, time, and temperature styles and add them.
// The null in OdfNumberDateStyle means "use default calendar system"
OdfNumberDateStyle dateStyle = new OdfNumberDateStyle(contentDom, "yyyy-MM-dd", "numberDateStyle", null);
OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle(contentDom, "hh:mm:ss", "numberTimeStyle");
OdfNumberStyle numberStyle = new OdfNumberStyle(contentDom, "#0.00", "numberTemperatureStyle");
contentAutoStyles.appendChild(dateStyle);
contentAutoStyles.appendChild(timeStyle);
contentAutoStyles.appendChild(numberStyle);
// cell style for Date cells
style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
noaaDateStyleName = style.getStyleNameAttribute();
style.setStyleDataStyleNameAttribute("numberDateStyle");
// and for time cells
style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
noaaTimeStyleName = style.getStyleNameAttribute();
style.setStyleDataStyleNameAttribute("numberTimeStyle");
// and for the temperatures
style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
noaaTempStyleName = style.getStyleNameAttribute();
style.setStyleDataStyleNameAttribute("numberTemperatureStyle");
style.setProperty(OdfParagraphProperties.TextAlign, "right");
}