java的snmp编程_sheetcopier.java 源代码在线查看 - 主要介绍snmp编程的一些例子对于snmp编程的人非常重要 资源下载 虫虫电子下载站...

// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html// Decompiler options: packimports(3) fieldsfirst ansi // Source File Name: SheetCopier.javapackage jxl.write.biff;import common.Assert;import common.Logger;import java.util.*;import jxl.*;import jxl.biff.*;import jxl.biff.drawing.*;import jxl.format.CellFormat;import jxl.read.biff.*;import jxl.write.*;// Referenced classes of package jxl.write.biff:// WritableSheetImpl, ColumnInfoRecord, RowsExceededException, CellValue, // PLSRecord, ButtonPropertySetRecord, ReadNumberFormulaRecord, ReadStringFormulaRecord, // ReadBooleanFormulaRecord, ReadDateFormulaRecord, ReadErrorFormulaRecord, WritableWorkbookImpl, // MergedCells, RowRecord, SheetWriterclass SheetCopier{ private static Logger logger; private SheetImpl fromSheet; private WritableSheetImpl toSheet; private WorkbookSettings workbookSettings; private TreeSet columnFormats; private FormattingRecords formatRecords; private ArrayList hyperlinks; private MergedCells mergedCells; private ArrayList rowBreaks; private ArrayList columnBreaks; private SheetWriter sheetWriter; private ArrayList drawings; private ArrayList images; private DataValidation dataValidation; private ComboBox comboBox; private PLSRecord plsRecord; private boolean chartOnly; private ButtonPropertySetRecord buttonPropertySet; private HashMap xfRecords; private HashMap fonts; private HashMap formats; static Class class$jxl$write$biff$SheetCopier; /* synthetic field */ public SheetCopier(Sheet f, WritableSheet t) { fromSheet = (SheetImpl)f; toSheet = (WritableSheetImpl)t; workbookSettings = toSheet.getWorkbook().getSettings(); chartOnly = false; } void setColumnFormats(TreeSet cf) { columnFormats = cf; } void setFormatRecords(FormattingRecords fr) { formatRecords = fr; } void setHyperlinks(ArrayList h) { hyperlinks = h; } void setMergedCells(MergedCells mc) { mergedCells = mc; } void setRowBreaks(ArrayList rb) { rowBreaks = rb; } void setColumnBreaks(ArrayList cb) { columnBreaks = cb; } void setSheetWriter(SheetWriter sw) { sheetWriter = sw; } void setDrawings(ArrayList d) { drawings = d; } void setImages(ArrayList i) { images = i; } DataValidation getDataValidation() { return dataValidation; } ComboBox getComboBox() { return comboBox; } PLSRecord getPLSRecord() { return plsRecord; } boolean isChartOnly() { return chartOnly; } ButtonPropertySetRecord getButtonPropertySet() { return buttonPropertySet; } public void copySheet() { shallowCopyCells(); ColumnInfoRecord readCirs[] = fromSheet.getColumnInfos(); for(int i = 0; i < readCirs.length; i++) { ColumnInfoRecord rcir = readCirs[i]; for(int j = rcir.getStartColumn(); j { jxl.write.biff.ColumnInfoRecord cir = new jxl.write.biff.ColumnInfoRecord(rcir, j, formatRecords); cir.setHidden(rcir.getHidden()); columnFormats.add(cir); } } jxl.Hyperlink hls[] = fromSheet.getHyperlinks(); for(int i = 0; i < hls.length; i++) { WritableHyperlink hr = new WritableHyperlink(hls[i], toSheet); hyperlinks.add(hr); } jxl.Range merged[] = fromSheet.getMergedCells(); for(int i = 0; i < merged.length; i++) mergedCells.add(new SheetRangeImpl((SheetRangeImpl)merged[i], toSheet)); try { RowRecord rowprops[] = fromSheet.getRowProperties(); for(int i = 0; i < rowprops.length; i++) { jxl.write.biff.RowRecord rr = toSheet.getRowRecord(rowprops[i].getRowNumber()); XFRecord format = rowprops[i].hasDefaultFormat() ? formatRecords.getXFRecord(rowprops[i].getXFIndex()) : null; rr.setRowDetails(rowprops[i].getRowHeight(), rowprops[i].matchesDefaultFontHeight(), rowprops[i].isCollapsed(), format); } } catch(RowsExceededException e) { Assert.verify(false); } int rowbreaks[] = fromSheet.getRowPageBreaks(); if(rowbreaks != null) { for(int i = 0; i < rowbreaks.length; i++) rowBreaks.add(new Integer(rowbreaks[i])); } int columnbreaks[] = fromSheet.getColumnPageBreaks(); if(columnbreaks != null) { for(int i = 0; i < columnbreaks.length; i++) columnBreaks.add(new Integer(columnbreaks[i])); } sheetWriter.setCharts(fromSheet.getCharts()); jxl.biff.drawing.DrawingGroupObject dr[] = fromSheet.getDrawings(); for(int i = 0; i < dr.length; i++) { if(dr[i] instanceof Drawing) { WritableImage wi = new WritableImage(dr[i], toSheet.getWorkbook().getDrawingGroup()); drawings.add(wi); images.add(wi); continue; } if(dr[i] instanceof Comment) { Comment c = new Comment(dr[i], toSheet.getWorkbook().getDrawingGroup(), workbookSettings); drawings.add(c); CellValue cv = (CellValue)toSheet.getWritableCell(c.getColumn(), c.getRow()); Assert.verify(cv.getCellFeatures() != null); cv.getWritableCellFeatures().setCommentDrawing(c); continue; } if(dr[i] instanceof Button) { Button b = new Button(dr[i], toSheet.getWorkbook().getDrawingGroup(), workbookSettings); drawings.add(b); continue; } if(dr[i] instanceof ComboBox) { ComboBox cb = new ComboBox(dr[i], toSheet.getWorkbook().getDrawingGroup(), workbookSettings); drawings.add(cb); } } DataValidation rdv = fromSheet.getDataValidation(); if(rdv != null) { dataValidation = new DataValidation(rdv, toSheet.getWorkbook(), toSheet.getWorkbook(), workbookSettings); int objid = dataValidation.getComboBoxObjectId(); if(objid != 0) comboBox = (ComboBox)drawings.get(objid); } sheetWriter.setWorkspaceOptions(fromSheet.getWorkspaceOptions()); if(fromSheet.getSheetBof().isChart()) { chartOnly = true; sheetWriter.setChartOnly(); } if(fromSheet.getPLS() != null) if(fromSheet.getWorkbookBof().isBiff7()) logger.warn("Cannot copy Biff7 print settings record - ignoring"); else plsRecord = new PLSRecord(fromSheet.getPLS()); if(fromSheet.getButtonPropertySet() != null) buttonPropertySet = new ButtonPropertySetRecord(fromSheet.getButtonPropertySet()); } public void importSheet() { xfRecords = new HashMap(); fonts = new HashMap(); formats = new HashMap(); deepCopyCells(); ColumnInfoRecord readCirs[] = fromSheet.getColumnInfos(); for(int i = 0; i < readCirs.length; i++) { ColumnInfoRecord rcir = readCirs[i]; for(int j = rcir.getStartColumn(); j

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值