KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > pdf > TransitionDictionary


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id: TransitionDictionary.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.pdf;
21
22 import java.util.Map JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 /**
26  * Transition Dictionary
27  * This class is used to build a transition dictionary to
28  * specify the transition between pages.
29  */

30 public class TransitionDictionary extends PDFObject {
31
32     private Map JavaDoc dictionaryValues;
33
34     /**
35      * Create a Transition Dictionary
36      *
37      * @param values the dictionary values to output
38      */

39     public TransitionDictionary(Map JavaDoc values) {
40         dictionaryValues = values;
41     }
42
43     /**
44      * Get the dictionary.
45      * This returns the string containing the dictionary values.
46      *
47      * @return the string with the dictionary values
48      */

49     public String JavaDoc getDictionary() {
50         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
51         sb.append("/Type /Trans\n");
52         for (Iterator JavaDoc iter = dictionaryValues.keySet().iterator(); iter.hasNext();) {
53             Object JavaDoc key = iter.next();
54             sb.append(key + " " + dictionaryValues.get(key) + "\n");
55         }
56         return sb.toString();
57     }
58
59     /**
60      * there is nothing to return for the toPDF method, as it should not be called
61      *
62      * @return an empty string
63      */

64     public byte[] toPDF() {
65         return new byte[0];
66     }
67 }
68
69
Popular Tags