1 31 package org.pdfbox.pdmodel.graphics; 32 33 import org.pdfbox.util.Matrix; 34 35 import org.pdfbox.pdmodel.text.PDTextState; 36 37 import org.pdfbox.pdmodel.graphics.color.PDColorSpaceInstance; 38 39 46 public class PDGraphicsState implements Cloneable 47 { 48 private Matrix currentTransformationMatrix = new Matrix(); 49 50 private PDColorSpaceInstance strokingColorSpace = new PDColorSpaceInstance(); 54 private PDColorSpaceInstance nonStrokingColorSpace = new PDColorSpaceInstance(); 55 private PDTextState textState = new PDTextState(); 56 private double lineWidth = 0; 57 private int lineCap = 0; 58 private int lineJoin = 0; 59 private double miterLimit = 0; 60 private PDLineDashPattern lineDashPattern; 61 private String renderingIntent; 62 private boolean strokeAdjustment = false; 63 private double alphaConstants = 0; 66 private boolean alphaSource = false; 67 68 private boolean overprint = false; 70 private double overprintMode = 0; 71 private double flatness = 1.0; 76 private double smoothness = 0; 77 78 83 public Matrix getCurrentTransformationMatrix() 84 { 85 return currentTransformationMatrix; 86 } 87 88 93 public void setCurrentTransformationMatrix(Matrix value) 94 { 95 currentTransformationMatrix = value; 96 } 97 98 103 public double getLineWidth() 104 { 105 return lineWidth; 106 } 107 108 113 public void setLineWidth(double value) 114 { 115 lineWidth = value; 116 } 117 118 123 public int getLineCap() 124 { 125 return lineCap; 126 } 127 128 133 public void setLineCap(int value) 134 { 135 lineCap = value; 136 } 137 138 143 public int getLineJoin() 144 { 145 return lineJoin; 146 } 147 148 153 public void setLineJoin(int value) 154 { 155 lineJoin = value; 156 } 157 158 163 public double getMiterLimit() 164 { 165 return miterLimit; 166 } 167 168 173 public void setMiterLimit(double value) 174 { 175 miterLimit = value; 176 } 177 178 183 public boolean isStrokeAdjustment() 184 { 185 return strokeAdjustment; 186 } 187 188 193 public void setStrokeAdjustment(boolean value) 194 { 195 strokeAdjustment = value; 196 } 197 198 203 public double getAlphaConstants() 204 { 205 return alphaConstants; 206 } 207 208 213 public void setAlphaConstants(double value) 214 { 215 alphaConstants = value; 216 } 217 218 223 public boolean isAlphaSource() 224 { 225 return alphaSource; 226 } 227 228 233 public void setAlphaSource(boolean value) 234 { 235 alphaSource = value; 236 } 237 238 243 public boolean isOverprint() 244 { 245 return overprint; 246 } 247 248 253 public void setOverprint(boolean value) 254 { 255 overprint = value; 256 } 257 258 263 public double getOverprintMode() 264 { 265 return overprintMode; 266 } 267 268 273 public void setOverprintMode(double value) 274 { 275 overprintMode = value; 276 } 277 278 283 public double getFlatness() 284 { 285 return flatness; 286 } 287 288 293 public void setFlatness(double value) 294 { 295 flatness = value; 296 } 297 298 303 public double getSmoothness() 304 { 305 return smoothness; 306 } 307 308 313 public void setSmoothness(double value) 314 { 315 smoothness = value; 316 } 317 318 323 public PDTextState getTextState() 324 { 325 return textState; 326 } 327 328 333 public void setTextState(PDTextState value) 334 { 335 textState = value; 336 } 337 338 343 public PDLineDashPattern getLineDashPattern() 344 { 345 return lineDashPattern; 346 } 347 348 353 public void setLineDashPattern(PDLineDashPattern value) 354 { 355 lineDashPattern = value; 356 } 357 358 365 public String getRenderingIntent() 366 { 367 return renderingIntent; 368 } 369 370 375 public void setRenderingIntent(String value) 376 { 377 renderingIntent = value; 378 } 379 380 383 public Object clone() 384 { 385 PDGraphicsState clone = null; 386 try 387 { 388 clone = (PDGraphicsState)super.clone(); 389 clone.setTextState( (PDTextState)textState.clone() ); 390 clone.setCurrentTransformationMatrix( currentTransformationMatrix.copy() ); 391 } 392 catch( CloneNotSupportedException e ) 393 { 394 e.printStackTrace(); 395 } 396 return clone; 397 } 398 399 404 public PDColorSpaceInstance getStrokingColorSpace() 405 { 406 return strokingColorSpace; 407 } 408 409 414 public void setStrokingColorSpace(PDColorSpaceInstance value) 415 { 416 strokingColorSpace = value; 417 } 418 419 424 public PDColorSpaceInstance getNonStrokingColorSpace() 425 { 426 return nonStrokingColorSpace; 427 } 428 429 434 public void setNonStrokingColorSpace(PDColorSpaceInstance value) 435 { 436 nonStrokingColorSpace = value; 437 } 438 } | Popular Tags |