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.

BorderPaintingInfo.java 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. import java.awt.Color;
  20. /**
  21. * Border painting information
  22. */
  23. public class BorderPaintingInfo implements PaintingInfo {
  24. private final float x1;
  25. private final float y1;
  26. private final float x2;
  27. private final float y2;
  28. private final boolean isHorizontal;
  29. private final int style;
  30. private final Color color;
  31. /**
  32. * Main constructor
  33. *
  34. * @param x1 the x1 coordinate
  35. * @param y1 the y1 coordinate
  36. * @param x2 the x2 coordinate
  37. * @param y2 the y2 coordinate
  38. * @param isHorizontal true when the border line is horizontal
  39. * @param style the border style
  40. * @param color the border color
  41. */
  42. public BorderPaintingInfo(float x1, float y1, float x2, float y2,
  43. boolean isHorizontal, int style, Color color) {
  44. this.x1 = x1;
  45. this.y1 = y1;
  46. this.x2 = x2;
  47. this.y2 = y2;
  48. this.isHorizontal = isHorizontal;
  49. this.style = style;
  50. this.color = color;
  51. }
  52. /**
  53. * Returns the x1 coordinate
  54. *
  55. * @return the x1 coordinate
  56. */
  57. public float getX1() {
  58. return x1;
  59. }
  60. /**
  61. * Returns the y1 coordinate
  62. *
  63. * @return the y1 coordinate
  64. */
  65. public float getY1() {
  66. return y1;
  67. }
  68. /**
  69. * Returns the x2 coordinate
  70. *
  71. * @return the x2 coordinate
  72. */
  73. public float getX2() {
  74. return x2;
  75. }
  76. /**
  77. * Returns the y2 coordinate
  78. *
  79. * @return the y2 coordinate
  80. */
  81. public float getY2() {
  82. return y2;
  83. }
  84. /**
  85. * Returns true when this is a horizontal line
  86. *
  87. * @return true when this is a horizontal line
  88. */
  89. public boolean isHorizontal() {
  90. return isHorizontal;
  91. }
  92. /**
  93. * Returns the style
  94. *
  95. * @return the style
  96. */
  97. public int getStyle() {
  98. return style;
  99. }
  100. /**
  101. * Returns the color
  102. *
  103. * @return the color
  104. */
  105. public Color getColor() {
  106. return color;
  107. }
  108. }