[FOray-commit] SF.net SVN: foray: [9748] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-06-11 19:17:40
|
Revision: 9748
http://svn.sourceforge.net/foray/?rev=9748&view=rev
Author: victormote
Date: 2007-06-11 12:17:42 -0700 (Mon, 11 Jun 2007)
Log Message:
-----------
1. Add basic implementation of new axsl interface GraphicLink.
2. Stub-in conformance to new axsl changes requiring SVGGraphic to write its content to PostScript and PDF documents.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
Added Paths:
-----------
trunk/foray/foray-graphic/src/java/org/foray/graphic/GraphicLink4a.java
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-06-11 15:37:29 UTC (rev 9747)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/FOrayGraphic.java 2007-06-11 19:17:42 UTC (rev 9748)
@@ -61,6 +61,9 @@
/** The bit depth (bits per pixel) for a typical 3-channel color image. */
public static final byte BIT_DEPTH_COLOR = 24;
+ /** An empty array of links to be used as the default. */
+ private static final GraphicLink4a[] DEFAULT_LINKS = new GraphicLink4a[0];
+
/**
* The default maximimum number of bytes that need to be read in order to
* extract the basic information from a file.
@@ -117,6 +120,9 @@
/** Set this flag to false if the image is not valid. */
private boolean isValid = true;
+ /** The links associated with this image. */
+ private GraphicLink4a[] links;
+
/**
* Constructor.
* @param server The parent graphic server.
@@ -578,4 +584,23 @@
this.basicsParsed = basicsParsed;
}
+ /**
+ * Returns the links associated with this graphic.
+ * @return The links associated with this graphic.
+ */
+ public GraphicLink4a[] getLinks() {
+ if (this.links == null) {
+ return DEFAULT_LINKS;
+ }
+ return this.links;
+ }
+
+ /**
+ * Sets the links for this graphic.
+ * @param links The new array of links for this graphic.
+ */
+ protected void setLinks(final GraphicLink4a[] links) {
+ this.links = links;
+ }
+
}
Added: trunk/foray/foray-graphic/src/java/org/foray/graphic/GraphicLink4a.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/GraphicLink4a.java (rev 0)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/GraphicLink4a.java 2007-06-11 19:17:42 UTC (rev 9748)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2007 The FOray Project.
+ * http://www.foray.org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+ * $LastChangedRevision$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ */
+
+package org.foray.graphic;
+
+import org.axsl.graphicR.GraphicLink;
+
+import java.awt.Shape;
+import java.net.URI;
+
+/**
+ * The FOray implementation of the {@link GraphicLink} interface.
+ */
+public class GraphicLink4a implements GraphicLink {
+
+ /** The URI for this link. */
+ private URI uri;
+
+ /** The Shape for this link. */
+ private Shape shape;
+
+ /**
+ * Constructor.
+ * @param uri The URI for this link.
+ * @param shape The Shape for this link.
+ */
+ public GraphicLink4a(final URI uri, final Shape shape) {
+ this.uri = uri;
+ this.shape = shape;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public URI getUri() {
+ return uri;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Shape getShape() {
+ return shape;
+ }
+
+}
Property changes on: trunk/foray/foray-graphic/src/java/org/foray/graphic/GraphicLink4a.java
___________________________________________________________________
Name: svn:keywords
+ "Author Id Rev Date URL"
Name: svn:eol-style
+ native
Modified: trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-06-11 15:37:29 UTC (rev 9747)
+++ trunk/foray/foray-graphic/src/java/org/foray/graphic/SVGGraphic.java 2007-06-11 19:17:42 UTC (rev 9748)
@@ -52,6 +52,7 @@
import java.awt.geom.Rectangle2D;
import java.io.BufferedInputStream;
import java.io.IOException;
+import java.io.OutputStream;
import java.net.URL;
/**
@@ -291,4 +292,21 @@
return new BridgeContext(userAgent);
}
+ /**
+ * {@inheritDoc}
+ */
+ public void drawPS(final OutputStream output, final boolean commentsEnabled,
+ final int x, final int y) {
+ /* TODO: Implement this. */
+ return;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void drawPdfStreamContent(final OutputStream output) {
+ /* TODO: Implement this. */
+ return;
+ }
+
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-06-11 15:37:29 UTC (rev 9747)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2007-06-11 19:17:42 UTC (rev 9748)
@@ -32,6 +32,7 @@
import org.axsl.graphicR.Graphic;
import org.axsl.graphicR.GraphicException;
+import org.axsl.graphicR.GraphicLink;
import java.awt.Color;
import java.awt.color.ColorSpace;
@@ -43,6 +44,9 @@
*/
public class TempImage implements Graphic {
+ /** An array of empty link to be used as a default. */
+ private static final GraphicLink[] EMPTY_LINKS = new GraphicLink[0];
+
/** The image height, in millipoints. */
private int height;
@@ -203,4 +207,11 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public GraphicLink[] getLinks() {
+ return EMPTY_LINKS;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|