You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LayoutContext.java 22KB

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