KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > imageio > plugins > wbmp > WBMPMetadataFormat


1 /*
2  * @(#)WBMPMetadataFormat.java 1.3 04/03/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.imageio.plugins.wbmp;
9
10 import java.util.Arrays JavaDoc;
11 import javax.imageio.ImageTypeSpecifier JavaDoc;
12 import javax.imageio.metadata.IIOMetadataFormat JavaDoc;
13 import javax.imageio.metadata.IIOMetadataFormatImpl JavaDoc;
14
15 public class WBMPMetadataFormat extends IIOMetadataFormatImpl JavaDoc {
16
17     private static IIOMetadataFormat JavaDoc instance = null;
18
19     private WBMPMetadataFormat() {
20         super(WBMPMetadata.nativeMetadataFormatName,
21               CHILD_POLICY_SOME);
22
23         // root -> ImageDescriptor
24
addElement("ImageDescriptor",
25                    WBMPMetadata.nativeMetadataFormatName,
26                    CHILD_POLICY_EMPTY);
27
28         addAttribute("ImageDescriptor", "WBMPType",
29                      DATATYPE_INTEGER, true, "0");
30
31         addAttribute("ImageDescriptor", "Width",
32                      DATATYPE_INTEGER, true, null,
33                      "0", "65535", true, true);
34         addAttribute("ImageDescriptor", "Height",
35                      DATATYPE_INTEGER, true, null,
36                      "1", "65535", true, true);
37     }
38         
39     
40
41     public boolean canNodeAppear(String JavaDoc elementName,
42                                  ImageTypeSpecifier JavaDoc imageType) {
43         return true;
44     }
45
46     public static synchronized IIOMetadataFormat JavaDoc getInstance() {
47         if (instance == null) {
48             instance = new WBMPMetadataFormat();
49         }
50         return instance;
51     }
52 }
53
Popular Tags