Package com.lightcrafts.mediax.jai.util

Examples of com.lightcrafts.mediax.jai.util.CaselessStringKey


  String modeNames[] = RegistryMode.getModeNames();

  for (int i = 0; i < modeNames.length; i++)
      localNamesTable.put(
    new CaselessStringKey(modeNames[i]), new Hashtable());
    }
View Full Code Here


     * be used to directly set preferences later.
     */
    private void mapLocalNameToObject(String modeName, String localName, Object factory) {

  Hashtable modeTable = (Hashtable)
      localNamesTable.get(new CaselessStringKey(modeName));

  modeTable.put(new CaselessStringKey(localName), factory);
    }
View Full Code Here

     * Get object registered under the local name for under the mode.
     */
    private Object getObjectFromLocalName(String modeName, String localName) {

  Hashtable modeTable = (Hashtable)
      localNamesTable.get(new CaselessStringKey(modeName));

  Object obj = modeTable.get(new CaselessStringKey(localName));

  if (obj == null)
      registryFileError(localName + ": " +
        JaiI18N.getString("RegistryFileParser8"));

View Full Code Here

        String[] propertyNames = source.getPropertyNames();
  String propertyName;
        if (propertyNames != null) {
            for (int i = 0; i < propertyNames.length; i++) {
    propertyName = propertyNames[i];
                properties.put(new CaselessStringKey(propertyName),
                               source.getProperty(propertyName));
            }
        }

        // Initialize the host field.
View Full Code Here

    }

    // XXX Should getProperty() request property values over a socket
    // connection also?
    public Object getProperty(String name) {
        Object property = properties.get(new CaselessStringKey(name));
  return property == null ? Image.UndefinedProperty : property;
    }
View Full Code Here

  String[] names = null;
        if (!properties.isEmpty()) {
            names = new String[properties.size()];
            Enumeration keys = properties.keys();
            int index = 0;
      CaselessStringKey key;
            while (keys.hasMoreElements()) {
    key = (CaselessStringKey)keys.nextElement();
                names[index++] = key.getName();
            }
        }
        return names;
    }
View Full Code Here

        }

  String descriptorName = rdesc.getName();

  // Use a caseless version of the key.
  CaselessStringKey key = new CaselessStringKey(descriptorName);

  // If the key has already been added bail out ...
  if (descriptorNames.containsKey(key) == true) {
      throw new IllegalArgumentException(
    JaiI18N.formatMsg("DescriptorCache0",
        new Object[] {descriptorName, modeName}));
  }

  // Store the RegistryElementDescriptor hashed by its global name
  descriptorNames.put(key, rdesc);

  // Store the ProductOperationGraph hashed by the caseless
  // descriptor name
  if (arePreferencesSupported)
      products.put(key, new ProductOperationGraph());

  // if properties arent supported by this descriptor we are done.
  if (rdesc.arePropertiesSupported() == false)
      return true;

  // Store the Property Generators associated with this descriptor
  // for the specified mode.
  PropertyGenerator props[] = rdesc.getPropertyGenerators(modeName);

  if (props != null) {
      for (int i=0; i<props.length; i++) {

    Vector v = (Vector)properties.get(key);
    if (v == null) {
        v = new Vector();
        v.addElement(props[i]);
        properties.put(key, v);
    } else {
        v.addElement(props[i]);
    }
   
    v = (Vector)suppressed.get(key);
    Hashtable h = (Hashtable)sourceForProp.get(key);
    String names[] = props[i].getPropertyNames();
   
    for (int j=0; j<names.length; j++) {
        CaselessStringKey name = new CaselessStringKey(names[j]);

        if (v != null) v.remove(name);
        if (h != null) h.remove(name);
    }
      }
View Full Code Here

     *         <code>RegistryElementDescriptor</code> to be removed is null.
     */
    boolean removeDescriptor(String descriptorName) {

  // Use a caseless version of the key.
  CaselessStringKey key = new CaselessStringKey(descriptorName);

  // If it is not present in the cache already, then return false.
  if (descriptorNames.containsKey(key) == false) {
      throw new IllegalArgumentException(
    JaiI18N.formatMsg("DescriptorCache1",
View Full Code Here

     *
     * @throws IllegalArgumentException if descriptorName is null
     */
    RegistryElementDescriptor getDescriptor(String descriptorName) {
  // Use a caseless version of the key.
  CaselessStringKey key = new CaselessStringKey(descriptorName);

  return (RegistryElementDescriptor)descriptorNames.get(key);
    }
View Full Code Here

  Enumeration e = descriptorNames.keys();
  int size = descriptorNames.size();
  String names[] = new String[size];

  for (int i = 0; i < size; i++) {
      CaselessStringKey key = (CaselessStringKey)e.nextElement();
      names[i] = key.getName();
  }
   
  return names;
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.util.CaselessStringKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.