1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /* $Id: LayoutContext.java 1610839 2014-07-15 20:25:58Z vhennebert $ */
19 
20 package org.apache.fop.layoutmgr;
21 
22 import java.util.Collections;
23 import java.util.List;
24 
25 import org.apache.fop.fo.Constants;
26 import org.apache.fop.layoutmgr.inline.AlignmentContext;
27 import org.apache.fop.layoutmgr.inline.HyphContext;
28 import org.apache.fop.traits.MinOptMax;
29 import org.apache.fop.traits.WritingMode;
30 
31 
32 /**
33  * This class is used to pass information to the getNextKnuthElements()
34  * method. It is set up by higher level LM and used by lower level LM.
35  */
36 public final class LayoutContext {
37 
38     /** Generated break possibility is first in a new area */
39     public static final int NEW_AREA = 0x01;
40 
41     /**
42      * If this flag is set, it indicates that any break-before values other than "auto" should
43      * not cause a mandatory break as this break was already handled by a parent layout manager.
44      */
45     public static final int SUPPRESS_BREAK_BEFORE = 0x02;
46 
47     public static final int FIRST_AREA = 0x04;
48 
49     public static final int LAST_AREA = 0x08;
50 
51     public static final int RESOLVE_LEADING_SPACE = 0x10;
52 
53     private static final int TREAT_AS_ARTIFACT = 0x20;
54 
55     private int flags; // Contains some set of flags defined above
56 
57     /**
58      * Total available stacking dimension for a "galley-level" layout
59      * manager in block-progression-direction. It is passed by the
60      * parent LM.
61      * These LM <b>may</b> wish to pass this information down to lower
62      * level LM to allow them to optimize returned break possibilities.
63      */
64     private MinOptMax stackLimitBP;
65 
66     /** to keep track of spanning in multi-column layout */
67     private int currentSpan = Constants.NOT_SET;
68     private int nextSpan = Constants.NOT_SET;
69 
70     /** inline-progression-dimension of nearest ancestor reference area */
71     private int refIPD;
72     //TODO After the split of stackLimit into stackLimitBP and stackLimitIP there's now some
73     //overlap with refIPD. Need to investigate how best to refactor that.
74 
75     /** the writing mode established by the nearest ancestor reference area */
76     private WritingMode writingMode = WritingMode.LR_TB;
77 
78     /** Current pending space-after or space-end from preceding area */
79     private SpaceSpecifier trailingSpace;
80 
81     /** Current pending space-before or space-start from ancestor areas */
82     private SpaceSpecifier leadingSpace;
83 
84     /**
85      * A list of pending marks (border and padding) on the after edge when a page break occurs.
86      * May be null.
87      */
88     private List pendingAfterMarks;
89 
90     /**
91      * A list of pending marks (border and padding) on the before edge when a page break occurs.
92      * May be null.
93      */
94     private List pendingBeforeMarks;
95 
96     /** Current hyphenation context. May be null. */
97     private HyphContext hyphContext;
98 
99     /** Alignment in BP direction */
100     private int bpAlignment = Constants.EN_START;
101 
102     /** Stretch or shrink value when making areas. */
103     private double ipdAdjust;
104 
105     /** Stretch or shrink value when adding spaces. */
106     private double dSpaceAdjust;
107 
108     private AlignmentContext alignmentContext;
109 
110     /** Amount of space before / start */
111     private int spaceBefore;
112     /** Amount of space after / end */
113     private int spaceAfter;
114 
115     /** Amount of space to reserve at the beginning of each line */
116     private int lineStartBorderAndPaddingWidth;
117     /** Amount of space to reserve at the end of each line */
118     private int lineEndBorderAndPaddingWidth;
119 
120     private int breakBefore;
121     private int breakAfter;
122 
123     private Keep pendingKeepWithNext = Keep.KEEP_AUTO;
124     private Keep pendingKeepWithPrevious = Keep.KEEP_AUTO;
125 
126     private int disableColumnBalancing;
127 
newInstance()128     public static LayoutContext newInstance() {
129         return new LayoutContext(0);
130     }
131 
copyOf(LayoutContext copy)132     public static LayoutContext copyOf(LayoutContext copy) {
133         return new LayoutContext(copy);
134     }
135 
136     /**
137      * Returns a descendant of the given layout context. The new context is the same as
138      * what would have been created by {@link #newInstance()}, except for inheritable
139      * properties that are passed on by the parent. At the moment, the only inheritable
140      * property is the value returned by {@link #treatAsArtifact()}.
141      */
offspringOf(LayoutContext parent)142     public static LayoutContext offspringOf(LayoutContext parent) {
143         LayoutContext offspring = new LayoutContext(0);
144         offspring.setTreatAsArtifact(parent.treatAsArtifact());
145         return offspring;
146     }
147 
LayoutContext(LayoutContext parentLC)148     private LayoutContext(LayoutContext parentLC) {
149         this.flags = parentLC.flags;
150         this.refIPD = parentLC.refIPD;
151         this.writingMode = parentLC.writingMode;
152         setStackLimitBP(parentLC.getStackLimitBP());
153         this.leadingSpace = parentLC.leadingSpace; //???
154         this.trailingSpace = parentLC.trailingSpace; //???
155         this.hyphContext = parentLC.hyphContext;
156         this.bpAlignment = parentLC.bpAlignment;
157         this.dSpaceAdjust = parentLC.dSpaceAdjust;
158         this.ipdAdjust = parentLC.ipdAdjust;
159         this.alignmentContext = parentLC.alignmentContext;
160         this.lineStartBorderAndPaddingWidth = parentLC.lineStartBorderAndPaddingWidth;
161         this.lineEndBorderAndPaddingWidth = parentLC.lineEndBorderAndPaddingWidth;
162         copyPendingMarksFrom(parentLC);
163         this.pendingKeepWithNext = parentLC.pendingKeepWithNext;
164         this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious;
165         // Copy other fields as necessary.
166         this.disableColumnBalancing = parentLC.disableColumnBalancing;
167     }
168 
LayoutContext(int flags)169     private LayoutContext(int flags) {
170         this.flags = flags;
171         this.refIPD = 0;
172         stackLimitBP = MinOptMax.ZERO;
173         leadingSpace = null;
174         trailingSpace = null;
175     }
176 
177     /** @param source from which pending marks are copied */
copyPendingMarksFrom(LayoutContext source)178     public void copyPendingMarksFrom(LayoutContext source) {
179         if (source.pendingAfterMarks != null) {
180             this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
181         }
182         if (source.pendingBeforeMarks != null) {
183             this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
184         }
185     }
186 
187     /** @param flags to set */
setFlags(int flags)188     public void setFlags(int flags) {
189         setFlags(flags, true);
190     }
191 
192     /**
193      * @param flags to set or clear
194      * @param bSet true to set, false to clear
195      */
setFlags(int flags, boolean bSet)196     public void setFlags(int flags, boolean bSet) {
197         if (bSet) {
198             this.flags |= flags;
199         } else {
200             this.flags &= ~flags;
201         }
202     }
203 
204     /** @param flags to clear */
unsetFlags(int flags)205     public void unsetFlags(int flags) {
206         setFlags(flags, false);
207     }
208 
209     /** @return true if new area is set */
isStart()210     public boolean isStart() {
211         return ((this.flags & NEW_AREA) != 0);
212     }
213 
214     /** @return true if new area is set and leading space is non-null */
startsNewArea()215     public boolean startsNewArea() {
216         return ((this.flags & NEW_AREA) != 0 && leadingSpace != null);
217     }
218 
219     /** @return true if first area is set */
isFirstArea()220     public boolean isFirstArea() {
221         return ((this.flags & FIRST_AREA) != 0);
222     }
223 
224     /** @return true if last area is set */
isLastArea()225     public boolean isLastArea() {
226         return ((this.flags & LAST_AREA) != 0);
227     }
228 
229     /** @return true if suppress break before is set */
suppressBreakBefore()230     public boolean suppressBreakBefore() {
231         return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0);
232     }
233 
234     /**
235      * Returns the strength of a keep-with-next currently pending.
236      * @return the keep-with-next strength
237      */
getKeepWithNextPending()238     public Keep getKeepWithNextPending() {
239         return this.pendingKeepWithNext;
240     }
241 
242     /**
243      * Returns the strength of a keep-with-previous currently pending.
244      * @return the keep-with-previous strength
245      */
getKeepWithPreviousPending()246     public Keep getKeepWithPreviousPending() {
247         return this.pendingKeepWithPrevious;
248     }
249 
250     /**
251      * Clears any pending keep-with-next strength.
252      */
clearKeepWithNextPending()253     public void clearKeepWithNextPending() {
254         this.pendingKeepWithNext = Keep.KEEP_AUTO;
255     }
256 
257     /**
258      * Clears any pending keep-with-previous strength.
259      */
clearKeepWithPreviousPending()260     public void clearKeepWithPreviousPending() {
261         this.pendingKeepWithPrevious = Keep.KEEP_AUTO;
262     }
263 
264     /**
265      * Clears both keep-with-previous and keep-with-next strengths.
266      */
clearKeepsPending()267     public void clearKeepsPending() {
268         clearKeepWithPreviousPending();
269         clearKeepWithNextPending();
270     }
271 
272     /**
273      * Updates the currently pending keep-with-next strength.
274      * @param keep the new strength to consider
275      */
updateKeepWithNextPending(Keep keep)276     public void updateKeepWithNextPending(Keep keep) {
277         this.pendingKeepWithNext = this.pendingKeepWithNext.compare(keep);
278     }
279 
280     /**
281      * Updates the currently pending keep-with-previous strength.
282      * @param keep the new strength to consider
283      */
updateKeepWithPreviousPending(Keep keep)284     public void updateKeepWithPreviousPending(Keep keep) {
285         this.pendingKeepWithPrevious = this.pendingKeepWithPrevious.compare(keep);
286     }
287 
288     /**
289      * Indicates whether a keep-with-next constraint is pending.
290      * @return true if a keep-with-next constraint is pending
291      */
isKeepWithNextPending()292     public boolean isKeepWithNextPending() {
293         return !getKeepWithNextPending().isAuto();
294     }
295 
296     /**
297      * Indicates whether a keep-with-previous constraint is pending.
298      * @return true if a keep-with-previous constraint is pending
299      */
isKeepWithPreviousPending()300     public boolean isKeepWithPreviousPending() {
301         return !getKeepWithPreviousPending().isAuto();
302     }
303 
304     /** @param space leading space */
setLeadingSpace(SpaceSpecifier space)305     public void setLeadingSpace(SpaceSpecifier space) {
306         leadingSpace = space;
307     }
308 
309     /** @return leading space */
getLeadingSpace()310     public SpaceSpecifier getLeadingSpace() {
311         return leadingSpace;
312     }
313 
314     /** @return true if resolve leading space is set */
resolveLeadingSpace()315     public boolean resolveLeadingSpace() {
316         return ((this.flags & RESOLVE_LEADING_SPACE) != 0);
317     }
318 
319     /** @param space trailing space */
setTrailingSpace(SpaceSpecifier space)320     public void setTrailingSpace(SpaceSpecifier space) {
321         trailingSpace = space;
322     }
323 
324     /** @return trailing space */
getTrailingSpace()325     public SpaceSpecifier getTrailingSpace() {
326         return trailingSpace;
327     }
328 
329     /**
330      * Adds a border or padding element to the pending list which will be used to generate
331      * the right element list for break possibilities. Conditionality resolution will be done
332      * elsewhere.
333      * @param element the border, padding or space element
334      */
addPendingAfterMark(UnresolvedListElementWithLength element)335     public void addPendingAfterMark(UnresolvedListElementWithLength element) {
336         if (this.pendingAfterMarks == null) {
337             this.pendingAfterMarks = new java.util.ArrayList();
338         }
339         this.pendingAfterMarks.add(element);
340     }
341 
342     /**
343      * @return the pending border and padding elements at the after edge
344      * @see #addPendingAfterMark(UnresolvedListElementWithLength)
345      */
getPendingAfterMarks()346     public List getPendingAfterMarks() {
347         if (this.pendingAfterMarks != null) {
348             return Collections.unmodifiableList(this.pendingAfterMarks);
349         } else {
350             return null;
351         }
352     }
353 
354     /**
355      * Clears all pending marks on the LayoutContext.
356      */
clearPendingMarks()357     public void clearPendingMarks() {
358         this.pendingBeforeMarks = null;
359         this.pendingAfterMarks = null;
360     }
361 
362     /**
363      * Adds a border or padding element to the pending list which will be used to generate
364      * the right element list for break possibilities. Conditionality resolution will be done
365      * elsewhere.
366      * @param element the border, padding or space element
367      */
addPendingBeforeMark(UnresolvedListElementWithLength element)368     public void addPendingBeforeMark(UnresolvedListElementWithLength element) {
369         if (this.pendingBeforeMarks == null) {
370             this.pendingBeforeMarks = new java.util.ArrayList();
371         }
372         this.pendingBeforeMarks.add(element);
373     }
374 
375     /**
376      * @return the pending border and padding elements at the before edge
377      * @see #addPendingBeforeMark(UnresolvedListElementWithLength)
378      */
getPendingBeforeMarks()379     public List getPendingBeforeMarks() {
380         if (this.pendingBeforeMarks != null) {
381             return Collections.unmodifiableList(this.pendingBeforeMarks);
382         } else {
383             return null;
384         }
385     }
386 
387     /**
388      * Sets the stack limit in block-progression-dimension.
389      * @param limit the stack limit
390      */
setStackLimitBP(MinOptMax limit)391     public void setStackLimitBP(MinOptMax limit) {
392         stackLimitBP = limit;
393     }
394 
395     /**
396      * Returns the stack limit in block-progression-dimension.
397      * @return the stack limit
398      */
getStackLimitBP()399     public MinOptMax getStackLimitBP() {
400         return stackLimitBP;
401     }
402 
403     /**
404      * Sets the inline-progression-dimension of the nearest ancestor reference area.
405      * @param ipd of nearest ancestor reference area
406      */
setRefIPD(int ipd)407     public void setRefIPD(int ipd) {
408         refIPD = ipd;
409     }
410 
411     /**
412      * Returns the inline-progression-dimension of the nearest ancestor reference area.
413      *
414      * @return the inline-progression-dimension of the nearest ancestor reference area
415      */
getRefIPD()416     public int getRefIPD() {
417         return refIPD;
418     }
419 
420     /** @param hyph a hyphenation context */
setHyphContext(HyphContext hyph)421     public void setHyphContext(HyphContext hyph) {
422         hyphContext = hyph;
423     }
424 
425     /** @return hyphenation context */
getHyphContext()426     public HyphContext getHyphContext() {
427         return hyphContext;
428     }
429 
430     /**
431      * Sets the currently applicable alignment in BP direction.
432      * @param alignment one of EN_START, EN_JUSTIFY etc.
433      */
setBPAlignment(int alignment)434     public void setBPAlignment(int alignment) {
435         this.bpAlignment = alignment;
436     }
437 
438     /** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...) */
getBPAlignment()439     public int getBPAlignment() {
440         return this.bpAlignment;
441     }
442 
443     /** @param adjust space adjustment */
setSpaceAdjust(double adjust)444     public void setSpaceAdjust(double adjust) {
445         dSpaceAdjust = adjust;
446     }
447 
448     /** @return space adjustment */
getSpaceAdjust()449     public double getSpaceAdjust() {
450         return dSpaceAdjust;
451     }
452 
453     /** @param ipdA ipd adjustment */
setIPDAdjust(double ipdA)454     public void setIPDAdjust(double ipdA) {
455         ipdAdjust = ipdA;
456     }
457 
458     /** @return ipd adjustment */
getIPDAdjust()459     public double getIPDAdjust() {
460         return ipdAdjust;
461     }
462 
463     /** @param alignmentContext alignment context */
setAlignmentContext(AlignmentContext alignmentContext)464     public void setAlignmentContext(AlignmentContext alignmentContext) {
465         this.alignmentContext = alignmentContext;
466     }
467 
468     /** @return alignment context */
getAlignmentContext()469     public AlignmentContext getAlignmentContext() {
470         return this.alignmentContext;
471     }
472 
473     /**
474      * Reset alignment context.
475      */
resetAlignmentContext()476     public void resetAlignmentContext() {
477         if (this.alignmentContext != null) {
478             this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
479         }
480     }
481 
482     /**
483      * Get the width to be reserved for border and padding at the start of the line.
484      * @return the width to be reserved
485      */
getLineStartBorderAndPaddingWidth()486     public int getLineStartBorderAndPaddingWidth() {
487         return lineStartBorderAndPaddingWidth;
488     }
489 
490     /**
491      * Set the width to be reserved for border and padding at the start of the line.
492      * @param lineStartBorderAndPaddingWidth the width to be reserved
493      */
setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth)494     public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
495         this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
496     }
497 
498     /**
499      * Get the width to be reserved for border and padding at the end of the line.
500      * @return the width to be reserved
501      */
getLineEndBorderAndPaddingWidth()502     public int getLineEndBorderAndPaddingWidth() {
503         return lineEndBorderAndPaddingWidth;
504     }
505 
506     /**
507      * Set the width to be reserved for border and padding at the end of the line.
508      * @param lineEndBorderAndPaddingWidth the width to be reserved
509      */
setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth)510     public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
511         this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
512     }
513 
514     /**
515      * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
516      *                  {@link Constants#EN_ALL}
517      */
getNextSpan()518     public int getNextSpan() {
519         return nextSpan;
520     }
521 
522     /**
523      * @return one of: {@link Constants#NOT_SET}, {@link Constants#EN_NONE}
524      *                  {@link Constants#EN_ALL}
525      */
getCurrentSpan()526     public int getCurrentSpan() {
527         return (currentSpan == Constants.NOT_SET)
528                 ? Constants.EN_NONE : currentSpan;
529     }
530 
531     /**
532      * Used to signal the PSLM that the element list ends early because of a span change in
533      * multi-column layout.
534      * @param span the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)
535      */
signalSpanChange(int span)536     public void signalSpanChange(int span) {
537         switch (span) {
538         case Constants.NOT_SET:
539         case Constants.EN_NONE:
540         case Constants.EN_ALL:
541             this.currentSpan = this.nextSpan;
542             this.nextSpan = span;
543             break;
544         default:
545             assert false;
546             throw new IllegalArgumentException("Illegal value on signalSpanChange() for span: "
547                     + span);
548         }
549     }
550 
551     /**
552      * Get the writing mode of the relevant reference area.
553      * @return the applicable writing mode
554      */
getWritingMode()555     public WritingMode getWritingMode() {
556         return writingMode;
557     }
558 
559     /**
560      * Set the writing mode.
561      * @param writingMode the writing mode
562      */
setWritingMode(WritingMode writingMode)563     public void setWritingMode(WritingMode writingMode) {
564         this.writingMode = writingMode;
565     }
566 
567     /**
568      * Get the current amount of space before / start
569      * @return the space before / start amount
570      */
getSpaceBefore()571     public int getSpaceBefore() {
572         return spaceBefore;
573     }
574 
575     /**
576      * Set the amount of space before / start
577      * @param spaceBefore the amount of space before / start
578      */
setSpaceBefore(int spaceBefore)579     public void setSpaceBefore(int spaceBefore) {
580         this.spaceBefore = spaceBefore;
581     }
582 
583     /**
584      * Get the current amount of space after / end
585      * @return the space after / end amount
586      */
getSpaceAfter()587     public int getSpaceAfter() {
588         return spaceAfter;
589     }
590 
591     /**
592      * Set the amount of space after / end
593      * @param spaceAfter the amount of space after / end
594      */
setSpaceAfter(int spaceAfter)595     public void setSpaceAfter(int spaceAfter) {
596         this.spaceAfter = spaceAfter;
597     }
598 
599     /**
600      * Returns the value of the break before the element whose
601      * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
602      * called.
603      *
604      * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
605      * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
606      * {@link Constants#EN_ODD_PAGE}
607      */
getBreakBefore()608     public int getBreakBefore() {
609         return breakBefore;
610     }
611 
612     /**
613      * Sets the value of the break before the current element.
614      *
615      * @param breakBefore the value of the break-before
616      * @see #getBreakBefore()
617      */
setBreakBefore(int breakBefore)618     public void setBreakBefore(int breakBefore) {
619         this.breakBefore = breakBefore;
620     }
621 
622     /**
623      * Returns the value of the break after the element whose
624      * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
625      * called.
626      *
627      * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
628      * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
629      * {@link Constants#EN_ODD_PAGE}
630      */
getBreakAfter()631     public int getBreakAfter() {
632         return breakAfter;
633     }
634 
635 
636     /**
637      * Sets the value of the break after the current element.
638      *
639      * @param breakAfter the value of the break-after
640      * @see #getBreakAfter()
641      */
setBreakAfter(int breakAfter)642     public void setBreakAfter(int breakAfter) {
643         this.breakAfter = breakAfter;
644     }
645 
646     /** {@inheritDoc} */
647     @Override
toString()648     public String toString() {
649         return "Layout Context:"
650                 + "\nStack Limit BPD: \t"
651                 + (getStackLimitBP() == null ? "null" : getStackLimitBP().toString())
652                 + "\nTrailing Space: \t"
653                 + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
654                 + "\nLeading Space: \t"
655                 + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
656                 + "\nReference IPD: \t" + getRefIPD()
657                 + "\nSpace Adjust: \t" + getSpaceAdjust()
658                 + "\nIPD Adjust: \t" + getIPDAdjust()
659                 + "\nResolve Leading Space: \t" + resolveLeadingSpace()
660                 + "\nSuppress Break Before: \t" + suppressBreakBefore()
661                 + "\nIs First Area: \t" + isFirstArea()
662                 + "\nStarts New Area: \t" + startsNewArea()
663                 + "\nIs Last Area: \t" + isLastArea()
664                 + "\nKeeps: \t[keep-with-next=" + getKeepWithNextPending()
665                 + "][keep-with-previous=" + getKeepWithPreviousPending() + "] pending"
666                 + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
667                 + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
668     }
669 
670     /**
671      * Returns whether the column balancer should be disabled before a spanning block
672      *
673      * @return one of {@link Constants#EN_TRUE}, {@link Constants#EN_FALSE}
674      */
getDisableColumnBalancing()675     public int getDisableColumnBalancing() {
676         return disableColumnBalancing;
677     }
678 
679     /**
680      * Sets whether the column balancer should be disabled before a spanning block
681      *
682      * @param disableColumnBalancing the value of the fox:disable-column-balancing property
683      * @see #getDisableColumnBalancing()
684      */
setDisableColumnBalancing(int disableColumnBalancing)685     public void setDisableColumnBalancing(int disableColumnBalancing) {
686         this.disableColumnBalancing = disableColumnBalancing;
687     }
688 
treatAsArtifact()689     public boolean treatAsArtifact() {
690         return (flags & TREAT_AS_ARTIFACT) != 0;
691     }
692 
setTreatAsArtifact(boolean treatAsArtifact)693     public void setTreatAsArtifact(boolean treatAsArtifact) {
694         setFlags(TREAT_AS_ARTIFACT, treatAsArtifact);
695     }
696 }
697 
698