public BandData findBandRecursively(String name) { BandNameVisitor visitor = new BandNameVisitor(name); visit(visitor); return visitor.foundBand; }
public BandData findBandRecursively(String name) { BandNameVisitor visitor = new BandNameVisitor(name); visit(visitor); return visitor.foundBand; }
public boolean visit(BandVisitor bandVisitor) { if (bandVisitor.visit(this)) { return true; } for (BandData child : getChildrenList()) { if (child.visit(bandVisitor)) { return true; } } return false; }
public boolean visit(BandVisitor bandVisitor) { if (bandVisitor.visit(this)) { return true; } for (BandData child : getChildrenList()) { if (child.visit(bandVisitor)) { return true; } } return false; }
protected Row findNextRowForChildBand(BandData band, Range templateRange, List<Row> resultSheetRows) { BandData parentBand = band.getParentBand(); Range resultParentRange = bandsForRanges.resultForBand(parentBand); Range templateParentRange = bandsForRanges.templateForBand(parentBand); if (resultParentRange != null && templateParentRange != null) { if (templateParentRange.getFirstRow() == templateRange.getFirstRow()) { if (resultSheetRows.size() > resultParentRange.getFirstRow() - 1) {//get current row return resultSheetRows.get(resultParentRange.getFirstRow() - 1); } } else { LastRowBandVisitor bandVisitor = new LastRowBandVisitor(); band.getParentBand().visit(bandVisitor); if (resultSheetRows.size() > bandVisitor.lastRow) {//get next row return resultSheetRows.get(bandVisitor.lastRow); } } } return null; }
protected Row findNextRowForChildBand(BandData band, Range templateRange, List<Row> resultSheetRows) { BandData parentBand = band.getParentBand(); Range resultParentRange = bandsForRanges.resultForBand(parentBand); Range templateParentRange = bandsForRanges.templateForBand(parentBand); if (resultParentRange != null && templateParentRange != null) { if (templateParentRange.getFirstRow() == templateRange.getFirstRow()) { if (resultSheetRows.size() > resultParentRange.getFirstRow() - 1) {//get current row return resultSheetRows.get(resultParentRange.getFirstRow() - 1); } } else { LastRowBandVisitor bandVisitor = new LastRowBandVisitor(); band.getParentBand().visit(bandVisitor); if (resultSheetRows.size() > bandVisitor.lastRow) {//get next row return resultSheetRows.get(bandVisitor.lastRow); } } } return null; }
protected Row findNextRowForHBand(BandData band, Range templateRange, List<Row> resultSheetRows) { Row firstRow = null; boolean isFirstLevelBand = BandData.ROOT_BAND_NAME.equals(band.getParentBand().getName()); //we suppose that when we render HORIZONTAL first level band, it should not be any right offset if (isFirstLevelBand || (previousRangeBandData != null && !previousRangeBandData.getParentBand().equals(band.getParentBand()))) { setPreviousRangeVerticalOffset(0, null); } Range lastRenderedRange = getLastRenderedBandForThisLevel(band); if (lastRenderedRange != null) {//this band has been already rendered at least once BandData lastRenderedBand = bandsForRanges.bandForResultRange(lastRenderedRange); LastRowBandVisitor bandVisitor = new LastRowBandVisitor(); lastRenderedBand.visit(bandVisitor); if (resultSheetRows.size() > bandVisitor.lastRow) {//get next row firstRow = resultSheetRows.get(bandVisitor.lastRow); } } else if (!isFirstLevelBand) { firstRow = findNextRowForChildBand(band, templateRange, resultSheetRows); } else {//this is the first render firstRow = findNextRowForFirstRender(templateRange, resultSheetRows); } return firstRow; }
protected Row findNextRowForHBand(BandData band, Range templateRange, List<Row> resultSheetRows) { Row firstRow = null; boolean isFirstLevelBand = BandData.ROOT_BAND_NAME.equals(band.getParentBand().getName()); //we suppose that when we render HORIZONTAL first level band, it should not be any right offset if (isFirstLevelBand || (previousRangeBandData != null && !previousRangeBandData.getParentBand().equals(band.getParentBand()))) { setPreviousRangeVerticalOffset(0, null); } Range lastRenderedRange = getLastRenderedBandForThisLevel(band); if (lastRenderedRange != null) {//this band has been already rendered at least once BandData lastRenderedBand = bandsForRanges.bandForResultRange(lastRenderedRange); LastRowBandVisitor bandVisitor = new LastRowBandVisitor(); lastRenderedBand.visit(bandVisitor); if (resultSheetRows.size() > bandVisitor.lastRow) {//get next row firstRow = resultSheetRows.get(bandVisitor.lastRow); } } else if (!isFirstLevelBand) { firstRow = findNextRowForChildBand(band, templateRange, resultSheetRows); } else {//this is the first render firstRow = findNextRowForFirstRender(templateRange, resultSheetRows); } return firstRow; }