KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > pagination > ColorProfile


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: ColorProfile.java 474225 2006-11-13 10:08:19Z jeremias $ */
19
20 package org.apache.fop.fo.pagination;
21
22 import org.apache.fop.apps.FOPException;
23 import org.apache.fop.fo.FONode;
24 import org.apache.fop.fo.FObj;
25 import org.apache.fop.fo.PropertyList;
26 import org.apache.fop.fo.ValidationException;
27
28 import org.xml.sax.Locator JavaDoc;
29
30 /**
31  * The fo:color-profile formatting object.
32  * This loads the color profile when needed and resolves a requested color.
33  */

34 public class ColorProfile extends FObj {
35     // The value of properties relevant for fo:color-profile.
36
private String JavaDoc src;
37     private String JavaDoc colorProfileName;
38     private int renderingIntent;
39     // End of property values
40

41     /**
42      * @see org.apache.fop.fo.FONode#FONode(FONode)
43      */

44     public ColorProfile(FONode parent) {
45         super(parent);
46     }
47
48     /**
49      * @see org.apache.fop.fo.FObj#bind(PropertyList)
50      */

51     public void bind(PropertyList pList) throws FOPException {
52         src = pList.get(PR_SRC).getString();
53         colorProfileName = pList.get(PR_COLOR_PROFILE_NAME).getString();
54         renderingIntent = pList.get(PR_RENDERING_INTENT).getEnum();
55     }
56
57     /**
58      * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
59         XSL 1.0/FOP: EMPTY (no child nodes permitted)
60      */

61     protected void validateChildNode(Locator JavaDoc loc, String JavaDoc nsURI, String JavaDoc localName)
62         throws ValidationException {
63         invalidChildError(loc, nsURI, localName);
64     }
65
66     /**
67      * Return the "color-profile-name" property.
68      */

69     public String JavaDoc getColorProfileName() {
70         return colorProfileName;
71     }
72
73     /** @see org.apache.fop.fo.FONode#getLocalName() */
74     public String JavaDoc getLocalName() {
75         return "color-profile";
76     }
77     
78     /**
79      * @see org.apache.fop.fo.FObj#getNameId()
80      */

81     public int getNameId() {
82         return FO_COLOR_PROFILE;
83     }
84     
85     /**
86      * Get src attribute
87      *
88      * @return Value of color-profile src attribute
89      */

90     public String JavaDoc getSrc() {
91         return this.src;
92     }
93     
94     /**
95      * Get rendering-intent attribute
96      *
97      * Returned value is one of
98      * Constants.EN_AUTO
99      * Constants.EN_PERCEPTUAL
100      * Constants.EN_RELATIVE_COLOMETRIC
101      * Constants.EN_SATURATION
102      * Constants.EN_ABSOLUTE_COLORMETRIC
103      *
104      * @return Rendering intent attribute
105      */

106     public int getRenderingIntent() {
107         return this.renderingIntent;
108     }
109 }
110
Popular Tags