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.

InlineArea.java 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001 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.area.inline;
  8. import org.apache.fop.area.Area;
  9. import org.apache.fop.area.Property;
  10. import org.apache.fop.render.Renderer;
  11. import java.util.List;
  12. import java.util.ArrayList;
  13. /**
  14. * Inline Area
  15. * This area is for all inline areas that can be placed
  16. * in a line area.
  17. * Extensions of this class should render themselves with the
  18. * requested renderer.
  19. */
  20. public class InlineArea extends Area {
  21. int width;
  22. int height;
  23. // position within the line area, either top or baseline
  24. int verticalPosition;
  25. // width, height, vertical alignment
  26. // store properties in array list, need better solution
  27. ArrayList props = null;
  28. // inline areas are expected to implement this method
  29. // to render themselves
  30. public void render(Renderer renderer) {
  31. }
  32. public void setWidth(int w) {
  33. width = w;
  34. }
  35. public int getWidth() {
  36. return width;
  37. }
  38. public void setOffset(int v) {
  39. verticalPosition = v;
  40. }
  41. public int getOffset() {
  42. return verticalPosition;
  43. }
  44. public void addProperty(Property prop) {
  45. if (props == null) {
  46. props = new ArrayList();
  47. }
  48. props.add(prop);
  49. }
  50. public List getPropertyList() {
  51. return props;
  52. }
  53. }