本文整理汇总了Java中jxl.format.UnderlineStyle.NO_UNDERLINE属性的典型用法代码示例。如果您正苦于以下问题:Java UnderlineStyle.NO_UNDERLINE属性的具体用法?Java UnderlineStyle.NO_UNDERLINE怎么用?Java UnderlineStyle.NO_UNDERLINE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jxl.format.UnderlineStyle
的用法示例。
在下文中一共展示了UnderlineStyle.NO_UNDERLINE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setExcelListTitle
/**
* 设置报表内容头
*
* @param listTitle
* 报表头
* @throws IOException
* @throws WriteException
*/
@Deprecated
public void setExcelListTitle(String[] listTitle) throws WriteException, IOException {
try {
irow++;
long start = System.currentTimeMillis();
wfont = new WritableFont(WritableFont.createFont("宋体"), 10, WritableFont.BOLD, false,
UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
wcfFC = new WritableCellFormat(wfont);
wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
for (int i = icol; i < listTitle.length; i++) {
wsheet.addCell(new Label(i, irow, listTitle[i], wcfFC));
}
trow = irow;
logger.info("title use time:" + (System.currentTimeMillis() - start));
} catch (Exception e) {
this.close();
}
}
示例2: setReportTitle
/**
* 设置报表标题
*
* @param reportTitle
* 报表标题
* @throws IOException
* @throws WriteException
* @throws WriteException
*/
public void setReportTitle(String reportTitle) throws WriteException, IOException {
try {
irow++;
wfont = new WritableFont(WritableFont.createFont("宋体"), 12, WritableFont.BOLD, false,
UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
wcfFC = new WritableCellFormat(wfont);
wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
// wcfFC.setBackground(jxl.format.Colour.VERY_LIGHT_YELLOW);// 背景色
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
// wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM,
// Colour.BLACK);//
// 边框
wsheet.addCell(new Label(icol, irow, reportTitle, wcfFC));
trow = irow;
} catch (Exception e) {
this.close();
}
}
示例3: setExcelListTitle
/**
* 设置报表内容头
*
* @param listTitle
* 报表头
* @throws IOException
* @throws WriteException
*/
@Deprecated
public void setExcelListTitle(String[] listTitle) throws WriteException, IOException {
try {
irow++;
long start = System.currentTimeMillis();
wfont = new WritableFont(WritableFont.createFont("宋体"), 10, WritableFont.BOLD, false,
UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
wcfFC = new WritableCellFormat(wfont);
wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
for (int i = icol; i < listTitle.length; i++) {
wsheet.addCell(new Label(i, irow, listTitle[i], wcfFC));
}
trow = irow;
log.info("title use time:" + (System.currentTimeMillis() - start));
} catch (Exception e) {
this.close();
}
}
示例4: getUnderlineStyle
public static UnderlineStyle getUnderlineStyle(int stepValue)
{
UnderlineStyle underline= UnderlineStyle.NO_UNDERLINE;
switch(stepValue)
{
case ExcelOutputMeta.FONT_UNDERLINE_SINGLE:
underline=UnderlineStyle.SINGLE;
break;
case ExcelOutputMeta.FONT_UNDERLINE_SINGLE_ACCOUNTING:
underline=UnderlineStyle.SINGLE_ACCOUNTING;
break;
case ExcelOutputMeta.FONT_UNDERLINE_DOUBLE:
underline=UnderlineStyle.DOUBLE;
break;
case ExcelOutputMeta.FONT_UNDERLINE_DOUBLE_ACCOUNTING:
underline=UnderlineStyle.DOUBLE_ACCOUNTING;
break;
default: break;
}
return underline;
}
示例5: getUnderlineStyle
public static UnderlineStyle getUnderlineStyle( int stepValue ) {
UnderlineStyle underline = UnderlineStyle.NO_UNDERLINE;
switch ( stepValue ) {
case ExcelOutputMeta.FONT_UNDERLINE_SINGLE:
underline = UnderlineStyle.SINGLE;
break;
case ExcelOutputMeta.FONT_UNDERLINE_SINGLE_ACCOUNTING:
underline = UnderlineStyle.SINGLE_ACCOUNTING;
break;
case ExcelOutputMeta.FONT_UNDERLINE_DOUBLE:
underline = UnderlineStyle.DOUBLE;
break;
case ExcelOutputMeta.FONT_UNDERLINE_DOUBLE_ACCOUNTING:
underline = UnderlineStyle.DOUBLE_ACCOUNTING;
break;
default:
break;
}
return underline;
}
示例6: createIndex
/**
* Create the index worksheet.
*
* <p>This also creates links back to the index in each of the worksheets.</p>
*/
public void createIndex() {
WritableSheet sheet = workbook.createSheet(spreadsheetifyName("Index"), 0);
createTitle(sheet, "Index");
try {
// Create links for each worksheet, apart from the first sheet which is the
// index we're currently creating
final String[] names = workbook.getSheetNames();
for (int currentSheet = 1; currentSheet < names.length; currentSheet++) {
// Create the link from the index to the table's worksheet
WritableHyperlink link = new WritableHyperlink(0, currentSheet - 1 + NUMBER_OF_ROWS_IN_TITLE, names[currentSheet], workbook.getSheet(currentSheet), 0, 0);
sheet.addHyperlink(link);
//Add the filename in column B (stored in cell B2 of each sheet)
String fileName = workbook.getSheet(currentSheet).getCell(1, 1).getContents();
Label fileNameLabel = new Label(1, currentSheet - 1 + NUMBER_OF_ROWS_IN_TITLE, fileName);
WritableFont fileNameFont = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK);
WritableCellFormat fileNameFormat = new WritableCellFormat(fileNameFont);
fileNameLabel.setCellFormat(fileNameFormat);
sheet.addCell(fileNameLabel);
// Create the link back to the index
link = new WritableHyperlink(0, 1, "Back to index", sheet, 0, currentSheet + NUMBER_OF_ROWS_IN_TITLE - 1);
workbook.getSheet(currentSheet).addHyperlink(link);
//Set column A of each sheet to be wide enough to show "Back to index"
workbook.getSheet(currentSheet).setColumnView(0, 13);
}
// Make Column A fairly wide to show tab names and hide column B
sheet.setColumnView(0, 35);
sheet.setColumnView(1, 0);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例7: getFormatRed
/**
* @return the formatRed
*/
public WritableCellFormat getFormatRed() throws Exception{
// if(formatRed == null){
formatRed=new WritableCellFormat();
formatRed.setAlignment(jxl.format.Alignment.CENTRE);
formatRed.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
WritableFont wf_color = new WritableFont(WritableFont.ARIAL,10,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.RED);
WritableCellFormat wff_color = new WritableCellFormat(wf_color);
formatRed.setBorder(Border.ALL, BorderLineStyle.THIN);
formatRed.setFont(wf_color);
// }
return formatRed;
}
示例8: WritableFont
/**
* Creates a default font, vanilla font of the specified face and with
* default point size.
*
* @param fn the font name
*/
public WritableFont(FontName fn)
{
this(fn,
DEFAULT_POINT_SIZE,
NO_BOLD,
false,
UnderlineStyle.NO_UNDERLINE,
Colour.BLACK,
ScriptStyle.NORMAL_SCRIPT);
}
示例9: generateExcelReport
public void generateExcelReport()
{
if(this.reports.isEmpty())
{
this.status = "There is no data yet";
this.success = false;
this.exception = "Please run linkcrawler at least once in order to be able to generate a report";
return;
}
try {
String reportDir = System.getProperty("user.dir") + File.separatorChar + "Reports";
Date date = new Date();
DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd__HH_mm_ss");
String reportDirFile = reportDir + File.separatorChar + "Report_" + dateFormat.format(date);
reportLocation = reportDirFile;
String reportExcelFile = reportDirFile + File.separatorChar + "ReportExcel.xls";
File reportDirPointer = new File(reportDir);
File reportDirFilePointer = new File(reportDirFile);
//Creating directories if not there
if(!reportDirFilePointer.exists())
{
reportDirPointer.mkdir();
reportDirFilePointer.mkdir();
}
File reportExcelFilePointer = new File(reportExcelFile);
reportExcelFilePointer.createNewFile();
WritableWorkbook workbook = Workbook.createWorkbook(reportExcelFilePointer);
int sheetNumber = 0;
for(UrlReport ur : reports)
{
WritableSheet sheet = workbook.createSheet("Crawled Url " + (sheetNumber + 1), sheetNumber++);
WritableFont blackHeadersFont = new WritableFont(WritableFont.ARIAL, 8, WritableFont.BOLD,false, UnderlineStyle.NO_UNDERLINE, Colour.WHITE);
WritableCellFormat blackHeadersFormatBackground = new WritableCellFormat();
blackHeadersFormatBackground.setBackground(Colour.BLUE) ;
blackHeadersFormatBackground.setBorder(Border.ALL, BorderLineStyle.THIN,Colour.BLACK);
blackHeadersFormatBackground.setFont(blackHeadersFont);
blackHeadersFormatBackground.setAlignment(Alignment.LEFT);
WritableFont whiteValueFont = new WritableFont(WritableFont.ARIAL, 8, WritableFont.BOLD,false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
WritableCellFormat whiteValueFormatBackground = new WritableCellFormat();
whiteValueFormatBackground.setBackground(Colour.WHITE);
whiteValueFormatBackground.setBorder(Border.ALL, BorderLineStyle.THIN,Colour.BLACK);
whiteValueFormatBackground.setFont(whiteValueFont);
whiteValueFormatBackground.setAlignment(Alignment.LEFT);
Label introLabel = new Label(0, 0, "Site:", blackHeadersFormatBackground);
Label introLabelValue = new Label(1, 0, ur.getPageUrl()+" ", whiteValueFormatBackground);
sheet.addCell(introLabel);
sheet.addCell(introLabelValue);
int staringRow = 0;
staringRow = prepareLinksDataDetail(sheet, ur, staringRow, LinkTypes.INTERNAL, "Internal links ", blackHeadersFormatBackground, whiteValueFormatBackground);
staringRow = prepareLinksDataDetail(sheet, ur, staringRow, LinkTypes.EXTERNAL, "External links ", blackHeadersFormatBackground, whiteValueFormatBackground);
staringRow = prepareLinksDataDetail(sheet, ur, staringRow, LinkTypes.SPECIAL, "Special links ", blackHeadersFormatBackground, whiteValueFormatBackground);
staringRow = prepareLinksDataDetail(sheet, ur, staringRow, LinkTypes.IMAGES, "Images ", blackHeadersFormatBackground, whiteValueFormatBackground);
for(int x=0; x < sheet.getColumns(); x++)
{
CellView cell=sheet.getColumnView(x);
cell.setAutosize(true);
sheet.setColumnView(x, cell);
}
}
workbook.write();
workbook.close();
this.status = "Excel report generated";
} catch (Exception ex) {
this.status = "Error when generating Excel File";
this.success = false;
this.exception = ex.getMessage();
}
}