1 18 package org.apache.batik.gvt; 19 20 import java.awt.Graphics2D ; 21 import java.awt.Shape ; 22 import java.awt.geom.AffineTransform ; 23 import java.awt.geom.Rectangle2D ; 24 25 33 public class ProxyGraphicsNode extends AbstractGraphicsNode { 34 35 38 protected GraphicsNode source; 39 40 43 public ProxyGraphicsNode() {} 44 45 50 public void setSource(GraphicsNode source) { 51 this.source = source; 52 } 53 54 57 public GraphicsNode getSource() { 58 return source; 59 } 60 61 66 public void primitivePaint(Graphics2D g2d) { 67 if (source != null) { 68 source.paint(g2d); 69 } 70 } 71 72 75 public Rectangle2D getPrimitiveBounds() { 76 if (source == null) 77 return null; 78 79 return source.getBounds(); 80 } 81 82 89 public Rectangle2D getTransformedPrimitiveBounds(AffineTransform txf) { 90 if (source == null) 91 return null; 92 93 AffineTransform t = txf; 94 if (transform != null) { 95 t = new AffineTransform (txf); 96 t.concatenate(transform); 97 } 98 return source.getTransformedPrimitiveBounds(t); 99 } 100 101 107 public Rectangle2D getGeometryBounds() { 108 if (source == null) 109 return null; 110 111 return source.getGeometryBounds(); 112 } 113 114 124 public Rectangle2D getTransformedGeometryBounds(AffineTransform txf) { 125 if (source == null) 126 return null; 127 128 AffineTransform t = txf; 129 if (transform != null) { 130 t = new AffineTransform (txf); 131 t.concatenate(transform); 132 } 133 return source.getTransformedGeometryBounds(t); 134 } 135 136 137 142 public Rectangle2D getSensitiveBounds() { 143 if (source == null) 144 return null; 145 146 return source.getSensitiveBounds(); 147 } 148 149 152 public Shape getOutline() { 153 if (source == null) 154 return null; 155 156 return source.getOutline(); 157 } 158 } 159 | Popular Tags |