Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

RegionSE.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.fo.pagination;
  8. import org.apache.fop.fo.*;
  9. import org.apache.fop.apps.FOPException;
  10. import java.awt.Rectangle;
  11. public abstract class RegionSE extends RegionBASE {
  12. protected RegionSE(FONode parent) {
  13. super(parent);
  14. }
  15. /**
  16. * Adjust the viewport reference rectangle for a region as a function
  17. * of precedence.
  18. * If before and after have precedence = true, the start and end
  19. * regions only go to the limits of their extents, otherwise
  20. * they extend in the BPD to the page reference rectangle
  21. * diminish by extend of start and end if present.
  22. */
  23. protected void adjustIPD(Rectangle refRect) {
  24. int yoff = 0;
  25. Region before = getSiblingRegion(Region.BEFORE);
  26. if (before != null && before.getPrecedence()) {
  27. yoff = before.getExtent();
  28. refRect.translate(0, yoff);
  29. }
  30. Region after = getSiblingRegion(Region.AFTER);
  31. if (after != null && after.getPrecedence()) {
  32. yoff += after.getExtent();
  33. }
  34. if (yoff > 0) {
  35. refRect.grow(0,-yoff);
  36. }
  37. }
  38. }