diff options
author | Keiron Liddle <keiron@apache.org> | 2001-01-30 00:03:06 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2001-01-30 00:03:06 +0000 |
commit | 19b89b86937f321cf4e0eabdfc97fe9ec4b4ce5d (patch) | |
tree | e7e9473383348c485dd3170986fab328f577e7ca /src/org/apache/fop/layout/BlockArea.java | |
parent | b163e2b08b1aba4ec19249a489eb7b2659d3a84a (diff) | |
download | xmlgraphics-fop-19b89b86937f321cf4e0eabdfc97fe9ec4b4ce5d.tar.gz xmlgraphics-fop-19b89b86937f321cf4e0eabdfc97fe9ec4b4ce5d.zip |
moved code out of block area -> char and pag num
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193990 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layout/BlockArea.java')
-rw-r--r-- | src/org/apache/fop/layout/BlockArea.java | 82 |
1 files changed, 29 insertions, 53 deletions
diff --git a/src/org/apache/fop/layout/BlockArea.java b/src/org/apache/fop/layout/BlockArea.java index e114cee52..e36dbc4c2 100644 --- a/src/org/apache/fop/layout/BlockArea.java +++ b/src/org/apache/fop/layout/BlockArea.java @@ -62,6 +62,16 @@ import java.util.Vector; import java.util.Enumeration; import org.apache.fop.messaging.MessageHandler; +/** + * This class represents a Block Area. + * A block area is made up of a sequence of Line Areas. + * + * This class is used to organise the sequence of line areas as + * inline areas are added to this block it creates and ands line areas + * to hold the inline areas. + * This uses the line-height and line-stacking-strategy to work + * out how to stack the lines. + */ public class BlockArea extends Area { /* relative to area container */ @@ -141,31 +151,6 @@ public class BlockArea extends Area { } } - public int addPageNumberCitation(FontState fontState, float red, - float green, float blue, int wrapOption, LinkSet ls, - int whiteSpaceCollapse, String refid) { - - this.currentLineArea.changeFont(fontState); - this.currentLineArea.changeColor(red, green, blue); - this.currentLineArea.changeWrapOption(wrapOption); - this.currentLineArea.changeWhiteSpaceCollapse(whiteSpaceCollapse); - this.currentLineArea.changeHyphenation(language, country, hyphenate, - hyphenationChar, hyphenationPushCharacterCount, - hyphenationRemainCharacterCount); - - - if (ls != null) { - this.currentLinkSet = ls; - ls.setYOffset(currentHeight); - } - - this.currentLineArea.addPageNumberCitation(refid, ls); - this.hasLines = true; - - return -1; - - } - // font-variant support : addText is a wrapper for addRealText // added by Eric SCHAEFFER public int addText(FontState fontState, float red, float green, @@ -359,45 +344,36 @@ public class BlockArea extends Area { return 1; } - public void addCharacter(FontState fontState, float red, float green, - float blue, int wrapOption, LinkSet ls, - int whiteSpaceCollapse, char data, boolean ul) { + public LineArea getCurrentLineArea() + { + return this.currentLineArea; + } - this.currentLineArea.changeFont(fontState); - this.currentLineArea.changeColor(red, green, blue); - this.currentLineArea.changeWrapOption(wrapOption); - this.currentLineArea.changeWhiteSpaceCollapse(whiteSpaceCollapse); - - if (ls != null) { - this.currentLinkSet = ls; - ls.setYOffset(currentHeight); - } - - int marker = this.currentLineArea.addCharacter(data, ls, ul); - //if character didn't fit into line, open a new one - if (marker == org.apache.fop.fo.flow.Character.DOESNOT_FIT) { + public LineArea createNextLineArea() + { + if (this.hasLines) { + this.currentLineArea.addPending(); this.currentLineArea.align(this.align); +// this.currentLineArea.verticalAlign(); this.addLineArea(this.currentLineArea); - + } this.currentLineArea = new LineArea(fontState, lineHeight, halfLeading, allocationWidth, startIndent, endIndent, currentLineArea); - this.currentLineArea.changeFont(fontState); - this.currentLineArea.changeColor(red, green, blue); - this.currentLineArea.changeWrapOption(wrapOption); - this.currentLineArea.changeWhiteSpaceCollapse( - whiteSpaceCollapse); + if (currentHeight + lineHeight > maxHeight) { + return null; + } + return this.currentLineArea; + } + + public void setupLinkSet(LinkSet ls) + { if (ls != null) { this.currentLinkSet = ls; ls.setYOffset(currentHeight); } - - this.currentLineArea.addCharacter(data, ls, ul); - } - this.hasLines = true; - } - + } public void end() { if (this.hasLines) { |