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

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