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 de...@apache.org on 2001/09/19 14:11:50 UTC
cvs commit: xml-batik/sources/org/apache/batik/ext/awt/image/renderable AbstractRable.java
deweese 01/09/19 05:11:50
Modified: resources/org/apache/batik/bridge/resources
Messages.properties
resources/org/apache/batik/ext/awt/image/spi/resources
Messages.properties
sources/org/apache/batik/bridge ErrorConstants.java
SVGBrokenLinkProvider.java
sources/org/apache/batik/ext/awt/image/renderable
AbstractRable.java
Log:
1) Fixed a boo-boo in Broken Link handling
2) Fixed a long standing bug in AbstractRable around properties handling.
3) Put newlines in Broken Link 'info' messages.
4) Added a title to the Broken Link 'info' messages.
Revision Changes Path
1.6 +3 -0 xml-batik/resources/org/apache/batik/bridge/resources/Messages.properties
Index: Messages.properties
===================================================================
RCS file: /home/cvs/xml-batik/resources/org/apache/batik/bridge/resources/Messages.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Messages.properties 2001/05/04 01:28:55 1.5
+++ Messages.properties 2001/09/19 12:11:49 1.6
@@ -47,3 +47,6 @@
uri.image.invalid = \
{0}:{1}\n\
The URI ''{3}'' specified on the element <{2}> is invalid
+
+broken.link.title = \
+Broken Link:
1.3 +11 -5 xml-batik/resources/org/apache/batik/ext/awt/image/spi/resources/Messages.properties
Index: Messages.properties
===================================================================
RCS file: /home/cvs/xml-batik/resources/org/apache/batik/ext/awt/image/spi/resources/Messages.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Messages.properties 2001/08/07 17:28:21 1.2
+++ Messages.properties 2001/09/19 12:11:49 1.3
@@ -6,14 +6,20 @@
# the LICENSE file. #
#############################################################################
-stream.unreadable = Stream data is corrupt or unsupported format
+stream.unreadable = \
+Stream data is corrupt or unsupported format
-stream.format.unreadable = {0} stream is corrupt or unsupported variant
+stream.format.unreadable = \
+{0} stream is corrupt or unsupported variant
-url.unreachable = Unable to access URL: {0}
+url.unreachable = \
+Unable to access URL: \n\
+{0}
-url.uninterpretable = URL data in unsupported format or corrupt: {0}
+url.uninterpretable = \
+URL data in unsupported format or corrupt: \n\
+{0}
url.format.unreadable =\
-{0} URL is corrupt or unsupported variant: \
+{0} URL is corrupt or unsupported variant: \n\
{1}
1.3 +7 -1 xml-batik/sources/org/apache/batik/bridge/ErrorConstants.java
Index: ErrorConstants.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/ErrorConstants.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ErrorConstants.java 2001/07/05 06:56:06 1.2
+++ ErrorConstants.java 2001/09/19 12:11:50 1.3
@@ -12,7 +12,7 @@
* The error code.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: ErrorConstants.java,v 1.2 2001/07/05 06:56:06 bella Exp $
+ * @version $Id: ErrorConstants.java,v 1.3 2001/09/19 12:11:50 deweese Exp $
*/
public interface ErrorConstants {
@@ -98,4 +98,10 @@
*/
public static final String ERR_URI_IMAGE_INVALID
= "uri.image.invalid";
+
+ /**
+ * The resource that contains the title for the Broken Link message
+ */
+ public static final String MSG_BROKEN_LINK_TITLE
+ = "broken.link.title";
}
1.7 +13 -6 xml-batik/sources/org/apache/batik/bridge/SVGBrokenLinkProvider.java
Index: SVGBrokenLinkProvider.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGBrokenLinkProvider.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SVGBrokenLinkProvider.java 2001/09/18 21:18:59 1.6
+++ SVGBrokenLinkProvider.java 2001/09/19 12:11:50 1.7
@@ -13,6 +13,7 @@
import org.apache.batik.ext.awt.image.renderable.Filter;
import org.apache.batik.ext.awt.image.spi.DefaultBrokenLinkProvider;
import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.gvt.filter.GraphicsNodeRable8Bit;
import org.apache.batik.gvt.renderer.StaticRenderer;
import org.apache.batik.i18n.LocalizableSupport;
@@ -34,7 +35,9 @@
* generating a placeholder image when the ImageTagRegistry
* fails to handle a given reference.
*/
-public class SVGBrokenLinkProvider extends DefaultBrokenLinkProvider {
+public class SVGBrokenLinkProvider
+ extends DefaultBrokenLinkProvider
+ implements ErrorConstants {
final static String SVG_BROKEN_LINK_DOCUMENT_PROPERTY =
"org.apache.batik.bridge.BrokenLinkDocument";
@@ -80,9 +83,15 @@
Object[] params) {
if (gvtRoot != null) {
String message = formatMessage(base, code, params);
- Document doc = DOMUtilities.deepCloneDocument(svgDoc,
- svgDoc.getImplementation());
+ Document doc = DOMUtilities.deepCloneDocument
+ (svgDoc, svgDoc.getImplementation());
Element infoE = doc.getElementById("More_About");
+ Element title = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
+ SVGConstants.SVG_TITLE_TAG);
+ title.appendChild(doc.createTextNode
+ (Messages.formatMessage
+ (MSG_BROKEN_LINK_TITLE, null)));
+ infoE.appendChild(title);
Element desc = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI,
SVGConstants.SVG_DESC_TAG);
desc.appendChild(doc.createTextNode(message));
@@ -92,9 +101,7 @@
props.put(BROKEN_LINK_PROPERTY, message);
props.put(SVG_BROKEN_LINK_DOCUMENT_PROPERTY, doc);
- // We should format the code and params and replace a node
- // in the gvtRoot with the result.
- return gvtRoot.getGraphicsNodeRable();
+ return new GraphicsNodeRable8Bit(gvtRoot, props);
}
return null;
}
1.3 +4 -6 xml-batik/sources/org/apache/batik/ext/awt/image/renderable/AbstractRable.java
Index: AbstractRable.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/renderable/AbstractRable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractRable.java 2001/03/26 21:27:31 1.2
+++ AbstractRable.java 2001/09/19 12:11:50 1.3
@@ -39,13 +39,13 @@
* implementation.
*
* @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
- * @version $Id: AbstractRable.java,v 1.2 2001/03/26 21:27:31 deweese Exp $
+ * @version $Id: AbstractRable.java,v 1.3 2001/09/19 12:11:50 deweese Exp $
*/
public abstract class AbstractRable implements Filter {
- protected Vector srcs;
- protected Map props;
- protected long stamp=0;
+ protected Vector srcs;
+ protected Map props = new HashMap();
+ protected long stamp = 0;
/**
* void constructor. The subclass must call one of the
@@ -143,7 +143,6 @@
*/
protected void init(Filter src, Map props) {
init (src);
- this.props = new HashMap();
if(props != null){
this.props.putAll(props);
}
@@ -174,7 +173,6 @@
*/
protected void init(List srcs, Map props) {
init (srcs);
- this.props = new HashMap();
if(props != null)
this.props.putAll(props);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org