1 7 8 package com.sun.imageio.plugins.wbmp; 9 10 import java.util.Arrays ; 11 import javax.imageio.ImageTypeSpecifier ; 12 import javax.imageio.metadata.IIOMetadataFormat ; 13 import javax.imageio.metadata.IIOMetadataFormatImpl ; 14 15 public class WBMPMetadataFormat extends IIOMetadataFormatImpl { 16 17 private static IIOMetadataFormat instance = null; 18 19 private WBMPMetadataFormat() { 20 super(WBMPMetadata.nativeMetadataFormatName, 21 CHILD_POLICY_SOME); 22 23 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 elementName, 42 ImageTypeSpecifier imageType) { 43 return true; 44 } 45 46 public static synchronized IIOMetadataFormat getInstance() { 47 if (instance == null) { 48 instance = new WBMPMetadataFormat(); 49 } 50 return instance; 51 } 52 } 53 | Popular Tags |