KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > stefanochizzolini > clown > documents > contents > Resources


1 /*
2   Copyright 2006 Stefano Chizzolini. http://clown.stefanochizzolini.it
3
4   Contributors:
5     * Stefano Chizzolini (original code developer, info@stefanochizzolini.it):
6       contributed code is Copyright 2006 by Stefano Chizzolini.
7
8   This file should be part of the source code distribution of "PDF Clown library"
9   (the Program): see the accompanying README files for more info.
10
11   This Program is free software; you can redistribute it and/or modify it under
12   the terms of the GNU General Public License as published by the Free Software
13   Foundation; either version 2 of the License, or (at your option) any later version.
14
15   This Program is distributed in the hope that it will be useful, but WITHOUT ANY
16   WARRANTY, either expressed or implied; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
18
19   You should have received a copy of the GNU General Public License along with this
20   Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
21
22   Redistribution and use, with or without modification, are permitted provided that such
23   redistributions retain the above copyright notice, license and disclaimer, along with
24   this list of conditions.
25 */

26
27 package it.stefanochizzolini.clown.documents.contents;
28
29 import it.stefanochizzolini.clown.documents.Document;
30 import it.stefanochizzolini.clown.objects.PdfDictionary;
31 import it.stefanochizzolini.clown.objects.PdfDirectObject;
32 import it.stefanochizzolini.clown.objects.PdfIndirectObject;
33 import it.stefanochizzolini.clown.objects.PdfName;
34 import it.stefanochizzolini.clown.objects.PdfObjectWrapper;
35 import it.stefanochizzolini.clown.util.NotImplementedException;
36
37 /**
38   Resources collection [PDF:1.6:3.7.2].
39 */

40 public class Resources
41   extends PdfObjectWrapper<PdfDictionary>
42 {
43   // <class>
44
// <dynamic>
45
// <constructors>
46
public Resources(
47     Document context
48     )
49   {
50     super(
51       context.getFile(),
52       new PdfDictionary()
53       );
54   }
55
56   /**
57     <h3>Remarks</h3>
58     <p>For internal use only.</p>
59   */

60   public Resources(
61     PdfDirectObject baseObject,
62     PdfIndirectObject container
63     )
64   {
65     super(
66       baseObject,
67       container
68       );
69   }
70   // </constructors>
71

72   // <interface>
73
// <public>
74
public Object JavaDoc clone(
75     Document context
76     )
77   {throw new NotImplementedException();}
78
79   public ColorSpaces getColorSpaces(
80     )
81   {
82     /*
83       NOTE: ColorSpace entry may be undefined [PDF:1.6:3.7.2].
84     */

85     PdfDirectObject colorSpaces = getBaseDataObject().get(PdfName.ColorSpace);
86     if(colorSpaces == null)
87       return null;
88     else
89       return new ColorSpaces(
90         colorSpaces,
91         getContainer()
92         );
93   }
94
95   public Fonts getFonts(
96     )
97   {
98     /*
99       NOTE: Font entry may be undefined [PDF:1.6:3.7.2].
100     */

101     PdfDirectObject fonts = getBaseDataObject().get(PdfName.Font);
102     if(fonts == null)
103       return null;
104     else
105       return new Fonts(
106         fonts,
107         getContainer()
108         );
109   }
110
111   public XObjects getXObjects(
112     )
113   {
114     /*
115       NOTE: XObject entry may be undefined [PDF:1.6:3.7.2].
116     */

117     PdfDirectObject xObjects = getBaseDataObject().get(PdfName.XObject);
118     if(xObjects == null)
119       return null;
120     else
121       return new XObjects(
122         xObjects,
123         getContainer()
124         );
125   }
126
127   public void setColorSpaces(
128     ColorSpaces value
129     )
130   {getBaseDataObject().put(PdfName.ColorSpace,value.getBaseObject());}
131
132   public void setFonts(
133     Fonts value
134     )
135   {getBaseDataObject().put(PdfName.Font,value.getBaseObject());}
136
137   public void setXObjects(
138     XObjects value
139     )
140   {getBaseDataObject().put(PdfName.XObject,value.getBaseObject());}
141   // </public>
142
// </interface>
143
// </dynamic>
144
// </class>
145
}
Popular Tags