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 tk...@apache.org on 2001/01/16 11:59:23 UTC
cvs commit: xml-batik/sources/org/apache/batik/transcoder/image/resources Messages.java
tkormann 01/01/16 02:59:23
Added: resources/org/apache/batik/transcoder/image/resources
Messages.properties
sources/org/apache/batik/transcoder DefaultErrorHandler.java
sources/org/apache/batik/transcoder/image package.html
sources/org/apache/batik/transcoder/image/resources
Messages.java
Log:
add files for transcoders
Revision Changes Path
1.1 xml-batik/resources/org/apache/batik/transcoder/image/resources/Messages.properties
Index: Messages.properties
===================================================================
#############################################################################
# Copyright (C) The Apache Software Foundation. All rights reserved. #
#############################################################################
# This software is published under the terms of the Apache Software License #
# version 1.1, a copy of which has been included with this distribution in #
# the LICENSE file. #
#############################################################################
#
# The error messages for the image transcoder.
#
# Author: Thierry Kormann
#
notsvg = \
The specified XML document fragment is not an SVG document
jpeg.badoutput = \
Invalid output. JPEG transcoder only supports a byte stream output
jpeg.unspecifiedQuality = \
The JPEG quality has not been specified. Use the default one: no compression
1.1 xml-batik/sources/org/apache/batik/transcoder/DefaultErrorHandler.java
Index: DefaultErrorHandler.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.transcoder;
/**
* A default <tt>ErrorHandler</tt> that throws a
* <tt>TranscoderException</tt> when a fatal error occured and display
* a message when a warning or an error occured.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
* @version $Id: DefaultErrorHandler.java,v 1.1 2001/01/16 10:59:22 tkormann Exp $
*/
public class DefaultErrorHandler implements ErrorHandler {
/**
* Invoked when an error occured while transcoding.
* @param ex the error informations encapsulated in a TranscoderException
* @exception TranscoderException if the method want to forward
* the exception
*/
public void error(TranscoderException ex) throws TranscoderException {
System.err.println("ERROR: "+ex.getMessage());
}
/**
* Invoked when an fatal error occured while transcoding.
* @param ex the fatal error informations encapsulated in a
* TranscoderException
* @exception TranscoderException if the method want to forward
* the exception
*/
public void fatalError(TranscoderException ex) throws TranscoderException {
throw ex;
}
/**
* Invoked when a warning occured while transcoding.
* @param ex the warning informations encapsulated in a TranscoderException
* @exception TranscoderException if the method want to forward
* the exception
*/
public void warning(TranscoderException ex) throws TranscoderException {
System.err.println("WARNING: "+ex.getMessage());
}
}
1.1 xml-batik/sources/org/apache/batik/transcoder/image/package.html
Index: package.html
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
Provides transcoders for transcoding a SVG document fragment
to an image.
</body>
</html>
1.1 xml-batik/sources/org/apache/batik/transcoder/image/resources/Messages.java
Index: Messages.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.transcoder.image.resources;
import java.util.Locale;
import java.util.MissingResourceException;
import org.apache.batik.i18n.Localizable;
import org.apache.batik.i18n.LocalizableSupport;
/**
* This class manages the message for the image transcoder module.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id: Messages.java,v 1.1 2001/01/16 10:59:22 tkormann Exp $
*/
public class Messages {
/**
* This class does not need to be instantiated.
*/
protected Messages() {
}
/**
* The error messages bundle class name.
*/
protected final static String RESOURCES =
"org.apache.batik.transcoder.image.resources.Messages";
/**
* The localizable support for the error messages.
*/
protected static LocalizableSupport localizableSupport =
new LocalizableSupport(RESOURCES);
/**
* Implements {@link org.apache.batik.i18n.Localizable#setLocale(Locale)}.
*/
public static void setLocale(Locale l) {
localizableSupport.setLocale(l);
}
/**
* Implements {@link org.apache.batik.i18n.Localizable#getLocale()}.
*/
public static Locale getLocale() {
return localizableSupport.getLocale();
}
/**
* Implements {@link
* org.apache.batik.i18n.Localizable#formatMessage(String,Object[])}.
*/
public static String formatMessage(String key, Object[] args)
throws MissingResourceException {
return localizableSupport.formatMessage(key, args);
}
}