Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ImageArea.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.image;
  8. import org.apache.fop.fo.properties.TextAlign;
  9. import org.apache.fop.layout.*;
  10. import org.apache.fop.layout.inline.*;
  11. import org.apache.fop.render.Renderer;
  12. import java.util.Vector;
  13. import java.util.Enumeration;
  14. public class ImageArea extends InlineArea {
  15. protected int xOffset = 0;
  16. protected int align;
  17. protected int valign;
  18. protected FopImage image;
  19. public ImageArea(FontState fontState, FopImage img, int AllocationWidth,
  20. int width, int height, int startIndent, int endIndent,
  21. int align) {
  22. super(fontState, width, 0, 0, 0);
  23. this.currentHeight = height;
  24. this.contentRectangleWidth = width;
  25. this.height = height;
  26. this.image = img;
  27. this.align = align;
  28. /*
  29. * switch (align) {
  30. * case TextAlign.START:
  31. * xOffset = startIndent;
  32. * break;
  33. * case TextAlign.END:
  34. * if (endIndent == 0)
  35. * endIndent = AllocationWidth;
  36. * xOffset = (endIndent - width);
  37. * break;
  38. * case TextAlign.JUSTIFY:
  39. * xOffset = startIndent;
  40. * break;
  41. * case TextAlign.CENTER:
  42. * if (endIndent == 0)
  43. * endIndent = AllocationWidth;
  44. * xOffset = startIndent + ((endIndent - startIndent) - width)/2;
  45. * break;
  46. * }
  47. */
  48. }
  49. public int getXOffset() {
  50. return this.xOffset;
  51. }
  52. public FopImage getImage() {
  53. return this.image;
  54. }
  55. public int getImageHeight() {
  56. return currentHeight;
  57. }
  58. public void setAlign(int align) {
  59. this.align = align;
  60. }
  61. public int getAlign() {
  62. return this.align;
  63. }
  64. public void setVerticalAlign(int align) {
  65. this.valign = align;
  66. }
  67. public int getVerticalAlign() {
  68. return this.valign;
  69. }
  70. public void setStartIndent(int startIndent) {
  71. xOffset = startIndent;
  72. }
  73. }