eas之style接口

Obj可以是KDTable对象,也可以是IRow,IColumn,ICell对象
锁定
Obj.getStyleAttributes().setLocked(true);
Obj.getStyleAttributes().isLocked();
隐藏
Obj.getStyleAttributes().setHided(true);
Obj.getStyleAttributes().isHided()
对齐(水平和垂直)
Obj.getStyleAttributes().setHorizontalAlign(HorizontalAlignment. RIGHT);
Obj.getStyleAttributes().setVerticalAlign(VerticalAlignment.TOP);
是否折行
Obj.getStyleAttributes().setWrapText(true);
背景色
Obj.getStyleAttributes().setBackground(Color.YELLOW);
边框笔形(实心线或点线等)
Obj.getStyleAttributes().setBorderPenStyle(Position.RIGHT, PenStyle.PS_SOLID);
Obj.getStyleAttributes().setBorderColor(Position.RIGHT, Color.YELLOW)
字体
Obj.getStyleAttributes().setFontSize(16);
Obj.getStyleAttributes().setBold(true)

// 隐藏列或行
col.getStyleAttributes().setHided(true);
row.getStyleAttributes().setHided(true);
// 设置单元背景色
cell.getStyleAttributes().setBackground(color);
// 设置单元字体颜色、字体名称、字体大小
cell.getStyleAttributes().setFontColor(color);
cell.getStyleAttributes().setFontName(strName);
cell.getStyleAttributes().setFontSize(size);
// 锁定表格、行、列、单元
table.getStyleAttributes().setLocked(true);
row.getStyleAttributes().setLocked(true);
col.getStyleAttributes().setLocked(true);
cell.getStyleAttributes().setLocked(true);
// 设置对齐方式
table.getStyleAttributes().setHorizontalAlign(HorizontalAlignment.RIGHT);
// 设置自动折行
table.getStyleAttributes().setWrapText(true);
// 隐藏表格、行、列、单元的边框
table.getStyleAttributes().setBorderLineStyle(Position.RIGHT, LineStyle. NULL_LINE);// 隐藏表格单元的右边框
table.getStyleAttributes().setBorderLineStyle(Position.BOTTOM, LineStyle. NULL_LINE);// 隐藏表格单元的下边框
注意:KDTable在默认情况下左边框和上边框为空,右边框和下边框不为空。上述代码也可应用在具体某个row、column或cell上。
table.getRow(2).setHeight(20);
table.getColumn(1).setWidth(100);


猜你喜欢

转载自www.cnblogs.com/luojiabao/p/10963785.html
EAS