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.reseaux.topologie;
28:
29: import java.util.Iterator;
30:
31: import fr.ign.cogit.geoxygene.contrib.appariement.reseaux.ParametresApp;
32: import fr.ign.cogit.geoxygene.contrib.cartetopo.CarteTopo;
33: import fr.ign.cogit.geoxygene.feature.Population;
34:
35: /**
36: * Réseau à apparier, spécialisation d'une carte topo,
37: * utile quasi-uniquement pour spécifier un constructeur adhoc.
38: *
39: * @author Mustiere - IGN / Laboratoire COGIT
40: * @version 1.0
41: *
42: */
43:
44: public class ReseauApp extends CarteTopo {
45:
46: /** Constructeur par défaut : ATTENTION, constructeur à éviter car aucune population n'est créée */
47: public ReseauApp() {
48: this .ojbConcreteClass = this .getClass().getName(); // nécessaire pour ojb
49: }
50:
51: /** Constructeur qui créé une carte topo non persistante de type Reseau_App, avec des populations
52: * de Arc_App, Noeud_App, Face_App, et Groupe_App */
53: public ReseauApp(String nom_logique) {
54: this .ojbConcreteClass = this .getClass().getName(); // nécessaire pour ojb
55: this .setNom(nom_logique);
56: this .setPersistant(false);
57: Population arcs = new Population(false, "Arc", ArcApp.class,
58: true);
59: this .addPopulation(arcs);
60: Population noeuds = new Population(false, "Noeud",
61: NoeudApp.class, true);
62: this .addPopulation(noeuds);
63: Population faces = new Population(false, "Face", FaceApp.class,
64: true);
65: this .addPopulation(faces);
66: Population groupes = new Population(false, "Groupe",
67: GroupeApp.class, false);
68: this .addPopulation(groupes);
69: }
70:
71: public void instancieAttributsNuls(ParametresApp param) {
72: // On affecte une taille par défaut à tous nouveaux sans taille
73: Iterator itNoeuds = this .getPopNoeuds().getElements()
74: .iterator();
75: while (itNoeuds.hasNext()) {
76: NoeudApp noeud = (NoeudApp) itNoeuds.next();
77: if (noeud.getTaille() == 0)
78: noeud.setTaille(param.distanceNoeudsMax);
79: }
80: }
81:
82: }
|