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.

Span.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.area;
  18. import java.util.List;
  19. /**
  20. * The span reference area.
  21. * This is a reference area block area with 0 border and padding
  22. * The span reference areas are stacked inside the main reference area.
  23. */
  24. public class Span extends Area {
  25. // the list of flow reference areas in this span area
  26. private List flowAreas;
  27. private int height;
  28. /**
  29. * Create a span area with the number of columns for this span area.
  30. *
  31. * @param cols the number of columns in the span
  32. */
  33. public Span(int cols) {
  34. flowAreas = new java.util.ArrayList(cols);
  35. }
  36. /**
  37. * Add the flow area to this span area.
  38. *
  39. * @param flow the flow area to add
  40. */
  41. public void addFlow(Flow flow) {
  42. flowAreas.add(flow);
  43. }
  44. /**
  45. * Get the column count for this span area.
  46. *
  47. * @return the number of columns in this span area
  48. */
  49. public int getColumnCount() {
  50. return flowAreas.size();
  51. }
  52. /**
  53. * Get the height of this span area.
  54. *
  55. * @return the height of this span area
  56. */
  57. public int getHeight() {
  58. return height;
  59. }
  60. /**
  61. * Get the flow area for a particular column.
  62. *
  63. * @param count the column number for the flow
  64. * @return the flow area for the requested column
  65. */
  66. public Flow getFlow(int count) {
  67. return (Flow) flowAreas.get(count);
  68. }
  69. }