ソースを参照

More PSLM simplifications.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198598 13f79535-47bb-0310-9956-ffa450edef68
Temp_KnuthStylePageBreaking
Glen Mazza 19年前
コミット
0427280b10

+ 16
- 28
src/java/org/apache/fop/area/BodyRegion.java ファイルの表示

@@ -76,34 +76,7 @@ public class BodyRegion extends RegionReference {
public int getColumnGap() {
return this.columnGap;
}
/**
* Set the before float area.
*
* @param bf the before float area
*/
public void setBeforeFloat(BeforeFloat bf) {
beforeFloat = bf;
}

/**
* Set the footnote area.
*
* @param foot the footnote area
*/
public void setFootnote(Footnote foot) {
footnote = foot;
}

/**
* Get the before float area.
*
* @return the before float area
*/
public BeforeFloat getBeforeFloat() {
return beforeFloat;
}

/**
* Get the main reference area.
*
@@ -123,12 +96,27 @@ public class BodyRegion extends RegionReference {
}


/**
* Get the before float area.
*
* @return the before float area
*/
public BeforeFloat getBeforeFloat() {
if (beforeFloat == null) {
beforeFloat = new BeforeFloat();
}
return beforeFloat;
}

/**
* Get the footnote area.
*
* @return the footnote area
*/
public Footnote getFootnote() {
if (footnote == null) {
footnote = new Footnote();
}
return footnote;
}


+ 0
- 3
src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java ファイルの表示

@@ -340,9 +340,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants
return null;
}

protected void flush() {
}

public void addChildArea(Area childArea) {
}


+ 8
- 44
src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java ファイルの表示

@@ -26,8 +26,6 @@ import org.apache.fop.area.Area;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.LineArea;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.BeforeFloat;
import org.apache.fop.area.Footnote;
import org.apache.fop.area.Resolvable;
import org.apache.fop.area.Trait;

@@ -139,7 +137,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
areaTreeModel.startPageSequence(title);
log.debug("Starting layout");

makeNewPage(false, true, false);
curPV = makeNewPage(false, true, false);

PageBreaker breaker = new PageBreaker(this);
int flowBPD = (int) curPV.getBodyRegion().getBPD();
@@ -377,21 +375,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
return mark;
}

/**
* For now, only handle normal flow areas.
* @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(org.apache.fop.area.Area)
*/
public void addChildArea(Area childArea) {
if (childArea == null) {
return;
}
if (childArea.getAreaClass() == Area.CLASS_NORMAL) {
getParentArea(childArea);
} else {
// todo: all the others!
}
}

private PageViewport makeNewPage(boolean bIsBlank, boolean bIsFirst, boolean bIsLast) {
if (curPV != null) {
finishPage();
@@ -469,7 +452,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
log.error("bp==null cls=" + reg.getRegionName());
}
}*/
//lm.flush();
lm.reset(null);
}

@@ -496,9 +478,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
if (breakVal != Constants.EN_AUTO) {
// We may be forced to make new page
handleBreak(breakVal);
} else if (curPV == null) {
log.debug("curPV is null. Making new page");
makeNewPage(false, false, false);
}
/* Determine if a new span is needed. From the XSL
* fo:region-body definition, if an fo:block has a span="ALL"
@@ -542,33 +521,18 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
*/
public Area getParentArea(Area childArea) {
int aclass = childArea.getAreaClass();

if (aclass == Area.CLASS_NORMAL) {
//We now do this in PageBreaker
//prepareNormalFlowArea(childArea);
return curPV.getCurrentSpan().getNormalFlow(curFlowIdx);
} else {
if (curPV == null) {
makeNewPage(false, false, false);
}
// Now handle different kinds of areas
if (aclass == Area.CLASS_BEFORE_FLOAT) {
BeforeFloat bf = curPV.getBodyRegion().getBeforeFloat();
if (bf == null) {
bf = new BeforeFloat();
curPV.getBodyRegion().setBeforeFloat(bf);
}
return bf;
} else if (aclass == Area.CLASS_FOOTNOTE) {
Footnote fn = curPV.getBodyRegion().getFootnote();
if (fn == null) {
fn = new Footnote();
curPV.getBodyRegion().setFootnote(fn);
}
return fn;
}
// todo!!! other area classes (side-float, absolute, fixed)
return null;
} else if (aclass == Area.CLASS_BEFORE_FLOAT) {
return curPV.getBodyRegion().getBeforeFloat();
} else if (aclass == Area.CLASS_FOOTNOTE) {
return curPV.getBodyRegion().getFootnote();
}
// todo!!! other area classes (side-float, absolute, fixed)
return null;
}

/**

読み込み中…
キャンセル
保存