1 7 8 17 18 package java.awt.image.renderable; 19 import java.util.*; 20 import java.awt.geom.*; 21 import java.awt.*; 22 import java.awt.image.*; 23 24 43 public class RenderContext implements Cloneable { 44 45 46 RenderingHints hints; 47 48 49 AffineTransform usr2dev; 50 51 52 Shape aoi; 53 54 58 67 public RenderContext(AffineTransform usr2dev, 68 Shape aoi, 69 RenderingHints hints) { 70 this.hints = hints; 71 this.aoi = aoi; 72 this.usr2dev = (AffineTransform)usr2dev.clone(); 73 } 74 75 82 public RenderContext(AffineTransform usr2dev) { 83 this(usr2dev, null, null); 84 } 85 86 93 public RenderContext(AffineTransform usr2dev, RenderingHints hints) { 94 this(usr2dev, null, hints); 95 } 96 97 105 public RenderContext(AffineTransform usr2dev, Shape aoi) { 106 this(usr2dev, aoi, null); 107 } 108 109 115 public RenderingHints getRenderingHints() { 116 return hints; 117 } 118 119 125 public void setRenderingHints(RenderingHints hints) { 126 this.hints = hints; 127 } 128 129 136 public void setTransform(AffineTransform newTransform) { 137 usr2dev = (AffineTransform)newTransform.clone(); 138 } 139 140 150 public void preConcatenateTransform(AffineTransform modTransform) { 151 this.preConcetenateTransform(modTransform); 152 } 153 154 169 @Deprecated 170 public void preConcetenateTransform(AffineTransform modTransform) { 171 usr2dev.preConcatenate(modTransform); 172 } 173 174 184 public void concatenateTransform(AffineTransform modTransform) { 185 this.concetenateTransform(modTransform); 186 } 187 188 203 @Deprecated 204 public void concetenateTransform(AffineTransform modTransform) { 205 usr2dev.concatenate(modTransform); 206 } 207 208 214 public AffineTransform getTransform() { 215 return (AffineTransform)usr2dev.clone(); 216 } 217 218 224 public void setAreaOfInterest(Shape newAoi) { 225 aoi = newAoi; 226 } 227 228 236 public Shape getAreaOfInterest() { 237 return aoi; 238 } 239 240 247 public Object clone() { 248 RenderContext newRenderContext = new RenderContext (usr2dev, 249 aoi, hints); 250 return newRenderContext; 251 } 252 } 253 | Popular Tags |