Package org.timepedia.chronoscope.client

Source Code of org.timepedia.chronoscope.client.ComponentFactory

package org.timepedia.chronoscope.client;

import org.timepedia.chronoscope.client.data.DatasetFactory;
import org.timepedia.chronoscope.client.data.MipMapStrategy;

import java.util.HashMap;
import java.util.Map;

/**
* Factory for obtaining a family of components that are tied to a given version
* of Chronoscope (i.e. the free vs. the commercial version).
*
* @author chad takahashi
*/
public abstract class ComponentFactory {

  protected Map<String, MipMapStrategy> name2mipmapStrategy
      = new HashMap<String, MipMapStrategy>();

  protected ComponentFactory() {
  }

  public abstract DatasetFactory getDatasetFactory();

  public final MipMapStrategy getMipMapStrategy(String name) {
    //GWT.log("TESTING: ComponentFactory: available mipmap strategies: " + name2mipmapStrategy.keySet(), null);
    MipMapStrategy mms = name2mipmapStrategy.get(name);
    if (mms == null) {
      return name2mipmapStrategy.values().iterator().next();
//      throw new IllegalArgumentException(
//          "Can't find MipMapStrategy associated with " + "name '" + name + "'");
    }
    return mms;
  }
}
TOP

Related Classes of org.timepedia.chronoscope.client.ComponentFactory

TOP
Copyright © 2018 www.massapi.com. 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.