01: /*
02: * This file is part of the GeOxygene project source files.
03: *
04: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
05: * the development and deployment of geographic (GIS) applications. It is a open source
06: * contribution of the COGIT laboratory at the Institut Géographique National (the French
07: * National Mapping Agency).
08: *
09: * See: http://oxygene-project.sourceforge.net
10: *
11: * Copyright (C) 2005 Institut Géographique National
12: *
13: * This library is free software; you can redistribute it and/or modify it under the terms
14: * of the GNU Lesser General Public License as published by the Free Software Foundation;
15: * either version 2.1 of the License, or any later version.
16: *
17: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
20: *
21: * You should have received a copy of the GNU Lesser General Public License along with
22: * this library (see file LICENSE if present); if not, write to the Free Software
23: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24: *
25: */
26:
27: package fr.ign.cogit.geoxygene.contrib.appariement.stockageLiens;
28:
29: import fr.ign.cogit.geoxygene.contrib.appariement.EnsembleDeLiens;
30: import fr.ign.cogit.geoxygene.datatools.ojb.GeodatabaseOjbFactory;
31: import fr.ign.cogit.geoxygene.feature.DataSet;
32:
33: /**
34: * Classe permettant le stockage et le chargement d'ensemble de liens résultants
35: * d'appariement
36: *
37: * @author Eric Grosso - IGN / Laboratoire COGIT
38: * @version 1.0
39: *
40: */
41:
42: public class StockageLiens {
43:
44: /** Méthode permettant de stocker automatiquement un ensemble de liens d'appariement
45: * et les liens correspondants dans le SGBD
46: * @param ensembleLiens */
47: public static void stockageDesLiens(EnsembleDeLiens ensembleLiens,
48: int rouge, int vert, int bleu) {
49: DataSet.db = GeodatabaseOjbFactory.newInstance();
50: DataSet.db.begin();
51: EnsembleDeLiensSGBD liensSGBD = new EnsembleDeLiensSGBD(true);
52: liensSGBD.conversionEnsembleLiensVersSGBD(ensembleLiens, rouge,
53: vert, bleu);
54: DataSet.db.commit();
55: }
56:
57: /** Méthode permettant de déstocker automatiquement un ensemble de liens d'appariement
58: * SGBD et les liens correspondants, en renvoyant l'ensemble de liens correspondants
59: * @param ensembleLiensSGBG */
60: public static EnsembleDeLiens destockageDesLiens(
61: EnsembleDeLiensSGBD ensembleLiensSGBD) {
62: EnsembleDeLiens liens = new EnsembleDeLiens();
63: ensembleLiensSGBD.conversionSGBDVersEnsembleLiens(liens);
64: return liens;
65: }
66:
67: }
|