public AreaContainer getCurrentColumnArea() { ArrayList spanAreas = this.mainReferenceArea.getChildren(); SpanArea spanArea = (SpanArea)spanAreas[spanAreas.Count - 1]; return(spanArea.getCurrentColumnArea()); }
public void resetSpanArea() { ArrayList spanAreas = this.mainReferenceArea.getChildren(); SpanArea spanArea = (SpanArea)spanAreas[spanAreas.Count - 1]; if (!spanArea.isBalanced()) { int newHeight = spanArea.getTotalContentHeight() / spanArea.getColumnCount(); newHeight += 2 * 15600; this.mainReferenceArea.removeChild(spanArea); resetHeights(); SpanArea newSpanArea = new SpanArea(fontState, getXPosition(), spanArea.GetYPosition(), allocationWidth, newHeight, spanArea.getColumnCount(), columnGap); this.mainReferenceArea.addChild(newSpanArea); newSpanArea.setPage(this.getPage()); newSpanArea.setIsBalanced(); this._isNewSpanArea = true; } else { throw new Exception("Trying to balance balanced area"); } }
public bool isLastColumn() { ArrayList spanAreas = this.mainReferenceArea.getChildren(); SpanArea spanArea = (SpanArea)spanAreas[spanAreas.Count - 1]; return(spanArea.isLastColumn()); }
public AreaContainer getNextArea(FObj fo) { _isNewSpanArea = false; int span = Span.NONE; if (fo is Block) { span = ((Block)fo).GetSpan(); } else if (fo is BlockContainer) { span = ((BlockContainer)fo).GetSpan(); } if (this.mainReferenceArea.getChildren().Count == 0) { if (span == Span.ALL) { return(addSpanArea(1)); } else { return(addSpanArea(columnCount)); } } ArrayList spanAreas = this.mainReferenceArea.getChildren(); SpanArea spanArea = (SpanArea)spanAreas[spanAreas.Count - 1]; if ((span == Span.ALL) && (spanArea.getColumnCount() == 1)) { return(spanArea.getCurrentColumnArea()); } else if ((span == Span.NONE) && (spanArea.getColumnCount() == columnCount)) { return(spanArea.getCurrentColumnArea()); } else if (span == Span.ALL) { return(addSpanArea(1)); } else if (span == Span.NONE) { return(addSpanArea(columnCount)); } else { throw new FonetException("BodyAreaContainer::getNextArea(): Span attribute messed up"); } }
public bool isBalancingRequired(FObj fo) { if (this.mainReferenceArea.getChildren().Count == 0) { return(false); } ArrayList spanAreas = this.mainReferenceArea.getChildren(); SpanArea spanArea = (SpanArea)spanAreas[spanAreas.Count - 1]; if (spanArea.isBalanced()) { return(false); } int span = Span.NONE; if (fo is Block) { span = ((Block)fo).GetSpan(); } else if (fo is BlockContainer) { span = ((BlockContainer)fo).GetSpan(); } if ((span == Span.ALL) && (spanArea.getColumnCount() == 1)) { return(false); } else if ((span == Span.NONE) && (spanArea.getColumnCount() == columnCount)) { return(false); } else if (span == Span.ALL) { return(true); } else if (span == Span.NONE) { return(false); } else { return(false); } }
private AreaContainer addSpanArea(int numColumns) { resetHeights(); int spanAreaYPosition = GetYPosition() - this.mainReferenceArea.getContentHeight(); SpanArea spanArea = new SpanArea(fontState, getXPosition(), spanAreaYPosition, allocationWidth, GetRemainingHeight(), numColumns, columnGap); this.mainReferenceArea.addChild(spanArea); spanArea.setPage(this.getPage()); this._isNewSpanArea = true; return(spanArea.getCurrentColumnArea()); }
public void RenderSpanArea(SpanArea area) { foreach (Box b in area.getChildren()) { b.render(this); // column areas } }
public void incrementSpanIndex() { SpanArea span = (SpanArea)this.parent; span.setCurrentColumn(span.getCurrentColumn() + 1); }