You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by di...@apache.org on 2001/04/29 10:22:42 UTC
cvs commit: xml-batik/sources/org/apache/batik/gvt CompositeGraphicsNode.java
dino 01/04/29 01:22:42
Modified: sources/org/apache/batik/gvt CompositeGraphicsNode.java
Log:
adding first pass at svg fonts
Revision Changes Path
1.19 +25 -4 xml-batik/sources/org/apache/batik/gvt/CompositeGraphicsNode.java
Index: CompositeGraphicsNode.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/gvt/CompositeGraphicsNode.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- CompositeGraphicsNode.java 2001/03/18 18:18:18 1.18
+++ CompositeGraphicsNode.java 2001/04/29 08:22:42 1.19
@@ -16,6 +16,7 @@
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+import java.awt.geom.GeneralPath;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
@@ -32,7 +33,7 @@
* A CompositeGraphicsNode is a graphics node that can contain graphics nodes.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
- * @version $Id: CompositeGraphicsNode.java,v 1.18 2001/03/18 18:18:18 vhardy Exp $
+ * @version $Id: CompositeGraphicsNode.java,v 1.19 2001/04/29 08:22:42 dino Exp $
*/
public class CompositeGraphicsNode extends AbstractGraphicsNode
implements List {
@@ -70,6 +71,9 @@
*/
private Rectangle2D primitiveBounds;
+
+ private Shape outline;
+
/**
* Constructs a new empty <tt>CompositeGraphicsNode</tt>.
*/
@@ -207,6 +211,7 @@
super.invalidateGeometryCache();
geometryBounds = null;
primitiveBounds = null;
+ outline = null;
}
public boolean contains(Point2D p, GraphicsNodeRenderContext rc) {
@@ -397,11 +402,27 @@
}
/**
- * Not supported operation.
+ * Returns the outline of this <tt>CompositeGraphicsNode</tt>.
+ *
+ * @param rc the GraphicsNodeRenderContext for which this dimension applies
+ * @return the outline of this node
*/
public Shape getOutline(GraphicsNodeRenderContext rc) {
- // <!> FIXME : TODO
- throw new Error("Not yet implemented");
+ if (outline == null) {
+ outline = new GeneralPath();
+ for (int i = 0; i < count; i++) {
+ Shape childOutline = children[i].getOutline(rc);
+ if (childOutline != null) {
+ AffineTransform tr = children[i].getTransform();
+ if (tr != null) {
+ ((GeneralPath)outline).append(tr.createTransformedShape(childOutline), false);
+ } else {
+ ((GeneralPath)outline).append(childOutline, false);
+ }
+ }
+ }
+ }
+ return outline;
}
//
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org