1 17 18 19 20 package org.apache.fop.area; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 import org.apache.fop.fo.pagination.Region; 26 27 32 public class RegionReference extends Area implements Cloneable { 33 34 35 private int regionClass; 37 private String regionName; 38 private CTM ctm; 39 40 41 private ArrayList blocks = new ArrayList (); 43 44 45 protected RegionViewport regionViewport; 46 47 53 public RegionReference(Region regionFO, RegionViewport parent) { 54 this(regionFO.getNameId(), regionFO.getRegionName(), parent); 55 } 56 57 64 public RegionReference(int regionClass, String regionName, RegionViewport parent) { 65 this.regionClass = regionClass; 66 this.regionName = regionName; 67 addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); 68 regionViewport = parent; 69 } 70 71 72 public void addChildArea(Area child) { 73 blocks.add(child); 74 } 75 76 85 public void setCTM(CTM ctm) { 86 this.ctm = ctm; 87 } 88 89 92 public RegionViewport getRegionViewport() { 93 return regionViewport; 94 } 95 96 101 public CTM getCTM() { 102 return this.ctm; 103 } 104 105 110 public List getBlocks() { 111 return blocks; 112 } 113 114 119 public int getRegionClass() { 120 return this.regionClass; 121 } 122 123 124 public String getRegionName() { 125 return this.regionName; 126 } 127 128 133 public void addBlock(Block block) { 134 addChildArea(block); 135 } 136 137 143 public Object clone() { 144 RegionReference rr = new RegionReference(regionClass, regionName, regionViewport); 145 rr.ctm = ctm; 146 rr.setIPD(getIPD()); 147 rr.blocks = (ArrayList )blocks.clone(); 148 return rr; 149 } 150 151 } 152 | Popular Tags |