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.

AFPObjectAreaInfo.java 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.afp;
  19. /**
  20. * A common class used to convey locations,
  21. * dimensions and resolutions of data objects.
  22. */
  23. public class AFPObjectAreaInfo {
  24. private int x;
  25. private int y;
  26. private int width;
  27. private int height;
  28. private int widthRes;
  29. private int heightRes;
  30. private int rotation = 0;
  31. /**
  32. * Sets the x position of the data object
  33. *
  34. * @param x the x position of the data object
  35. */
  36. public void setX(int x) {
  37. this.x = x;
  38. }
  39. /**
  40. * Sets the y position of the data object
  41. *
  42. * @param y the y position of the data object
  43. */
  44. public void setY(int y) {
  45. this.y = y;
  46. }
  47. /**
  48. * Sets the data object width
  49. *
  50. * @param width the width of the data object
  51. */
  52. public void setWidth(int width) {
  53. this.width = width;
  54. }
  55. /**
  56. * Sets the data object height
  57. *
  58. * @param height the height of the data object
  59. */
  60. public void setHeight(int height) {
  61. this.height = height;
  62. }
  63. /**
  64. * Sets the width resolution
  65. *
  66. * @param widthRes the width resolution
  67. */
  68. public void setWidthRes(int widthRes) {
  69. this.widthRes = widthRes;
  70. }
  71. /**
  72. * Sets the height resolution
  73. *
  74. * @param heightRes the height resolution
  75. */
  76. public void setHeightRes(int heightRes) {
  77. this.heightRes = heightRes;
  78. }
  79. /**
  80. * Returns the x coordinate of this data object
  81. *
  82. * @return the x coordinate of this data object
  83. */
  84. public int getX() {
  85. return x;
  86. }
  87. /**
  88. * Returns the y coordinate of this data object
  89. *
  90. * @return the y coordinate of this data object
  91. */
  92. public int getY() {
  93. return y;
  94. }
  95. /**
  96. * Returns the width of this data object
  97. *
  98. * @return the width of this data object
  99. */
  100. public int getWidth() {
  101. return width;
  102. }
  103. /**
  104. * Returns the height of this data object
  105. *
  106. * @return the height of this data object
  107. */
  108. public int getHeight() {
  109. return height;
  110. }
  111. /**
  112. * Returns the width resolution of this data object
  113. *
  114. * @return the width resolution of this data object
  115. */
  116. public int getWidthRes() {
  117. return widthRes;
  118. }
  119. /**
  120. * Returns the height resolution of this data object
  121. *
  122. * @return the height resolution of this data object
  123. */
  124. public int getHeightRes() {
  125. return heightRes;
  126. }
  127. /**
  128. * Returns the rotation of this data object
  129. *
  130. * @return the rotation of this data object
  131. */
  132. public int getRotation() {
  133. return rotation;
  134. }
  135. /**
  136. * Sets the data object rotation
  137. *
  138. * @param rotation the data object rotation
  139. */
  140. public void setRotation(int rotation) {
  141. this.rotation = rotation;
  142. }
  143. /** {@inheritDoc} */
  144. public String toString() {
  145. return "x=" + x
  146. + ", y=" + y
  147. + ", width=" + width
  148. + ", height=" + height
  149. + ", widthRes=" + widthRes
  150. + ", heightRes=" + heightRes
  151. + ", rotation=" + rotation;
  152. }
  153. }