001: /*
002: * This file is part of the GeOxygene project source files.
003: *
004: * GeOxygene aims at providing an open framework which implements OGC/ISO specifications for
005: * the development and deployment of geographic (GIS) applications. It is a open source
006: * contribution of the COGIT laboratory at the Institut G�ographique National (the French
007: * National Mapping Agency).
008: *
009: * See: http://oxygene-project.sourceforge.net
010: *
011: * Copyright (C) 2005 Institut G�ographique National
012: *
013: * This library is free software; you can redistribute it and/or modify it under the terms
014: * of the GNU Lesser General Public License as published by the Free Software Foundation;
015: * either version 2.1 of the License, or any later version.
016: *
017: * This library is distributed in the hope that it will be useful, but WITHOUT ANY
018: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
019: * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
020: *
021: * You should have received a copy of the GNU Lesser General Public License along with
022: * this library (see file LICENSE if present); if not, write to the Free Software
023: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024: *
025: */
026:
027: package fr.ign.cogit.geoxygene.example;
028:
029: import java.util.ArrayList;
030: import java.util.Vector;
031:
032: import fr.ign.cogit.geoxygene.spatial.coordgeom.DirectPosition;
033: import fr.ign.cogit.geoxygene.spatial.coordgeom.DirectPositionList;
034: import fr.ign.cogit.geoxygene.util.browser.ObjectBrowser;
035:
036: //import donnees.defaut.Departement;
037:
038: /**
039: * Classe de test pour le navigateur d'objets graphique de GeOxygene (ObjectBrowser), permettant de
040: * montrer comment on appelle celui-ci afin de visualiser graphiquement l'�tat d'un objet Java.
041: *
042: * @author Thierry Badard & Arnaud Braun
043: * @version 1.0
044: *
045: */
046: public class TestBrowser {
047: public String Attribut1 = null;
048: public int Attribut2;
049: public String[] Attribut3 = { "1", "a", "f1d8" };
050: public Vector Attribut4 = new Vector();
051: public ArrayList Attribut5 = new ArrayList();
052: public Object Attribut6 = new Object();
053: public double[] Attribut7 = { 1, 143, 1.2356 };
054: public int[] Attribut8 = { 1, 2, 3, 4, 5, 6, 7, 8 };
055: public Vector Attribut9 = new Vector();
056: public TestBrowserObjTest Attribut10 = new TestBrowserObjTest(
057: "Youpla boum !!!", 34);
058: public boolean Attribut11 = true;
059: public Vector Attribut12 = new Vector();
060: public int[][] Attribut13 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
061:
062: protected String Attribut14;
063: public Vector Attribut15 = new Vector();
064: protected Vector[] Attribut16 = new Vector[2];
065: protected Vector[][] Attribut17 = new Vector[2][3];
066:
067: //protected Departement Attribut18=new Departement();
068:
069: //protected StringBuffer Attribut19=new StringBuffer("test of a StringBuffer class");
070: //public ArrayList Attribut20= new ArrayList();
071:
072: public TestBrowser() {
073:
074: }
075:
076: public TestBrowser(String atr1, int atr2) {
077: this .Attribut1 = atr1;
078: this .Attribut2 = atr2;
079: }
080:
081: public String getAttribut1() {
082: return Attribut1;
083: }
084:
085: public double[] getAttribut7() {
086: return Attribut7;
087: }
088:
089: public static void main(String args[]) {
090: TestBrowser obj = new TestBrowser("Toto", 12543);
091: obj.Attribut4.add("alpha");
092: obj.Attribut4.add("beta");
093: obj.Attribut4.add("64");
094: obj.Attribut4.add("D2R2 ;-)");
095:
096: obj.Attribut5.add(new TestBrowserObjTest());
097: obj.Attribut5.add(new TestBrowserObjTest());
098:
099: TestBrowserObjTest vobjelt = new TestBrowserObjTest(
100: "Yiiiiiiiiipi !!! :))", 58);
101: obj.Attribut9.add(vobjelt);
102: obj.Attribut9.add(new TestBrowserObjTest("Pouet ...", 512));
103: obj.Attribut9.add(new TestBrowserObjTest("Boing :oP", 1024));
104: //obj.Attribut9.add(new ObjTest("Plaffff :))",2048));
105:
106: obj.Attribut12.add("texte libre");
107: obj.Attribut12.add(new TestBrowserObjTest("Et zouip !!!", 23));
108: obj.Attribut12.add(new TestBrowserObjTest("Plaffff :))", 2048));
109: obj.Attribut12.add("Et zouip 2 !!! ;-))");
110: obj.Attribut12.add("... et ...");
111: obj.Attribut12.add(new TestBrowserObjTest("Plaffff :))", 2048));
112: obj.Attribut12.add("... blaaaaaaaaaammmmmmm !?!!??");
113: for (int i = 0; i < 100; i++)
114: obj.Attribut12.add("... blaaaaaaaaaammmmmmm !?!!??");
115:
116: Vector vect15a = new Vector();
117: Vector vect15b = new Vector();
118: vect15a.add(new Integer(15));
119: //vect15b.add(new ObjTest());
120: obj.Attribut15.add(vect15a);
121: obj.Attribut15.add(vect15b);
122:
123: obj.Attribut16[0] = new Vector();
124: obj.Attribut16[0].add("toto");
125: obj.Attribut16[0].add(new Integer(12));
126: obj.Attribut16[0].add(new TestBrowserObjTest("PimPamPoum",
127: 146587));
128: obj.Attribut16[1] = new Vector();
129: obj.Attribut16[1].add("titi");
130: obj.Attribut16[1].add(new Integer(52));
131: obj.Attribut16[1].add(new TestBrowserObjTest("Pouet pouet !!!",
132: 26566));
133:
134: obj.Attribut17[0][0] = new Vector();
135: obj.Attribut17[0][0].add("?");
136: obj.Attribut17[0][1] = new Vector();
137: obj.Attribut17[0][1].add("??");
138: obj.Attribut17[0][2] = new Vector();
139: obj.Attribut17[0][2].add("???");
140:
141: DirectPositionList dPosList = new DirectPositionList();
142: dPosList.add(new DirectPosition(0, 0));
143: dPosList.add(new DirectPosition(0, 1));
144: dPosList.add(new DirectPosition(1, 1));
145: dPosList.add(new DirectPosition(1, 0));
146: //obj.Attribut18.setGeom(new GM_LineString(dPosList));
147:
148: /* Vector v20=new Vector();
149: v20.add("?");
150: v20.add("??");
151: v20.add("???");
152: obj.Attribut20.add(v20);
153: obj.Attribut20.add(v20); */
154:
155: ObjectBrowser.browse(obj);
156:
157: obj.Attribut1 = "Titi";
158:
159: ObjectBrowser.refresh(obj);
160:
161: }
162:
163: }
|