tkormann 01/09/17 06:37:31 Modified: sources/org/apache/batik/apps/svgbrowser FindDialog.java sources/org/apache/batik/bridge SVGClipPathElementBridge.java SVGLinearGradientElementBridge.java SVGMaskElementBridge.java SVGPatternElementBridge.java SVGRadialGradientElementBridge.java SVGUtilities.java sources/org/apache/batik/swing/gvt JGVTComponent.java TextSelectionManager.java Log: GVT cleanup continuation. According to our previous discussion, getBounds does not use GraphicsNodeRenderContext anymore. Only paint now uses it at this time. No regression has been found. Revision Changes Path 1.3 +2 -2 xml-batik/sources/org/apache/batik/apps/svgbrowser/FindDialog.java Index: FindDialog.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/FindDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FindDialog.java 2001/05/07 23:49:52 1.2 +++ FindDialog.java 2001/09/17 13:37:30 1.3 @@ -58,7 +58,7 @@ * an SVG document. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: FindDialog.java,v 1.2 2001/05/07 23:49:52 tkormann Exp $ + * @version $Id: FindDialog.java,v 1.3 2001/09/17 13:37:30 tkormann Exp $ */ public class FindDialog extends JDialog implements ActionMap { @@ -287,7 +287,7 @@ } System.out.println(((TextNode)gn).getText()); if (enableZoom.isSelected()) { - Rectangle2D bounds = gn.getBounds(svgCanvas.getRenderContext()); + Rectangle2D bounds = gn.getBounds(); bounds = gn.getGlobalTransform().createTransformedShape (bounds).getBounds(); Dimension dim = svgCanvas.getSize(); 1.11 +4 -4 xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java Index: SVGClipPathElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- SVGClipPathElementBridge.java 2001/05/02 14:33:38 1.10 +++ SVGClipPathElementBridge.java 2001/09/17 13:37:30 1.11 @@ -28,7 +28,7 @@ * Bridge class for the <clipPath> element. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: SVGClipPathElementBridge.java,v 1.10 2001/05/02 14:33:38 tkormann Exp $ + * @version $Id: SVGClipPathElementBridge.java,v 1.11 2001/09/17 13:37:30 tkormann Exp $ */ public class SVGClipPathElementBridge extends AbstractSVGBridge implements ClipBridge { @@ -80,9 +80,8 @@ (clipElement, SVG_CLIP_PATH_UNITS_ATTRIBUTE, s); } // additional transform to move to objectBoundingBox coordinate system - GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); if (coordSystemType == SVGUtilities.OBJECT_BOUNDING_BOX) { - Tx = SVGUtilities.toObjectBBox(Tx, clipedNode, rc); + Tx = SVGUtilities.toObjectBBox(Tx, clipedNode); } // Build the GVT tree that represents the clip path @@ -116,7 +115,7 @@ // compute the outline of the current clipPath's child int wr = CSSUtilities.convertClipRule(child); - GeneralPath path = new GeneralPath(clipNode.getOutline(rc)); + GeneralPath path = new GeneralPath(clipNode.getOutline()); path.setWindingRule(wr); Shape outline = Tx.createTransformedShape(path); @@ -151,6 +150,7 @@ Filter filter = clipedNode.getFilter(); if (filter == null) { // Make the initial source as a RenderableImage + GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); filter = new GraphicsNodeRable8Bit(clipedNode, rc); } return new ClipRable8Bit(filter, clipPath); 1.4 +2 -6 xml-batik/sources/org/apache/batik/bridge/SVGLinearGradientElementBridge.java Index: SVGLinearGradientElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGLinearGradientElementBridge.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SVGLinearGradientElementBridge.java 2001/05/02 14:34:06 1.3 +++ SVGLinearGradientElementBridge.java 2001/09/17 13:37:30 1.4 @@ -17,7 +17,6 @@ import org.apache.batik.ext.awt.LinearGradientPaint; import org.apache.batik.ext.awt.MultipleGradientPaint; import org.apache.batik.gvt.GraphicsNode; -import org.apache.batik.gvt.GraphicsNodeRenderContext; import org.w3c.dom.Element; @@ -25,7 +24,7 @@ * Bridge class for the <linearGradient> element. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: SVGLinearGradientElementBridge.java,v 1.3 2001/05/02 14:34:06 tkormann Exp $ + * @version $Id: SVGLinearGradientElementBridge.java,v 1.4 2001/09/17 13:37:30 tkormann Exp $ */ public class SVGLinearGradientElementBridge extends AbstractSVGGradientElementBridge { @@ -107,10 +106,7 @@ // additional transform to move to objectBoundingBox coordinate system if (coordSystemType == SVGUtilities.OBJECT_BOUNDING_BOX) { - GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); - transform = SVGUtilities.toObjectBBox(transform, - paintedNode, - rc); + transform = SVGUtilities.toObjectBBox(transform, paintedNode); } UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, paintElement); 1.10 +3 -3 xml-batik/sources/org/apache/batik/bridge/SVGMaskElementBridge.java Index: SVGMaskElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGMaskElementBridge.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- SVGMaskElementBridge.java 2001/05/02 14:34:08 1.9 +++ SVGMaskElementBridge.java 2001/09/17 13:37:30 1.10 @@ -26,7 +26,7 @@ * Bridge class for the <mask> element. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: SVGMaskElementBridge.java,v 1.9 2001/05/02 14:34:08 tkormann Exp $ + * @version $Id: SVGMaskElementBridge.java,v 1.10 2001/09/17 13:37:30 tkormann Exp $ */ public class SVGMaskElementBridge extends AbstractSVGBridge implements MaskBridge { @@ -112,9 +112,8 @@ } // additional transform to move to objectBoundingBox coordinate system - GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); if (coordSystemType == SVGUtilities.OBJECT_BOUNDING_BOX) { - Tx = SVGUtilities.toObjectBBox(Tx, maskedNode, rc); + Tx = SVGUtilities.toObjectBBox(Tx, maskedNode); } maskNodeContent.setTransform(Tx); @@ -122,6 +121,7 @@ Filter filter = maskedNode.getFilter(); if (filter == null) { // Make the initial source as a RenderableImage + GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); filter = new GraphicsNodeRable8Bit(maskedNode, rc); } 1.18 +2 -2 xml-batik/sources/org/apache/batik/bridge/SVGPatternElementBridge.java Index: SVGPatternElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGPatternElementBridge.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- SVGPatternElementBridge.java 2001/05/02 14:34:10 1.17 +++ SVGPatternElementBridge.java 2001/09/17 13:37:30 1.18 @@ -38,7 +38,7 @@ * Bridge class for the <pattern> element. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: SVGPatternElementBridge.java,v 1.17 2001/05/02 14:34:10 tkormann Exp $ + * @version $Id: SVGPatternElementBridge.java,v 1.18 2001/09/17 13:37:30 tkormann Exp $ */ public class SVGPatternElementBridge extends AbstractSVGBridge implements PaintBridge, ErrorConstants { @@ -171,7 +171,7 @@ if(contentCoordSystem == SVGUtilities.OBJECT_BOUNDING_BOX){ AffineTransform patternContentUnitsTransform = new AffineTransform(); - Rectangle2D objectBoundingBox = paintedNode.getGeometryBounds(rc); + Rectangle2D objectBoundingBox = paintedNode.getGeometryBounds(); patternContentUnitsTransform.translate (objectBoundingBox.getX(), objectBoundingBox.getY()); 1.5 +2 -5 xml-batik/sources/org/apache/batik/bridge/SVGRadialGradientElementBridge.java Index: SVGRadialGradientElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGRadialGradientElementBridge.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SVGRadialGradientElementBridge.java 2001/05/02 14:34:13 1.4 +++ SVGRadialGradientElementBridge.java 2001/09/17 13:37:30 1.5 @@ -17,7 +17,6 @@ import org.apache.batik.ext.awt.RadialGradientPaint; import org.apache.batik.ext.awt.MultipleGradientPaint; import org.apache.batik.gvt.GraphicsNode; -import org.apache.batik.gvt.GraphicsNodeRenderContext; import org.w3c.dom.Element; @@ -25,7 +24,7 @@ * Bridge class for the <radialGradient> element. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: SVGRadialGradientElementBridge.java,v 1.4 2001/05/02 14:34:13 tkormann Exp $ + * @version $Id: SVGRadialGradientElementBridge.java,v 1.5 2001/09/17 13:37:30 tkormann Exp $ */ public class SVGRadialGradientElementBridge extends AbstractSVGGradientElementBridge { @@ -115,10 +114,8 @@ // additional transform to move to objectBoundingBox coordinate system if (coordSystemType == SVGUtilities.OBJECT_BOUNDING_BOX) { - GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); transform = SVGUtilities.toObjectBBox(transform, - paintedNode, - rc); + paintedNode); } UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, paintElement); 1.15 +11 -19 xml-batik/sources/org/apache/batik/bridge/SVGUtilities.java Index: SVGUtilities.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGUtilities.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- SVGUtilities.java 2001/08/03 16:33:42 1.14 +++ SVGUtilities.java 2001/09/17 13:37:30 1.15 @@ -25,7 +25,6 @@ import org.apache.batik.dom.util.XMLSupport; import org.apache.batik.gvt.GraphicsNode; -import org.apache.batik.gvt.GraphicsNodeRenderContext; import org.apache.batik.parser.AWTTransformProducer; import org.apache.batik.parser.LengthHandler; @@ -51,7 +50,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGUtilities.java,v 1.14 2001/08/03 16:33:42 vhardy Exp $ + * @version $Id: SVGUtilities.java,v 1.15 2001/09/17 13:37:30 tkormann Exp $ */ public abstract class SVGUtilities implements SVGConstants, ErrorConstants { @@ -386,8 +385,7 @@ hStr, unitsType, maskedNode, - uctx, - ctx.getGraphicsNodeRenderContext()); + uctx); } ///////////////////////////////////////////////////////////////////////// @@ -455,8 +453,7 @@ hStr, unitsType, paintedNode, - uctx, - ctx.getGraphicsNodeRenderContext()); + uctx); } ///////////////////////////////////////////////////////////////////////// @@ -571,8 +568,7 @@ hStr, unitsType, filteredNode, - uctx, - ctx.getGraphicsNodeRenderContext()); + uctx); } /** @@ -641,8 +637,7 @@ switch (unitsType) { case OBJECT_BOUNDING_BOX: - GraphicsNodeRenderContext rc = ctx.getGraphicsNodeRenderContext(); - Rectangle2D bounds = filteredNode.getGeometryBounds(rc); + Rectangle2D bounds = filteredNode.getGeometryBounds(); if (xStr.length() != 0) { x = UnitProcessor.svgHorizontalCoordinateToObjectBoundingBox (xStr, SVG_X_ATTRIBUTE, uctx); @@ -766,8 +761,7 @@ String hStr, short unitsType, GraphicsNode targetNode, - UnitProcessor.Context uctx, - GraphicsNodeRenderContext rc) { + UnitProcessor.Context uctx) { // construct the mask region in the appropriate coordinate system double x, y, w, h; @@ -782,7 +776,7 @@ h = UnitProcessor.svgVerticalLengthToObjectBoundingBox (hStr, SVG_HEIGHT_ATTRIBUTE, uctx); - Rectangle2D bounds = targetNode.getGeometryBounds(rc); + Rectangle2D bounds = targetNode.getGeometryBounds(); if (bounds != null ) { x = bounds.getX() + x*bounds.getWidth(); y = bounds.getY() + y*bounds.getHeight(); @@ -842,11 +836,10 @@ * @param rc the graphics node render context */ public static AffineTransform toObjectBBox(AffineTransform Tx, - GraphicsNode node, - GraphicsNodeRenderContext rc) { + GraphicsNode node) { AffineTransform Mx = new AffineTransform(); - Rectangle2D bounds = node.getGeometryBounds(rc); + Rectangle2D bounds = node.getGeometryBounds(); Mx.translate(bounds.getX(), bounds.getY()); Mx.scale(bounds.getWidth(), bounds.getHeight()); Mx.concatenate(Tx); @@ -863,10 +856,9 @@ * @param rc the graphics node render context */ public static Rectangle2D toObjectBBox(Rectangle2D r, - GraphicsNode node, - GraphicsNodeRenderContext rc) { + GraphicsNode node) { - Rectangle2D bounds = node.getGeometryBounds(rc); + Rectangle2D bounds = node.getGeometryBounds(); if(bounds != null){ return new Rectangle2D.Double (bounds.getX() + r.getX()*bounds.getWidth(), 1.16 +2 -3 xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java Index: JGVTComponent.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- JGVTComponent.java 2001/07/18 22:04:54 1.15 +++ JGVTComponent.java 2001/09/17 13:37:31 1.16 @@ -53,7 +53,7 @@ * This class represents a component which can display a GVT tree. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: JGVTComponent.java,v 1.15 2001/07/18 22:04:54 deweese Exp $ + * @version $Id: JGVTComponent.java,v 1.16 2001/09/17 13:37:31 tkormann Exp $ */ public class JGVTComponent extends JComponent { @@ -291,8 +291,7 @@ */ protected void initializeEventHandling() { if (eventsEnabled) { - eventDispatcher = - new AWTEventDispatcher(rendererFactory.getRenderContext()); + eventDispatcher = new AWTEventDispatcher(); if (selectableText) { textSelectionManager = new TextSelectionManager(this, rendererFactory.getRenderContext(), 1.5 +2 -2 xml-batik/sources/org/apache/batik/swing/gvt/TextSelectionManager.java Index: TextSelectionManager.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/gvt/TextSelectionManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TextSelectionManager.java 2001/05/14 16:48:05 1.4 +++ TextSelectionManager.java 2001/09/17 13:37:31 1.5 @@ -37,7 +37,7 @@ * This class represents an object which manage GVT text nodes selection. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: TextSelectionManager.java,v 1.4 2001/05/14 16:48:05 tkormann Exp $ + * @version $Id: TextSelectionManager.java,v 1.5 2001/09/17 13:37:31 tkormann Exp $ */ public class TextSelectionManager { @@ -92,7 +92,7 @@ public TextSelectionManager(JGVTComponent comp, GraphicsNodeRenderContext rc, AWTEventDispatcher ed) { - textSelector = new ConcreteTextSelector(rc); + textSelector = new ConcreteTextSelector(); textSelectionListener = new TextSelectionListener(); textSelector.addSelectionListener(textSelectionListener); mouseListener = new MouseListener(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]