import jxl.write.WritableCellFormat; //导入方法依赖的package包/类
private WritableCellFormat setParam(WritableCellFormat wcf, int map) throws WriteException {
if ( (map&CENTRE)!=0 ) wcf.setAlignment(Alignment.CENTRE);
if ( (map&RIGHT)!=0 ) wcf.setAlignment(Alignment.RIGHT);
if ( (map&LEFT)!=0 ) wcf.setAlignment(Alignment.LEFT);
if ( (map&VCENTRE)!=0 ) wcf.setVerticalAlignment(VerticalAlignment.CENTRE);
if ( (map&B_TOP_MED)!=0 ) wcf.setBorder(Border.TOP, BorderLineStyle.MEDIUM);
if ( (map&B_BOTTOM_MED)!=0 ) wcf.setBorder(Border.BOTTOM, BorderLineStyle.MEDIUM);
if ( (map&B_LEFT_MED)!=0 ) wcf.setBorder(Border.LEFT, BorderLineStyle.MEDIUM);
if ( (map&B_RIGHT_MED)!=0 ) wcf.setBorder(Border.RIGHT, BorderLineStyle.MEDIUM);
if ( (map&B_ALL_MED)!=0 ) {
wcf.setBorder(Border.RIGHT, BorderLineStyle.MEDIUM);
wcf.setBorder(Border.LEFT, BorderLineStyle.MEDIUM);
wcf.setBorder(Border.TOP, BorderLineStyle.MEDIUM);
wcf.setBorder(Border.BOTTOM, BorderLineStyle.MEDIUM);
}
if ( (map&B_TOP_LOW)!=0 ) wcf.setBorder(Border.TOP, BorderLineStyle.THIN);
if ( (map&B_BOTTOM_LOW)!=0 ) wcf.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
if ( (map&B_LEFT_LOW)!=0 ) wcf.setBorder(Border.LEFT, BorderLineStyle.THIN);
if ( (map&B_RIGHT_LOW)!=0 ) wcf.setBorder(Border.RIGHT, BorderLineStyle.THIN);
if ( (map&B_ALL_LOW)!=0 ) {
wcf.setBorder(Border.RIGHT, BorderLineStyle.THIN);
wcf.setBorder(Border.LEFT, BorderLineStyle.THIN);
wcf.setBorder(Border.TOP, BorderLineStyle.THIN);
wcf.setBorder(Border.BOTTOM, BorderLineStyle.THIN);
}
if ( (map&GRAY_25)!=0 ) wcf.setBackground(Colour.GRAY_25);
if ( (map&GREEN)!=0 ) wcf.setBackground(Colour.LIGHT_GREEN);
if ( (map&BLACK)!=0 ) wcf.setBackground(Colour.BLACK);
if ( (map&YELLOW)!=0 ) wcf.setBackground(Colour.YELLOW);
if ( (map&RED)!=0 ) wcf.setBackground(Colour.RED);
if ( (map&WRAP)!=0 ) wcf.setWrap(true);
if ( (map&DIAG45)!=0 ) wcf.setOrientation(Orientation.PLUS_45);
return wcf;
}