/** * Constructor */ public Window2Record(SheetSettings settings) : base(Type.WINDOW2) { int options = 0; options |= 0x0; // display formula values, not formulas if (settings.getShowGridLines()) options |= 0x02; options |= 0x04; // display row and column headings options |= 0x0; // panes should be not frozen if (settings.getDisplayZeroValues()) options |= 0x10; options |= 0x20; // default header options |= 0x80; // display outline symbols // Handle the freeze panes if (settings.getHorizontalFreeze() != 0 || settings.getVerticalFreeze() != 0) { options |= 0x08; options |= 0x100; } // Handle the selected flag if (settings.isSelected()) options |= 0x600; // Handle the view mode if (settings.getPageBreakPreviewMode()) options |= 0x800; // hard code the data in for now data = new byte[18]; IntegerHelper.getTwoBytes(options, data, 0); IntegerHelper.getTwoBytes(0x40, data, 6); // grid line colour IntegerHelper.getTwoBytes(settings.getPageBreakPreviewMagnification(), data, 10); IntegerHelper.getTwoBytes(settings.getNormalMagnification(), data, 12); }
/** * Copy constructor. Called when copying sheets * @param copy the settings to copy */ public SheetSettings(SheetSettings copy, Sheet s) { Assert.verify(copy != null); sheet = s; // for internal use when accessing ranges orientation = copy.orientation; pageOrder = copy.pageOrder; paperSize = copy.paperSize; sheetProtected = copy.sheetProtected; hidden = copy.hidden; selected = false; // don't copy the selected flag headerMargin = copy.headerMargin; footerMargin = copy.footerMargin; scaleFactor = copy.scaleFactor; pageStart = copy.pageStart; fitWidth = copy.fitWidth; fitHeight = copy.fitHeight; horizontalPrintResolution = copy.horizontalPrintResolution; verticalPrintResolution = copy.verticalPrintResolution; leftMargin = copy.leftMargin; rightMargin = copy.rightMargin; topMargin = copy.topMargin; bottomMargin = copy.bottomMargin; fitToPages = copy.fitToPages; password = copy.password; passwordHash = copy.passwordHash; defaultColumnWidth = copy.defaultColumnWidth; defaultRowHeight = copy.defaultRowHeight; zoomFactor = copy.zoomFactor; pageBreakPreviewMagnification = copy.pageBreakPreviewMagnification; normalMagnification = copy.normalMagnification; showGridLines = copy.showGridLines; displayZeroValues = copy.displayZeroValues; pageBreakPreviewMode = copy.pageBreakPreviewMode; horizontalFreeze = copy.horizontalFreeze; verticalFreeze = copy.verticalFreeze; horizontalCentre = copy.horizontalCentre; verticalCentre = copy.verticalCentre; copies = copy.copies; header = new HeaderFooter(copy.header); footer = new HeaderFooter(copy.footer); automaticFormulaCalculation = copy.automaticFormulaCalculation; recalculateFormulasBeforeSave = copy.recalculateFormulasBeforeSave; if (copy.printArea != null) { printArea = new SheetRangeImpl (sheet, copy.getPrintArea().getTopLeft().getColumn(), copy.getPrintArea().getTopLeft().getRow(), copy.getPrintArea().getBottomRight().getColumn(), copy.getPrintArea().getBottomRight().getRow()); } if (copy.printTitlesRow != null) { printTitlesRow = new SheetRangeImpl (sheet, copy.getPrintTitlesRow().getTopLeft().getColumn(), copy.getPrintTitlesRow().getTopLeft().getRow(), copy.getPrintTitlesRow().getBottomRight().getColumn(), copy.getPrintTitlesRow().getBottomRight().getRow()); } if (copy.printTitlesCol != null) { printTitlesCol = new SheetRangeImpl (sheet, copy.getPrintTitlesCol().getTopLeft().getColumn(), copy.getPrintTitlesCol().getTopLeft().getRow(), copy.getPrintTitlesCol().getBottomRight().getColumn(), copy.getPrintTitlesCol().getBottomRight().getRow()); } }
/** * Copy constructor. Called when copying sheets * @param copy the settings to copy */ public SheetSettings(SheetSettings copy,Sheet s) { Assert.verify(copy != null); sheet = s; // for internal use when accessing ranges orientation = copy.orientation; pageOrder = copy.pageOrder; paperSize = copy.paperSize; sheetProtected = copy.sheetProtected; hidden = copy.hidden; selected = false; // don't copy the selected flag headerMargin = copy.headerMargin; footerMargin = copy.footerMargin; scaleFactor = copy.scaleFactor; pageStart = copy.pageStart; fitWidth = copy.fitWidth; fitHeight = copy.fitHeight; horizontalPrintResolution = copy.horizontalPrintResolution; verticalPrintResolution = copy.verticalPrintResolution; leftMargin = copy.leftMargin; rightMargin = copy.rightMargin; topMargin = copy.topMargin; bottomMargin = copy.bottomMargin; fitToPages = copy.fitToPages; password = copy.password; passwordHash = copy.passwordHash; defaultColumnWidth = copy.defaultColumnWidth; defaultRowHeight = copy.defaultRowHeight; zoomFactor = copy.zoomFactor; pageBreakPreviewMagnification = copy.pageBreakPreviewMagnification; normalMagnification = copy.normalMagnification; showGridLines = copy.showGridLines; displayZeroValues = copy.displayZeroValues; pageBreakPreviewMode = copy.pageBreakPreviewMode; horizontalFreeze = copy.horizontalFreeze; verticalFreeze = copy.verticalFreeze; horizontalCentre = copy.horizontalCentre; verticalCentre = copy.verticalCentre; copies = copy.copies; header = new HeaderFooter(copy.header); footer = new HeaderFooter(copy.footer); automaticFormulaCalculation = copy.automaticFormulaCalculation; recalculateFormulasBeforeSave = copy.recalculateFormulasBeforeSave; if (copy.printArea != null) { printArea = new SheetRangeImpl (sheet, copy.getPrintArea().getTopLeft().getColumn(), copy.getPrintArea().getTopLeft().getRow(), copy.getPrintArea().getBottomRight().getColumn(), copy.getPrintArea().getBottomRight().getRow()); } if (copy.printTitlesRow != null) { printTitlesRow = new SheetRangeImpl (sheet, copy.getPrintTitlesRow().getTopLeft().getColumn(), copy.getPrintTitlesRow().getTopLeft().getRow(), copy.getPrintTitlesRow().getBottomRight().getColumn(), copy.getPrintTitlesRow().getBottomRight().getRow()); } if (copy.printTitlesCol != null) { printTitlesCol = new SheetRangeImpl (sheet, copy.getPrintTitlesCol().getTopLeft().getColumn(), copy.getPrintTitlesCol().getTopLeft().getRow(), copy.getPrintTitlesCol().getBottomRight().getColumn(), copy.getPrintTitlesCol().getBottomRight().getRow()); } }