Пример #1
0
  /**
   * @param f
   * @param chain
   * @return
   * @throws PersistenceException
   * @throws IOException
   */
  private List<String> parser(File f, String chain) throws PersistenceException, IOException {

    PersistenceManager manager = ToolsLocator.getPersistenceManager();

    Patternnormalization pat = new DefaultPatternnormalization();
    FileReader reader = new FileReader(f);
    PersistentState state = manager.loadState(reader);
    pat.loadFromState(state);
    reader.close();

    NormalizationAlgorithm na = new DefaultNormalizationAlgorithm(pat);

    List<String> result = na.splitChain(chain);
    return result;
  }
Пример #2
0
  /**
   * Constructor
   *
   * @param filterStack
   */
  public RasterFilterListManager(RasterFilterList filterStack) {
    this.rasterFilterList = filterStack;

    // Cargamos el manager con los gestores de drivers registrados
    ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
    ExtensionPoint point = extensionPoints.get("RasterFilter");
    Iterator iterator = point.iterator();
    while (iterator.hasNext()) {
      ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator.next();
      if (entry != null) {
        Class RasterClass = entry.getExtension();
        Object obj = RasterFilterListManager.loadClass(RasterClass, this);
        if (obj != null) managers.add(obj);
      }
    }
  }
Пример #3
0
 /*	public static ProjectTable createTable(String viewName, FTable ftable){
 		return Table.createTable(viewName, ftable);
 	}
 */
 public static ProjectView createView(String viewName) {
   ProjectDocumentFactory pdf = null;
   try {
     pdf =
         (ProjectDocumentFactory)
             ToolsLocator.getExtensionPointManager()
                 .get("Documents")
                 .create(ProjectViewFactory.registerName);
   } catch (Exception e) {
     // FIXME Exception
     e.printStackTrace();
   }
   ProjectView pv = (ProjectView) pdf.create((Project) null);
   pv.setProjectDocumentFactory(pdf);
   pv.setName(viewName);
   return pv;
 }
Пример #4
0
  public static FeatureTableDocument createTable(String name, FeatureStore fs) {
    ProjectDocumentFactory pdf = null;
    try {
      pdf =
          (ProjectDocumentFactory)
              ToolsLocator.getExtensionPointManager()
                  .get("Documents")
                  .create(FeatureTableDocumentFactory.registerName);
    } catch (Exception e) {
      // FIXME Exception
      e.printStackTrace();
    }

    FeatureTableDocument pt = FeatureTableDocumentFactory.createTable(name, fs);
    pt.setProjectDocumentFactory(pdf);
    return pt;
  }
Пример #5
0
 public static ProjectMap createMap(String baseName) {
   ProjectDocumentFactory pdf = null;
   try {
     pdf =
         (ProjectDocumentFactory)
             ToolsLocator.getExtensionPointManager()
                 .get("Documents")
                 .create(ProjectMapFactory.registerName);
   } catch (Exception e) {
     // FIXME Exception
     e.printStackTrace();
   }
   ProjectMap pm = (ProjectMap) pdf.create((Project) null);
   pm.setProjectDocumentFactory(pdf);
   pm.setName(baseName);
   return pm;
 }
Пример #6
0
  protected static void registerDynClass() {
    DynObjectManager dynman = ToolsLocator.getDynObjectManager();
    DynClass dynClass;
    DynField field;
    if (DYNCLASS == null) {

      DynClass dbfDynClass = DBFStoreProvider.DYNCLASS;
      dynClass = dynman.add(DYNCLASS_NAME);

      field = dynClass.addDynField(DYNFIELD_SRSORIGINALPARAMETERS_NAME);
      field.setType(DataTypes.STRING);
      field.setDescription("SRS original parameters");

      // The SHP store parameters extend the DBF store parameters
      dynClass.extend(dbfDynClass);

      DYNCLASS = dynClass;
    }
  }
Пример #7
0
  /** Constructor */
  public TestNormAlgorithm() {

    ToolsLibrary tools = new ToolsLibrary();
    tools.initialize();
    ToolsLocator.registerPersistenceManager(XMLEntityManager.class);
    tools.postInitialize();

    Library dlib = new DALLibrary();
    dlib.initialize();
    dlib.postInitialize();

    Library libFile = new DALFileLibrary();
    libFile.initialize();
    libFile.postInitialize();

    Library shpLib = new SHPLibrary();
    shpLib.initialize();
    shpLib.postInitialize();
  }
Пример #8
0
 public SHPStoreProvider(SHPStoreParameters params, DataStoreProviderServices storeServices)
     throws InitializeException {
   super(params, storeServices, ToolsLocator.getDynObjectManager().createDynObject(DYNCLASS));
 }
Пример #9
0
 public DynField addDynFieldURI(String name) {
   DataTypesManager datamanager = ToolsLocator.getDataTypesManager();
   return addDynField(name).setType(datamanager.get(DataTypes.URI));
 }