tkormann    01/10/19 02:09:32

  Modified:    sources/org/apache/batik/transcoder/image
                        ImageTranscoder.java
  Log:
  add a TranscodingHint for alternate stylesheets
  
  Revision  Changes    Path
  1.31      +33 -2     
xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java
  
  Index: ImageTranscoder.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ImageTranscoder.java      2001/10/08 15:49:38     1.30
  +++ ImageTranscoder.java      2001/10/19 09:09:32     1.31
  @@ -102,7 +102,7 @@
    * millimeter conversion factor.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Thierry Kormann</a>
  - * @version $Id: ImageTranscoder.java,v 1.30 2001/10/08 15:49:38 hillion Exp $
  + * @version $Id: ImageTranscoder.java,v 1.31 2001/10/19 09:09:32 tkormann Exp $
    */
   public abstract class ImageTranscoder extends XMLAbstractTranscoder {
   
  @@ -140,7 +140,14 @@
               throw new TranscoderException(
                   Messages.formatMessage("notsvg", null));
           }
  +     
           SVGDocument svgDoc = (SVGDocument)document;
  +     // set the alternate stylesheet if any
  +        if (hints.containsKey(KEY_ALTERNATE_STYLESHEET)) {
  +            String stylesheetName = (String)hints.get(KEY_ALTERNATE_STYLESHEET);
  +         ((SVGOMDocument)svgDoc).enableAlternateStyleSheet(stylesheetName);
  +        }
  +
           SVGSVGElement root = svgDoc.getRootElement();
           // initialize the SVG document with the appropriate context
           DefaultSVGContext svgCtx = new DefaultSVGContext();
  @@ -578,7 +585,7 @@
           = new StringKey();
   
       /**
  -     * The language key.
  +     * The media key.
        * <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1">
        * <TR>
        * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Key: </TH>
  @@ -599,6 +606,30 @@
        * </TABLE>
        */
       public static final TranscodingHints.Key KEY_MEDIA
  +        = new StringKey();
  +
  +    /**
  +     * The alternate stylesheet key.
  +     * <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1">
  +     * <TR>
  +     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Key: </TH>
  +     * <TD VALIGN="TOP">KEY_ALTERNATE_STYLESHEET</TD></TR>
  +     * <TR>
  +     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Value: </TH>
  +     * <TD VALIGN="TOP">String</TD></TR>
  +     * <TR>
  +     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Default: </TH>
  +     * <TD VALIGN="TOP">null</TD></TR>
  +     * <TR>
  +     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Required: </TH>
  +     * <TD VALIGN="TOP">No</TD></TR>
  +     * <TR>
  +     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN="RIGHT">Description: </TH>
  +     * <TD VALIGN="TOP">Specify the alternate stylesheet to use.
  +     * </TD></TR>
  +     * </TABLE>
  +     */
  +    public static final TranscodingHints.Key KEY_ALTERNATE_STYLESHEET
           = new StringKey();
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to