Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

BorderRectangle.java 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. *
  3. * Copyright 2004 The Apache Software Foundation.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * 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. * Created on 7/06/2004
  18. * $Id$
  19. */
  20. package org.apache.fop.area;
  21. import java.awt.geom.Point2D;
  22. import java.awt.geom.Rectangle2D;
  23. /**
  24. * @author pbw
  25. * @version $Revision$ $Name$
  26. */
  27. public class BorderRectangle extends AreaFrame {
  28. public BorderRectangle(Area area, PaddingRectangle content) {
  29. super(area, content);
  30. spaces = new SpacesRectangle(area, this);
  31. }
  32. public BorderRectangle(Area area,
  33. double ipOffset, double bpOffset, double ipDim, double bpDim,
  34. PaddingRectangle contents, Point2D contentOffset) {
  35. super(area, ipOffset, bpOffset, ipDim, bpDim, contents, contentOffset);
  36. spaces = new SpacesRectangle(area, this);
  37. }
  38. /**
  39. * @param rect
  40. * @param contents
  41. * @param contentOffset
  42. */
  43. public BorderRectangle(Area area, Rectangle2D rect,
  44. PaddingRectangle contents, Point2D contentOffset) {
  45. super(area, rect, contents, contentOffset);
  46. spaces = new SpacesRectangle(area, this);
  47. }
  48. private SpacesRectangle spaces = null;
  49. public SpacesRectangle getSpaces() {
  50. return spaces;
  51. }
  52. /**
  53. * {@inheritDoc}
  54. * <p>The containing <code>SpacesRectangle</code> is notified of the
  55. * change.
  56. */
  57. public void setTop(double top) {
  58. super.setTop(top);
  59. spaces.setContents(this);
  60. }
  61. /**
  62. * {@inheritDoc}
  63. * <p>The containing <code>SpacesRectangle</code> is notified of the
  64. * change.
  65. */
  66. public void setLeft(double left) {
  67. super.setLeft(left);
  68. spaces.setContents(this);
  69. }
  70. /**
  71. * {@inheritDoc}
  72. * <p>The containing <code>SpacesRectangle</code> is notified of the
  73. * change.
  74. */
  75. public void setBottom(double bottom) {
  76. super.setBottom(bottom);
  77. spaces.setContents(this);
  78. }
  79. /**
  80. * {@inheritDoc}
  81. * <p>The containing <code>SpacesRectangle</code> is notified of the
  82. * change.
  83. */
  84. public void setRight(double right) {
  85. super.setRight(right);
  86. spaces.setContents(this);
  87. }
  88. }