You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(89) |
Mar
(219) |
Apr
(82) |
May
(33) |
Jun
(11) |
Jul
(129) |
Aug
(357) |
Sep
(34) |
Oct
(37) |
Nov
(42) |
Dec
(182) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(74) |
Mar
(196) |
Apr
(205) |
May
(109) |
Jun
(268) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/commun/conversion
Modified Files:
FudaaElement.java FudaaMaillageElement.java FudaaNoeud.java
FudaaPoint.java FudaaPolyligne.java
Log Message:
reformat all files
Index: FudaaElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaElement.java 23 Sep 2003 21:08:04 -0000 1.4
--- FudaaElement.java 25 Nov 2003 10:13:32 -0000 1.5
***************
*** 1,59 ****
! /*
! * @file FudaaElement.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.conversion;
!
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
!
! /**
! * Une classe de translation des SElement <=> GrElement.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaElement {
!
! /**
! * Translation d'un point SElement vers GrElement
! */
! public static GrElement s2Gr(SElement _e) {
! GrNoeud[] noeuds=new GrNoeud[_e.noeuds.length];
! for (int i=0; i<noeuds.length; i++) noeuds[i]=FudaaNoeud.s2Gr(_e.noeuds[i]);
!
! int type=-1;
! if (_e.type==LTypeElement.L2) type=GrElement.L2;
! else if (_e.type==LTypeElement.L3) type=GrElement.L3;
! else if (_e.type==LTypeElement.T3) type=GrElement.T3;
! else if (_e.type==LTypeElement.T6) type=GrElement.T6;
! else if (_e.type==LTypeElement.Q4) type=GrElement.Q4;
! else if (_e.type==LTypeElement.Q8) type=GrElement.Q8;
!
! return new GrElement(noeuds,type);
! }
!
! /**
! * Translation d'un point GrElement vers SElement
! */
! public static SElement gr2S(GrElement _e) {
! SNoeud[] noeuds=new SNoeud[_e.noeuds.length];
! for (int i=0; i<noeuds.length; i++) noeuds[i]=FudaaNoeud.gr2S(_e.noeuds[i]);
!
! LTypeElement type=null;
! if (_e.type==GrElement.L2) type=LTypeElement.L2;
! else if (_e.type==GrElement.L3) type=LTypeElement.L3;
! else if (_e.type==GrElement.T3) type=LTypeElement.T3;
! else if (_e.type==GrElement.T6) type=LTypeElement.T6;
! else if (_e.type==GrElement.Q4) type=LTypeElement.Q4;
! else if (_e.type==GrElement.Q8) type=LTypeElement.Q8;
!
! return new SElement(noeuds,type);
! }
! }
!
--- 1,63 ----
! /*
! * @file FudaaElement.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.conversion;
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! /**
! * Une classe de translation des SElement <=> GrElement.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaElement {
! /**
! * Translation d'un point SElement vers GrElement
! */
! public static GrElement s2Gr(SElement _e) {
! GrNoeud[] noeuds= new GrNoeud[_e.noeuds.length];
! for (int i= 0; i < noeuds.length; i++)
! noeuds[i]= FudaaNoeud.s2Gr(_e.noeuds[i]);
! int type= -1;
! if (_e.type == LTypeElement.L2)
! type= GrElement.L2;
! else if (_e.type == LTypeElement.L3)
! type= GrElement.L3;
! else if (_e.type == LTypeElement.T3)
! type= GrElement.T3;
! else if (_e.type == LTypeElement.T6)
! type= GrElement.T6;
! else if (_e.type == LTypeElement.Q4)
! type= GrElement.Q4;
! else if (_e.type == LTypeElement.Q8)
! type= GrElement.Q8;
! return new GrElement(noeuds, type);
! }
! /**
! * Translation d'un point GrElement vers SElement
! */
! public static SElement gr2S(GrElement _e) {
! SNoeud[] noeuds= new SNoeud[_e.noeuds.length];
! for (int i= 0; i < noeuds.length; i++)
! noeuds[i]= FudaaNoeud.gr2S(_e.noeuds[i]);
! LTypeElement type= null;
! if (_e.type == GrElement.L2)
! type= LTypeElement.L2;
! else if (_e.type == GrElement.L3)
! type= LTypeElement.L3;
! else if (_e.type == GrElement.T3)
! type= LTypeElement.T3;
! else if (_e.type == GrElement.T6)
! type= LTypeElement.T6;
! else if (_e.type == GrElement.Q4)
! type= LTypeElement.Q4;
! else if (_e.type == GrElement.Q8)
! type= LTypeElement.Q8;
! return new SElement(noeuds, type);
! }
! }
Index: FudaaMaillageElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaMaillageElement.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaMaillageElement.java 23 Sep 2003 21:08:04 -0000 1.4
--- FudaaMaillageElement.java 25 Nov 2003 10:13:32 -0000 1.5
***************
*** 1,130 ****
! /*
! * @file FudaaMaillageElement.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.conversion;
!
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! import java.util.*;
!
! /**
! * Une classe de translation des SMaillage <=> GrMaillageElement.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaMaillageElement {
!
! /**
! * Translation d'un SMaillage vers un GrMaillageElement
! */
! public static GrMaillageElement s2Gr(SMaillage _ml) {
! SNoeud[] sNds=_ml.noeuds;
! SElement[] sEls=_ml.elements;
! GrNoeud[] nds =new GrNoeud[sNds.length];
! GrElement[] els =new GrElement[sEls.length];
! Hashtable s2Gr=new Hashtable(sNds.length);
! // List lSNds=Arrays.asList(sNds);
!
! // Noeuds
! for (int i=0; i<sNds.length; i++) {
! nds[i]=FudaaNoeud.s2Gr(sNds[i]);
! s2Gr.put(sNds[i],nds[i]);
! }
!
! // Elements
! for (int i=0; i<sEls.length; i++) {
! SNoeud[] sNdsEl=sEls[i].noeuds;
! GrNoeud[] ndsEl=new GrNoeud[sNdsEl.length];
! int type;
!
! for (int j=0; j<sNdsEl.length; j++)
! ndsEl[j]=(GrNoeud)s2Gr.get(sNdsEl[j]);
!
! if (sEls[i].type==LTypeElement.L2) type=GrElement.L2;
! else if (sEls[i].type==LTypeElement.L3) type=GrElement.L3;
! else if (sEls[i].type==LTypeElement.T3) type=GrElement.T3;
! else if (sEls[i].type==LTypeElement.T6) type=GrElement.T6;
! else if (sEls[i].type==LTypeElement.Q4) type=GrElement.Q4;
! else if (sEls[i].type==LTypeElement.Q8) type=GrElement.Q8;
! else type=-1;
!
! els[i]=new GrElement(ndsEl,type);
! }
!
! /* for (int i=0; i<sEls.length; i++) {
! GrNoeud[] ndsEl;
! SNoeud[] sNdsEl;
!
! els[i]=FudaaElement.s2Gr(sEls[i]);
! ndsEl =els[i].noeuds;
! sNdsEl=sEls[i].noeuds;
!
! // Remplacement des noeuds créés pour chaque element par ceux de la liste
! for (int j=0; j<sNdsEl.length; j++)
! ndsEl[j]=nds[lSNds.indexOf(sNdsEl[j])];
! } */
!
! return new GrMaillageElement(els,nds);
! }
!
! /**
! * Translation d'une GrMaillageElement vers une SMaillage
! */
! public static SMaillage gr2S(GrMaillageElement _ml) {
! GrNoeud[] nds=_ml.noeuds();
! GrElement[] els=_ml.elements();
! SNoeud[] sNds=new SNoeud[nds.length];
! SElement[] sEls=new SElement[els.length];
! Hashtable gr2S=new Hashtable(sNds.length);
! // List lNds=Arrays.asList(nds);
!
! // Noeuds
! for (int i=0; i<nds.length; i++) {
! sNds[i]=FudaaNoeud.gr2S(nds[i]);
! gr2S.put(nds[i],sNds[i]);
! }
!
! // Elements
! for (int i=0; i<els.length; i++) {
! GrNoeud[] ndsEl=els[i].noeuds;
! SNoeud[] sNdsEl=new SNoeud[ndsEl.length];
! LTypeElement type;
!
! for (int j=0; j<ndsEl.length; j++)
! sNdsEl[j]=(SNoeud)gr2S.get(ndsEl[j]);
!
! if (els[i].type==GrElement.L2) type=LTypeElement.L2;
! else if (els[i].type==GrElement.L3) type=LTypeElement.L3;
! else if (els[i].type==GrElement.T3) type=LTypeElement.T3;
! else if (els[i].type==GrElement.T6) type=LTypeElement.T6;
! else if (els[i].type==GrElement.Q4) type=LTypeElement.Q4;
! else if (els[i].type==GrElement.Q8) type=LTypeElement.Q8;
! else type=null;
!
! sEls[i]=new SElement(sNdsEl,type);
! }
!
! /* for (int i=0; i<els.length; i++) {
! GrNoeud[] ndsEl;
! SNoeud[] sNdsEl;
!
! sEls[i]=FudaaElement.gr2S(els[i]);
! ndsEl =els[i].noeuds;
! sNdsEl =sEls[i].noeuds;
!
! // Remplacement des noeuds créés pour chaque element par ceux de la liste
! for (int j=0; j<ndsEl.length; j++)
! sNdsEl[j]=sNds[lNds.indexOf(ndsEl[j])];
! } */
!
! return new SMaillage(sEls,sNds);
! }
! }
!
--- 1,124 ----
! /*
! * @file FudaaMaillageElement.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.conversion;
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! import java.util.*;
! /**
! * Une classe de translation des SMaillage <=> GrMaillageElement.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaMaillageElement {
! /**
! * Translation d'un SMaillage vers un GrMaillageElement
! */
! public static GrMaillageElement s2Gr(SMaillage _ml) {
! SNoeud[] sNds= _ml.noeuds;
! SElement[] sEls= _ml.elements;
! GrNoeud[] nds= new GrNoeud[sNds.length];
! GrElement[] els= new GrElement[sEls.length];
! Hashtable s2Gr= new Hashtable(sNds.length);
! // List lSNds=Arrays.asList(sNds);
! // Noeuds
! for (int i= 0; i < sNds.length; i++) {
! nds[i]= FudaaNoeud.s2Gr(sNds[i]);
! s2Gr.put(sNds[i], nds[i]);
! }
! // Elements
! for (int i= 0; i < sEls.length; i++) {
! SNoeud[] sNdsEl= sEls[i].noeuds;
! GrNoeud[] ndsEl= new GrNoeud[sNdsEl.length];
! int type;
! for (int j= 0; j < sNdsEl.length; j++)
! ndsEl[j]= (GrNoeud)s2Gr.get(sNdsEl[j]);
! if (sEls[i].type == LTypeElement.L2)
! type= GrElement.L2;
! else if (sEls[i].type == LTypeElement.L3)
! type= GrElement.L3;
! else if (sEls[i].type == LTypeElement.T3)
! type= GrElement.T3;
! else if (sEls[i].type == LTypeElement.T6)
! type= GrElement.T6;
! else if (sEls[i].type == LTypeElement.Q4)
! type= GrElement.Q4;
! else if (sEls[i].type == LTypeElement.Q8)
! type= GrElement.Q8;
! else
! type= -1;
! els[i]= new GrElement(ndsEl, type);
! }
! /* for (int i=0; i<sEls.length; i++) {
! GrNoeud[] ndsEl;
! SNoeud[] sNdsEl;
!
! els[i]=FudaaElement.s2Gr(sEls[i]);
! ndsEl =els[i].noeuds;
! sNdsEl=sEls[i].noeuds;
!
! // Remplacement des noeuds créés pour chaque element par ceux de la liste
! for (int j=0; j<sNdsEl.length; j++)
! ndsEl[j]=nds[lSNds.indexOf(sNdsEl[j])];
! } */
! return new GrMaillageElement(els, nds);
! }
! /**
! * Translation d'une GrMaillageElement vers une SMaillage
! */
! public static SMaillage gr2S(GrMaillageElement _ml) {
! GrNoeud[] nds= _ml.noeuds();
! GrElement[] els= _ml.elements();
! SNoeud[] sNds= new SNoeud[nds.length];
! SElement[] sEls= new SElement[els.length];
! Hashtable gr2S= new Hashtable(sNds.length);
! // List lNds=Arrays.asList(nds);
! // Noeuds
! for (int i= 0; i < nds.length; i++) {
! sNds[i]= FudaaNoeud.gr2S(nds[i]);
! gr2S.put(nds[i], sNds[i]);
! }
! // Elements
! for (int i= 0; i < els.length; i++) {
! GrNoeud[] ndsEl= els[i].noeuds;
! SNoeud[] sNdsEl= new SNoeud[ndsEl.length];
! LTypeElement type;
! for (int j= 0; j < ndsEl.length; j++)
! sNdsEl[j]= (SNoeud)gr2S.get(ndsEl[j]);
! if (els[i].type == GrElement.L2)
! type= LTypeElement.L2;
! else if (els[i].type == GrElement.L3)
! type= LTypeElement.L3;
! else if (els[i].type == GrElement.T3)
! type= LTypeElement.T3;
! else if (els[i].type == GrElement.T6)
! type= LTypeElement.T6;
! else if (els[i].type == GrElement.Q4)
! type= LTypeElement.Q4;
! else if (els[i].type == GrElement.Q8)
! type= LTypeElement.Q8;
! else
! type= null;
! sEls[i]= new SElement(sNdsEl, type);
! }
! /* for (int i=0; i<els.length; i++) {
! GrNoeud[] ndsEl;
! SNoeud[] sNdsEl;
!
! sEls[i]=FudaaElement.gr2S(els[i]);
! ndsEl =els[i].noeuds;
! sNdsEl =sEls[i].noeuds;
!
! // Remplacement des noeuds créés pour chaque element par ceux de la liste
! for (int j=0; j<ndsEl.length; j++)
! sNdsEl[j]=sNds[lNds.indexOf(ndsEl[j])];
! } */
! return new SMaillage(sEls, sNds);
! }
! }
Index: FudaaNoeud.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaNoeud.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaNoeud.java 23 Sep 2003 21:08:04 -0000 1.4
--- FudaaNoeud.java 25 Nov 2003 10:13:33 -0000 1.5
***************
*** 1,37 ****
! /*
! * @file FudaaNoeud.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.conversion;
!
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
!
! /**
! * Une classe de translation des SNoeud <=> GrNoeud.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaNoeud {
!
! /**
! * Translation d'un point SPoint vers GrPoint
! */
! public static GrNoeud s2Gr(SNoeud _n) {
! return new GrNoeud(FudaaPoint.s2Gr(_n.point));
! }
!
! /**
! * Translation d'un point GrPoint vers SPoint
! */
! public static SNoeud gr2S(GrNoeud _n) {
! return new SNoeud(FudaaPoint.gr2S(_n.point));
! }
! }
!
--- 1,31 ----
! /*
! * @file FudaaNoeud.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.conversion;
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! /**
! * Une classe de translation des SNoeud <=> GrNoeud.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaNoeud {
! /**
! * Translation d'un point SPoint vers GrPoint
! */
! public static GrNoeud s2Gr(SNoeud _n) {
! return new GrNoeud(FudaaPoint.s2Gr(_n.point));
! }
! /**
! * Translation d'un point GrPoint vers SPoint
! */
! public static SNoeud gr2S(GrNoeud _n) {
! return new SNoeud(FudaaPoint.gr2S(_n.point));
! }
! }
Index: FudaaPoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaPoint.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaPoint.java 23 Sep 2003 21:08:04 -0000 1.4
--- FudaaPoint.java 25 Nov 2003 10:13:33 -0000 1.5
***************
*** 1,37 ****
! /*
! * @file FudaaPoint.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.conversion;
!
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
!
! /**
! * Une classe de translation des SPoint <=> GrPoint.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaPoint {
!
! /**
! * Translation d'un point SPoint vers GrPoint
! */
! public static GrPoint s2Gr(SPoint _pt) {
! return new GrPoint(_pt.x,_pt.y,_pt.z);
! }
!
! /**
! * Translation d'un point GrPoint vers SPoint
! */
! public static SPoint gr2S(GrPoint _pt) {
! return new SPoint(_pt.x,_pt.y,_pt.z);
! }
! }
!
--- 1,31 ----
! /*
! * @file FudaaPoint.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.conversion;
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! /**
! * Une classe de translation des SPoint <=> GrPoint.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaPoint {
! /**
! * Translation d'un point SPoint vers GrPoint
! */
! public static GrPoint s2Gr(SPoint _pt) {
! return new GrPoint(_pt.x, _pt.y, _pt.z);
! }
! /**
! * Translation d'un point GrPoint vers SPoint
! */
! public static SPoint gr2S(GrPoint _pt) {
! return new SPoint(_pt.x, _pt.y, _pt.z);
! }
! }
Index: FudaaPolyligne.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaPolyligne.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaPolyligne.java 23 Sep 2003 21:08:04 -0000 1.4
--- FudaaPolyligne.java 25 Nov 2003 10:13:33 -0000 1.5
***************
*** 1,49 ****
! /*
! * @file FudaaPolyligne.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.conversion;
!
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
!
! /**
! * Une classe de translation des SPolyligne <=> GrPolyligne.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaPolyligne {
!
! /**
! * Translation d'une SPolyligne vers une GrPolyligne
! */
! public static GrPolyligne s2Gr(SPolyligne _pl) {
! GrPolyligne r=new GrPolyligne();
!
! for (int i=0; i<_pl.points.length; i++)
! r.sommets.ajoute(FudaaPoint.s2Gr(_pl.points[i]));
!
! return r;
! }
!
! /**
! * Translation d'une GrPolyligne vers une SPolyligne
! */
! public static SPolyligne gr2S(GrPolyligne _pl) {
! SPoint[] sPts=new SPoint[_pl.nombre()];
!
! for (int i=0; i<_pl.nombre(); i++) {
! GrPoint pt=_pl.sommets.renvoie(i);
! sPts[i]=new SPoint(pt.x,pt.y,pt.z);
! }
!
! return new SPolyligne(sPts);
! }
! }
!
--- 1,39 ----
! /*
! * @file FudaaPolyligne.java
! * @creation 1999-07-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.conversion;
! import org.fudaa.dodico.corba.geometrie.*;
! import org.fudaa.ebli.geometrie.*;
! /**
! * Une classe de translation des SPolyligne <=> GrPolyligne.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public abstract class FudaaPolyligne {
! /**
! * Translation d'une SPolyligne vers une GrPolyligne
! */
! public static GrPolyligne s2Gr(SPolyligne _pl) {
! GrPolyligne r= new GrPolyligne();
! for (int i= 0; i < _pl.points.length; i++)
! r.sommets.ajoute(FudaaPoint.s2Gr(_pl.points[i]));
! return r;
! }
! /**
! * Translation d'une GrPolyligne vers une SPolyligne
! */
! public static SPolyligne gr2S(GrPolyligne _pl) {
! SPoint[] sPts= new SPoint[_pl.nombre()];
! for (int i= 0; i < _pl.nombre(); i++) {
! GrPoint pt= _pl.sommets.renvoie(i);
! sPts[i]= new SPoint(pt.x, pt.y, pt.z);
! }
! return new SPolyligne(sPts);
! }
! }
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/commun/calcul
Modified Files:
FudaaCalculAction.java FudaaCalculOp.java
FudaaCalculSupportInterface.java
Log Message:
reformat all files
Index: FudaaCalculAction.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul/FudaaCalculAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FudaaCalculAction.java 10 Oct 2003 14:49:07 -0000 1.5
--- FudaaCalculAction.java 25 Nov 2003 10:13:29 -0000 1.6
***************
*** 1 ****
! /*
* @file TrCalculActions.java
* @creation 10 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.commun.calcul;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JPanel;
import com.memoire.bu.BuButton;
import com.memoire.bu.BuButtonLayout;
import com.memoire.bu.BuPanel;
import com.memoire.bu.BuResource;
import org.fudaa.dodico.calcul.CalculLauncher;
import org.fudaa.dodico.calcul.CalculListener;
import org.fudaa.ebli.calque.action.EbliActionInterface;
import org.fudaa.ebli.calque.action.EbliSimpleAction;
import org.fudaa.fudaa.ressource.FudaaResource;
/**
* @author deniger
* @version $Id$
*/
public class FudaaCalculAction implements CalculListener {
EbliSimpleAction actCalcul_;
EbliSimpleAction actStopCalcul_;
FudaaCalculSupportInterface support_;
CalculLauncher calculEnCours_;
/**
*
*/
public FudaaCalculAction(
final FudaaCalculSupportInterface _support,
boolean _stopCalcul) {
support_= _support;
initCalcul();
if (_stopCalcul)
initStopCalcul();
}
private void initCalcul() {
actCalcul_=
new EbliSimpleAction(
FudaaResource.getS("Calculer"),
BuResource.BU.getIcon("calculer"),"COMPUTE") {
public void actionPerformed(ActionEvent _com) {
if (calculEnCours_ != null)
System.out.println(FudaaResource.getS("Calcul en cours"));
calculEnCours_= support_.actionCalcul();
calculEnCours_.addListener(FudaaCalculAction.this);
calculEnCours_.execute();
setEnableStopCalcul(true);
setEnableCalcul(false);
}
};
actCalcul_.putValue(Action.SHORT_DESCRIPTION, FudaaResource.getS("Lancer le calcul"));
actCalcul_.setEnabled(false);
}
public boolean calculIsRunning() {
return (calculEnCours_ == null) || (calculEnCours_.isFinished());
}
private void initStopCalcul() {
actStopCalcul_=
new EbliSimpleAction(
FudaaResource.getS("Arrêter"),
BuResource.BU.getIcon("arreter"),"STOP_COMPUTE") {
public void actionPerformed(ActionEvent _com) {
if (calculIsRunning()) {
calculEnCours_.stop();
}
}
};
actStopCalcul_.setEnabled(false);
}
public void setEnableCalcul(boolean _b) {
if (actCalcul_ != null)
actCalcul_.setEnabled(_b);
}
public void setEnableStopCalcul(boolean _b) {
if (actStopCalcul_ != null)
actStopCalcul_.setEnabled(_b);
}
public EbliActionInterface getCalcul() {
return actCalcul_;
}
public EbliActionInterface getStopCalcul() {
return actStopCalcul_;
}
public boolean isStopCalculVisible() {
return actStopCalcul_ != null;
}
public JPanel createPanel() {
BuPanel p= new BuPanel();
p.setLayout(new BuButtonLayout(5, BuButtonLayout.RIGHT));
if (actCalcul_ != null) {
BuButton bt= new BuButton();
bt.setAction(actCalcul_);
p.add(bt);
}
if (actStopCalcul_ != null) {
BuButton bt= new BuButton();
bt.setAction(actStopCalcul_);
p.add(bt);
}
return p;
}
/**
* @param _source
*/
public void calculFinished(CalculLauncher _source) {
if (_source == calculEnCours_) {
calculEnCours_= null;
setEnableStopCalcul(false);
setEnableCalcul(true);
}
}
}
\ No newline at end of file
--- 1,123 ----
! /*
! * @file TrCalculActions.java
! * @creation 10 juin 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.calcul;
! import java.awt.event.ActionEvent;
! import javax.swing.AbstractAction;
! import javax.swing.Action;
! import javax.swing.JPanel;
! import com.memoire.bu.BuButton;
! import com.memoire.bu.BuButtonLayout;
! import com.memoire.bu.BuPanel;
! import com.memoire.bu.BuResource;
! import org.fudaa.dodico.calcul.CalculLauncher;
! import org.fudaa.dodico.calcul.CalculListener;
! import org.fudaa.ebli.calque.action.EbliActionInterface;
! import org.fudaa.ebli.calque.action.EbliSimpleAction;
! import org.fudaa.fudaa.ressource.FudaaResource;
! /**
! * @author deniger
! * @version $Id$
! */
! public class FudaaCalculAction implements CalculListener {
! EbliSimpleAction actCalcul_;
! EbliSimpleAction actStopCalcul_;
! FudaaCalculSupportInterface support_;
! CalculLauncher calculEnCours_;
! /**
! *
! */
! public FudaaCalculAction(
! final FudaaCalculSupportInterface _support,
! boolean _stopCalcul) {
! support_= _support;
! initCalcul();
! if (_stopCalcul)
! initStopCalcul();
! }
! private void initCalcul() {
! actCalcul_=
! new EbliSimpleAction(
! FudaaResource.getS("Calculer"),
! BuResource.BU.getIcon("calculer"),
! "COMPUTE") {
! public void actionPerformed(ActionEvent _com) {
! if (calculEnCours_ != null)
! System.out.println(FudaaResource.getS("Calcul en cours"));
! calculEnCours_= support_.actionCalcul();
! calculEnCours_.addListener(FudaaCalculAction.this);
! calculEnCours_.execute();
! setEnableStopCalcul(true);
! setEnableCalcul(false);
! }
! };
! actCalcul_.putValue(
! Action.SHORT_DESCRIPTION,
! FudaaResource.getS("Lancer le calcul"));
! actCalcul_.setEnabled(false);
! }
! public boolean calculIsRunning() {
! return (calculEnCours_ == null) || (calculEnCours_.isFinished());
! }
! private void initStopCalcul() {
! actStopCalcul_=
! new EbliSimpleAction(
! FudaaResource.getS("Arrêter"),
! BuResource.BU.getIcon("arreter"),
! "STOP_COMPUTE") {
! public void actionPerformed(ActionEvent _com) {
! if (calculIsRunning()) {
! calculEnCours_.stop();
! }
! }
! };
! actStopCalcul_.setEnabled(false);
! }
! public void setEnableCalcul(boolean _b) {
! if (actCalcul_ != null)
! actCalcul_.setEnabled(_b);
! }
! public void setEnableStopCalcul(boolean _b) {
! if (actStopCalcul_ != null)
! actStopCalcul_.setEnabled(_b);
! }
! public EbliActionInterface getCalcul() {
! return actCalcul_;
! }
! public EbliActionInterface getStopCalcul() {
! return actStopCalcul_;
! }
! public boolean isStopCalculVisible() {
! return actStopCalcul_ != null;
! }
! public JPanel createPanel() {
! BuPanel p= new BuPanel();
! p.setLayout(new BuButtonLayout(5, BuButtonLayout.RIGHT));
! if (actCalcul_ != null) {
! BuButton bt= new BuButton();
! bt.setAction(actCalcul_);
! p.add(bt);
! }
! if (actStopCalcul_ != null) {
! BuButton bt= new BuButton();
! bt.setAction(actStopCalcul_);
! p.add(bt);
! }
! return p;
! }
! /**
! * @param _source
! */
! public void calculFinished(CalculLauncher _source) {
! if (_source == calculEnCours_) {
! calculEnCours_= null;
! setEnableStopCalcul(false);
! setEnableCalcul(true);
! }
! }
! }
Index: FudaaCalculOp.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul/FudaaCalculOp.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaCalculOp.java 10 Oct 2003 14:49:07 -0000 1.4
--- FudaaCalculOp.java 25 Nov 2003 10:13:31 -0000 1.5
***************
*** 1 ****
! /*
* @file TrRefluxCalcul.java
* @creation 13 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.commun.calcul;
import java.io.File;
import java.io.PrintStream;
import javax.swing.event.ChangeEvent;
import com.memoire.bu.BuCommonImplementation;
import com.memoire.bu.BuMainPanel;
import com.memoire.bu.BuProgressBar;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuTask;
import com.memoire.bu.BuTaskOperation;
import org.fudaa.dodico.calcul.CalculExec;
import org.fudaa.dodico.calcul.CalculLauncher;
import org.fudaa.dodico.calcul.CalculLauncherAbstract;
import org.fudaa.dodico.calcul.CalculLauncherExe;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoUI;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.objet.CExecListener;
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.commun.FudaaUI;
import org.fudaa.fudaa.ressource.FudaaResource;
/**
* @author deniger
* @version $Id$
*/
public abstract class FudaaCalculOp
extends CalculLauncherAbstract
implements CExecListener {
FudaaUI impl_;
CalculExec exe_;
boolean isFinished_;
boolean stop_;
Process p_;
public FudaaCalculOp(CalculExec _exe) {
exe_= _exe;
}
protected String getTaskName() {
return FudaaResource.getS("Calcul");
}
public void setImpl(FudaaUI _impl) {
impl_= _impl;
}
public void execute() {
new BuTaskOperation(null, getTaskName()) {
public void act() {
isFinished_= false;
_calcul(impl_.createProgressionInterface(this));
isFinished_= true;
fireFinishedEvent();
}
}
.start();
}
public abstract File proceedParamFile(ProgressionInterface _inter);
protected void setEtat(String _msg, int _p) {
if (impl_ != null) {
impl_.setMainMessage(_msg);
impl_.setMainProgression(_p);
}
}
protected void initEtat() {
setEtat(DodicoLib.EMPTY_STRING, 0);
}
protected void _calcul(ProgressionInterface _progress) {
setEtat(FudaaResource.getS("Enregistrement des paramètres"), 0);
if (stop_) {
initEtat();
return;
}
File f= proceedParamFile(_progress);
setEtat(FudaaResource.getS("Calcul") + "...", 10);
if (stop_) {
initEtat();
return;
}
exe_.setUI(impl_);
exe_.setProgression(_progress);
exe_.launch(f, manageArgs(), this);
setEtat("Fin du calcul", 90);
impl_.message(
FudaaResource.getS("Calcul"),
FudaaResource.getS("Le calcul est terminé"));
initEtat();
isFinished_= true;
}
public String[] manageArgs() {
return args_;
}
/**
*
*/
public void stop() {
stop_= true;
if (p_ != null)
p_.destroy();
}
/**
*
* Methode appeler par CExec afin de stocker le processus avec
* le blocage du thread (p.waitfor()).
* Cela permet de stopper le process si necessaire.
* @param p
*/
public void setProcess(Process p) {
p_= p;
}
/**
* @return
*/
public boolean isFinished() {
return isFinished_;
}
/**
* @param _err
*/
public void setErr(PrintStream _err) {
exe_.setOutError(_err);
}
/**
* @param _std
*/
public void setStd(PrintStream _std) {
exe_.setOutStandard(_std);
}
}
\ No newline at end of file
--- 1,135 ----
! /*
! * @file TrRefluxCalcul.java
! * @creation 13 juin 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.calcul;
! import java.io.File;
! import java.io.PrintStream;
! import javax.swing.event.ChangeEvent;
! import com.memoire.bu.BuCommonImplementation;
! import com.memoire.bu.BuMainPanel;
! import com.memoire.bu.BuProgressBar;
! import com.memoire.bu.BuResource;
! import com.memoire.bu.BuTask;
! import com.memoire.bu.BuTaskOperation;
! import org.fudaa.dodico.calcul.CalculExec;
! import org.fudaa.dodico.calcul.CalculLauncher;
! import org.fudaa.dodico.calcul.CalculLauncherAbstract;
! import org.fudaa.dodico.calcul.CalculLauncherExe;
! import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.commun.DodicoUI;
! import org.fudaa.dodico.commun.ProgressionBuAdapter;
! import org.fudaa.dodico.commun.ProgressionInterface;
! import org.fudaa.dodico.objet.CExecListener;
! import org.fudaa.fudaa.commun.FudaaCommonImplementation;
! import org.fudaa.fudaa.commun.FudaaLib;
! import org.fudaa.fudaa.commun.FudaaUI;
! import org.fudaa.fudaa.ressource.FudaaResource;
! /**
! * @author deniger
! * @version $Id$
! */
! public abstract class FudaaCalculOp
! extends CalculLauncherAbstract
! implements CExecListener {
! FudaaUI impl_;
! CalculExec exe_;
! boolean isFinished_;
! boolean stop_;
! Process p_;
! public FudaaCalculOp(CalculExec _exe) {
! exe_= _exe;
! }
! protected String getTaskName() {
! return FudaaResource.getS("Calcul");
! }
! public void setImpl(FudaaUI _impl) {
! impl_= _impl;
! }
! public void execute() {
! new BuTaskOperation(null, getTaskName()) {
! public void act() {
! isFinished_= false;
! _calcul(impl_.createProgressionInterface(this));
! isFinished_= true;
! fireFinishedEvent();
! }
! }
! .start();
! }
! public abstract File proceedParamFile(ProgressionInterface _inter);
! protected void setEtat(String _msg, int _p) {
! if (impl_ != null) {
! impl_.setMainMessage(_msg);
! impl_.setMainProgression(_p);
! }
! }
! protected void initEtat() {
! setEtat(DodicoLib.EMPTY_STRING, 0);
! }
! protected void _calcul(ProgressionInterface _progress) {
! setEtat(FudaaResource.getS("Enregistrement des paramètres"), 0);
! if (stop_) {
! initEtat();
! return;
! }
! File f= proceedParamFile(_progress);
! setEtat(FudaaResource.getS("Calcul") + "...", 10);
! if (stop_) {
! initEtat();
! return;
! }
! exe_.setUI(impl_);
! exe_.setProgression(_progress);
! exe_.launch(f, manageArgs(), this);
! setEtat("Fin du calcul", 90);
! impl_.message(
! FudaaResource.getS("Calcul"),
! FudaaResource.getS("Le calcul est terminé"));
! initEtat();
! isFinished_= true;
! }
! public String[] manageArgs() {
! return args_;
! }
! /**
! *
! */
! public void stop() {
! stop_= true;
! if (p_ != null)
! p_.destroy();
! }
! /**
! *
! * Methode appeler par CExec afin de stocker le processus avec
! * le blocage du thread (p.waitfor()).
! * Cela permet de stopper le process si necessaire.
! * @param p
! */
! public void setProcess(Process p) {
! p_= p;
! }
! /**
! * @return
! */
! public boolean isFinished() {
! return isFinished_;
! }
! /**
! * @param _err
! */
! public void setErr(PrintStream _err) {
! exe_.setOutError(_err);
! }
! /**
! * @param _std
! */
! public void setStd(PrintStream _std) {
! exe_.setOutStandard(_std);
! }
! }
Index: FudaaCalculSupportInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/calcul/FudaaCalculSupportInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FudaaCalculSupportInterface.java 23 Sep 2003 21:08:04 -0000 1.2
--- FudaaCalculSupportInterface.java 25 Nov 2003 10:13:32 -0000 1.3
***************
*** 1,21 ****
! /*
! * @file TrCalculSupportInterface.java
! * @creation 10 juin 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.calcul;
!
! import org.fudaa.dodico.calcul.CalculLauncher;
!
!
! /**
! * @author deniger
! * @version $Id$
! */
! public interface FudaaCalculSupportInterface
! {
! public CalculLauncher actionCalcul();
! }
--- 1,17 ----
! /*
! * @file TrCalculSupportInterface.java
! * @creation 10 juin 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.calcul;
! import org.fudaa.dodico.calcul.CalculLauncher;
! /**
! * @author deniger
! * @version $Id$
! */
! public interface FudaaCalculSupportInterface {
! public CalculLauncher actionCalcul();
! }
|
|
From: <de...@us...> - 2003-11-25 12:40:32
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/mathematiques
In directory sc8-pr-cvs1:/tmp/cvs-serv1137/mathematiques
Modified Files:
Fonctions.java Matrice.java MatriceHermite.java
Log Message:
reformat files
Index: Fonctions.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/mathematiques/Fonctions.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Fonctions.java 23 Sep 2003 20:42:20 -0000 1.3
--- Fonctions.java 25 Nov 2003 10:06:44 -0000 1.4
***************
*** 1,30 ****
! /*
! * @file Fonctions.java
! * @creation 1998-03-25
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.ebli.mathematiques;
!
! /**
! * Fonctions
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! * @see Math
! */
! public class Fonctions
! {
! public static double sqr(double d)
! {
! return d*d;
! }
!
! public static double sign(double d)
! {
! return d<0. ? -1. : d>0. ? 1. : 0.;
! }
! }
--- 1,24 ----
! /*
! * @file Fonctions.java
! * @creation 1998-03-25
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.ebli.mathematiques;
! /**
! * Fonctions
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! * @see Math
! */
! public class Fonctions {
! public static double sqr(double d) {
! return d * d;
! }
! public static double sign(double d) {
! return d < 0. ? -1. : d > 0. ? 1. : 0.;
! }
! }
Index: Matrice.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/mathematiques/Matrice.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Matrice.java 23 Sep 2003 20:42:20 -0000 1.3
--- Matrice.java 25 Nov 2003 10:06:44 -0000 1.4
***************
*** 1,309 ****
! /*
! * @file Matrice.java
! * @creation 1998-03-25
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.ebli.mathematiques;
!
! import java.io.*;
! import org.fudaa.ebli.commun.*;
!
! /**
! * Une matrice
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class Matrice
! {
! private double a[][];
!
! public Matrice()
! {
! }
!
! public Matrice(int ni, int nj)
! {
! a=new double[ni][nj];
! }
!
! public int ni()
! {
! return a.length;
! }
!
! public int nj()
! {
! return a[0].length;
! }
!
! /*
! public Object clone()
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j];
!
! return r;
! }
! */
!
! public double a(int i, int j)
! {
! return a[i][j];
! }
!
! public void a(int i, int j, double ia)
! {
! a[i][j]=ia;
! }
!
! public Matrice colonne(int c)
! {
! int nj=nj();
! Matrice r=new Matrice(1,nj);
!
! for(int j=0;j<nj;j++)
! r.a[0][j]=a[c][j];
!
! return r;
! }
!
! public Matrice ligne(int c)
! {
! int ni=ni();
! Matrice r=new Matrice(ni,1);
!
! for(int i=0;i<ni;i++)
! r.a[i][0]=a[i][c];
!
! return r;
! }
!
! public String toString()
! {
! int ni=ni();
! int nj=nj();
! return "Matrice("+ni+","+nj+")";
! }
!
! public String texte()
! {
! int ni=ni();
! int nj=nj();
! String r="";
!
! for(int i=0;i<ni;i++)
! {
! for(int j=0;j<nj;j++)
! {
! String s=" "+a[i][j];
! r+=s.substring(s.length()-17,s.length());
! if(j>=4) { j=nj; r+=" ..."; }
! }
! r+="\n";
! if(i>=4) r+="...\n";
! }
!
! return r;
! }
!
! public Matrice transposee()
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(nj,ni);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[j][i]=a[i][j];
!
! return r;
! }
!
! public Matrice extraction(int i1, int j1, int i2, int j2)
! {
! Matrice r=new Matrice(i2-i1+1,j2-j1+1);
!
! for(int i=i1;i<=i2;i++)
! for(int j=j1;j<=j2;j++)
! r.a[i-i1][j-j1]=a[i][j];
!
! return r;
! }
!
! public Matrice remplacement(Matrice m, int i0, int j0)
! {
! int ni=m.ni();
! int nj=m.nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j];
!
! for(int i=i0;i<i0+ni;i++)
! for(int j=j0;j<j0+nj;j++)
! r.a[i][j]=m.a[i][j];
!
! return r;
! }
!
! public Matrice ajoutColonnes(Matrice m)
! {
! int ni=ni()+m.ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=(i<a.length ? a[i][j] : m.a[i-a.length][j]);
!
! return r;
! }
!
! public Matrice ajoutLignes(Matrice m)
! {
! int ni=ni();
! int nj=nj()+m.nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=(j<nj() ? a[i][j] : m.a[i][j-nj()]);
!
! return r;
! }
!
! public Matrice addition(Matrice m)
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j]+m.a[i][j];
!
! return r;
! }
!
! public Matrice soustraction(Matrice m)
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j]-m.a[i][j];
!
! return r;
! }
!
! public Matrice multiplication(double d)
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j]*d;
!
! return r;
! }
!
! public Matrice multiplication(Matrice m)
! {
! int ni=ni();
! int nj=m.nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! for(int k=0;k<nj();k++)
! r.a[i][j]+=a[i][k]*m.a[k][j];
!
! return r;
! }
!
! public Matrice division(double d)
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j]/d;
!
! return r;
! }
!
! double norme()
! {
! Matrice m=multiplication(this.transposee());
! int ni=m.ni();
! int nj=m.nj();
! double r=0.;
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r+=m.a[i][j];
!
! return r;
! }
!
! public Matrice constante(double d)
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=d;
!
! return r;
! }
!
! public Matrice nulle()
! {
! return constante(0.);
! }
!
! public Matrice identite()
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=(i==j ? 1. : 0.);
!
! return r;
! }
!
! public Matrice triangulaire()
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=(i<=j ? 1. : 0.);
!
! return r;
! }
! }
--- 1,220 ----
! /*
! * @file Matrice.java
! * @creation 1998-03-25
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.ebli.mathematiques;
! import java.io.*;
! import org.fudaa.ebli.commun.*;
! /**
! * Une matrice
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class Matrice {
! private double a[][];
! public Matrice() {}
! public Matrice(int ni, int nj) {
! a= new double[ni][nj];
! }
! public int ni() {
! return a.length;
! }
! public int nj() {
! return a[0].length;
! }
! /*
! public Object clone()
! {
! int ni=ni();
! int nj=nj();
! Matrice r=new Matrice(ni,nj);
!
! for(int i=0;i<ni;i++)
! for(int j=0;j<nj;j++)
! r.a[i][j]=a[i][j];
!
! return r;
! }
! */
! public double a(int i, int j) {
! return a[i][j];
! }
! public void a(int i, int j, double ia) {
! a[i][j]= ia;
! }
! public Matrice colonne(int c) {
! int nj= nj();
! Matrice r= new Matrice(1, nj);
! for (int j= 0; j < nj; j++)
! r.a[0][j]= a[c][j];
! return r;
! }
! public Matrice ligne(int c) {
! int ni= ni();
! Matrice r= new Matrice(ni, 1);
! for (int i= 0; i < ni; i++)
! r.a[i][0]= a[i][c];
! return r;
! }
! public String toString() {
! int ni= ni();
! int nj= nj();
! return "Matrice(" + ni + "," + nj + ")";
! }
! public String texte() {
! int ni= ni();
! int nj= nj();
! String r= "";
! for (int i= 0; i < ni; i++) {
! for (int j= 0; j < nj; j++) {
! String s= " " + a[i][j];
! r += s.substring(s.length() - 17, s.length());
! if (j >= 4) {
! j= nj;
! r += " ...";
! }
! }
! r += "\n";
! if (i >= 4)
! r += "...\n";
! }
! return r;
! }
! public Matrice transposee() {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(nj, ni);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[j][i]= a[i][j];
! return r;
! }
! public Matrice extraction(int i1, int j1, int i2, int j2) {
! Matrice r= new Matrice(i2 - i1 + 1, j2 - j1 + 1);
! for (int i= i1; i <= i2; i++)
! for (int j= j1; j <= j2; j++)
! r.a[i - i1][j - j1]= a[i][j];
! return r;
! }
! public Matrice remplacement(Matrice m, int i0, int j0) {
! int ni= m.ni();
! int nj= m.nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= a[i][j];
! for (int i= i0; i < i0 + ni; i++)
! for (int j= j0; j < j0 + nj; j++)
! r.a[i][j]= m.a[i][j];
! return r;
! }
! public Matrice ajoutColonnes(Matrice m) {
! int ni= ni() + m.ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= (i < a.length ? a[i][j] : m.a[i - a.length][j]);
! return r;
! }
! public Matrice ajoutLignes(Matrice m) {
! int ni= ni();
! int nj= nj() + m.nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= (j < nj() ? a[i][j] : m.a[i][j - nj()]);
! return r;
! }
! public Matrice addition(Matrice m) {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= a[i][j] + m.a[i][j];
! return r;
! }
! public Matrice soustraction(Matrice m) {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= a[i][j] - m.a[i][j];
! return r;
! }
! public Matrice multiplication(double d) {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= a[i][j] * d;
! return r;
! }
! public Matrice multiplication(Matrice m) {
! int ni= ni();
! int nj= m.nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! for (int k= 0; k < nj(); k++)
! r.a[i][j] += a[i][k] * m.a[k][j];
! return r;
! }
! public Matrice division(double d) {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= a[i][j] / d;
! return r;
! }
! double norme() {
! Matrice m= multiplication(this.transposee());
! int ni= m.ni();
! int nj= m.nj();
! double r= 0.;
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r += m.a[i][j];
! return r;
! }
! public Matrice constante(double d) {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= d;
! return r;
! }
! public Matrice nulle() {
! return constante(0.);
! }
! public Matrice identite() {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= (i == j ? 1. : 0.);
! return r;
! }
! public Matrice triangulaire() {
! int ni= ni();
! int nj= nj();
! Matrice r= new Matrice(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! r.a[i][j]= (i <= j ? 1. : 0.);
! return r;
! }
! }
Index: MatriceHermite.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/mathematiques/MatriceHermite.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MatriceHermite.java 23 Sep 2003 20:42:20 -0000 1.3
--- MatriceHermite.java 25 Nov 2003 10:06:44 -0000 1.4
***************
*** 1,92 ****
! /*
! * @file MatriceHermite.java
! * @creation 1999-02-15
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.ebli.mathematiques;
!
! import java.awt.*;
! import java.awt.geom.Point2D;
!
! /**
! * Mini class matrice pour l'interpolation de Hermite.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Axel von Arnim
! */
! public class MatriceHermite
! {
! public final static MatriceHermite HERMITE=new MatriceHermite( new double[][] {
! { 2,-2, 1, 1 },
! {-3, 3,-2,-1 },
! { 0, 0, 1, 0 },
! { 1, 0, 0, 0 } } );
!
! private double a[][];
!
! public MatriceHermite(int ni, int nj)
! {
! a=new double[ni][nj];
! }
!
! public MatriceHermite(double[][] _a)
! {
! a=_a;
! }
!
! public double a(int i, int j)
! {
! return a[i][j];
! }
!
! public void a(int i, int j, double ia)
! {
! a[i][j]=ia;
! }
!
! public MatriceHermite multiplication(MatriceHermite m)
! {
! int ni=a.length;
! int nj=m.a[0].length;
! MatriceHermite r=new MatriceHermite(ni,nj);
!
! for(int i=0; i<ni; i++)
! for(int j=0; j<nj; j++)
! for(int k=0; k<a[0].length; k++)
! r.a[i][j]+=a[i][k]*m.a[k][j];
! return r;
! }
! /**
! * Interpolation de Hermite.
! */
! public static Point hermite(double t, int x1, int y1, int x2, int y2, int vx1, int vy1, int vx2, int vy2)
! {
! MatriceHermite H=MatriceHermite.HERMITE;
! MatriceHermite T=new MatriceHermite(new double[][] { { t*t*t, t*t, t, 1 } } );
! MatriceHermite X=new MatriceHermite(new double[][] {
! { x1, y1, 0, 1 },
! { x2, y2, 0, 1 },
! { vx1, vy1, 0, 0 },
! { vx2, vy2, 0, 0 } } );
! MatriceHermite Q=T.multiplication(H).multiplication(X);
! return new Point((int)Q.a(0, 0), (int)Q.a(0, 1));
! }
!
! public static Point2D.Double hermite(double t, double x1, double y1, double x2, double y2, double vx1, double vy1, double vx2, double vy2)
! {
! MatriceHermite H=MatriceHermite.HERMITE;
! MatriceHermite T=new MatriceHermite(new double[][] { { t*t*t, t*t, t, 1d } } );
! MatriceHermite X=new MatriceHermite(new double[][] {
! { x1, y1, 0d, 1d },
! { x2, y2, 0d, 1d },
! { vx1, vy1, 0d, 0d },
! { vx2, vy2, 0d, 0d } } );
! MatriceHermite Q=T.multiplication(H).multiplication(X);
! return new Point2D.Double(Q.a(0, 0), Q.a(0, 1));
! }
!
! }
--- 1,95 ----
! /*
! * @file MatriceHermite.java
! * @creation 1999-02-15
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.ebli.mathematiques;
! import java.awt.*;
! import java.awt.geom.Point2D;
! /**
! * Mini class matrice pour l'interpolation de Hermite.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Axel von Arnim
! */
! public class MatriceHermite {
! public final static MatriceHermite HERMITE=
! new MatriceHermite(new double[][] { { 2, -2, 1, 1 }, {
! -3, 3, -2, -1 }, {
! 0, 0, 1, 0 }, {
! 1, 0, 0, 0 }
! });
! private double a[][];
! public MatriceHermite(int ni, int nj) {
! a= new double[ni][nj];
! }
! public MatriceHermite(double[][] _a) {
! a= _a;
! }
! public double a(int i, int j) {
! return a[i][j];
! }
! public void a(int i, int j, double ia) {
! a[i][j]= ia;
! }
! public MatriceHermite multiplication(MatriceHermite m) {
! int ni= a.length;
! int nj= m.a[0].length;
! MatriceHermite r= new MatriceHermite(ni, nj);
! for (int i= 0; i < ni; i++)
! for (int j= 0; j < nj; j++)
! for (int k= 0; k < a[0].length; k++)
! r.a[i][j] += a[i][k] * m.a[k][j];
! return r;
! }
! /**
! * Interpolation de Hermite.
! */
! public static Point hermite(
! double t,
! int x1,
! int y1,
! int x2,
! int y2,
! int vx1,
! int vy1,
! int vx2,
! int vy2) {
! MatriceHermite H= MatriceHermite.HERMITE;
! MatriceHermite T=
! new MatriceHermite(new double[][] { { t * t * t, t * t, t, 1 }
! });
! MatriceHermite X= new MatriceHermite(new double[][] { { x1, y1, 0, 1 }, {
! x2, y2, 0, 1 }, {
! vx1, vy1, 0, 0 }, {
! vx2, vy2, 0, 0 }
! });
! MatriceHermite Q= T.multiplication(H).multiplication(X);
! return new Point((int)Q.a(0, 0), (int)Q.a(0, 1));
! }
! public static Point2D.Double hermite(
! double t,
! double x1,
! double y1,
! double x2,
! double y2,
! double vx1,
! double vy1,
! double vx2,
! double vy2) {
! MatriceHermite H= MatriceHermite.HERMITE;
! MatriceHermite T=
! new MatriceHermite(new double[][] { { t * t * t, t * t, t, 1d }
! });
! MatriceHermite X= new MatriceHermite(new double[][] { { x1, y1, 0d, 1d }, {
! x2, y2, 0d, 1d }, {
! vx1, vy1, 0d, 0d }, {
! vx2, vy2, 0d, 0d }
! });
! MatriceHermite Q= T.multiplication(H).multiplication(X);
! return new Point2D.Double(Q.a(0, 0), Q.a(0, 1));
! }
! }
|
|
From: <de...@us...> - 2003-11-25 12:40:28
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/association
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/association
Modified Files:
DTableHachage.java
Log Message:
reformat all files
Index: DTableHachage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/association/DTableHachage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DTableHachage.java 22 Sep 2003 20:46:17 -0000 1.4
--- DTableHachage.java 25 Nov 2003 10:11:24 -0000 1.5
***************
*** 1,267 ****
! /*
! * @file DTableHachage.java
! * @creation 1998-04-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.association;
!
! import org.fudaa.dodico.corba.association.ITableHachageOperations;
! import org.fudaa.dodico.corba.objet.IObjetHelper;
! import org.fudaa.dodico.corba.objet.IObjet;
!
! import org.fudaa.dodico.objet.DObjet;
!
! import java.util.Hashtable;
! import java.util.Enumeration;
!
! /**
! * Une classe implementant une table de hachage similaire a
! * <code>java.util.Hashtable</code>.
! * Les operations sont en fait deleguees a un attirbut protege de type
! * <code>java.util.Hashtable</code>.
! *
! * @version $Id$
! * @author Guillaume Desnoix
! */
! public class DTableHachage
! extends DObjet implements ITableHachageOperations
! {
!
! /**
! * La table de hachage utilisee.
! * @see java.util.Hashtable
! */
! protected Hashtable v_;
!
!
! /**
! * Initialise la table de hachage interne.
! */
! public DTableHachage()
! {
! super();
! v_ = new Hashtable();
! }
!
!
! /**
! * Transforme l'objet delegue corba en un objet java.
! *
! * @return Clone de la hashtable utilisee en interne.
! */
! public Hashtable toHashtable()
! {
! return (Hashtable)(v_.clone());
! }
!
!
! /**
! * Renvoie un chaine descriptive de l'objet.
! *
! * @return "DTableHachage(" + v_.size() + " elements)"
! */
! public String toString()
! {
! return "DTableHachage(" + v_.size() + " elements)";
! }
!
!
! /*
! * JDK120:
! * public void ajoute(IObjet _o) { v_.add(_o); }
! * public void vide() { v_.clear(); }
! * public boolean contient(IObjet _o) { return v_.contains(_o); }
! * public boolean estVide() { return v_.isEmpty(); }
! * public void enleve(IObjet _o) { v_.remove(_o); }
! * public int taille() { return v_.size(); }
! * public IObjet element(int _i) { return (IObjet)v_.get(_i); }
! * public void remplace(int _i, IObjet _o) { v_.set(_i,_o); }
! */
!
! /**
! * Vide la table.
! */
! public void vide()
! {
! v_.clear();
! }
!
!
! /**
! * Teste la presence du IObjet <code>_o</code>.
! *
! * @param _o objet teste
! * @return true si l'objet est stocke dans la table.
! */
! public boolean contient(IObjet _o)
! {
! return v_.contains(_o);
! }
!
!
! /**
! * Renvoie l'IObjet dont la cle correspond a <code>_key</code>.
! *
! * @param _key la cle demandee.
! * @return la valeur correspondante a la cle <code>_key</code>.
! */
! public IObjet valeur(IObjet _key)
! {
! return IObjetHelper.narrow((org.omg.CORBA.Object)v_.get(_key));
! }
!
!
! /**
! * Teste si la table est vide ou non.
! *
! * @return <code>true</code> si la table est vide.
! */
! public boolean estVide()
! {
! return v_.isEmpty();
! }
!
!
! /**
! * Enleve de la table l'Iobjet <code>_c</code>
! *
! * @param _c l'Iobjet a enlever
! */
! public void enleve(IObjet _c)
! {
! v_.remove(_c);
! }
!
!
! /**
! * Renvoie la taille da la table.
! *
! * @return nombre d'elements stockes dans la table.
! */
! public int taille()
! {
! return v_.size();
! }
!
!
! /**
! * Affecte la valeur <code>_val</code> pour la cle <code>_key</code>.
! *
! * @param _key la cle concernee.
! * @param _val la nouvelle valeur pour la cle <code>_key</code>.
! */
! public void place(IObjet _key, IObjet _val)
! {
! v_.put(_key, _val);
! }
!
!
! /**
! * Les valeurs de la table de hachage (les objets obtenus par la methode
! * <code>elements()</code> de <code>java.util.Hashtable</code>).
! *
! * @return Toutes les valeurs (elements) sotckées dans la table.
! */
! public IObjet[] valeurs()
! {
! // JDK120: return (IObjet[])(v.toArray());
!
! int i;
! Enumeration e;
!
! Object[] o = new Object[v_.size()];
!
! for(i = 0, e = v_.elements(); e.hasMoreElements(); i++)
! {
! o[i] = e.nextElement();
! }
!
! IObjet[] r = new IObjet[o.length];
! for(i = 0; i < o.length; i++)
! {
! r[i] = (IObjet)o[i];
! }
! return r;
! }
!
!
! /**
! * Renvoie les clefs de la table de hachage sous forme d'un tableau d'IObjets.
! *
! * @return java.util.Hashtable.keys()
! */
! public IObjet[] clefs()
! {
! int i;
! Enumeration e;
!
! Object[] o = new Object[v_.size()];
!
! for(i = 0, e = v_.keys(); e.hasMoreElements(); i++)
! {
! o[i] = e.nextElement();
! }
!
! IObjet[] r = new IObjet[o.length];
! for(i = 0; i < o.length; i++)
! {
! r[i] = (IObjet)o[i];
! }
! return r;
! }
!
!
! /**
! * Renvoie toutes les donnees de la table dans un tableau de IObjet dont
! chaque ligne est composee de la facon suivante:
! * <br>colonne 0: la cle
! * <br>colonne 1: la valeur correspondante.
! *
! * @return tableau contenant les cles et les valeurs coorespondantes de la
! * Hashtable.
! */
! public IObjet[][] paires()
! {
! int i;
! Enumeration e;
!
! Object[][] o = new Object[v_.size()][2];
!
! for(i = 0, e = v_.keys(); e.hasMoreElements(); i++)
! {
! o[i][0] = e.nextElement();
! o[i][1] = v_.get(o[i][0]);
! }
!
! IObjet[][] r = new IObjet[o.length][2];
! for(i = 0; i < o.length; i++)
! {
! r[i][0] = IObjetHelper.narrow((org.omg.CORBA.Object)o[i][0]);
! r[i][1] = IObjetHelper.narrow((org.omg.CORBA.Object)o[i][1]);
! }
! return r;
! }
!
!
! /**
! * Vide la table et affecte chaque ligne de <code>_p</code> dans la table en
! * prenant la premiere colonne comme cle et la deuxieme comme valeur
! * associee.
! *
! * @param _p les nouvelles cles et valeurs a affecter a la table.
! */
! public void paires(IObjet[][] _p)
! {
! vide();
! for(int i = 0; i < _p.length; i++)
! {
! place(_p[i][0], _p[i][1]);
! }
! }
! }
!
!
--- 1,197 ----
! /*
! * @file DTableHachage.java
! * @creation 1998-04-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.association;
! import org.fudaa.dodico.corba.association.ITableHachageOperations;
! import org.fudaa.dodico.corba.objet.IObjetHelper;
! import org.fudaa.dodico.corba.objet.IObjet;
! import org.fudaa.dodico.objet.DObjet;
! import java.util.Hashtable;
! import java.util.Enumeration;
! /**
! * Une classe implementant une table de hachage similaire a
! * <code>java.util.Hashtable</code>.
! * Les operations sont en fait deleguees a un attirbut protege de type
! * <code>java.util.Hashtable</code>.
! *
! * @version $Id$
! * @author Guillaume Desnoix
! */
! public class DTableHachage extends DObjet implements ITableHachageOperations {
! /**
! * La table de hachage utilisee.
! * @see java.util.Hashtable
! */
! protected Hashtable v_;
! /**
! * Initialise la table de hachage interne.
! */
! public DTableHachage() {
! super();
! v_= new Hashtable();
! }
! /**
! * Transforme l'objet delegue corba en un objet java.
! *
! * @return Clone de la hashtable utilisee en interne.
! */
! public Hashtable toHashtable() {
! return (Hashtable) (v_.clone());
! }
! /**
! * Renvoie un chaine descriptive de l'objet.
! *
! * @return "DTableHachage(" + v_.size() + " elements)"
! */
! public String toString() {
! return "DTableHachage(" + v_.size() + " elements)";
! }
! /*
! * JDK120:
! * public void ajoute(IObjet _o) { v_.add(_o); }
! * public void vide() { v_.clear(); }
! * public boolean contient(IObjet _o) { return v_.contains(_o); }
! * public boolean estVide() { return v_.isEmpty(); }
! * public void enleve(IObjet _o) { v_.remove(_o); }
! * public int taille() { return v_.size(); }
! * public IObjet element(int _i) { return (IObjet)v_.get(_i); }
! * public void remplace(int _i, IObjet _o) { v_.set(_i,_o); }
! */
! /**
! * Vide la table.
! */
! public void vide() {
! v_.clear();
! }
! /**
! * Teste la presence du IObjet <code>_o</code>.
! *
! * @param _o objet teste
! * @return true si l'objet est stocke dans la table.
! */
! public boolean contient(IObjet _o) {
! return v_.contains(_o);
! }
! /**
! * Renvoie l'IObjet dont la cle correspond a <code>_key</code>.
! *
! * @param _key la cle demandee.
! * @return la valeur correspondante a la cle <code>_key</code>.
! */
! public IObjet valeur(IObjet _key) {
! return IObjetHelper.narrow((org.omg.CORBA.Object)v_.get(_key));
! }
! /**
! * Teste si la table est vide ou non.
! *
! * @return <code>true</code> si la table est vide.
! */
! public boolean estVide() {
! return v_.isEmpty();
! }
! /**
! * Enleve de la table l'Iobjet <code>_c</code>
! *
! * @param _c l'Iobjet a enlever
! */
! public void enleve(IObjet _c) {
! v_.remove(_c);
! }
! /**
! * Renvoie la taille da la table.
! *
! * @return nombre d'elements stockes dans la table.
! */
! public int taille() {
! return v_.size();
! }
! /**
! * Affecte la valeur <code>_val</code> pour la cle <code>_key</code>.
! *
! * @param _key la cle concernee.
! * @param _val la nouvelle valeur pour la cle <code>_key</code>.
! */
! public void place(IObjet _key, IObjet _val) {
! v_.put(_key, _val);
! }
! /**
! * Les valeurs de la table de hachage (les objets obtenus par la methode
! * <code>elements()</code> de <code>java.util.Hashtable</code>).
! *
! * @return Toutes les valeurs (elements) sotckées dans la table.
! */
! public IObjet[] valeurs() {
! // JDK120: return (IObjet[])(v.toArray());
! int i;
! Enumeration e;
! Object[] o= new Object[v_.size()];
! for (i= 0, e= v_.elements(); e.hasMoreElements(); i++) {
! o[i]= e.nextElement();
! }
! IObjet[] r= new IObjet[o.length];
! for (i= 0; i < o.length; i++) {
! r[i]= (IObjet)o[i];
! }
! return r;
! }
! /**
! * Renvoie les clefs de la table de hachage sous forme d'un tableau d'IObjets.
! *
! * @return java.util.Hashtable.keys()
! */
! public IObjet[] clefs() {
! int i;
! Enumeration e;
! Object[] o= new Object[v_.size()];
! for (i= 0, e= v_.keys(); e.hasMoreElements(); i++) {
! o[i]= e.nextElement();
! }
! IObjet[] r= new IObjet[o.length];
! for (i= 0; i < o.length; i++) {
! r[i]= (IObjet)o[i];
! }
! return r;
! }
! /**
! * Renvoie toutes les donnees de la table dans un tableau de IObjet dont
! chaque ligne est composee de la facon suivante:
! * <br>colonne 0: la cle
! * <br>colonne 1: la valeur correspondante.
! *
! * @return tableau contenant les cles et les valeurs coorespondantes de la
! * Hashtable.
! */
! public IObjet[][] paires() {
! int i;
! Enumeration e;
! Object[][] o= new Object[v_.size()][2];
! for (i= 0, e= v_.keys(); e.hasMoreElements(); i++) {
! o[i][0]= e.nextElement();
! o[i][1]= v_.get(o[i][0]);
! }
! IObjet[][] r= new IObjet[o.length][2];
! for (i= 0; i < o.length; i++) {
! r[i][0]= IObjetHelper.narrow((org.omg.CORBA.Object)o[i][0]);
! r[i][1]= IObjetHelper.narrow((org.omg.CORBA.Object)o[i][1]);
! }
! return r;
! }
! /**
! * Vide la table et affecte chaque ligne de <code>_p</code> dans la table en
! * prenant la premiere colonne comme cle et la deuxieme comme valeur
! * associee.
! *
! * @param _p les nouvelles cles et valeurs a affecter a la table.
! */
! public void paires(IObjet[][] _p) {
! vide();
! for (int i= 0; i < _p.length; i++) {
! place(_p[i][0], _p[i][1]);
! }
! }
! }
|
|
From: <de...@us...> - 2003-11-25 12:02:10
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/controle/border In directory sc8-pr-cvs1:/tmp/cvs-serv1137/controle/border Modified Files: LineChoiceBorder.java Log Message: reformat files Index: LineChoiceBorder.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/controle/border/LineChoiceBorder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LineChoiceBorder.java 23 Sep 2003 20:51:16 -0000 1.3 --- LineChoiceBorder.java 25 Nov 2003 10:06:40 -0000 1.4 *************** *** 1,63 **** ! /* ! * @file LineChoiceBorder.java ! * @creation 2000-11-28 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! ! package org.fudaa.ebli.controle.border; ! ! import java.awt.*; ! import java.io.*; ! import javax.swing.*; ! import javax.swing.border.*; ! import com.memoire.bu.*; ! ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class LineChoiceBorder extends AbstractBorder ! { ! private boolean high_, bottom_, right_, left_, middleVert_, middleHor_; ! ! public LineChoiceBorder(boolean _high, boolean _bottom, boolean _right, ! boolean _left, boolean _middleVert, boolean _middleHor) ! { ! high_ =_high; ! bottom_=_bottom; ! right_ =_right; ! left_=_left; ! middleVert_ =_middleVert; ! middleHor_=_middleHor; ! } ! ! public void paintBorder(Component _c, Graphics _g, ! int _x, int _y, int _w, int _h) ! { ! Color old=_g.getColor(); ! _g.translate(_x,_y); ! _g.setColor(_c.getForeground()); ! if (high_) _g.drawLine(0,0,_w,0); ! if (bottom_) _g.drawLine(0,_h,_w,_h); ! if (right_) _g.drawLine(_w-1,0,_w,_h); ! if (left_) _g.drawLine(0,0,0,_h); ! if (middleVert_) _g.drawLine(_w/2,0,_w/2,_h); ! if (middleHor_) _g.drawLine(0,_h/2,_w,_h/2); ! ! // _g.draw3DRect(0,0,_w-1,_h-1,true); ! ! _g.translate(-_x,-_y); ! _g.setColor(old); ! } ! ! public Insets getBorderInsets(Component _c) ! { ! return new Insets(3,3,3,3); ! } ! ! public boolean isBorderOpaque() { return true; } ! } ! --- 1,67 ---- ! /* ! * @file LineChoiceBorder.java ! * @creation 2000-11-28 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.ebli.controle.border; ! import java.awt.*; ! import java.io.*; ! import javax.swing.*; ! import javax.swing.border.*; ! import com.memoire.bu.*; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class LineChoiceBorder extends AbstractBorder { ! private boolean high_, bottom_, right_, left_, middleVert_, middleHor_; ! public LineChoiceBorder( ! boolean _high, ! boolean _bottom, ! boolean _right, ! boolean _left, ! boolean _middleVert, ! boolean _middleHor) { ! high_= _high; ! bottom_= _bottom; ! right_= _right; ! left_= _left; ! middleVert_= _middleVert; ! middleHor_= _middleHor; ! } ! public void paintBorder( ! Component _c, ! Graphics _g, ! int _x, ! int _y, ! int _w, ! int _h) { ! Color old= _g.getColor(); ! _g.translate(_x, _y); ! _g.setColor(_c.getForeground()); ! if (high_) ! _g.drawLine(0, 0, _w, 0); ! if (bottom_) ! _g.drawLine(0, _h, _w, _h); ! if (right_) ! _g.drawLine(_w - 1, 0, _w, _h); ! if (left_) ! _g.drawLine(0, 0, 0, _h); ! if (middleVert_) ! _g.drawLine(_w / 2, 0, _w / 2, _h); ! if (middleHor_) ! _g.drawLine(0, _h / 2, _w, _h / 2); ! // _g.draw3DRect(0,0,_w-1,_h-1,true); ! _g.translate(-_x, -_y); ! _g.setColor(old); ! } ! public Insets getBorderInsets(Component _c) { ! return new Insets(3, 3, 3, 3); ! } ! public boolean isBorderOpaque() { ! return true; ! } ! } |
|
From: <de...@us...> - 2003-11-25 12:01:59
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/d1d2
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/d1d2
Modified Files:
LidoReflux.java Profil1D2D.java
Log Message:
reformat all files
Index: LidoReflux.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/d1d2/LidoReflux.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** LidoReflux.java 23 Sep 2003 21:11:40 -0000 1.3
--- LidoReflux.java 25 Nov 2003 10:13:37 -0000 1.4
***************
*** 1,243 ****
! /*
! * @file LidoReflux.java
! * @creation 2000-02-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.d1d2;
!
! import org.fudaa.dodico.corba.reflux.*;
! import org.fudaa.dodico.corba.lido.*;
! import org.fudaa.dodico.reflux.*;
! import org.fudaa.dodico.lido.*;
! import org.fudaa.dodico.objet.*;
!
! import com.memoire.bu.*;
! import org.fudaa.fudaa.commun.*;
! import com.diaam.lgpl.ts.*;
! import org.fudaa.fudaa.lido.*;
! import org.fudaa.fudaa.reflux.*;
! import org.fudaa.fudaa.reflux.calcul.PRCalculReflux2d;
! import org.fudaa.fudaa.reflux.calcul.PRCalculReflux3d;
! import javax.swing.JFrame;
!
! /**
! * Point d'entrée de l'application LidoReflux
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public class LidoReflux {
! final public static String[][] SOFTWARE_CLASSES=new String[][] {
! BuLib.SWING_CLASSES,
! BuLib.BU_CLASSES
! };
!
! // Informations sur Lido/Reflux
! public final static BuInformationsSoftware isD1d2_=new BuInformationsSoftware();
! static {
! isD1d2_.name ="Lido/Reflux";
! isD1d2_.version ="0.01";
! isD1d2_.date ="11-Fév-2000";
! isD1d2_.rights ="Tous droits réservés. GHN (c)1998-2000";
! isD1d2_.contact ="Ber...@ut...";
! isD1d2_.license ="";
! isD1d2_.logo =null;
! // isD1d2_.banner =RefluxResource.REFLUX.getIcon("reflux-banner");
! isD1d2_.banner =null;
! isD1d2_.ftp ="ftp://www.utc.fr/ghn/";
! isD1d2_.http ="http://www.utc.fr/ghn";
! isD1d2_.man ="http://www.utc.fr/manuels";
! isD1d2_.update ="http://www.utc.fr/ghn/fudaa/deltas/";
!
! isD1d2_.authors =new String[] {"Bertrand Marchand"};
! isD1d2_.contributors=null;
! isD1d2_.testers =null;
! }
!
! public static BuInformationsSoftware informationsSoftware()
! { return isD1d2_; }
!
! /**
! * Exécution de l'application
! */
! public static void main(String[] args)
! {
! System.out.println("Client Lido/Reflux");
!
! // Lecture des flags
! FudaaCommandLineParser flags=new FudaaCommandLineParser();
! args=flags.parse(args);
! if( args.length>0 ) {
! System.err.println("The flag "+args[0]+" is unknown");
! System.err.println("Flags: "+flags.flagTotalText());
! System.exit(1);
! }
!
! // Console système
! if( !flags.no_terminal ) {
! String ver=informationsSoftware().version;
! TerminalStandard ts = new TerminalStandard();
! ts.activeStandards();
! JFrame fts=new JFrame("Console");
! fts.setContentPane(ts);
! fts.pack();
! fts.show();
! String wlcmsg=
! "******************************************************************************\n"+
! "* Bienvenue dans Lido/Reflux "+ver+" *\n"+
! "* -------------------------- *\n"+
! "* Ceci est la console texte. Elle affiche tous les messages systeme: *\n"+
! "* erreurs, taches en cours. Consultez-la regulierement pour savoir *\n"+
! "* si le programme est actif, si une erreur s'est produite, ... *\n"+
! "* En cas d'erreur, joignez son contenu (enregistre dans le fichier ts.log) *\n"+
! "* au mail de notification de bogue, ceci nous aidera a comprendre. *\n"+
! "******************************************************************************\n\n";
! System.out.println(wlcmsg);
! }
!
! // Preferences
! BuInformationsSoftware il=informationsSoftware();
! BuPreferences.BU.applyLookAndFeel();
!
! // Network Check
! FudaaNetworkChecker nc=new FudaaNetworkChecker(il);
! nc.check();
!
! // Update
! // if( !flags.no_update ) {
! // FudaaUpdate update=new FudaaUpdate(RefondeImplementation.informationsSoftware());
! // update.setInstallMode(flags.jar_update?FudaaUpdate.JAR:FudaaUpdate.CLASS);
! // if( update.scanForUpdate() ) {
! // if( update.startUpdate() )
! // System.exit(0);
! // } else System.err.println("Refonde : no update");
! // }
!
! // Splash screen
! // BuSplashScreen ss=new BuSplashScreen
! // (RefondeImplementation.informationsSoftware(),
! // 3000,Refonde.SOFTWARE_CLASSES,
! // RefondeImplementation.class.getName());
! // ss.start();
! // ss.setProgression(0);
!
! // ss.setText("Recherche d'un serveur Refonde distant...");
!
! //--- Serveurs Lido ------------------------------------------------------
! /*
! if (!flags.no_server) {
! if (!flags.no_corba) {
! // ss.setText("Connexion au serveur Lido...");
! // ss.setProgression(0);
! System.out.println("Connexion au serveur Lido..");
! if (!flags.no_delay) {
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido", 30000));
! if( LidoImplementation.SERVEUR_LIDO==null ) {
! // ss.setText("Connexion au serveur Lido, deuxième tentative...");
! // ss.setProgression(30);
! System.out.println("Connexion au serveur Lido, deuxième tentative...");
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido", 30000));
! }
! } else {
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido"));
! }
! if( LidoImplementation.SERVEUR_LIDO==null ) {
! // ss.setText("Echec de la connexion : sortie.");
! System.out.println("Echec de la connexion : sortie.");
! try {Thread.sleep(3000);} catch(InterruptedException e) {
! System.err.println("interrupted");
! }
! System.exit(1);
! } else {
! // ss.setText("Connexion établie");
! System.out.println("Connexion établie");
! try {Thread.sleep(3000);} catch(InterruptedException e) {}
! }
! } else { // flags.no_corba
! // ss.setText("Lancement du serveur Lido...");
! // ss.setProgression(0);
! System.out.println("Lancement du serveur local Lido");
! ICalculLido s=new CCalculLido();
! // ss.setProgression(40);
! LidoImplementation.SERVEUR_LIDO=s;
! }
! } else { // flags.no_server
! // ss.setText("Lancement sans serveur");
! // ss.setProgression(0);
! System.out.println("Lancement sans serveur");
! }
!
! //--- Serveurs Reflux ----------------------------------------------------
!
! if (!flags.no_server) {
!
! // Reflux 2D
! System.out.println("Acces au serveur de calcul Reflux 2D...");
! PRCalculReflux2d.initialiser(!flags.no_corba);
!
! // Reflux 3D
! System.out.println("Acces au serveur de calcul Reflux 3D...");
! PRCalculReflux3d.initialiser(!flags.no_corba);
!
! // if (!flags.no_corba) {
! // System.out.println("Connexion au serveur Reflux...");
! // if (!flags.no_delay) {
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux", 1000));
! // if( RefluxImplementation.SERVEUR_REFLUX==null ) {
! //// ss.setText("Connexion au serveur Reflux, deuxième tentative...");
! //// ss.setProgression(30);
! // System.out.println("Connexion au serveur Reflux, deuxième tentative...");
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux", 1000));
! // }
! // } else {
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux"));
! // }
! // if( RefluxImplementation.SERVEUR_REFLUX==null ) {
! //// ss.setText("Echec de la connexion : sortie.");
! // System.out.println("Echec de la connexion : sortie.");
! // try {Thread.sleep(3000);} catch(InterruptedException e) {
! // System.err.println("interrupted");
! // }
! // System.exit(1);
! // } else {
! //// ss.setText("Connexion établie");
! // System.out.println("Connexion établie");
! // try {Thread.sleep(3000);} catch(InterruptedException e) {}
! // }
! // } else { // flags.no_corba
! //// ss.setText("Lancement du serveur Reflux...");
! //// ss.setProgression(0);
! // System.out.println("Lancement du serveur local Reflux");
! // ICalculReflux s=new CCalculReflux();
! //// ss.setProgression(40);
! // RefluxImplementation.SERVEUR_REFLUX=s;
! // }
! // } else { // flags.no_server
! //// ss.setText("Lancement sans serveur");
! ////// ss.setProgression(0);
! // System.out.println("Lancement sans serveur");
! }
! */
! //--- Lancement des applications -----------------------------------------
!
! LidoApplication lidoApp=new LidoApplication();
! lidoApp.init();
! lidoApp.start();
!
! RefluxApplication prefluxApp=new RefluxApplication();
! prefluxApp.init();
! prefluxApp.start();
! }
! }
!
!
--- 1,224 ----
! /*
! * @file LidoReflux.java
! * @creation 2000-02-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.d1d2;
! import org.fudaa.dodico.corba.reflux.*;
! import org.fudaa.dodico.corba.lido.*;
! import org.fudaa.dodico.reflux.*;
! import org.fudaa.dodico.lido.*;
! import org.fudaa.dodico.objet.*;
! import com.memoire.bu.*;
! import org.fudaa.fudaa.commun.*;
! import com.diaam.lgpl.ts.*;
! import org.fudaa.fudaa.lido.*;
! import org.fudaa.fudaa.reflux.*;
! import org.fudaa.fudaa.reflux.calcul.PRCalculReflux2d;
! import org.fudaa.fudaa.reflux.calcul.PRCalculReflux3d;
! import javax.swing.JFrame;
! /**
! * Point d'entrée de l'application LidoReflux
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public class LidoReflux {
! final public static String[][] SOFTWARE_CLASSES=
! new String[][] { BuLib.SWING_CLASSES, BuLib.BU_CLASSES };
! // Informations sur Lido/Reflux
! public final static BuInformationsSoftware isD1d2_=
! new BuInformationsSoftware();
! static {
! isD1d2_.name= "Lido/Reflux";
! isD1d2_.version= "0.01";
! isD1d2_.date= "11-Fév-2000";
! isD1d2_.rights= "Tous droits réservés. GHN (c)1998-2000";
! isD1d2_.contact= "Ber...@ut...";
! isD1d2_.license= "";
! isD1d2_.logo= null;
! // isD1d2_.banner =RefluxResource.REFLUX.getIcon("reflux-banner");
! isD1d2_.banner= null;
! isD1d2_.ftp= "ftp://www.utc.fr/ghn/";
! isD1d2_.http= "http://www.utc.fr/ghn";
! isD1d2_.man= "http://www.utc.fr/manuels";
! isD1d2_.update= "http://www.utc.fr/ghn/fudaa/deltas/";
! isD1d2_.authors= new String[] { "Bertrand Marchand" };
! isD1d2_.contributors= null;
! isD1d2_.testers= null;
! }
! public static BuInformationsSoftware informationsSoftware() {
! return isD1d2_;
! }
! /**
! * Exécution de l'application
! */
! public static void main(String[] args) {
! System.out.println("Client Lido/Reflux");
! // Lecture des flags
! FudaaCommandLineParser flags= new FudaaCommandLineParser();
! args= flags.parse(args);
! if (args.length > 0) {
! System.err.println("The flag " + args[0] + " is unknown");
! System.err.println("Flags: " + flags.flagTotalText());
! System.exit(1);
! }
! // Console système
! if (!flags.no_terminal) {
! String ver= informationsSoftware().version;
! TerminalStandard ts= new TerminalStandard();
! ts.activeStandards();
! JFrame fts= new JFrame("Console");
! fts.setContentPane(ts);
! fts.pack();
! fts.show();
! String wlcmsg=
! "******************************************************************************\n"
! + "* Bienvenue dans Lido/Reflux "
! + ver
! + " *\n"
! + "* -------------------------- *\n"
! + "* Ceci est la console texte. Elle affiche tous les messages systeme: *\n"
! + "* erreurs, taches en cours. Consultez-la regulierement pour savoir *\n"
! + "* si le programme est actif, si une erreur s'est produite, ... *\n"
! + "* En cas d'erreur, joignez son contenu (enregistre dans le fichier ts.log) *\n"
! + "* au mail de notification de bogue, ceci nous aidera a comprendre. *\n"
! + "******************************************************************************\n\n";
! System.out.println(wlcmsg);
! }
! // Preferences
! BuInformationsSoftware il= informationsSoftware();
! BuPreferences.BU.applyLookAndFeel();
! // Network Check
! FudaaNetworkChecker nc= new FudaaNetworkChecker(il);
! nc.check();
! // Update
! // if( !flags.no_update ) {
! // FudaaUpdate update=new FudaaUpdate(RefondeImplementation.informationsSoftware());
! // update.setInstallMode(flags.jar_update?FudaaUpdate.JAR:FudaaUpdate.CLASS);
! // if( update.scanForUpdate() ) {
! // if( update.startUpdate() )
! // System.exit(0);
! // } else System.err.println("Refonde : no update");
! // }
! // Splash screen
! // BuSplashScreen ss=new BuSplashScreen
! // (RefondeImplementation.informationsSoftware(),
! // 3000,Refonde.SOFTWARE_CLASSES,
! // RefondeImplementation.class.getName());
! // ss.start();
! // ss.setProgression(0);
! // ss.setText("Recherche d'un serveur Refonde distant...");
! //--- Serveurs Lido ------------------------------------------------------
! /*
! if (!flags.no_server) {
! if (!flags.no_corba) {
! // ss.setText("Connexion au serveur Lido...");
! // ss.setProgression(0);
! System.out.println("Connexion au serveur Lido..");
! if (!flags.no_delay) {
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido", 30000));
! if( LidoImplementation.SERVEUR_LIDO==null ) {
! // ss.setText("Connexion au serveur Lido, deuxième tentative...");
! // ss.setProgression(30);
! System.out.println("Connexion au serveur Lido, deuxième tentative...");
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido", 30000));
! }
! } else {
! LidoImplementation.SERVEUR_LIDO=
! ICalculLidoHelper.narrow(CDodico.findServerByName("un-serveur-lido"));
! }
! if( LidoImplementation.SERVEUR_LIDO==null ) {
! // ss.setText("Echec de la connexion : sortie.");
! System.out.println("Echec de la connexion : sortie.");
! try {Thread.sleep(3000);} catch(InterruptedException e) {
! System.err.println("interrupted");
! }
! System.exit(1);
! } else {
! // ss.setText("Connexion établie");
! System.out.println("Connexion établie");
! try {Thread.sleep(3000);} catch(InterruptedException e) {}
! }
! } else { // flags.no_corba
! // ss.setText("Lancement du serveur Lido...");
! // ss.setProgression(0);
! System.out.println("Lancement du serveur local Lido");
! ICalculLido s=new CCalculLido();
! // ss.setProgression(40);
! LidoImplementation.SERVEUR_LIDO=s;
! }
! } else { // flags.no_server
! // ss.setText("Lancement sans serveur");
! // ss.setProgression(0);
! System.out.println("Lancement sans serveur");
! }
!
! //--- Serveurs Reflux ----------------------------------------------------
!
! if (!flags.no_server) {
!
! // Reflux 2D
! System.out.println("Acces au serveur de calcul Reflux 2D...");
! PRCalculReflux2d.initialiser(!flags.no_corba);
!
! // Reflux 3D
! System.out.println("Acces au serveur de calcul Reflux 3D...");
! PRCalculReflux3d.initialiser(!flags.no_corba);
!
! // if (!flags.no_corba) {
! // System.out.println("Connexion au serveur Reflux...");
! // if (!flags.no_delay) {
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux", 1000));
! // if( RefluxImplementation.SERVEUR_REFLUX==null ) {
! //// ss.setText("Connexion au serveur Reflux, deuxième tentative...");
! //// ss.setProgression(30);
! // System.out.println("Connexion au serveur Reflux, deuxième tentative...");
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux", 1000));
! // }
! // } else {
! // RefluxImplementation.SERVEUR_REFLUX=
! // ICalculRefluxHelper.narrow(CDodico.findServerByName("un-serveur-reflux"));
! // }
! // if( RefluxImplementation.SERVEUR_REFLUX==null ) {
! //// ss.setText("Echec de la connexion : sortie.");
! // System.out.println("Echec de la connexion : sortie.");
! // try {Thread.sleep(3000);} catch(InterruptedException e) {
! // System.err.println("interrupted");
! // }
! // System.exit(1);
! // } else {
! //// ss.setText("Connexion établie");
! // System.out.println("Connexion établie");
! // try {Thread.sleep(3000);} catch(InterruptedException e) {}
! // }
! // } else { // flags.no_corba
! //// ss.setText("Lancement du serveur Reflux...");
! //// ss.setProgression(0);
! // System.out.println("Lancement du serveur local Reflux");
! // ICalculReflux s=new CCalculReflux();
! //// ss.setProgression(40);
! // RefluxImplementation.SERVEUR_REFLUX=s;
! // }
! // } else { // flags.no_server
! //// ss.setText("Lancement sans serveur");
! ////// ss.setProgression(0);
! // System.out.println("Lancement sans serveur");
! }
! */
! //--- Lancement des applications -----------------------------------------
! LidoApplication lidoApp= new LidoApplication();
! lidoApp.init();
! lidoApp.start();
! RefluxApplication prefluxApp= new RefluxApplication();
! prefluxApp.init();
! prefluxApp.start();
! }
! }
Index: Profil1D2D.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/d1d2/Profil1D2D.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Profil1D2D.java 23 Sep 2003 21:11:40 -0000 1.3
--- Profil1D2D.java 25 Nov 2003 10:13:37 -0000 1.4
***************
*** 1,107 ****
! /*
! * @file Profil1D2D.java
! * @creation 2000-02-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.d1d2;
!
! import java.awt.datatransfer.*;
! import java.io.*;
!
! /**
! * Profil transférable
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public class Profil1D2D implements Serializable, Transferable {
! private String name_;
! private boolean disponibilite_;
! private boolean regimePermanent_;
! private double[][] courbe_; // {{0.,10.},{10.,30.},{20.,35.},{25.,37.},{10000.,37.}};
!
! /**
! * Création d'un profil vide
! */
! public Profil1D2D()
! {
! name_="";
! regimePermanent_=true;
! disponibilite_=false;
! courbe_=null;
! }
!
! /**
! * Création d'un profil sans valeurs
! */
! public Profil1D2D(String name, boolean P)
! {
! name_=name;
! regimePermanent_=P;
! disponibilite_=false;
! courbe_=null;
! }
!
! /**
! * Affectation du liminigramme résultat Lido
! */
! public void setLimnigramme(double[][] l)
! {
! if( (courbe_==l)||(l==null)||(l.length==0)||(l[0].length==0) ) return;
! courbe_=l;
! disponibilite_=true;
! }
!
! /**
! * Retourne le nom du profil
! */
! public String getName() {
! return name_;
! }
!
! /**
! * Les résultats sont-ils disponibles sur le profil ?
! */
! public boolean isResultatDisponible() {
! return disponibilite_;
! }
!
! /**
! * Retourne le résultat sous forme de limnigramme. Pour une valeur
! * stationnaire, le limnigramme ne comporte qu'un seul h(t). t dans ce
! * cas n'a pas d'importance.
! */
! public double[][] getLimnigramme() {
! return courbe_;
! }
!
! /**
! * Le regime du calcul d'ou provient le résultat est-il permanent ?
! */
! public boolean isRegimePermanent() {
! return regimePermanent_;
! }
!
!
! // Transferable
! public Object getTransferData(DataFlavor flavor)
! {
! if( isDataFlavorSupported(flavor) ) return this;
! return null;
! }
!
! public DataFlavor[] getTransferDataFlavors()
! {
! return new DataFlavor[] {
! new DataFlavor(getClass(), DataFlavor.javaSerializedObjectMimeType) };
! }
!
! public boolean isDataFlavorSupported(DataFlavor flavor)
! {
! return getClass().equals(flavor.getRepresentationClass());
! }
! }
--- 1,90 ----
! /*
! * @file Profil1D2D.java
! * @creation 2000-02-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.d1d2;
! import java.awt.datatransfer.*;
! import java.io.*;
! /**
! * Profil transférable
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Bertrand Marchand
! */
! public class Profil1D2D implements Serializable, Transferable {
! private String name_;
! private boolean disponibilite_;
! private boolean regimePermanent_;
! private double[][] courbe_;
! // {{0.,10.},{10.,30.},{20.,35.},{25.,37.},{10000.,37.}};
! /**
! * Création d'un profil vide
! */
! public Profil1D2D() {
! name_= "";
! regimePermanent_= true;
! disponibilite_= false;
! courbe_= null;
! }
! /**
! * Création d'un profil sans valeurs
! */
! public Profil1D2D(String name, boolean P) {
! name_= name;
! regimePermanent_= P;
! disponibilite_= false;
! courbe_= null;
! }
! /**
! * Affectation du liminigramme résultat Lido
! */
! public void setLimnigramme(double[][] l) {
! if ((courbe_ == l) || (l == null) || (l.length == 0) || (l[0].length == 0))
! return;
! courbe_= l;
! disponibilite_= true;
! }
! /**
! * Retourne le nom du profil
! */
! public String getName() {
! return name_;
! }
! /**
! * Les résultats sont-ils disponibles sur le profil ?
! */
! public boolean isResultatDisponible() {
! return disponibilite_;
! }
! /**
! * Retourne le résultat sous forme de limnigramme. Pour une valeur
! * stationnaire, le limnigramme ne comporte qu'un seul h(t). t dans ce
! * cas n'a pas d'importance.
! */
! public double[][] getLimnigramme() {
! return courbe_;
! }
! /**
! * Le regime du calcul d'ou provient le résultat est-il permanent ?
! */
! public boolean isRegimePermanent() {
! return regimePermanent_;
! }
! // Transferable
! public Object getTransferData(DataFlavor flavor) {
! if (isDataFlavorSupported(flavor))
! return this;
! return null;
! }
! public DataFlavor[] getTransferDataFlavors() {
! return new DataFlavor[] {
! new DataFlavor(getClass(), DataFlavor.javaSerializedObjectMimeType)};
! }
! public boolean isDataFlavorSupported(DataFlavor flavor) {
! return getClass().equals(flavor.getRepresentationClass());
! }
! }
|
|
From: <de...@us...> - 2003-11-25 12:01:57
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/cubature In directory sc8-pr-cvs1:/tmp/cvs-serv3074/cubature Modified Files: Cubature.java CubatureApplication.java CubatureImplementation.java Log Message: reformat all files Index: Cubature.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/cubature/Cubature.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Cubature.java 23 Sep 2003 21:09:25 -0000 1.5 --- Cubature.java 25 Nov 2003 10:13:36 -0000 1.6 *************** *** 1,148 **** ! /* ! * @file Cubature.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! ! package org.fudaa.fudaa.cubature; ! ! import java.io.*; ! import java.util.*; ! import javax.swing.*; ! ! import org.fudaa.dodico.olb.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.cubature.*; ! import org.fudaa.dodico.corba.cubature.*; ! ! import com.memoire.bu.*; ! import org.fudaa.fudaa.commun.*; ! import com.diaam.lgpl.ts.*; ! ! /** ! * Point d'entrée de l'application Cubature. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class Cubature { ! final public static String[][] SOFTWARE_CLASSES=new String[][] ! { ! BuLib.SWING_CLASSES, ! BuLib.BU_CLASSES ! }; ! ! /** ! * Exécution de l'application ! */ ! public static void main(String[] args) ! { ! System.out.println("Client Cubature"); ! ! // Lecture des flags ! FudaaCommandLineParser flags=new FudaaCommandLineParser(); ! args=flags.parse(args); ! if( args.length>0 ) { ! System.err.println("The flag "+args[0]+" is unknown"); ! System.err.println("Flags: "+flags.flagTotalText()); ! System.exit(1); ! } ! ! // Console système ! if( !flags.no_terminal ) { ! String ver=CubatureImplementation.informationsSoftware().version; ! TerminalStandard ts = new TerminalStandard(); ! ts.activeStandards(); ! JFrame fts=new JFrame("Console"); ! fts.setTitle("Console système"); ! fts.setContentPane(ts); ! fts.pack(); ! fts.show(); ! CubatureImplementation.ts=fts; ! String wlcmsg= ! "******************************************************************************\n"+ ! "* Bienvenue dans Cubature "+ver+" *\n"+ ! "* ----------------------- *\n"+ ! "* Ceci est la console texte. Elle affiche tous les messages systeme: *\n"+ ! "* erreurs, taches en cours. Consultez-la regulierement pour savoir *\n"+ ! "* si le programme est actif, si une erreur s'est produite, ... *\n"+ ! "* En cas d'erreur, joignez son contenu (enregistre dans le fichier ts.log) *\n"+ ! "* au mail de notification de bogue, ceci nous aidera a comprendre. *\n"+ ! "******************************************************************************\n\n"; ! System.out.println(wlcmsg); ! } ! ! // Preferences ! BuInformationsSoftware il=CubatureImplementation.informationsSoftware(); ! BuPreferences.BU.applyLookAndFeel(); ! ! // Network Check ! // FudaaNetworkChecker nc=new FudaaNetworkChecker(il); ! // nc.check(); ! ! // Update ! // if( !flags.no_update ) { ! // FudaaUpdate update=new FudaaUpdate(il); ! // update.setInstallMode(flags.jar_update?FudaaUpdate.JAR:FudaaUpdate.CLASS); ! // if( update.scanForUpdate() ) { ! // if( update.startUpdate() ) ! // System.exit(0); ! // } else System.err.println("Cubature : no update"); ! // } ! ! // Splash screen ! BuSplashScreen ss=new BuSplashScreen ! (il, ! 3000,SOFTWARE_CLASSES); ! // if (!flags.no_splash) ss.start(); ! ss.setProgression(0); ! ! ss.setText("Recherche d'un serveur Cubature distant..."); ! ! /* ! if(!flags.no_corba&&!flags.no_server) ! // Recherche du serveur ! CubatureImplementation.SERVEUR_CUBATURE=ICalculCubatureHelper.narrow( ! CDodico.findServerByInterface("::cubature::ICalculCubature",4000)); ! ! ss.setProgression(20); ! ! if(!flags.no_server) ! if(CubatureImplementation.SERVEUR_CUBATURE==null) { ! ! ss.setText("Lancement d'un serveur Cubature local..."); ! System.err.print("Lancement d'un serveur Cubature local..."); ! ! { ! ss.setProgression(30); ! ss.setText("Initialisation du serveur local... "); ! CubatureImplementation.SERVEUR_CUBATURE=new CCalculCubature(); ! System.err.println("OK"); ! ! } ! ! } ! */ ! ! ss.setProgression(40); ! ! ss.setText("Création de l'application..."); ! CubatureApplication app=new CubatureApplication(); ! ss.setProgression(60); ! ! ss.setText("Initialisation de l'application..."); ! app.init(); ! ss.setProgression(100); ! ! try { Thread.currentThread().sleep(500); } ! catch(Exception ex) { } ! ! ss.setVisible(false); ! app.start(); ! } ! } ! ! --- 1,124 ---- ! /* ! * @file Cubature.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.cubature; ! import java.io.*; ! import java.util.*; ! import javax.swing.*; ! import org.fudaa.dodico.olb.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.cubature.*; ! import org.fudaa.dodico.corba.cubature.*; ! import com.memoire.bu.*; ! import org.fudaa.fudaa.commun.*; ! import com.diaam.lgpl.ts.*; ! /** ! * Point d'entrée de l'application Cubature. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class Cubature { ! final public static String[][] SOFTWARE_CLASSES= ! new String[][] { BuLib.SWING_CLASSES, BuLib.BU_CLASSES }; ! /** ! * Exécution de l'application ! */ ! public static void main(String[] args) { ! System.out.println("Client Cubature"); ! // Lecture des flags ! FudaaCommandLineParser flags= new FudaaCommandLineParser(); ! args= flags.parse(args); ! if (args.length > 0) { ! System.err.println("The flag " + args[0] + " is unknown"); ! System.err.println("Flags: " + flags.flagTotalText()); ! System.exit(1); ! } ! // Console système ! if (!flags.no_terminal) { ! String ver= CubatureImplementation.informationsSoftware().version; ! TerminalStandard ts= new TerminalStandard(); ! ts.activeStandards(); ! JFrame fts= new JFrame("Console"); ! fts.setTitle("Console système"); ! fts.setContentPane(ts); ! fts.pack(); ! fts.show(); ! CubatureImplementation.ts= fts; ! String wlcmsg= ! "******************************************************************************\n" ! + "* Bienvenue dans Cubature " ! + ver ! + " *\n" ! + "* ----------------------- *\n" ! + "* Ceci est la console texte. Elle affiche tous les messages systeme: *\n" ! + "* erreurs, taches en cours. Consultez-la regulierement pour savoir *\n" ! + "* si le programme est actif, si une erreur s'est produite, ... *\n" ! + "* En cas d'erreur, joignez son contenu (enregistre dans le fichier ts.log) *\n" ! + "* au mail de notification de bogue, ceci nous aidera a comprendre. *\n" ! + "******************************************************************************\n\n"; ! System.out.println(wlcmsg); ! } ! // Preferences ! BuInformationsSoftware il= CubatureImplementation.informationsSoftware(); ! BuPreferences.BU.applyLookAndFeel(); ! // Network Check ! // FudaaNetworkChecker nc=new FudaaNetworkChecker(il); ! // nc.check(); ! // Update ! // if( !flags.no_update ) { ! // FudaaUpdate update=new FudaaUpdate(il); ! // update.setInstallMode(flags.jar_update?FudaaUpdate.JAR:FudaaUpdate.CLASS); ! // if( update.scanForUpdate() ) { ! // if( update.startUpdate() ) ! // System.exit(0); ! // } else System.err.println("Cubature : no update"); ! // } ! // Splash screen ! BuSplashScreen ss= new BuSplashScreen(il, 3000, SOFTWARE_CLASSES); ! // if (!flags.no_splash) ss.start(); ! ss.setProgression(0); ! ss.setText("Recherche d'un serveur Cubature distant..."); ! /* ! if(!flags.no_corba&&!flags.no_server) ! // Recherche du serveur ! CubatureImplementation.SERVEUR_CUBATURE=ICalculCubatureHelper.narrow( ! CDodico.findServerByInterface("::cubature::ICalculCubature",4000)); ! ! ss.setProgression(20); ! ! if(!flags.no_server) ! if(CubatureImplementation.SERVEUR_CUBATURE==null) { ! ! ss.setText("Lancement d'un serveur Cubature local..."); ! System.err.print("Lancement d'un serveur Cubature local..."); ! ! { ! ss.setProgression(30); ! ss.setText("Initialisation du serveur local... "); ! CubatureImplementation.SERVEUR_CUBATURE=new CCalculCubature(); ! System.err.println("OK"); ! ! } ! ! } ! */ ! ss.setProgression(40); ! ss.setText("Création de l'application..."); ! CubatureApplication app= new CubatureApplication(); ! ss.setProgression(60); ! ss.setText("Initialisation de l'application..."); ! app.init(); ! ss.setProgression(100); ! try { ! Thread.currentThread().sleep(500); ! } catch (Exception ex) {} ! ss.setVisible(false); ! app.start(); ! } ! } Index: CubatureApplication.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/cubature/CubatureApplication.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CubatureApplication.java 23 Sep 2003 21:09:25 -0000 1.3 --- CubatureApplication.java 25 Nov 2003 10:13:37 -0000 1.4 *************** *** 1,27 **** ! /* ! * @file CubatureApplication.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! ! package org.fudaa.fudaa.cubature; ! ! import com.memoire.bu.*; ! ! /** ! * Application Cubature (parallèle à Applet) ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class CubatureApplication ! extends BuApplication { ! ! public CubatureApplication() { ! super(); ! setImplementation(new CubatureImplementation()); ! } ! } --- 1,22 ---- ! /* ! * @file CubatureApplication.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.cubature; ! import com.memoire.bu.*; ! /** ! * Application Cubature (parallèle à Applet) ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class CubatureApplication extends BuApplication { ! public CubatureApplication() { ! super(); ! setImplementation(new CubatureImplementation()); ! } ! } Index: CubatureImplementation.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/cubature/CubatureImplementation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CubatureImplementation.java 23 Sep 2003 21:09:25 -0000 1.4 --- CubatureImplementation.java 25 Nov 2003 10:13:37 -0000 1.5 *************** *** 1,380 **** ! /* ! * @file CubatureImplementation.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! ! package org.fudaa.fudaa.cubature; ! ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.corba.cubature.*; ! import org.fudaa.dodico.cubature.*; ! ! import com.memoire.bu.*; ! ! import org.fudaa.fudaa.commun.*; ! import org.fudaa.fudaa.commun.dodico.*; ! ! import java.awt.event.*; ! import java.awt.*; ! import java.text.*; ! import java.io.*; ! import java.util.*; ! import javax.swing.border.*; ! import javax.swing.*; ! import javax.swing.event.ChangeEvent; ! import javax.swing.event.ChangeListener; ! ! /** ! * Classe principale d'implémentation de Cubature. Commune à l'application et à ! * l'applet. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class CubatureImplementation extends BuCommonImplementation { ! /** ! * Objet Calcul Cubature ! */ ! public static ICalculCubature SERVEUR_CUBATURE=null; ! public static IConnexion CONNEXION_CUBATURE=null; ! public static IPersonne PERSONNE=null; ! ! /** ! * Console système. ! */ ! public static JFrame ts =null; ! ! /** ! * Barre de status pour affichage messages. ! */ ! public static BuStatusBar statusBar =null; ! ! // Informations sur Cubature ! private final static BuInformationsSoftware isCubature_= ! new BuInformationsSoftware(); ! static { ! isCubature_.name ="Cubature"; ! isCubature_.version ="1.00"; ! isCubature_.date ="12-Dec-2000"; ! isCubature_.rights ="Tous droits réservés. GHN (c) 2000"; ! isCubature_.contact ="Sof...@ut..."; ! isCubature_.license ="GPL2"; ! isCubature_.ftp ="ftp://www.utc.fr/ghn/"; ! isCubature_.http ="http://www.utc.fr/ghn/"; ! isCubature_.man ="http://www.utc.fr/ghn/manuels/"; ! isCubature_.update ="http://www.utc.fr/ghn/fudaa/deltas/"; ! ! isCubature_.authors =new String[] {"Bertrand Marchand","Sofiane Hadji"}; ! isCubature_.contributors=null; ! isCubature_.testers =null; ! ! BuPrinter.INFO_LOG=isCubature_; ! } ! ! private File openDir_=new File(System.getProperty("user.dir")); ! private JFileChooser diOpen_ =null; ! ! public CubatureImplementation() {} ! ! public void init() { ! super.init(); ! ! BuMenuBar mb; ! JMenu mn; ! BuToolBar tb; ! ! statusBar=getMainPanel().getStatusBar(); ! ! setTitle(null); ! ! //------------------------------------------------------------------------ ! //--- Menus et toolbar ------------------------------------------------- ! //------------------------------------------------------------------------ ! ! mb=getMainMenuBar(); ! tb=getMainToolBar(); ! ! // Menu édition ! mn=mb.getMenu("MENU_EDITION"); ! mb.remove(mn); ! ! // Menu calcul ! mn=buildCalculMenu(); ! mn.setIcon(null); ! mn.addActionListener(mb); ! mb.add(mn,1); ! ! // ToolBar ! tb.removeAll(); ! tb.addToolButton("Ouvrir","OUVRIR",BuResource.BU.getIcon("OUVRIR"),true); ! tb.addToolButton("Calculer","CALCULER",BuResource.BU.getIcon("CALCULER"),false); ! tb.addToolButton("Connecter", "CONNECTER", FudaaLib.getIcon("connecter"), true); ! ! ! setEnabledForAction("OUVRIR" , true); ! setEnabledForAction("QUITTER", true); ! setEnabledForAction("AIDE_INDEX", false); ! setEnabledForAction("POINTEURAIDE", false); ! setEnabledForAction("INDEX_ALPHA", false); ! setEnabledForAction("INDEX_THEMA", false); ! setEnabledForAction("ASTUCE", false); ! ! setEnabledForAction("ECHANGER_COLONNES", false); ! setEnabledForAction("VISIBLE_SPECIFICBAR",false); ! setEnabledForAction("VISIBLE_LEFTCOLUMN", false); ! setEnabledForAction("VISIBLE_RIGHTCOLUMN",false); ! ! setCheckedForAction("VISIBLE_SPECIFICBAR",false); ! setCheckedForAction("VISIBLE_LEFTCOLUMN", false); ! setCheckedForAction("VISIBLE_RIGHTCOLUMN",false); ! ! removeAction("CREER"); ! removeAction("REOUVRIR"); ! removeAction("ENREGISTRER"); ! removeAction("ENREGISTRERSOUS"); ! removeAction("FERMER"); ! removeAction("IMPORTER"); ! removeAction("EXPORTER"); ! removeAction("IMPRIMER"); ! removeAction("PREVISUALISER"); ! removeAction("PROPRIETE"); ! removeAction("ASSISTANT"); ! ! getMainPanel().getSpecificBar().setVisible(false); ! getMainPanel().getRightColumn().setVisible(false); ! getMainPanel().getLeftColumn() .setVisible(false); ! } ! ! public void start() ! { ! connecter(); ! } ! ! /** ! * Retourne les informations Cubature ! */ ! public static BuInformationsSoftware informationsSoftware() ! { return isCubature_; } ! ! /** ! * Retourne les informations Cubature ! */ ! public BuInformationsSoftware getInformationsSoftware() { ! return isCubature_; ! } ! ! /** ! * Ajoute le titre de l'application au titre en argument ! * @param _title En principe, le nom du projet courant ! */ ! public void setTitle(String _title) { ! BuInformationsSoftware is=getInformationsSoftware(); ! String title=is.name+" "+is.version; ! if (_title!=null) title+=" - "+_title; ! super.setTitle(title); ! } ! ! //------------------------------------------------------------------------------ ! //--- ACTIONS ------------------------------------------------------------------ ! //------------------------------------------------------------------------------ ! ! public void actionPerformed(ActionEvent _evt) { ! String action = _evt.getActionCommand(); ! ! if (action.equals("OUVRIR" )) cmdOuvrir(); ! else if (action.equals("CALCULER" )) cmdExecuter(); ! else if (action.equals("CONNECTER")) connecter(); ! ! else super.actionPerformed(_evt); ! } ! ! /** ! * Ouverture des fichiers ! */ ! private void cmdOuvrir() { ! diOpen_=new JFileChooser(); ! diOpen_.setFileHidingEnabled(true); ! diOpen_.setCurrentDirectory(openDir_); ! diOpen_.setMultiSelectionEnabled(false); ! ! BuFileFilter[] filtres={ ! new BuFileFilter(new String[]{"cub_geo1","cub_geo2","cub_ref"},"Géométries") ! }; ! ! diOpen_.setDialogTitle("Ouverture des fichiers géométriques"); ! diOpen_.resetChoosableFileFilters(); ! diOpen_.addChoosableFileFilter(filtres[0]); ! diOpen_.setFileFilter(filtres[0]); ! ! int r=diOpen_.showOpenDialog((BuApplication)getApp()); ! openDir_=diOpen_.getCurrentDirectory(); ! ! if (r==JFileChooser.APPROVE_OPTION) { ! new BuTaskOperation(this,"Ouverture des fichiers géométriques") { ! public void act() { oprOuvrir(); } ! }.start(); ! } ! } ! ! /* ! * Tâche d'ouverture des fichiers géométriques ! */ ! private void oprOuvrir() { ! File fichier=diOpen_.getSelectedFile(); ! String path =fichier.getPath(); ! int indext; ! ! if ((indext=path.lastIndexOf(".cub_geo1"))!=-1 || ! (indext=path.lastIndexOf(".cub_geo2"))!=-1 || ! (indext=path.lastIndexOf(".cub_ref")) !=-1) ! path=path.substring(0,indext); ! ! try { ! statusBar.setMessage("Ouverture des fichiers géométriques "+path+"..."); ! statusBar.setProgression(0); ! ! IParametresCubature par= ! IParametresCubatureHelper.narrow(SERVEUR_CUBATURE.parametres(CONNEXION_CUBATURE)); ! DParametresCubature.litSurFichiers(path,par); ! statusBar.setProgression(100); ! setTitle(path); ! ! setEnabledForAction("CALCULER",true); ! } ! catch (Exception _exc) { ! _exc.printStackTrace(); ! new BuDialogError(this, getInformationsSoftware(),_exc.getMessage()) ! .activate(); ! ! setEnabledForAction("CALCULER",false); ! } ! finally { ! statusBar.setMessage(""); ! statusBar.setProgression(0); ! } ! } ! ! ! /* ! * Exécution de cubature ! */ ! private void cmdExecuter() { ! new BuTaskOperation(this,"Exécution de Cubature") { ! public void act() { ! oprExecuter(); ! } ! }.start(); ! } ! ! /** ! * Tâche d'exécution de cubature. ! */ ! private void oprExecuter() { ! if( !connecte() ) { ! new BuDialogError(getApp(), informationsSoftware(), ! "vous n'êtes pas connecté à un serveur Cubature ! ").activate(); ! return; ! } ! try { ! statusBar.setMessage("Exécution de Cubature en tâche de fond..."); ! statusBar.setProgression(10); ! ! // Exécution de cubature ! SERVEUR_CUBATURE.calcul(CONNEXION_CUBATURE); ! ! // Récupération du résultat ! statusBar.setProgression(90); ! IResultatsCubature res= ! IResultatsCubatureHelper.narrow(SERVEUR_CUBATURE.resultats(CONNEXION_CUBATURE)); ! ! double volume=res.volume().volume; ! new BuDialogMessage(this, getInformationsSoftware(), ! "Volume trouvé : "+volume).activate(); ! } ! catch (IllegalArgumentException _exc) { ! new BuDialogError(this, getInformationsSoftware(),_exc.getMessage()) ! .activate(); ! return; ! } ! finally { ! statusBar.setMessage(""); ! statusBar.setProgression(0); ! } ! } ! ! //------------------------------------------------------------------------------ ! //--- MENUS -------------------------------------------------------------------- ! //------------------------------------------------------------------------------ ! ! // Le menu "Calcul" ! private BuMenu buildCalculMenu() { ! BuMenu r=new BuMenu("Calcul","mnCALCUL"); ! r.addMenuItem("Exécuter Cubature","CALCULER",BuResource.BU.getIcon("calculer"),false); ! return r; ! } ! ! public void exit() ! { ! closeConnection(); ! super.exit(); ! } ! ! public void finalize() ! { ! closeConnection(); ! } ! ! private boolean connecte() ! { ! boolean res=CONNEXION_CUBATURE==null || SERVEUR_CUBATURE==null; ! try { ! res=res || !CONNEXION_CUBATURE.connecte(); ! } catch ( org.omg.CORBA.SystemException ce ) {} ! if( res ) closeConnection(); ! return !res; ! } ! ! private void closeConnection() ! { ! if( CONNEXION_CUBATURE!=null ) { ! try { ! SERVEUR_CUBATURE.deconnexion(CONNEXION_CUBATURE); ! } catch( org.omg.CORBA.SystemException ce ) { ! System.err.println("Unable to close connexion"); ! } ! CONNEXION_CUBATURE=null; ! } ! } ! ! public boolean isCloseFrameMode() { return false; } ! ! private void setInfoConnexion(FudaaInfoConnexion r) ! { ! SERVEUR_CUBATURE=ICalculCubatureHelper.narrow(r.SERVEUR); ! CONNEXION_CUBATURE=r.CONNEXION; ! PERSONNE=r.PERSONNE; ! } ! ! protected void connecter() ! { ! if( connecte() ) { ! new BuDialogMessage(getApp(), isCubature_, "Vous êtes déjà connecté").activate(); ! return; ! } ! setEnabledForAction("CONNECTER", false); ! final FudaaInfoConnexion r=FudaaImplementation.popConnexion(isCubature_.name,"ICalculCubature",this, isCubature_); ! r.addChangeListener(new ChangeListener() ! { ! public void stateChanged(ChangeEvent e) ! { ! if( !r.errorOccurred() ) setInfoConnexion(r); ! setEnabledForAction("CONNECTER", true); ! ! } ! }); ! } ! } --- 1,348 ---- ! /* ! * @file CubatureImplementation.java ! * @creation 2000-12-12 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.cubature; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.corba.cubature.*; ! import org.fudaa.dodico.cubature.*; ! import com.memoire.bu.*; ! import org.fudaa.fudaa.commun.*; ! import org.fudaa.fudaa.commun.dodico.*; ! import java.awt.event.*; ! import java.awt.*; ! import java.text.*; ! import java.io.*; ! import java.util.*; ! import javax.swing.border.*; ! import javax.swing.*; ! import javax.swing.event.ChangeEvent; ! import javax.swing.event.ChangeListener; ! /** ! * Classe principale d'implémentation de Cubature. Commune à l'application et à ! * l'applet. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author B.Marchand ! */ ! public class CubatureImplementation extends BuCommonImplementation { ! /** ! * Objet Calcul Cubature ! */ ! public static ICalculCubature SERVEUR_CUBATURE= null; ! public static IConnexion CONNEXION_CUBATURE= null; ! public static IPersonne PERSONNE= null; ! /** ! * Console système. ! */ ! public static JFrame ts= null; ! /** ! * Barre de status pour affichage messages. ! */ ! public static BuStatusBar statusBar= null; ! // Informations sur Cubature ! private final static BuInformationsSoftware isCubature_= ! new BuInformationsSoftware(); ! static { ! isCubature_.name= "Cubature"; ! isCubature_.version= "1.00"; ! isCubature_.date= "12-Dec-2000"; ! isCubature_.rights= "Tous droits réservés. GHN (c) 2000"; ! isCubature_.contact= "Sof...@ut..."; ! isCubature_.license= "GPL2"; ! isCubature_.ftp= "ftp://www.utc.fr/ghn/"; ! isCubature_.http= "http://www.utc.fr/ghn/"; ! isCubature_.man= "http://www.utc.fr/ghn/manuels/"; ! isCubature_.update= "http://www.utc.fr/ghn/fudaa/deltas/"; ! isCubature_.authors= new String[] { "Bertrand Marchand", "Sofiane Hadji" }; ! isCubature_.contributors= null; ! isCubature_.testers= null; ! BuPrinter.INFO_LOG= isCubature_; ! } ! private File openDir_= new File(System.getProperty("user.dir")); ! private JFileChooser diOpen_= null; ! public CubatureImplementation() {} ! public void init() { ! super.init(); ! BuMenuBar mb; ! JMenu mn; ! BuToolBar tb; ! statusBar= getMainPanel().getStatusBar(); ! setTitle(null); ! //------------------------------------------------------------------------ ! //--- Menus et toolbar ------------------------------------------------- ! //------------------------------------------------------------------------ ! mb= getMainMenuBar(); ! tb= getMainToolBar(); ! // Menu édition ! mn= mb.getMenu("MENU_EDITION"); ! mb.remove(mn); ! // Menu calcul ! mn= buildCalculMenu(); ! mn.setIcon(null); ! mn.addActionListener(mb); ! mb.add(mn, 1); ! // ToolBar ! tb.removeAll(); ! tb.addToolButton("Ouvrir", "OUVRIR", BuResource.BU.getIcon("OUVRIR"), true); ! tb.addToolButton( ! "Calculer", ! "CALCULER", ! BuResource.BU.getIcon("CALCULER"), ! false); ! tb.addToolButton( ! "Connecter", ! "CONNECTER", ! FudaaLib.getIcon("connecter"), ! true); ! setEnabledForAction("OUVRIR", true); ! setEnabledForAction("QUITTER", true); ! setEnabledForAction("AIDE_INDEX", false); ! setEnabledForAction("POINTEURAIDE", false); ! setEnabledForAction("INDEX_ALPHA", false); ! setEnabledForAction("INDEX_THEMA", false); ! setEnabledForAction("ASTUCE", false); ! setEnabledForAction("ECHANGER_COLONNES", false); ! setEnabledForAction("VISIBLE_SPECIFICBAR", false); ! setEnabledForAction("VISIBLE_LEFTCOLUMN", false); ! setEnabledForAction("VISIBLE_RIGHTCOLUMN", false); ! setCheckedForAction("VISIBLE_SPECIFICBAR", false); ! setCheckedForAction("VISIBLE_LEFTCOLUMN", false); ! setCheckedForAction("VISIBLE_RIGHTCOLUMN", false); ! removeAction("CREER"); ! removeAction("REOUVRIR"); ! removeAction("ENREGISTRER"); ! removeAction("ENREGISTRERSOUS"); ! removeAction("FERMER"); ! removeAction("IMPORTER"); ! removeAction("EXPORTER"); ! removeAction("IMPRIMER"); ! removeAction("PREVISUALISER"); ! removeAction("PROPRIETE"); ! removeAction("ASSISTANT"); ! getMainPanel().getSpecificBar().setVisible(false); ! getMainPanel().getRightColumn().setVisible(false); ! getMainPanel().getLeftColumn().setVisible(false); ! } ! public void start() { ! connecter(); ! } ! /** ! * Retourne les informations Cubature ! */ ! public static BuInformationsSoftware informationsSoftware() { ! return isCubature_; ! } ! /** ! * Retourne les informations Cubature ! */ ! public BuInformationsSoftware getInformationsSoftware() { ! return isCubature_; ! } ! /** ! * Ajoute le titre de l'application au titre en argument ! * @param _title En principe, le nom du projet courant ! */ ! public void setTitle(String _title) { ! BuInformationsSoftware is= getInformationsSoftware(); ! String title= is.name + " " + is.version; ! if (_title != null) ! title += " - " + _title; ! super.setTitle(title); ! } ! //------------------------------------------------------------------------------ ! //--- ACTIONS ------------------------------------------------------------------ ! //------------------------------------------------------------------------------ ! public void actionPerformed(ActionEvent _evt) { ! String action= _evt.getActionCommand(); ! if (action.equals("OUVRIR")) ! cmdOuvrir(); ! else if (action.equals("CALCULER")) ! cmdExecuter(); ! else if (action.equals("CONNECTER")) ! connecter(); ! else ! super.actionPerformed(_evt); ! } ! /** ! * Ouverture des fichiers ! */ ! private void cmdOuvrir() { ! diOpen_= new JFileChooser(); ! diOpen_.setFileHidingEnabled(true); ! diOpen_.setCurrentDirectory(openDir_); ! diOpen_.setMultiSelectionEnabled(false); ! BuFileFilter[] filtres= ! { ! new BuFileFilter( ! new String[] { "cub_geo1", "cub_geo2", "cub_ref" }, ! "Géométries") ! }; ! diOpen_.setDialogTitle("Ouverture des fichiers géométriques"); ! diOpen_.resetChoosableFileFilters(); ! diOpen_.addChoosableFileFilter(filtres[0]); ! diOpen_.setFileFilter(filtres[0]); ! int r= diOpen_.showOpenDialog((BuApplication)getApp()); ! openDir_= diOpen_.getCurrentDirectory(); ! if (r == JFileChooser.APPROVE_OPTION) { ! new BuTaskOperation(this, "Ouverture des fichiers géométriques") { ! public void act() { ! oprOuvrir(); ! } ! } ! .start(); ! } ! } ! /* ! * Tâche d'ouverture des fichiers géométriques ! */ ! private void oprOuvrir() { ! File fichier= diOpen_.getSelectedFile(); ! String path= fichier.getPath(); ! int indext; ! if ((indext= path.lastIndexOf(".cub_geo1")) != -1 ! || (indext= path.lastIndexOf(".cub_geo2")) != -1 ! || (indext= path.lastIndexOf(".cub_ref")) != -1) ! path= path.substring(0, indext); ! try { ! statusBar.setMessage( ! "Ouverture des fichiers géométriques " + path + "..."); ! statusBar.setProgression(0); ! IParametresCubature par= ! IParametresCubatureHelper.narrow( ! SERVEUR_CUBATURE.parametres(CONNEXION_CUBATURE)); ! DParametresCubature.litSurFichiers(path, par); ! statusBar.setProgression(100); ! setTitle(path); ! setEnabledForAction("CALCULER", true); ! } catch (Exception _exc) { ! _exc.printStackTrace(); ! new BuDialogError(this, getInformationsSoftware(), _exc.getMessage()) ! .activate(); ! setEnabledForAction("CALCULER", false); ! } finally { ! statusBar.setMessage(""); ! statusBar.setProgression(0); ! } ! } ! /* ! * Exécution de cubature ! */ ! private void cmdExecuter() { ! new BuTaskOperation(this, "Exécution de Cubature") { ! public void act() { ! oprExecuter(); ! } ! } ! .start(); ! } ! /** ! * Tâche d'exécution de cubature. ! */ ! private void oprExecuter() { ! if (!connecte()) { ! new BuDialogError( ! getApp(), ! informationsSoftware(), ! "vous n'êtes pas connecté à un serveur Cubature ! ") ! .activate(); ! return; ! } ! try { ! statusBar.setMessage("Exécution de Cubature en tâche de fond..."); ! statusBar.setProgression(10); ! // Exécution de cubature ! SERVEUR_CUBATURE.calcul(CONNEXION_CUBATURE); ! // Récupération du résultat ! statusBar.setProgression(90); ! IResultatsCubature res= ! IResultatsCubatureHelper.narrow( ! SERVEUR_CUBATURE.resultats(CONNEXION_CUBATURE)); ! double volume= res.volume().volume; ! new BuDialogMessage( ! this, ! getInformationsSoftware(), ! "Volume trouvé : " + volume) ! .activate(); ! } catch (IllegalArgumentException _exc) { ! new BuDialogError(this, getInformationsSoftware(), _exc.getMessage()) ! .activate(); ! return; ! } finally { ! statusBar.setMessage(""); ! statusBar.setProgression(0); ! } ! } ! //------------------------------------------------------------------------------ ! //--- MENUS -------------------------------------------------------------------- ! //------------------------------------------------------------------------------ ! // Le menu "Calcul" ! private BuMenu buildCalculMenu() { ! BuMenu r= new BuMenu("Calcul", "mnCALCUL"); ! r.addMenuItem( ! "Exécuter Cubature", ! "CALCULER", ! BuResource.BU.getIcon("calculer"), ! false); ! return r; ! } ! public void exit() { ! closeConnection(); ! super.exit(); ! } ! public void finalize() { ! closeConnection(); ! } ! private boolean connecte() { ! boolean res= CONNEXION_CUBATURE == null || SERVEUR_CUBATURE == null; ! try { ! res= res || !CONNEXION_CUBATURE.connecte(); ! } catch (org.omg.CORBA.SystemException ce) {} ! if (res) ! closeConnection(); ! return !res; ! } ! private void closeConnection() { ! if (CONNEXION_CUBATURE != null) { ! try { ! SERVEUR_CUBATURE.deconnexion(CONNEXION_CUBATURE); ! } catch (org.omg.CORBA.SystemException ce) { ! System.err.println("Unable to close connexion"); ! } ! CONNEXION_CUBATURE= null; ! } ! } ! public boolean isCloseFrameMode() { ! return false; ! } ! private void setInfoConnexion(FudaaInfoConnexion r) { ! SERVEUR_CUBATURE= ICalculCubatureHelper.narrow(r.SERVEUR); ! CONNEXION_CUBATURE= r.CONNEXION; ! PERSONNE= r.PERSONNE; ! } ! protected void connecter() { ! if (connecte()) { ! new BuDialogMessage(getApp(), isCubature_, "Vous êtes déjà connecté") ! .activate(); ! return; ! } ! setEnabledForAction("CONNECTER", false); ! final FudaaInfoConnexion r= ! FudaaImplementation.popConnexion( ! isCubature_.name, ! "ICalculCubature", ! this, ! isCubature_); ! r.addChangeListener(new ChangeListener() { ! public void stateChanged(ChangeEvent e) { ! if (!r.errorOccurred()) ! setInfoConnexion(r); ! setEnabledForAction("CONNECTER", true); ! } ! }); ! } ! } |
|
From: <de...@us...> - 2003-11-25 12:01:54
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ant
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/ant
Modified Files:
genereUsine.java
Log Message:
reformat all files
Index: genereUsine.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ant/genereUsine.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** genereUsine.java 22 Sep 2003 20:45:44 -0000 1.4
--- genereUsine.java 25 Nov 2003 10:11:24 -0000 1.5
***************
*** 1,518 ****
! package org.fudaa.dodico.ant;
! import java.io.BufferedWriter;
! import java.io.File;
! import java.io.FileReader;
! import java.io.FileWriter;
! import java.io.LineNumberReader;
! import java.util.Arrays;
! import java.util.StringTokenizer;
! import java.util.Vector;
!
[...984 lines suppressed...]
! DirectoryScanner ds= fs.getDirectoryScanner(project);
! String[] files= ds.getIncludedFiles();
! for (int iFiles= 0; iFiles < files.length; iFiles++) {
! if (!idlDest_.getAbsolutePath().endsWith(files[iFiles]))
! idlModule.add(files[iFiles]);
! }
! }
! enteteIdl(idlModule);
! enteteJava();
! computeJavaFile();
! //Fin des fichiers
! j("}");
! i(" };");
! i("};");
! iNewLine();
! i("#endif");
! writeFile(javaBuffer_, javaDest_);
! writeFile(idlBuffer_, idlDest_);
! }
! }
|
|
From: <de...@us...> - 2003-11-25 12:01:41
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux In directory sc8-pr-cvs1:/tmp/cvs-serv8153 Removed Files: TrRefluxBoudaryMiddleLayer.java Log Message: Rename the file --- TrRefluxBoudaryMiddleLayer.java DELETED --- |
|
From: <de...@us...> - 2003-11-25 10:43:18
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action
In directory sc8-pr-cvs1:/tmp/cvs-serv1137/calque/action
Modified Files:
EbliAbstractAction.java EbliActionInterface.java
EbliChangeStateAction.java EbliComponentFactory.java
EbliPaletteAction.java EbliPaletteButton.java
EbliSimpleAction.java
Log Message:
reformat files
Index: EbliAbstractAction.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliAbstractAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliAbstractAction.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliAbstractAction.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 8,18 ****
*/
package org.fudaa.ebli.calque.action;
-
import java.awt.event.ActionEvent;
-
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
-
/**
* @author deniger
--- 8,15 ----
***************
*** 20,29 ****
*/
public abstract class EbliAbstractAction
! extends AbstractAction implements EbliActionInterface{
!
! public EbliAbstractAction(String name, Icon icon,String _command) {
super(name, icon);
putValue(Action.ACTION_COMMAND_KEY, _command);
}
-
}
--- 17,25 ----
*/
public abstract class EbliAbstractAction
! extends AbstractAction
! implements EbliActionInterface {
! public EbliAbstractAction(String name, Icon icon, String _command) {
super(name, icon);
putValue(Action.ACTION_COMMAND_KEY, _command);
}
}
Index: EbliActionInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliActionInterface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliActionInterface.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliActionInterface.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 8,15 ****
*/
package org.fudaa.ebli.calque.action;
-
import javax.swing.AbstractButton;
import javax.swing.Action;
-
/**
* @author deniger
--- 8,13 ----
***************
*** 17,21 ****
*/
public interface EbliActionInterface extends Action {
-
public AbstractButton buildToolButton(EbliComponentFactory _f);
public AbstractButton buildButton(EbliComponentFactory _f);
--- 15,18 ----
Index: EbliChangeStateAction.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliChangeStateAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliChangeStateAction.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliChangeStateAction.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 9,13 ****
package org.fudaa.ebli.calque.action;
import java.awt.event.ActionEvent;
-
import javax.swing.AbstractButton;
import javax.swing.Icon;
--- 9,12 ----
***************
*** 21,25 ****
super(_name, _ic, _action);
}
-
/**
* Change the selection state and call the method changeSelectedState
--- 20,23 ----
***************
*** 51,55 ****
return _f.buildButton(this);
}
-
/**
*
--- 49,52 ----
***************
*** 58,62 ****
return _f.buildMenuItem(this);
}
-
/**
*
--- 55,58 ----
***************
*** 65,68 ****
return _f.buildToolButton(this);
}
-
}
--- 61,63 ----
Index: EbliComponentFactory.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliComponentFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliComponentFactory.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliComponentFactory.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 39,48 ****
public JMenuItem buildMenuItem(EbliChangeStateAction a) {
BuCheckBoxMenuItem r= new BuCheckBoxMenuItem();
! decoreStateButton(r,a);
return r;
}
public AbstractButton buildButton(EbliChangeStateAction a) {
JToggleButton r= new BuToggleButton();
! decoreStateButton(r,a);
return r;
}
--- 39,48 ----
public JMenuItem buildMenuItem(EbliChangeStateAction a) {
BuCheckBoxMenuItem r= new BuCheckBoxMenuItem();
! decoreStateButton(r, a);
return r;
}
public AbstractButton buildButton(EbliChangeStateAction a) {
JToggleButton r= new BuToggleButton();
! decoreStateButton(r, a);
return r;
}
***************
*** 54,58 ****
public AbstractButton buildToolButton(EbliChangeStateAction a) {
AbstractButton r= new BuToggleButton();
! decoreStateButton(r,a);
decoreToolBarButton(r);
return r;
--- 54,58 ----
public AbstractButton buildToolButton(EbliChangeStateAction a) {
AbstractButton r= new BuToggleButton();
! decoreStateButton(r, a);
decoreToolBarButton(r);
return r;
***************
*** 73,85 ****
_a.addPropertyChangeListener(new EbliSelectedChangeListener(_r));
}
!
! public void addActionsToMenu(EbliActionInterface[] _acs,JMenu _dest){
! if( (_acs!=null) && (_dest!=null)){
! int n=_acs.length;
for (int i= 0; i < n; i++) {
_dest.add(_acs[i].buildMenuItem(this));
}
}
-
}
}
--- 73,83 ----
_a.addPropertyChangeListener(new EbliSelectedChangeListener(_r));
}
! public void addActionsToMenu(EbliActionInterface[] _acs, JMenu _dest) {
! if ((_acs != null) && (_dest != null)) {
! int n= _acs.length;
for (int i= 0; i < n; i++) {
_dest.add(_acs[i].buildMenuItem(this));
}
}
}
}
Index: EbliPaletteAction.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliPaletteAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliPaletteAction.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliPaletteAction.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 17,21 ****
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
-
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
--- 17,20 ----
***************
*** 24,28 ****
import javax.swing.JComponent;
import javax.swing.JInternalFrame;
-
import com.memoire.bu.BuButton;
import com.memoire.bu.BuDesktop;
--- 23,26 ----
***************
*** 33,37 ****
*/
public class EbliPaletteAction
! extends EbliChangeStateAction implements VetoableChangeListener{
private BuPalette window_;
public EbliPaletteAction(
--- 31,36 ----
*/
public class EbliPaletteAction
! extends EbliChangeStateAction
! implements VetoableChangeListener {
private BuPalette window_;
public EbliPaletteAction(
***************
*** 46,53 ****
window_.setContent(_c);
}
!
! public void setMainButtonVisible(boolean _b){
! if(_b && isSelected())
! showWindow();
else
hideWindow();
--- 45,51 ----
window_.setContent(_c);
}
! public void setMainButtonVisible(boolean _b) {
! if (_b && isSelected())
! showWindow();
else
hideWindow();
***************
*** 126,136 ****
public void vetoableChange(PropertyChangeEvent evt)
throws PropertyVetoException {
! if(evt.getPropertyName()==JInternalFrame.IS_SELECTED_PROPERTY){
! if ( (((Boolean)evt.getNewValue()).booleanValue()) && (isSelected()) )
! showWindow();
! else
! hideWindow();
! }
}
!
}
--- 124,133 ----
public void vetoableChange(PropertyChangeEvent evt)
throws PropertyVetoException {
! if (evt.getPropertyName() == JInternalFrame.IS_SELECTED_PROPERTY) {
! if ((((Boolean)evt.getNewValue()).booleanValue()) && (isSelected()))
! showWindow();
! else
! hideWindow();
}
! }
}
Index: EbliPaletteButton.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliPaletteButton.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliPaletteButton.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliPaletteButton.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 8,21 ****
*/
package org.fudaa.ebli.calque.action;
-
import com.memoire.bu.BuDesktop;
import com.memoire.bu.BuToggleButton;
-
/**
* @author deniger
* @version $Id$
*/
! public class EbliPaletteButton extends BuToggleButton{
!
EbliPaletteAction ac_;
/**
--- 8,18 ----
*/
package org.fudaa.ebli.calque.action;
import com.memoire.bu.BuDesktop;
import com.memoire.bu.BuToggleButton;
/**
* @author deniger
* @version $Id$
*/
! public class EbliPaletteButton extends BuToggleButton {
EbliPaletteAction ac_;
/**
***************
*** 23,38 ****
*/
public EbliPaletteButton(EbliPaletteAction _ac) {
! ac_=_ac;
super.setAction(ac_);
}
!
! public final void setVisible(boolean _b){
! if(_b!=isVisible()){
ac_.setMainButtonVisible(_b);
}
super.setVisible(_b);
}
!
! public void setDesktop(BuDesktop _d){
ac_.setDesktop(_d);
}
--- 20,33 ----
*/
public EbliPaletteButton(EbliPaletteAction _ac) {
! ac_= _ac;
super.setAction(ac_);
}
! public final void setVisible(boolean _b) {
! if (_b != isVisible()) {
ac_.setMainButtonVisible(_b);
}
super.setVisible(_b);
}
! public void setDesktop(BuDesktop _d) {
ac_.setDesktop(_d);
}
Index: EbliSimpleAction.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/action/EbliSimpleAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliSimpleAction.java 6 Oct 2003 07:55:28 -0000 1.1
--- EbliSimpleAction.java 25 Nov 2003 10:06:39 -0000 1.2
***************
*** 8,25 ****
*/
package org.fudaa.ebli.calque.action;
-
import javax.swing.AbstractButton;
import javax.swing.Icon;
-
/**
* @author deniger
* @version $Id$
*/
! public abstract class EbliSimpleAction extends EbliAbstractAction{
/**
*
*/
! public EbliSimpleAction(String _name,Icon _ic,String _ac) {
! super(_name,_ic,_ac);
}
/**
--- 8,23 ----
*/
package org.fudaa.ebli.calque.action;
import javax.swing.AbstractButton;
import javax.swing.Icon;
/**
* @author deniger
* @version $Id$
*/
! public abstract class EbliSimpleAction extends EbliAbstractAction {
/**
*
*/
! public EbliSimpleAction(String _name, Icon _ic, String _ac) {
! super(_name, _ic, _ac);
}
/**
***************
*** 29,33 ****
return _f.buildButton(this);
}
-
/**
*
--- 27,30 ----
***************
*** 36,40 ****
return _f.buildMenuItem(this);
}
-
/**
*
--- 33,36 ----
|
|
From: <de...@us...> - 2003-11-25 10:43:13
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/ressource
In directory sc8-pr-cvs1:/tmp/cvs-serv1137/ressource
Modified Files:
EbliResource.java
Log Message:
reformat files
Index: EbliResource.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/ressource/EbliResource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** EbliResource.java 26 Sep 2003 11:14:37 -0000 1.4
--- EbliResource.java 25 Nov 2003 10:06:47 -0000 1.5
***************
*** 7,28 ****
* @mail de...@fu...
*/
-
package org.fudaa.ebli.ressource;
-
import com.memoire.bu.BuResource;
import com.memoire.fu.FuLib;
-
/**
* @version $Id$
* @author Axel von Arnim
*/
! public class EbliResource
! extends BuResource
! {
! public final static EbliResource EBLI=
! new EbliResource(BuResource.BU);
!
! public EbliResource(BuResource _parent) { setParent(_parent); }
!
public String getString(String _s, String _v0) {
String r= getString(_s);
--- 7,22 ----
* @mail de...@fu...
*/
package org.fudaa.ebli.ressource;
import com.memoire.bu.BuResource;
import com.memoire.fu.FuLib;
/**
* @version $Id$
* @author Axel von Arnim
*/
! public class EbliResource extends BuResource {
! public final static EbliResource EBLI= new EbliResource(BuResource.BU);
! public EbliResource(BuResource _parent) {
! setParent(_parent);
! }
public String getString(String _s, String _v0) {
String r= getString(_s);
***************
*** 31,35 ****
return FuLib.replace(r, "{0}", _v0);
}
-
public String getString(String _s, String _v0, String _v1) {
String r= getString(_s);
--- 25,28 ----
***************
*** 39,45 ****
r= FuLib.replace(r, "{1}", _v1);
return r;
-
}
-
/**
* A "shortcut" to get i18n String (FudaaResource.FUDAA.getString)
--- 32,36 ----
***************
*** 48,52 ****
return EBLI.getString(_s);
}
-
/**
* A "shortcut" to get i18n String (FudaaResource.FUDAA.getString)
--- 39,42 ----
***************
*** 55,59 ****
return EBLI.getString(_s, _v0);
}
-
/**
* A "shortcut" to get i18n String (FudaaResource.FUDAA.getString)
--- 45,48 ----
***************
*** 62,67 ****
return EBLI.getString(_s, _v0, _v1);
}
-
-
-
}
--- 51,53 ----
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/curvi
Modified Files:
DCalculCurvi.java DParametresCurvi.java DResultatsCurvi.java
PontCurvi.java ServeurCurvi.java
Log Message:
reformat all files
Index: DCalculCurvi.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi/DCalculCurvi.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DCalculCurvi.java 22 Sep 2003 20:49:33 -0000 1.3
--- DCalculCurvi.java 25 Nov 2003 10:11:25 -0000 1.4
***************
*** 1,180 ****
! /*
! * @file DCalculCurvi.java
! * @creation 1997-12-10
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.curvi;
!
! import org.fudaa.dodico.corba.curvi.ICalculCurviOperations;
! import org.fudaa.dodico.corba.curvi.IParametresCurvi;
! import org.fudaa.dodico.corba.curvi.IResultatsCurvi;
! import org.fudaa.dodico.corba.curvi.IParametresCurviHelper;
! import org.fudaa.dodico.corba.curvi.IResultatsCurviHelper;
! import org.fudaa.dodico.corba.curvi.SParametresCurviINP;
! import org.fudaa.dodico.corba.objet.IConnexion;
!
! import org.fudaa.dodico.calcul.DCalcul;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.objet.CExec;
!
! import java.io.File;
! import java.io.FileReader;
! import java.io.LineNumberReader;
!
! /**
! * Gestion du lancement du code de calcul <code>Curvi</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DCalculCurvi
! extends DCalcul
! implements ICalculCurviOperations
! {
! /**
! * Initialisation des extensions des fichiers (asc, cor, ele, sol, ini, fin
! * , out).
! */
! public DCalculCurvi()
! {
! super();
! setFichiersExtensions(new String[] {
! ".asc",
! ".cor",
! ".ele",
! ".sol",
! ".ini",
! ".fin",
! ".out"
! });
! }
!
! /**
! * Pas implenter completement.
! *
! * @return <code>new DCalculCurvi()</code>.
! */
! public Object clone()
! { return new DCalculCurvi(); }
!
! /**
! * Chaine descriptive de la classe
! *
! * @return <code>"DCalculCurvi()"</code>.
! */
! public String toString()
! { return "DCalculCurvi()"; }
!
! /**
! * Estime le temps necessaire au calcul.
! *
! * @param _c la connexion concernee.
! */
! public int dureeEstimee(IConnexion c)
! {
! int t=0;
! IParametresCurvi params=(IParametresCurvi)parametres(c);
!
! if(params!=null)
! {
! SParametresCurviINP p=params.parametresINP();
! if(p.test==1) t= 3;
! else if(p.test==2) t=12;
! else if(p.test==3) t=11;
! else t=20;
! t*=p.nbMaillesXI*p.nbMaillesETA/10;
! }
!
! return t+5;
! }
!
! /**
! * Description du serveur de calcul <code>Curvi</code>.
! */
! public String description()
! {
! return "Curvi, serveur de calcul pour la houle: "+super.description();
! }
!
! /**
! * Lance le code de calcul Curvi : verifie la non-nullite des interfaces
! * parametres et resultats,lance l'executable et finalement lit les fichiers
! * de resultats pour completer l'interface IResultats.
! *
! * @param _c la connexion utilisee.
! */
! public void calcul(IConnexion _c)
! {
! //verifie la connexion et les interfaces des parametres et des resultats.
! if( !verifieConnexion(_c) ) return;
!
! IParametresCurvi params=IParametresCurviHelper.narrow(parametres(_c));
! if(params==null)
! CDodico.exception_axel(this,new Exception("params non definis (null)"));
! IResultatsCurvi results=IResultatsCurviHelper.narrow(resultats(_c));
! if(results==null)
! CDodico.exception_axel(this,new Exception("results non definis (null)"));
!
! log(_c, "lancement du calcul");
!
! //les parametres neccessaires au lancement du code.
! String os=System.getProperty("os.name");
! String path=cheminServeur();
! String fichier=path+"curvi"+_c.numero();
!
! try {
! DParametresCurvi.ecritParametresCurviINP (fichier,params.parametresINP());
! DParametresCurvi.ecritParametresCurviASC(fichier,params.parametresASC());
! //construction de la commande a lancer
! System.out.println("Appel de l'exécutable curvi pour "+fichier);
! String[] cmd;
! if( os.startsWith("Windows") ) {
! cmd=new String[2];
! cmd[0]=path+"curvi.bat";
! cmd[1]=fichier;
! System.out.println(cmd[0]+" "+cmd[1]);
! } else {
! cmd=new String[2];
! cmd[0]=path+"curvi.sh";
! cmd[1]=fichier;
! System.out.println(cmd[0]+" "+cmd[1]);
! }
!
! //lancement de l'executable
! CExec ex=new CExec();
! ex.setCommand(cmd);
! ex.setOutStream(System.out);
! ex.setErrStream(System.err);
! ex.exec();
! System.out.println("Fin du calcul");
! System.out.println("Résultats de "+fichier+".out");
!
! if(new File(fichier+".out").exists())
! {
! LineNumberReader fr=new LineNumberReader
! (new FileReader(fichier+".out"));
! while(fr.ready())
! {
! String s=fr.readLine();
! if(!s.equals("")) System.out.println(s);
! }
! }
! //lecture des fichiers resultats.
! results.resultatsCurviCOR(DResultatsCurvi.litResultatsCurviCOR(fichier));
! results.resultatsCurviELE(DResultatsCurvi.litResultatsCurviELE(fichier));
!
! int nsol=results.resultatsCurviCOR().nbNoeuds;
! results.resultatsCurviSOL(DResultatsCurvi.litResultatsCurviSOL(fichier,nsol));
!
! log(_c, "calcul terminé");
! }
! catch(Exception ex) {
! log(_c, "erreur du calcul");
! CDodico.exception_axel(this,ex);
! }
! }
! }
--- 1,151 ----
! /*
! * @file DCalculCurvi.java
! * @creation 1997-12-10
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.curvi;
! import org.fudaa.dodico.corba.curvi.ICalculCurviOperations;
! import org.fudaa.dodico.corba.curvi.IParametresCurvi;
! import org.fudaa.dodico.corba.curvi.IResultatsCurvi;
! import org.fudaa.dodico.corba.curvi.IParametresCurviHelper;
! import org.fudaa.dodico.corba.curvi.IResultatsCurviHelper;
! import org.fudaa.dodico.corba.curvi.SParametresCurviINP;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.calcul.DCalcul;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.objet.CExec;
! import java.io.File;
! import java.io.FileReader;
! import java.io.LineNumberReader;
! /**
! * Gestion du lancement du code de calcul <code>Curvi</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DCalculCurvi extends DCalcul implements ICalculCurviOperations {
! /**
! * Initialisation des extensions des fichiers (asc, cor, ele, sol, ini, fin
! * , out).
! */
! public DCalculCurvi() {
! super();
! setFichiersExtensions(
! new String[] { ".asc", ".cor", ".ele", ".sol", ".ini", ".fin", ".out" });
! }
! /**
! * Pas implenter completement.
! *
! * @return <code>new DCalculCurvi()</code>.
! */
! public Object clone() {
! return new DCalculCurvi();
! }
! /**
! * Chaine descriptive de la classe
! *
! * @return <code>"DCalculCurvi()"</code>.
! */
! public String toString() {
! return "DCalculCurvi()";
! }
! /**
! * Estime le temps necessaire au calcul.
! *
! * @param _c la connexion concernee.
! */
! public int dureeEstimee(IConnexion c) {
! int t= 0;
! IParametresCurvi params= (IParametresCurvi)parametres(c);
! if (params != null) {
! SParametresCurviINP p= params.parametresINP();
! if (p.test == 1)
! t= 3;
! else if (p.test == 2)
! t= 12;
! else if (p.test == 3)
! t= 11;
! else
! t= 20;
! t *= p.nbMaillesXI * p.nbMaillesETA / 10;
! }
! return t + 5;
! }
! /**
! * Description du serveur de calcul <code>Curvi</code>.
! */
! public String description() {
! return "Curvi, serveur de calcul pour la houle: " + super.description();
! }
! /**
! * Lance le code de calcul Curvi : verifie la non-nullite des interfaces
! * parametres et resultats,lance l'executable et finalement lit les fichiers
! * de resultats pour completer l'interface IResultats.
! *
! * @param _c la connexion utilisee.
! */
! public void calcul(IConnexion _c) {
! //verifie la connexion et les interfaces des parametres et des resultats.
! if (!verifieConnexion(_c))
! return;
! IParametresCurvi params= IParametresCurviHelper.narrow(parametres(_c));
! if (params == null)
! CDodico.exception_axel(this, new Exception("params non definis (null)"));
! IResultatsCurvi results= IResultatsCurviHelper.narrow(resultats(_c));
! if (results == null)
! CDodico.exception_axel(this, new Exception("results non definis (null)"));
! log(_c, "lancement du calcul");
! //les parametres neccessaires au lancement du code.
! String os= System.getProperty("os.name");
! String path= cheminServeur();
! String fichier= path + "curvi" + _c.numero();
! try {
! DParametresCurvi.ecritParametresCurviINP(fichier, params.parametresINP());
! DParametresCurvi.ecritParametresCurviASC(fichier, params.parametresASC());
! //construction de la commande a lancer
! System.out.println("Appel de l'exécutable curvi pour " + fichier);
! String[] cmd;
! if (os.startsWith("Windows")) {
! cmd= new String[2];
! cmd[0]= path + "curvi.bat";
! cmd[1]= fichier;
! System.out.println(cmd[0] + " " + cmd[1]);
! } else {
! cmd= new String[2];
! cmd[0]= path + "curvi.sh";
! cmd[1]= fichier;
! System.out.println(cmd[0] + " " + cmd[1]);
! }
! //lancement de l'executable
! CExec ex= new CExec();
! ex.setCommand(cmd);
! ex.setOutStream(System.out);
! ex.setErrStream(System.err);
! ex.exec();
! System.out.println("Fin du calcul");
! System.out.println("Résultats de " + fichier + ".out");
! if (new File(fichier + ".out").exists()) {
! LineNumberReader fr=
! new LineNumberReader(new FileReader(fichier + ".out"));
! while (fr.ready()) {
! String s= fr.readLine();
! if (!s.equals(""))
! System.out.println(s);
! }
! }
! //lecture des fichiers resultats.
! results.resultatsCurviCOR(DResultatsCurvi.litResultatsCurviCOR(fichier));
! results.resultatsCurviELE(DResultatsCurvi.litResultatsCurviELE(fichier));
! int nsol= results.resultatsCurviCOR().nbNoeuds;
! results.resultatsCurviSOL(
! DResultatsCurvi.litResultatsCurviSOL(fichier, nsol));
! log(_c, "calcul terminé");
! } catch (Exception ex) {
! log(_c, "erreur du calcul");
! CDodico.exception_axel(this, ex);
! }
! }
! }
Index: DParametresCurvi.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi/DParametresCurvi.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DParametresCurvi.java 22 Sep 2003 20:49:33 -0000 1.3
--- DParametresCurvi.java 25 Nov 2003 10:11:25 -0000 1.4
***************
*** 1,225 ****
! /*
! * @file DParametresCurvi.java
! * @creation 1998-03-31
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.curvi;
!
! import org.fudaa.dodico.corba.curvi.IParametresCurviOperations;
! import org.fudaa.dodico.corba.curvi.SParametresCurviASC;
! import org.fudaa.dodico.corba.curvi.SParametresCurviINP;
!
! import org.fudaa.dodico.calcul.DParametres;
! import org.fudaa.dodico.fortran.FortranWriter;
! import org.fudaa.dodico.objet.CDodico;
!
! import java.io.FileWriter;
!
! /**
! * Les parametres du code Curvi.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DParametresCurvi
! extends DParametres
! implements IParametresCurviOperations
! {
! /**
! * Les parametres INP (voir le fichier curvi.idl).
! */
! private SParametresCurviINP paramsINP =null;
!
! /**
! * Les parametres ASC (voir le fichier curvi.idl).
! */
! private SParametresCurviASC paramsASC =null;
!
! /**
! * Constructeur par defaut
! */
! public DParametresCurvi()
! { super(); }
!
!
! /**
! * Pas implanter completement.
! *
! * @return <code>new DParametresCurvi()</code>.
! */
! public Object clone()
! { return new DParametresCurvi(); }
!
! /**
! * Description de la classe.
! *
! * @return <code>"DParametresCurvi()"</code>.
! */
! public String toString()
! { return "DParametresCurvi()"; }
!
! // INP
!
! /**
! * Renvoie les parametres INP utilises.(voir le fichier curvi.idl).
! */
! public SParametresCurviINP parametresINP()
! { return paramsINP; }
!
! /**
! * Modifications des parametres INP.
! */
! public void parametresINP(SParametresCurviINP _p)
! { paramsINP=_p; }
!
! /**
! * Ecrit les parametres INP dans le fichier <code>_fichier.inp</code>
! * dans le "format" Fortran.
! *
! * @param _fichier le nom du fichier destinaire (sans extension).
! * @param _parametres les parametres ecrits dans le fichier.
! * @see org.fudaa.dodico.fortran.FortranWriter
! */
! public static void ecritParametresCurviINP
! (String _fichier, SParametresCurviINP _parametres)
! {
! System.out.println("Ecriture de "+_fichier+".inp");
!
! try
! {
! FortranWriter finp=new FortranWriter (new FileWriter(_fichier+".inp"));
!
! // System.err.println("FINP="+finp);
! int[] fmt;
!
! fmt=new int[] { 12 };
!
! finp.stringField(0,_fichier+".asc");
! finp.writeFields(fmt);
! finp.stringField(0,"");
! finp.writeFields(fmt);
! finp.stringField(0,"");
! finp.writeFields(fmt);
! finp.stringField(0,_fichier+".cor");
! finp.writeFields(fmt);
! finp.stringField(0,_fichier+".ele");
! finp.writeFields(fmt);
! finp.stringField(0,_fichier+".sol");
! finp.writeFields(fmt);
! finp.stringField(0,"");
! finp.writeFields(fmt);
! finp.stringField(0,"");
! finp.writeFields(fmt);
! finp.stringField(0,_fichier+".ini");
! finp.writeFields(fmt);
! finp.stringField(0,_fichier+".fin");
! finp.writeFields(fmt);
!
! fmt=new int[] { 10 };
!
! finp.intField (0,1 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.periodeHoule );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.hauteurHoule );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.hauteurMer );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.incidenceHoule);
! finp.writeFields(fmt);
! finp.intField (0,_parametres.nbMaillesXI );
! finp.writeFields(fmt);
! finp.intField (0,_parametres.nbMaillesETA );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.xd1 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.yd1 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.xd2 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.yd2 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.xd3 );
! finp.writeFields(fmt);
! finp.doubleField(0,_parametres.yd3 );
! finp.writeFields(fmt);
! finp.intField(0,_parametres.lissage );
! finp.writeFields(fmt);
! finp.intField (0,_parametres.test );
! finp.writeFields(fmt);
! finp.intField (0,_parametres.repriseVag );
! finp.writeFields(fmt);
!
! finp.flush();
! finp.close();
! }
! catch(Exception ex) { CDodico.exception(DParametresCurvi.class,ex); }
! }
!
!
! //ASC
!
! /**
! * Renvoie les parametres ASC utilises.(voir le fichier curvi.idl).
! */
! public SParametresCurviASC parametresASC()
! { return paramsASC; }
!
! /**
! * Modification des parametres ASC
! */
! public void parametresASC(SParametresCurviASC _p)
! { paramsASC=_p; }
!
! /**
! * Ecrit les parametres <code>_parametres</code> dans le fichier de
! * destination <code>_fichier.asc</code> dans le "format" Fortran.
! *
! * @param _fichier le nom du fichier de destination sans extension.
! * @param _parametres les parametres a ecrire.
! */
! public static void ecritParametresCurviASC
! (String _fichier, SParametresCurviASC _parametres)
! {
!
! if(_parametres==null)
! {
! System.out.println("Paramètres ASC internes à Curvi");
! return;
! }
!
! System.out.println("Ecriture de "+_fichier+".asc");
!
! try
! {
! FortranWriter fasc=new FortranWriter(new FileWriter(_fichier+".asc"));
!
! int[] fmt;
!
! fmt=new int[] { 5 };
!
! fasc.intField(0,_parametres.nbMaillesXI );
! fasc.writeFields(fmt);
! fasc.intField(0,_parametres.nbMaillesETA);
! fasc.writeFields(fmt);
!
! fmt=new int[] { 12,12,12 };
!
! for(int i=0;i<_parametres.lignes.length; i++)
! {
! fasc.doubleField(0,_parametres.lignes[i].x);
! fasc.doubleField(1,_parametres.lignes[i].y);
! fasc.doubleField(2,_parametres.lignes[i].z);
! fasc.writeFields(fmt);
! }
!
! fasc.flush();
! fasc.close();
! }
! catch(Exception ex) { CDodico.exception(DParametresCurvi.class,ex); }
! }
! }
--- 1,194 ----
! /*
! * @file DParametresCurvi.java
! * @creation 1998-03-31
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.curvi;
! import org.fudaa.dodico.corba.curvi.IParametresCurviOperations;
! import org.fudaa.dodico.corba.curvi.SParametresCurviASC;
! import org.fudaa.dodico.corba.curvi.SParametresCurviINP;
! import org.fudaa.dodico.calcul.DParametres;
! import org.fudaa.dodico.fortran.FortranWriter;
! import org.fudaa.dodico.objet.CDodico;
! import java.io.FileWriter;
! /**
! * Les parametres du code Curvi.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DParametresCurvi
! extends DParametres
! implements IParametresCurviOperations {
! /**
! * Les parametres INP (voir le fichier curvi.idl).
! */
! private SParametresCurviINP paramsINP= null;
! /**
! * Les parametres ASC (voir le fichier curvi.idl).
! */
! private SParametresCurviASC paramsASC= null;
! /**
! * Constructeur par defaut
! */
! public DParametresCurvi() {
! super();
! }
! /**
! * Pas implanter completement.
! *
! * @return <code>new DParametresCurvi()</code>.
! */
! public Object clone() {
! return new DParametresCurvi();
! }
! /**
! * Description de la classe.
! *
! * @return <code>"DParametresCurvi()"</code>.
! */
! public String toString() {
! return "DParametresCurvi()";
! }
! // INP
! /**
! * Renvoie les parametres INP utilises.(voir le fichier curvi.idl).
! */
! public SParametresCurviINP parametresINP() {
! return paramsINP;
! }
! /**
! * Modifications des parametres INP.
! */
! public void parametresINP(SParametresCurviINP _p) {
! paramsINP= _p;
! }
! /**
! * Ecrit les parametres INP dans le fichier <code>_fichier.inp</code>
! * dans le "format" Fortran.
! *
! * @param _fichier le nom du fichier destinaire (sans extension).
! * @param _parametres les parametres ecrits dans le fichier.
! * @see org.fudaa.dodico.fortran.FortranWriter
! */
! public static void ecritParametresCurviINP(
! String _fichier,
! SParametresCurviINP _parametres) {
! System.out.println("Ecriture de " + _fichier + ".inp");
! try {
! FortranWriter finp= new FortranWriter(new FileWriter(_fichier + ".inp"));
! // System.err.println("FINP="+finp);
! int[] fmt;
! fmt= new int[] { 12 };
! finp.stringField(0, _fichier + ".asc");
! finp.writeFields(fmt);
! finp.stringField(0, "");
! finp.writeFields(fmt);
! finp.stringField(0, "");
! finp.writeFields(fmt);
! finp.stringField(0, _fichier + ".cor");
! finp.writeFields(fmt);
! finp.stringField(0, _fichier + ".ele");
! finp.writeFields(fmt);
! finp.stringField(0, _fichier + ".sol");
! finp.writeFields(fmt);
! finp.stringField(0, "");
! finp.writeFields(fmt);
! finp.stringField(0, "");
! finp.writeFields(fmt);
! finp.stringField(0, _fichier + ".ini");
! finp.writeFields(fmt);
! finp.stringField(0, _fichier + ".fin");
! finp.writeFields(fmt);
! fmt= new int[] { 10 };
! finp.intField(0, 1);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.periodeHoule);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.hauteurHoule);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.hauteurMer);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.incidenceHoule);
! finp.writeFields(fmt);
! finp.intField(0, _parametres.nbMaillesXI);
! finp.writeFields(fmt);
! finp.intField(0, _parametres.nbMaillesETA);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.xd1);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.yd1);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.xd2);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.yd2);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.xd3);
! finp.writeFields(fmt);
! finp.doubleField(0, _parametres.yd3);
! finp.writeFields(fmt);
! finp.intField(0, _parametres.lissage);
! finp.writeFields(fmt);
! finp.intField(0, _parametres.test);
! finp.writeFields(fmt);
! finp.intField(0, _parametres.repriseVag);
! finp.writeFields(fmt);
! finp.flush();
! finp.close();
! } catch (Exception ex) {
! CDodico.exception(DParametresCurvi.class, ex);
! }
! }
! //ASC
! /**
! * Renvoie les parametres ASC utilises.(voir le fichier curvi.idl).
! */
! public SParametresCurviASC parametresASC() {
! return paramsASC;
! }
! /**
! * Modification des parametres ASC
! */
! public void parametresASC(SParametresCurviASC _p) {
! paramsASC= _p;
! }
! /**
! * Ecrit les parametres <code>_parametres</code> dans le fichier de
! * destination <code>_fichier.asc</code> dans le "format" Fortran.
! *
! * @param _fichier le nom du fichier de destination sans extension.
! * @param _parametres les parametres a ecrire.
! */
! public static void ecritParametresCurviASC(
! String _fichier,
! SParametresCurviASC _parametres) {
! if (_parametres == null) {
! System.out.println("Paramètres ASC internes à Curvi");
! return;
! }
! System.out.println("Ecriture de " + _fichier + ".asc");
! try {
! FortranWriter fasc= new FortranWriter(new FileWriter(_fichier + ".asc"));
! int[] fmt;
! fmt= new int[] { 5 };
! fasc.intField(0, _parametres.nbMaillesXI);
! fasc.writeFields(fmt);
! fasc.intField(0, _parametres.nbMaillesETA);
! fasc.writeFields(fmt);
! fmt= new int[] { 12, 12, 12 };
! for (int i= 0; i < _parametres.lignes.length; i++) {
! fasc.doubleField(0, _parametres.lignes[i].x);
! fasc.doubleField(1, _parametres.lignes[i].y);
! fasc.doubleField(2, _parametres.lignes[i].z);
! fasc.writeFields(fmt);
! }
! fasc.flush();
! fasc.close();
! } catch (Exception ex) {
! CDodico.exception(DParametresCurvi.class, ex);
! }
! }
! }
Index: DResultatsCurvi.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi/DResultatsCurvi.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DResultatsCurvi.java 22 Sep 2003 20:49:33 -0000 1.3
--- DResultatsCurvi.java 25 Nov 2003 10:11:25 -0000 1.4
***************
*** 1,527 ****
! /*
! * @file DResultatsCurvi.java
! * @creation 1998-03-31
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.curvi;
[...961 lines suppressed...]
! carteHauteur_=carte(LGrandeur.HAUTEUR_HOULE,1);
! return carteHauteur_;
! }
!
! public ICarteReel cartePhase()
! {
! if(cartePhase_==null)
! cartePhase_=carte(LGrandeur.PHASE,0);
! return cartePhase_;
! }
!
! public ICarteReel carteDeferlement(double _critere)
! {
! if(carteDeferlement_==null)
! carteDeferlement_=construitCarteDeferlement
! (maillage(),carteHauteur(),carteBathymetrie(),_critere);
! return carteDeferlement_;
! }
! */
! }
Index: PontCurvi.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi/PontCurvi.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PontCurvi.java 22 Sep 2003 20:49:33 -0000 1.3
--- PontCurvi.java 25 Nov 2003 10:11:25 -0000 1.4
***************
*** 1,179 ****
! /*
! * @file PontCurvi.java
! * @creation 2000-12-05
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.curvi;
!
!
! import org.fudaa.dodico.corba.calcul.IResultats;
! import org.fudaa.dodico.corba.calcul.IParametres;
! import org.fudaa.dodico.corba.curvi.ICalculCurvi;
! import org.fudaa.dodico.corba.curvi.ICalculCurviHelper;
! import org.fudaa.dodico.corba.curvi.ICalculCurviOperations;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.objet.IObjet;
! import org.fudaa.dodico.corba.objet.IPersonne;
!
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.calcul.DCalcul;
!
! import java.util.Date;
!
! /**
! * Un pont vers CalculCurvi. Une instance de ICalculCurvi est referencee en
! * interne et une partie des operations sont deleguees a cet objet.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class PontCurvi
! extends DCalcul
! implements ICalculCurviOperations
! {
! /**
! * Le calcul <code>Curvi</code> vers lequel le "pont" est effectue.
! */
! ICalculCurvi curvi_;
!
! /**
! * Constructeur qui recherche un serveur Curvi (<code>ICalculCurvi</code>).
! */
! public PontCurvi()
! {
! super();
! /*
! curvi_=ICalculCurviHelper.narrow
! (CDodico.findServerByInterface("::curvi::ICalculCurvi"));
! */
! curvi_=ICalculCurviHelper.narrow
! (CDodico.findServerByName("ICalculCurvi-xeena-78711030"));
! System.err.println("server: "+curvi_);
! }
!
!
! /**
! * Pas implanter completement.
! *
! * @return <code>new PontCurvi()</code>
! */
! public Object clone()
! { return new PontCurvi(); }
!
! /**
! * Description de l'objet.
! *
! * @return "PontCurvi()".
! */
! public String toString()
! { return "PontCurvi()"; }
!
! // IObjet
!
! /**
! * Appelle "l'initialisateur" du ICalculCurvi (soit DCalculCurvi) interne.
! *
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! public void initialise(IObjet _o)
! { curvi_.initialise(_o); }
!
! /**
! * Methode deleguee au ICalculCurvi interne.
! *
! * @return moduleCorba de ICalculCurvi.
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! final public String moduleCorba()
! { return curvi_.moduleCorba(); }
!
! /**
! * Les interfaces corba du ICalculCurvi interne.
! *
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! final public String[] interfacesCorba()
! { return curvi_.interfacesCorba(); }
!
! // ICalcul
!
! /**
! * Instant en secondes correspondant a la creation du ICalculCurvi interne.
! */
! public int creation()
! { return curvi_.creation(); }
!
! /**
! * Instant en secondes correspondant a la derniere utilisation du ICalculCurvi
! * interne.
! */
! public int derniereUtilisation()
! { return curvi_.derniereUtilisation(); }
!
! /**
! * Responsable du ICalculCurvi.
! */
! public IPersonne responsable()
! { return curvi_.responsable(); }
!
! /**
! * Duree estimee du calcul.
! */
! public int dureeEstimee(IConnexion c)
! { return curvi_.dureeEstimee(c); }
!
! /**
! * Description du pont vers le ICalculCurvi.
! */
! public String description()
! {
! return "Curvi, pont: "+super.description();
! }
!
! // Curvi
!
! /**
! * Les IParametres du ICalculCurvi.
! */
! public IParametres parametres(IConnexion c)
! { return curvi_.parametres(c); }
!
! /**
! * Les IResultats du ICalculCurvi.
! */
! public IResultats resultats(IConnexion c)
! { return curvi_.resultats(c); }
!
! /**
! * Lancement du calcul.
! *
! */
! public void calcul(IConnexion c)
! { curvi_.calcul(c); }
!
! /**
! * Creation et connexion a l'orb d'une instance de <code>DPontCurvi</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args)
! {
! String nom=(args.length>0
! ? args[0]
! : CDodico.generateName("::curvi::PontCurvi"));
!
! PontCurvi s=new PontCurvi();
! CDodico.rebind(nom, s.tie());
!
! System.out.println("Curvi bridge running... ");
! System.out.println("Name: "+nom);
! System.out.println("Date: "+new Date());
! }
! }
--- 1,158 ----
! /*
! * @file PontCurvi.java
! * @creation 2000-12-05
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.curvi;
! import org.fudaa.dodico.corba.calcul.IResultats;
! import org.fudaa.dodico.corba.calcul.IParametres;
! import org.fudaa.dodico.corba.curvi.ICalculCurvi;
! import org.fudaa.dodico.corba.curvi.ICalculCurviHelper;
! import org.fudaa.dodico.corba.curvi.ICalculCurviOperations;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.objet.IObjet;
! import org.fudaa.dodico.corba.objet.IPersonne;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.calcul.DCalcul;
! import java.util.Date;
! /**
! * Un pont vers CalculCurvi. Une instance de ICalculCurvi est referencee en
! * interne et une partie des operations sont deleguees a cet objet.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class PontCurvi extends DCalcul implements ICalculCurviOperations {
! /**
! * Le calcul <code>Curvi</code> vers lequel le "pont" est effectue.
! */
! ICalculCurvi curvi_;
! /**
! * Constructeur qui recherche un serveur Curvi (<code>ICalculCurvi</code>).
! */
! public PontCurvi() {
! super();
! /*
! curvi_=ICalculCurviHelper.narrow
! (CDodico.findServerByInterface("::curvi::ICalculCurvi"));
! */
! curvi_=
! ICalculCurviHelper.narrow(
! CDodico.findServerByName("ICalculCurvi-xeena-78711030"));
! System.err.println("server: " + curvi_);
! }
! /**
! * Pas implanter completement.
! *
! * @return <code>new PontCurvi()</code>
! */
! public Object clone() {
! return new PontCurvi();
! }
! /**
! * Description de l'objet.
! *
! * @return "PontCurvi()".
! */
! public String toString() {
! return "PontCurvi()";
! }
! // IObjet
! /**
! * Appelle "l'initialisateur" du ICalculCurvi (soit DCalculCurvi) interne.
! *
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! public void initialise(IObjet _o) {
! curvi_.initialise(_o);
! }
! /**
! * Methode deleguee au ICalculCurvi interne.
! *
! * @return moduleCorba de ICalculCurvi.
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! final public String moduleCorba() {
! return curvi_.moduleCorba();
! }
! /**
! * Les interfaces corba du ICalculCurvi interne.
! *
! * @see org.fudaa.dodico.curvi.DCalculCurvi
! */
! final public String[] interfacesCorba() {
! return curvi_.interfacesCorba();
! }
! // ICalcul
! /**
! * Instant en secondes correspondant a la creation du ICalculCurvi interne.
! */
! public int creation() {
! return curvi_.creation();
! }
! /**
! * Instant en secondes correspondant a la derniere utilisation du ICalculCurvi
! * interne.
! */
! public int derniereUtilisation() {
! return curvi_.derniereUtilisation();
! }
! /**
! * Responsable du ICalculCurvi.
! */
! public IPersonne responsable() {
! return curvi_.responsable();
! }
! /**
! * Duree estimee du calcul.
! */
! public int dureeEstimee(IConnexion c) {
! return curvi_.dureeEstimee(c);
! }
! /**
! * Description du pont vers le ICalculCurvi.
! */
! public String description() {
! return "Curvi, pont: " + super.description();
! }
! // Curvi
! /**
! * Les IParametres du ICalculCurvi.
! */
! public IParametres parametres(IConnexion c) {
! return curvi_.parametres(c);
! }
! /**
! * Les IResultats du ICalculCurvi.
! */
! public IResultats resultats(IConnexion c) {
! return curvi_.resultats(c);
! }
! /**
! * Lancement du calcul.
! *
! */
! public void calcul(IConnexion c) {
! curvi_.calcul(c);
! }
! /**
! * Creation et connexion a l'orb d'une instance de <code>DPontCurvi</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args) {
! String nom=
! (args.length > 0 ? args[0] : CDodico.generateName("::curvi::PontCurvi"));
! PontCurvi s= new PontCurvi();
! CDodico.rebind(nom, s.tie());
! System.out.println("Curvi bridge running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
Index: ServeurCurvi.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/curvi/ServeurCurvi.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ServeurCurvi.java 22 Sep 2003 20:49:33 -0000 1.3
--- ServeurCurvi.java 25 Nov 2003 10:11:26 -0000 1.4
***************
*** 1,47 ****
! /*
! * @file ServeurCurvi.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.curvi;
!
! import java.net.*;
! import java.util.*;
! import org.fudaa.dodico.corba.objet.*;
! import org.fudaa.dodico.objet.*;
! import org.fudaa.dodico.corba.curvi.*;
!
! /**
! * Lance le serveur du code de calcul <code>curvi</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurCurvi
! {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculCurvi</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args)
! {
! String nom=(args.length>0
! ? args[0]
! : CDodico.generateName("::curvi::ICalculCurvi"));
!
! DCalculCurvi s=new DCalculCurvi();
! CDodico.rebind(nom, s.tie());
!
! System.out.println("Curvi server running... ");
! System.out.println("Name: "+nom);
! System.out.println("Date: "+new Date());
! }
! }
--- 1,41 ----
! /*
! * @file ServeurCurvi.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.curvi;
! import java.net.*;
! import java.util.*;
! import org.fudaa.dodico.corba.objet.*;
! import org.fudaa.dodico.objet.*;
! import org.fudaa.dodico.corba.curvi.*;
! /**
! * Lance le serveur du code de calcul <code>curvi</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurCurvi {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculCurvi</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args) {
! String nom=
! (args.length > 0
! ? args[0]
! : CDodico.generateName("::curvi::ICalculCurvi"));
! DCalculCurvi s= new DCalculCurvi();
! CDodico.rebind(nom, s.tie());
! System.out.println("Curvi server running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/diapre
Modified Files:
ClientDiapre.java DCalculDiapre.java DParametresDiapre.java
DResultatsDiapre.java ServeurDiapre.java
Log Message:
reformat all files
Index: ClientDiapre.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre/ClientDiapre.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ClientDiapre.java 22 Sep 2003 20:49:58 -0000 1.4
--- ClientDiapre.java 25 Nov 2003 10:11:26 -0000 1.5
***************
*** 1,75 ****
! /*
! * @file TestDiapre.java
! * @creation 2001-12-06
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.diapre;
!
!
! import java.io.File;
!
! import org.fudaa.dodico.corba.diapre.ICalculDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapreHelper;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.objet.IOrganisme;
! import org.fudaa.dodico.corba.objet.IPersonne;
! import org.fudaa.dodico.corba.usine.IUsine;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.usine.UsineHelper;
!
! /**
! * Une encapsulation du programme Diapre ecrit en Fortran.
! *
! * @version $Id$
! * @author Fred Deniger
! */
! public class ClientDiapre
! {
! public static void main( String[] args)
! {
! if(args.length!=2)
! {
! System.out.println("ClientDiapre <serveur> <fichier_entree>");
! System.exit(1);
! }
! System.out.println("serveur "+args[0]);
! System.setProperty("FUDAA_SERVEUR",args[0]);
! File entree=new File(args[1]+".dat");
! if( !entree.exists() )
! {
! System.out.println(entree.getAbsolutePath()+" non trouvé");
! System.exit(1);
! }
! System.out.println("création du serveur");
! //Creation de l'usine de base
! IUsine usine=UsineHelper.creeUsineLocale();
! //Creation d'une personne (et son organisme)
! IPersonne p=usine.creeObjetPersonne();
! IOrganisme o=usine.creeObjetOrganisme();
! o.intitule("sans");
! p.organisme(o);
! p.nom("test");
! //Creation du serveur de calcul et connexion de la personne
! ICalculDiapre calcul=usine.creeDiapreCalculDiapre();
! IConnexion connexion=calcul.connexion(p);
! IParametresDiapre params=IParametresDiapreHelper.narrow(calcul.parametres(connexion));
! System.out.println("lecture des parametres");
! try
! {
! params.parametresDiapre(DParametresDiapre.litParametresDiapre(args[1]));
! System.out.println("lancement calcul");
! calcul.calcul(connexion);
! System.out.println("calcul termine");
! }
! catch(Exception e)
! {
! System.out.println(e);
! }
!
! }
! }
--- 1,63 ----
! /*
! * @file TestDiapre.java
! * @creation 2001-12-06
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.diapre;
! import java.io.File;
! import org.fudaa.dodico.corba.diapre.ICalculDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapreHelper;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.objet.IOrganisme;
! import org.fudaa.dodico.corba.objet.IPersonne;
! import org.fudaa.dodico.corba.usine.IUsine;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.usine.UsineHelper;
! /**
! * Une encapsulation du programme Diapre ecrit en Fortran.
! *
! * @version $Id$
! * @author Fred Deniger
! */
! public class ClientDiapre {
! public static void main(String[] args) {
! if (args.length != 2) {
! System.out.println("ClientDiapre <serveur> <fichier_entree>");
! System.exit(1);
! }
! System.out.println("serveur " + args[0]);
! System.setProperty("FUDAA_SERVEUR", args[0]);
! File entree= new File(args[1] + ".dat");
! if (!entree.exists()) {
! System.out.println(entree.getAbsolutePath() + " non trouvé");
! System.exit(1);
! }
! System.out.println("création du serveur");
! //Creation de l'usine de base
! IUsine usine= UsineHelper.creeUsineLocale();
! //Creation d'une personne (et son organisme)
! IPersonne p= usine.creeObjetPersonne();
! IOrganisme o= usine.creeObjetOrganisme();
! o.intitule("sans");
! p.organisme(o);
! p.nom("test");
! //Creation du serveur de calcul et connexion de la personne
! ICalculDiapre calcul= usine.creeDiapreCalculDiapre();
! IConnexion connexion= calcul.connexion(p);
! IParametresDiapre params=
! IParametresDiapreHelper.narrow(calcul.parametres(connexion));
! System.out.println("lecture des parametres");
! try {
! params.parametresDiapre(DParametresDiapre.litParametresDiapre(args[1]));
! System.out.println("lancement calcul");
! calcul.calcul(connexion);
! System.out.println("calcul termine");
! } catch (Exception e) {
! System.out.println(e);
! }
! }
! }
Index: DCalculDiapre.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre/DCalculDiapre.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DCalculDiapre.java 22 Sep 2003 20:49:58 -0000 1.3
--- DCalculDiapre.java 25 Nov 2003 10:11:26 -0000 1.4
***************
*** 1,155 ****
! /*
! * @file DCalculDiapre.java
! * @creation 2000-09-22
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.diapre;
!
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.diapre.IParametresDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapreHelper;
! import org.fudaa.dodico.corba.diapre.IResultatsDiapre;
! import org.fudaa.dodico.corba.diapre.IResultatsDiapreHelper;
! import org.fudaa.dodico.corba.diapre.ICalculDiapreOperations;
!
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.objet.CExec;
! import org.fudaa.dodico.calcul.DCalcul;
!
! /**
! * Une encapsulation du programme Diapre ecrit en Fortran.
! *
! * @version $Id$
! * @author Fouzia Elouafi , Jean de Malafosse
! */
! public class DCalculDiapre
! extends DCalcul
! implements ICalculDiapreOperations
! {
! /**
! * Initialisation des extensions de fichier utilisees:".dia, .dat, .d" .
! */
! public DCalculDiapre()
! {
! super();
! setFichiersExtensions(new String[]{
! ".dia",
! ".dat",
! ".d"
! });
! }
!
!
! /**
! * Pas implanter completement.
! *
! * @return <code>new DCalculDiapre()</code>.
! */
! public Object clone()
! {
! return new DCalculDiapre();
! }
!
!
! /**
! * Chaine descriptive de l'objet.
! *
! * @return "DCalculDiapre()"
! */
! public String toString()
! {
! return "DCalculDiapre()";
! }
!
!
! /**
! * Chaine descriptive du serveur de calcul Diapre.
! */
! public String description()
! {
! return "Diapre, serveur de calcul " + super.description();
! }
!
!
! /**
! * Lance le code de calcul apres verification de l'existence des interfaces
! * parametres et resultats. A la fin, les resultats sont lus et stockes dans
! * l'interface IResultats.
! *
! * @param _c connexion concernee par le calcul.
! */
! public void calcul(IConnexion c)
! {
! if(!verifieConnexion(c))
! {
! return;
! }
!
! IParametresDiapre params =IParametresDiapreHelper.narrow(parametres(c));
! if(params == null)
! {
! CDodico.exception_axel(this, new Exception("params non definis (null)"));
! return ;
! }
! IResultatsDiapre results = IResultatsDiapreHelper.narrow(resultats(c));
! if(results == null)
! {
! CDodico.exception_axel(this, new Exception("results non definis (null)"));
! return ;
! }
!
! log(c, "lancement du calcul");
!
! String os = System.getProperty("os.name");
! //String drive;
! String path = cheminServeur();
! String fichier ="diapre" + c.numero();
! //A FAIRE EN DERNIER
! try
! {
! String nomexec;
!
! if(os.startsWith("Win"))
! {
! nomexec = "diapre.bat";
! }
! else
! {
! nomexec = "diapre.sh";
! }
!
! String[] param=new String[3];
! param[0] =path + nomexec;
! //fichier de description des parametres
! param[1] = path;
! param[2] = fichier;
! //ecriture fichier
! DParametresDiapre.ecritParametresDiapre(params.parametresDiapre(),path+fichier);
!
! //lancement calcul
! CExec ex = new CExec(param);
! //redirection de la sortie
! //exec.setOutStream(System.out);
! System.out.println("--Debut du calcul--");
!
! //Lancement de l'execution
! ex.exec();
! //recuperation des resultats.
! System.out.println("--Fin du calcul--");
! results.resultatsDiapre(DResultatsDiapre.litResultatsDiapre(
! params.parametresDiapre(),path+fichier));
! System.out.println("--Fin du calcul--");
! log(c, "calcul terminé");
! }
! catch(Exception ex)
! {
! log(c, "erreur du calcul");
! CDodico.exception_axel(this, ex);
! }
! }
! }
!
--- 1,118 ----
! /*
! * @file DCalculDiapre.java
! * @creation 2000-09-22
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.diapre;
! import org.fudaa.dodico.corba.objet.IConnexion;
! import org.fudaa.dodico.corba.diapre.IParametresDiapre;
! import org.fudaa.dodico.corba.diapre.IParametresDiapreHelper;
! import org.fudaa.dodico.corba.diapre.IResultatsDiapre;
! import org.fudaa.dodico.corba.diapre.IResultatsDiapreHelper;
! import org.fudaa.dodico.corba.diapre.ICalculDiapreOperations;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.objet.CExec;
! import org.fudaa.dodico.calcul.DCalcul;
! /**
! * Une encapsulation du programme Diapre ecrit en Fortran.
! *
! * @version $Id$
! * @author Fouzia Elouafi , Jean de Malafosse
! */
! public class DCalculDiapre extends DCalcul implements ICalculDiapreOperations {
! /**
! * Initialisation des extensions de fichier utilisees:".dia, .dat, .d" .
! */
! public DCalculDiapre() {
! super();
! setFichiersExtensions(new String[] { ".dia", ".dat", ".d" });
! }
! /**
! * Pas implanter completement.
! *
! * @return <code>new DCalculDiapre()</code>.
! */
! public Object clone() {
! return new DCalculDiapre();
! }
! /**
! * Chaine descriptive de l'objet.
! *
! * @return "DCalculDiapre()"
! */
! public String toString() {
! return "DCalculDiapre()";
! }
! /**
! * Chaine descriptive du serveur de calcul Diapre.
! */
! public String description() {
! return "Diapre, serveur de calcul " + super.description();
! }
! /**
! * Lance le code de calcul apres verification de l'existence des interfaces
! * parametres et resultats. A la fin, les resultats sont lus et stockes dans
! * l'interface IResultats.
! *
! * @param _c connexion concernee par le calcul.
! */
! public void calcul(IConnexion c) {
! if (!verifieConnexion(c)) {
! return;
! }
! IParametresDiapre params= IParametresDiapreHelper.narrow(parametres(c));
! if (params == null) {
! CDodico.exception_axel(this, new Exception("params non definis (null)"));
! return;
! }
! IResultatsDiapre results= IResultatsDiapreHelper.narrow(resultats(c));
! if (results == null) {
! CDodico.exception_axel(this, new Exception("results non definis (null)"));
! return;
! }
! log(c, "lancement du calcul");
! String os= System.getProperty("os.name");
! //String drive;
! String path= cheminServeur();
! String fichier= "diapre" + c.numero();
! //A FAIRE EN DERNIER
! try {
! String nomexec;
! if (os.startsWith("Win")) {
! nomexec= "diapre.bat";
! } else {
! nomexec= "diapre.sh";
! }
! String[] param= new String[3];
! param[0]= path + nomexec;
! //fichier de description des parametres
! param[1]= path;
! param[2]= fichier;
! //ecriture fichier
! DParametresDiapre.ecritParametresDiapre(
! params.parametresDiapre(),
! path + fichier);
! //lancement calcul
! CExec ex= new CExec(param);
! //redirection de la sortie
! //exec.setOutStream(System.out);
! System.out.println("--Debut du calcul--");
! //Lancement de l'execution
! ex.exec();
! //recuperation des resultats.
! System.out.println("--Fin du calcul--");
! results.resultatsDiapre(
! DResultatsDiapre.litResultatsDiapre(
! params.parametresDiapre(),
! path + fichier));
! System.out.println("--Fin du calcul--");
! log(c, "calcul terminé");
! } catch (Exception ex) {
! log(c, "erreur du calcul");
! CDodico.exception_axel(this, ex);
! }
! }
! }
Index: DParametresDiapre.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre/DParametresDiapre.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DParametresDiapre.java 22 Sep 2003 20:49:58 -0000 1.3
--- DParametresDiapre.java 25 Nov 2003 10:11:26 -0000 1.4
***************
*** 1,562 ****
! /*
! * @file DParametresDiapre.java
! * @creation 2000-09-21
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.diapre;
[...1088 lines suppressed...]
! f01.readFields(fmtI);
! params.surchargesProjet.surchargesTrapezoidales[i].forceVerticaleFin=
! f01.doubleField(0);
! f01.readFields(fmtI);
! params.surchargesProjet.surchargesTrapezoidales[i].forceHorizontaleFin=
! f01.doubleField(0);
! }
! //options
! f01.readFields(fmtI);
! params.options.nombreSegmentsEcran= f01.intField(0);
! f01.readFields(fmtI);
! params.options.largeurSegmentDebut= f01.doubleField(0);
! f01.readFields(fmtI);
! params.options.nombreSegmentsTalus= f01.intField(0);
! f01.readFields(fmtI);
! params.options.ligneGlissement= f01.stringField(0);
! System.out.println("fin lecture");
! return params;
! }
! }
Index: DResultatsDiapre.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre/DResultatsDiapre.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DResultatsDiapre.java 22 Sep 2003 20:49:58 -0000 1.3
--- DResultatsDiapre.java 25 Nov 2003 10:11:26 -0000 1.4
***************
*** 1,242 ****
! /*
! * @file DResultatsDiapre.java
! * @creation 2000-09-22
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.diapre;
!
! import org.fudaa.dodico.corba.diapre.IResultatsDiapreOperations;
! import org.fudaa.dodico.corba.diapre.SResultatsDiapre;
! import org.fudaa.dodico.corba.diapre.SParametresDiapre;
! import org.fudaa.dodico.corba.diapre.SPointDiagrammePression;
! import org.fudaa.dodico.corba.diapre.SAngleRupture;
!
! import org.fudaa.dodico.calcul.DResultats;
! import org.fudaa.dodico.fortran.FortranReader;
!
! import java.io.FileReader;
! import java.io.IOException;
!
! /**
! * Classe d'implentation de l'interface IResultatsDiapre gerant les resultats
! * du code de calcul <code>diapre</code>.
! *
! * @version $Id$
! * @author Fouzia Elouafi , Jean de Malafosse
! */
! public class DResultatsDiapre
! extends DResultats
! implements IResultatsDiapreOperations
! {
!
!
! /**
! * Le pas ???
! */
! private int pasImp_;
!
! /**
! * variable indiquant si la lecture d'un fichier a ete correcte???
! */
! private boolean dirty05_;
!
! /**
! * ???
! */
! private boolean dirtyIO_;
!
! /**
! * ???
! */
! private boolean dirtyOUT_;
!
! private SResultatsDiapre resultats_;
!
!
! /**
! * Initialise des variables internes.
! */
! public DResultatsDiapre()
! {
! super();
! pasImp_ = 1;
! resultats_=null;
! dirty05_ = true;
! dirtyIO_ = true;
! dirtyOUT_ = true;
! }
!
!
! /**
! * Teste 3 booleens internes ( ou logique)
! *
! * @return resultats du "ou logique" entre 3 variables internes.
! */
! public boolean isDirty()
! {
! return dirty05_ || dirtyIO_ || dirtyOUT_;
! }
!
!
! /**
! * Pas implenter completement.
! *
! * @return <code>new DResultatsDiapre()</code>
! */
! public Object clone()
! {
! return new DResultatsDiapre();
! }
!
!
! /**
! * Renvoie la structure de resultats utilisee.
! */
! public SResultatsDiapre resultatsDiapre()
! {
! return resultats_;
! }
!
!
! /**
! * Modifie la structure de resultats utilisee.
! *
! * @param _r la nouvelle structure de resultat.
! */
! public void resultatsDiapre(SResultatsDiapre _r)
! {
! resultats_=_r;
! }
!
!
! /**
! * Affecte les 3 booleens internes a false.
! */
! public void setDirty()
! {
! dirty05_ = true;
! dirtyIO_ = true;
! dirtyOUT_ = true;
! }
!
!
! public static SResultatsDiapre litResultatsDiapre(SParametresDiapre _params,String _fichier)
! throws IOException
! {
! SResultatsDiapre resultatDiapre = new SResultatsDiapre();
! System.out.println("lecture fichier d");
! litResultatsDiapre_d(_params,resultatDiapre,_fichier);
! System.out.println("fin lecture fichier d");
! System.out.println("lecture fichier dat");
! litResultatsDiapre_dat(_params,resultatDiapre,_fichier);
! System.out.println("fin lecture fichier dat");
! return resultatDiapre;
! }
! /**
! * Lit des resultats dans un fichier "resultat.d" pour construire la structure
! * renvoyee <code>SResultatsDiapre</code>. La structure <code>_param</code>
! * sert a specifier le nombre de segments par ecran:
! * <code>SParametresDiapre.options.nombreSegmentsEcran</code> (cf diapre.idl).
! *
! * @param _params indique le nombre de segment par ecran.
! * @return structure construire a partir du fichier.
! */
! public static SResultatsDiapre litResultatsDiapre_d(SParametresDiapre _params,SResultatsDiapre _results,String _fichier)
! throws IOException
! {
!
! if( _results==null) throw new RuntimeException("SResultats non initialisés");
! SResultatsDiapre resultatDiapre = _results;
! System.out.println("litResultatsDiapre_d");
! if(_params.options==null) System.out.println("options nulles");
! System.out.println("nb " + _params.options.nombreSegmentsEcran);
! resultatDiapre.pointsDiagrammePression = new SPointDiagrammePression[_params.options.nombreSegmentsEcran];
! for(int i = 0; i < _params.options.nombreSegmentsEcran; i++)
! {
! resultatDiapre.pointsDiagrammePression[i] = new SPointDiagrammePression();
! }
!
!
! int[] fmt = {14, 14, 14};
! //ouverture du fichier
! FortranReader fichier = new FortranReader(new FileReader(_fichier+".d"));
!
! //lecture des donnees du fichier
! for(int i = 0; i < _params.options.nombreSegmentsEcran; i++)
! {
! fichier.readFields(fmt);
! resultatDiapre.pointsDiagrammePression[i].ordonneeMilieuSegment = fichier.doubleField(0);
! resultatDiapre.pointsDiagrammePression[i].pressionEffective = fichier.doubleField(1);
! resultatDiapre.pointsDiagrammePression[i].pressionInterstitielle = fichier.doubleField(2);
! resultatDiapre.pointsDiagrammePression[i].pressionTotale = resultatDiapre.pointsDiagrammePression[i].pressionEffective +
! resultatDiapre.pointsDiagrammePression[i].pressionInterstitielle;
! }
!
! return resultatDiapre;
! }
!
!
! /**
! * Lit des resultats dans un fichier "resultat.dat" pour construire la
! * structure renvoyee <code>SResultatsDiapre</code>.
! * La structure <code>_param</code> sert a specifier le nombre de segments
! * par ecran:
! * <code>SParametresDiapre.options.nombreSegmentsEcran</code> (cf diapre.idl).
! *
! * @param _params indique le nombre de segment par ecran.
! * @return structure construire a partir du fichier.
! */
! public static SResultatsDiapre litResultatsDiapre_dat(SParametresDiapre _params,SResultatsDiapre _results,String _fichier)
! throws IOException
! {
!
! if( _results==null) throw new RuntimeException("SResultats non initialisés");
! SResultatsDiapre resultatDiapre = _results;
! int nbSegments=_params.options.nombreSegmentsEcran;
! int nbCouches=_params.sol.nombreCouches;
! System.out.println(nbSegments);
! System.out.println(nbCouches);
! int[] fmt = new int[nbCouches+1];
! fmt[0]=4;
! for(int i=1;i<nbCouches+1;i++) fmt[i]=14;
! resultatDiapre.anglesRupture = new SAngleRupture[nbSegments][nbCouches+1];
! System.out.println("Lecture des résultats dans le fichier "+_fichier+".dat");
!
! //ouverture du fichier
! FortranReader fichier = new FortranReader(new FileReader(_fichier+".dat"));
!
! //lecture des donnees du fichier
! for(int i = 0; i < nbSegments; i++)
! {
! fichier.readFields(fmt);
! //System.out.println("lecture ligne "+i);
! //System.out.println("lecture colonne 0...");
! resultatDiapre.anglesRupture[i][0] = new SAngleRupture();
! resultatDiapre.anglesRupture[i][0].numeroSegment = fichier.intField(0);
! for(int j = 1; j < nbCouches+1; j++)
! {
! //System.out.println("lecture colonne "+j);
! resultatDiapre.anglesRupture[i][j] = new SAngleRupture();
! try
! {
! resultatDiapre.anglesRupture[i][j].angleRupture = fichier.doubleField(j);
! }
! catch(NumberFormatException _e)
! {
! resultatDiapre.anglesRupture[i][j].angleRupture=0;
! System.err.println("L'angle du segment n°"+resultatDiapre.anglesRupture[i][0].numeroSegment+
! "pour la couche "+j+" n'est pas lue ( mise à 0)");
! }
!
! }
!
! }
! return resultatDiapre;
! }
!
! }
!
--- 1,209 ----
! /*
! * @file DResultatsDiapre.java
! * @creation 2000-09-22
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.diapre;
! import org.fudaa.dodico.corba.diapre.IResultatsDiapreOperations;
! import org.fudaa.dodico.corba.diapre.SResultatsDiapre;
! import org.fudaa.dodico.corba.diapre.SParametresDiapre;
! import org.fudaa.dodico.corba.diapre.SPointDiagrammePression;
! import org.fudaa.dodico.corba.diapre.SAngleRupture;
! import org.fudaa.dodico.calcul.DResultats;
! import org.fudaa.dodico.fortran.FortranReader;
! import java.io.FileReader;
! import java.io.IOException;
! /**
! * Classe d'implentation de l'interface IResultatsDiapre gerant les resultats
! * du code de calcul <code>diapre</code>.
! *
! * @version $Id$
! * @author Fouzia Elouafi , Jean de Malafosse
! */
! public class DResultatsDiapre
! extends DResultats
! implements IResultatsDiapreOperations {
! /**
! * Le pas ???
! */
! private int pasImp_;
! /**
! * variable indiquant si la lecture d'un fichier a ete correcte???
! */
! private boolean dirty05_;
! /**
! * ???
! */
! private boolean dirtyIO_;
! /**
! * ???
! */
! private boolean dirtyOUT_;
! private SResultatsDiapre resultats_;
! /**
! * Initialise des variables internes.
! */
! public DResultatsDiapre() {
! super();
! pasImp_= 1;
! resultats_= null;
! dirty05_= true;
! dirtyIO_= true;
! dirtyOUT_= true;
! }
! /**
! * Teste 3 booleens internes ( ou logique)
! *
! * @return resultats du "ou logique" entre 3 variables internes.
! */
! public boolean isDirty() {
! return dirty05_ || dirtyIO_ || dirtyOUT_;
! }
! /**
! * Pas implenter completement.
! *
! * @return <code>new DResultatsDiapre()</code>
! */
! public Object clone() {
! return new DResultatsDiapre();
! }
! /**
! * Renvoie la structure de resultats utilisee.
! */
! public SResultatsDiapre resultatsDiapre() {
! return resultats_;
! }
! /**
! * Modifie la structure de resultats utilisee.
! *
! * @param _r la nouvelle structure de resultat.
! */
! public void resultatsDiapre(SResultatsDiapre _r) {
! resultats_= _r;
! }
! /**
! * Affecte les 3 booleens internes a false.
! */
! public void setDirty() {
! dirty05_= true;
! dirtyIO_= true;
! dirtyOUT_= true;
! }
! public static SResultatsDiapre litResultatsDiapre(
! SParametresDiapre _params,
! String _fichier)
! throws IOException {
! SResultatsDiapre resultatDiapre= new SResultatsDiapre();
! System.out.println("lecture fichier d");
! litResultatsDiapre_d(_params, resultatDiapre, _fichier);
! System.out.println("fin lecture fichier d");
! System.out.println("lecture fichier dat");
! litResultatsDiapre_dat(_params, resultatDiapre, _fichier);
! System.out.println("fin lecture fichier dat");
! return resultatDiapre;
! }
! /**
! * Lit des resultats dans un fichier "resultat.d" pour construire la structure
! * renvoyee <code>SResultatsDiapre</code>. La structure <code>_param</code>
! * sert a specifier le nombre de segments par ecran:
! * <code>SParametresDiapre.options.nombreSegmentsEcran</code> (cf diapre.idl).
! *
! * @param _params indique le nombre de segment par ecran.
! * @return structure construire a partir du fichier.
! */
! public static SResultatsDiapre litResultatsDiapre_d(
! SParametresDiapre _params,
! SResultatsDiapre _results,
! String _fichier)
! throws IOException {
! if (_results == null)
! throw new RuntimeException("SResultats non initialisés");
! SResultatsDiapre resultatDiapre= _results;
! System.out.println("litResultatsDiapre_d");
! if (_params.options == null)
! System.out.println("options nulles");
! System.out.println("nb " + _params.options.nombreSegmentsEcran);
! resultatDiapre.pointsDiagrammePression=
! new SPointDiagrammePression[_params.options.nombreSegmentsEcran];
! for (int i= 0; i < _params.options.nombreSegmentsEcran; i++) {
! resultatDiapre.pointsDiagrammePression[i]= new SPointDiagrammePression();
! }
! int[] fmt= { 14, 14, 14 };
! //ouverture du fichier
! FortranReader fichier= new FortranReader(new FileReader(_fichier + ".d"));
! //lecture des donnees du fichier
! for (int i= 0; i < _params.options.nombreSegmentsEcran; i++) {
! fichier.readFields(fmt);
! resultatDiapre.pointsDiagrammePression[i].ordonneeMilieuSegment=
! fichier.doubleField(0);
! resultatDiapre.pointsDiagrammePression[i].pressionEffective=
! fichier.doubleField(1);
! resultatDiapre.pointsDiagrammePression[i].pressionInterstitielle=
! fichier.doubleField(2);
! resultatDiapre.pointsDiagrammePression[i].pressionTotale=
! resultatDiapre.pointsDiagrammePression[i].pressionEffective
! + resultatDiapre.pointsDiagrammePression[i].pressionInterstitielle;
! }
! return resultatDiapre;
! }
! /**
! * Lit des resultats dans un fichier "resultat.dat" pour construire la
! * structure renvoyee <code>SResultatsDiapre</code>.
! * La structure <code>_param</code> sert a specifier le nombre de segments
! * par ecran:
! * <code>SParametresDiapre.options.nombreSegmentsEcran</code> (cf diapre.idl).
! *
! * @param _params indique le nombre de segment par ecran.
! * @return structure construire a partir du fichier.
! */
! public static SResultatsDiapre litResultatsDiapre_dat(
! SParametresDiapre _params,
! SResultatsDiapre _results,
! String _fichier)
! throws IOException {
! if (_results == null)
! throw new RuntimeException("SResultats non initialisés");
! SResultatsDiapre resultatDiapre= _results;
! int nbSegments= _params.options.nombreSegmentsEcran;
! int nbCouches= _params.sol.nombreCouches;
! System.out.println(nbSegments);
! System.out.println(nbCouches);
! int[] fmt= new int[nbCouches + 1];
! fmt[0]= 4;
! for (int i= 1; i < nbCouches + 1; i++)
! fmt[i]= 14;
! resultatDiapre.anglesRupture= new SAngleRupture[nbSegments][nbCouches + 1];
! System.out.println(
! "Lecture des résultats dans le fichier " + _fichier + ".dat");
! //ouverture du fichier
! FortranReader fichier= new FortranReader(new FileReader(_fichier + ".dat"));
! //lecture des donnees du fichier
! for (int i= 0; i < nbSegments; i++) {
! fichier.readFields(fmt);
! //System.out.println("lecture ligne "+i);
! //System.out.println("lecture colonne 0...");
! resultatDiapre.anglesRupture[i][0]= new SAngleRupture();
! resultatDiapre.anglesRupture[i][0].numeroSegment= fichier.intField(0);
! for (int j= 1; j < nbCouches + 1; j++) {
! //System.out.println("lecture colonne "+j);
! resultatDiapre.anglesRupture[i][j]= new SAngleRupture();
! try {
! resultatDiapre.anglesRupture[i][j].angleRupture=
! fichier.doubleField(j);
! } catch (NumberFormatException _e) {
! resultatDiapre.anglesRupture[i][j].angleRupture= 0;
! System.err.println(
! "L'angle du segment n°"
! + resultatDiapre.anglesRupture[i][0].numeroSegment
! + "pour la couche "
! + j
! + " n'est pas lue ( mise à 0)");
! }
! }
! }
! return resultatDiapre;
! }
! }
Index: ServeurDiapre.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/diapre/ServeurDiapre.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ServeurDiapre.java 22 Sep 2003 20:49:58 -0000 1.3
--- ServeurDiapre.java 25 Nov 2003 10:11:26 -0000 1.4
***************
*** 1,46 ****
! /*
! * @file ServeurDiapre.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.diapre;
!
! import org.fudaa.dodico.objet.CDodico;
!
! import java.util.Date;
!
! /**
! * Lance le serveur du code de calcul <code>diapre</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurDiapre
! {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculDiapre</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args)
! {
! String nom = (args.length > 0
! ? args[0]
! : CDodico.generateName("::diapre::ICalculDiapre"));
!
! DCalculDiapre s = new DCalculDiapre();
! CDodico.rebind(nom, s.tie());
!
! System.out.println("Diapre server running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
!
--- 1,38 ----
! /*
! * @file ServeurDiapre.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.diapre;
! import org.fudaa.dodico.objet.CDodico;
! import java.util.Date;
! /**
! * Lance le serveur du code de calcul <code>diapre</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurDiapre {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculDiapre</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args) {
! String nom=
! (args.length > 0
! ? args[0]
! : CDodico.generateName("::diapre::ICalculDiapre"));
! DCalculDiapre s= new DCalculDiapre();
! CDodico.rebind(nom, s.tie());
! System.out.println("Diapre server running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
|
|
From: <de...@us...> - 2003-11-25 10:43:07
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fichiers
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/commun/fichiers
Modified Files:
FudaaMaillageCORELEBTH.java
Log Message:
reformat all files
Index: FudaaMaillageCORELEBTH.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fichiers/FudaaMaillageCORELEBTH.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FudaaMaillageCORELEBTH.java 23 Sep 2003 21:08:05 -0000 1.5
--- FudaaMaillageCORELEBTH.java 25 Nov 2003 10:13:33 -0000 1.6
***************
*** 1,590 ****
! /*
! * @file FudaaMaillageCORELEBTH.java
! * @creation 1999-06-28
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.fichiers;
[...1124 lines suppressed...]
! }
! file.writeFields(fmt);
! } */
! } catch (FileNotFoundException exc) {
! throw new IOException("Erreur d'ouverture du fichier " + _nomFichier);
! } catch (IOException exc) {
! throw new IOException("Erreur d'écriture sur " + _nomFichier);
! } catch (NumberFormatException exc) {
! throw new IOException("Erreur d'écriture sur " + _nomFichier);
! }
! // catch (Exception exc) {
! // System.out.println(exc);
! // }
! finally {
! // Fermeture du fichier
! if (file != null)
! file.close();
! }
! }
! }
|
|
From: <de...@us...> - 2003-11-25 10:43:05
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/collection
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/collection
Modified Files:
DCollection.java DTableau.java
Log Message:
reformat all files
Index: DCollection.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/collection/DCollection.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DCollection.java 23 Sep 2003 19:22:15 -0000 1.4
--- DCollection.java 25 Nov 2003 10:11:25 -0000 1.5
***************
*** 1,31 ****
! /*
! * @file DCollection.java
! * @creation 2001-07-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.collection;
!
! import org.fudaa.dodico.corba.collection.*;
! import org.fudaa.dodico.objet.DObjet;
!
! /**
! * Classe typant les objets implantant des interfaces du type ICollection.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Fred Deniger
! */
! public abstract class DCollection
! extends DObjet implements ICollectionOperations
! {
! /**
! * Constructeur vide.
! */
! public DCollection()
! {
! }
! }
!
--- 1,25 ----
! /*
! * @file DCollection.java
! * @creation 2001-07-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.collection;
! import org.fudaa.dodico.corba.collection.*;
! import org.fudaa.dodico.objet.DObjet;
! /**
! * Classe typant les objets implantant des interfaces du type ICollection.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Fred Deniger
! */
! public abstract class DCollection
! extends DObjet
! implements ICollectionOperations {
! /**
! * Constructeur vide.
! */
! public DCollection() {}
! }
Index: DTableau.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/collection/DTableau.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DTableau.java 23 Sep 2003 19:22:15 -0000 1.4
--- DTableau.java 25 Nov 2003 10:11:25 -0000 1.5
***************
*** 1,276 ****
! /*
! * @file DTableau.java
! * @creation 1998-12-18
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.collection;
!
! import org.fudaa.dodico.corba.collection.ITableau;
! import org.fudaa.dodico.corba.collection.ITableauOperations;
! import org.fudaa.dodico.corba.objet.IObjetHelper;
! import org.fudaa.dodico.corba.objet.IObjet;
!
! import org.fudaa.dodico.objet.DObjet;
!
! import java.util.Vector;
! import java.util.Enumeration;
!
! /**
! * Cette classe implante un tableau d'objet dynamique (cf
! * <code>java.util.Vector</code>) : un tableau dont la taille est geree
! * automatiquement et dont les elements sont accessibles par l'intermediaire
! * d'un index numerique. Les elements de ce tableau peuvent etre manipules tres
! * facilement :suppression, ajout, remplacement...<br>
! * En interne, toutes les operations sont deleguees a un attribut prive du type
! * <code>java.lang.Vector</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DTableau
! extends DObjet implements ITableauOperations
! {
! /**
! * Le vecteur utilise pour stocké les donnees.
! */
! private Vector v_;
!
! /**
! * Initialise le vecteur (<code>java.lang.Vector</code>) interne utilise pour
! * stocker les IObjets.
! */
! public DTableau()
! {
! v_ = new Vector();
! }
!
! /**
! * Convertit l'objet corba en un objet java (<code>java.lang.Vector</code>).
! * Le Vector retourne est en fait un clone.
! *
! * @return clone du vector utilise en interne.
! */
! public Vector toVector()
! {
! return (Vector)(v_.clone());
! }
!
! /**
! * Attention: les methodes <code>clone()</code> ne sont pas implementees
! * correctement.
! *
! * @return tableau avec les memes elements.
! */
! public Object clone()
! {
! DTableau r = new DTableau();
! r.elements(elements());
! return r;
! }
!
!
! /**
! * Renvoie une chaine decrivant l'objet.
! *
! * @return "DTableau(" + v_.size() + " elements)"
! */
! public String toString()
! {
! return "DTableau(" + v_.size() + " elements)";
! }
!
!
! /**
! * Initialise cet objet avec <code>_o</code>, si <code>_o</code> est une
! * instance de <code>ITableau</code>.
! * Les elements seront les memes que ceux de <code>_o</code>.
! *
! * @param _o l'objet servant de reference pour l'initialisation.
! */
! public void initialise(IObjet _o)
! {
! if(_o instanceof ITableau)
! {
! ITableau q = (ITableau)_o;
! elements(q.elements());
! }
! }
!
! /**
! * Ajoute l'objet <code>_o</code> au ITableau.
! *
! * @param _o objet a ajouter.
! */
! public void ajoute(IObjet _o)
! {
! v_.addElement(_o);
! }
!
!
! /**
! * Supprime tous les elements du tableau.
! */
! public void vide()
! {
! v_.removeAllElements();
! }
!
!
! /**
! * Teste si l'IObjet <code>_o</code> appartient a ce tableau.
! *
! * @param _o
! * @return <code>true</code> si <code>_o</code> est present.
! */
! public boolean contient(IObjet _o)
! {
! return v_.contains(_o);
! }
!
!
! /**
! * Teste si le tableau est vide.
! *
! * @return <code>true</code> si le tableau est vide
! */
! public boolean estVide()
! {
! return v_.isEmpty();
! }
!
!
! /**
! * Enleve l'IObjet <code>_o</code> du tableau.
! *
! * @param _o objet a enlever
! */
! public void enleve(IObjet _o)
! {
! v_.removeElement(_o);
! }
!
!
! /**
! * Renvoie la taille du tableau: le nombre d'IObjets stockés.
! *
! * @return taille du tableau.
! */
! public int taille()
! {
! return v_.size();
! }
!
! /**
! * Renvoie l'IObjet situe a la position <code>_i</code> du tableau.
! *
! * @param _i la position de l'objet voulu.
! * @return null si <code>_i</code> ne correspond pas a un indice valide
! * ,l'IObjet correspondant sinon.
! */
! public IObjet element(int _i)
! {
! IObjet r = null;
! if((_i >= 0) && (_i < v_.size()))
! {
! r = IObjetHelper.narrow((org.omg.CORBA.Object)(v_.elementAt(_i)));
! }
! return r;
! }
!
! /**
! * Si <code>_i</code> est un indice valide, remplace l'objet correspondant par
! * <code>_o</code>.
! *
! * @param _i l'indice de l'objet a remplacer.
! * @param _o la nouvelle valeur pour l'objet situe a l'indice
! <code>_i</code>
! */
! public void remplace(int _i, IObjet _o)
! {
! if((_i >= 0) && (_i < v_.size()))
! {
! v_.setElementAt(_o, _i);
! }
! }
!
! /**
! * Renvoie le tableau sous forme d'un tableau d'IObjets.
! *
! * @return tous les elements du tableau.
! */
! public IObjet[] elements()
! {
! // JDK120: return (IObjet[])(v.toArray());
! /*
! * Enumeration e;
! * Object[] o = new Object[v_.size()];
! * for( i = 0, e = v_.elements(); e.hasMoreElements(); i++ )
! * {
! * o[i] = e.nextElement();
! * }
! */
! int i;
! Object[] o = v_.toArray();
! IObjet[] r = new IObjet[o.length];
! for(i = 0; i < o.length; i++)
! {
! r[i] = IObjetHelper.narrow((org.omg.CORBA.Object)o[i]);
! }
! return r;
! }
!
!
! /**
! * Vide le tableau et ajoute tous les objets du tableau <code>_o</code>.
! *
! * @param _o les nouveaux elements du tableau.
! */
! public void elements(IObjet[] _o)
! {
! vide();
! for(int i = 0; i < _o.length; i++)
! {
! ajoute(_o[i]);
! }
! }
!
! /*
! * public void ajouteTous( ICollection c )
! * {
! * }
! */
!
! /*
! * public void contientTous( ICollection c )
! * {
! * }
! */
!
! /*
! * public void enleveTous( ICollection c )
! * {
! * }
! */
!
! // Vector
!
! /*
! * JDK120:
! * public void ajoute(IObjet _o) { v_.add(_o); }
! * public void vide() { v_.clear(); }
! * public boolean contient(IObjet _o) { return v_.contains(_o); }
! * public boolean estVide() { return v_.isEmpty(); }
! * public void enleve(IObjet _o) { v_.remove(_o); }
! * public int taille() { return v_.size(); }
! * public IObjet element(int _i) { return (IObjet)v_.get(_i); }
! * public void remplace(int _i, IObjet _o) { v_.set(_i,_o); }
! */
!
!
! }
!
!
--- 1,217 ----
! /*
! * @file DTableau.java
! * @creation 1998-12-18
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.collection;
! import org.fudaa.dodico.corba.collection.ITableau;
! import org.fudaa.dodico.corba.collection.ITableauOperations;
! import org.fudaa.dodico.corba.objet.IObjetHelper;
! import org.fudaa.dodico.corba.objet.IObjet;
! import org.fudaa.dodico.objet.DObjet;
! import java.util.Vector;
! import java.util.Enumeration;
! /**
! * Cette classe implante un tableau d'objet dynamique (cf
! * <code>java.util.Vector</code>) : un tableau dont la taille est geree
! * automatiquement et dont les elements sont accessibles par l'intermediaire
! * d'un index numerique. Les elements de ce tableau peuvent etre manipules tres
! * facilement :suppression, ajout, remplacement...<br>
! * En interne, toutes les operations sont deleguees a un attribut prive du type
! * <code>java.lang.Vector</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class DTableau extends DObjet implements ITableauOperations {
! /**
! * Le vecteur utilise pour stocké les donnees.
! */
! private Vector v_;
! /**
! * Initialise le vecteur (<code>java.lang.Vector</code>) interne utilise pour
! * stocker les IObjets.
! */
! public DTableau() {
! v_= new Vector();
! }
! /**
! * Convertit l'objet corba en un objet java (<code>java.lang.Vector</code>).
! * Le Vector retourne est en fait un clone.
! *
! * @return clone du vector utilise en interne.
! */
! public Vector toVector() {
! return (Vector) (v_.clone());
! }
! /**
! * Attention: les methodes <code>clone()</code> ne sont pas implementees
! * correctement.
! *
! * @return tableau avec les memes elements.
! */
! public Object clone() {
! DTableau r= new DTableau();
! r.elements(elements());
! return r;
! }
! /**
! * Renvoie une chaine decrivant l'objet.
! *
! * @return "DTableau(" + v_.size() + " elements)"
! */
! public String toString() {
! return "DTableau(" + v_.size() + " elements)";
! }
! /**
! * Initialise cet objet avec <code>_o</code>, si <code>_o</code> est une
! * instance de <code>ITableau</code>.
! * Les elements seront les memes que ceux de <code>_o</code>.
! *
! * @param _o l'objet servant de reference pour l'initialisation.
! */
! public void initialise(IObjet _o) {
! if (_o instanceof ITableau) {
! ITableau q= (ITableau)_o;
! elements(q.elements());
! }
! }
! /**
! * Ajoute l'objet <code>_o</code> au ITableau.
! *
! * @param _o objet a ajouter.
! */
! public void ajoute(IObjet _o) {
! v_.addElement(_o);
! }
! /**
! * Supprime tous les elements du tableau.
! */
! public void vide() {
! v_.removeAllElements();
! }
! /**
! * Teste si l'IObjet <code>_o</code> appartient a ce tableau.
! *
! * @param _o
! * @return <code>true</code> si <code>_o</code> est present.
! */
! public boolean contient(IObjet _o) {
! return v_.contains(_o);
! }
! /**
! * Teste si le tableau est vide.
! *
! * @return <code>true</code> si le tableau est vide
! */
! public boolean estVide() {
! return v_.isEmpty();
! }
! /**
! * Enleve l'IObjet <code>_o</code> du tableau.
! *
! * @param _o objet a enlever
! */
! public void enleve(IObjet _o) {
! v_.removeElement(_o);
! }
! /**
! * Renvoie la taille du tableau: le nombre d'IObjets stockés.
! *
! * @return taille du tableau.
! */
! public int taille() {
! return v_.size();
! }
! /**
! * Renvoie l'IObjet situe a la position <code>_i</code> du tableau.
! *
! * @param _i la position de l'objet voulu.
! * @return null si <code>_i</code> ne correspond pas a un indice valide
! * ,l'IObjet correspondant sinon.
! */
! public IObjet element(int _i) {
! IObjet r= null;
! if ((_i >= 0) && (_i < v_.size())) {
! r= IObjetHelper.narrow((org.omg.CORBA.Object) (v_.elementAt(_i)));
! }
! return r;
! }
! /**
! * Si <code>_i</code> est un indice valide, remplace l'objet correspondant par
! * <code>_o</code>.
! *
! * @param _i l'indice de l'objet a remplacer.
! * @param _o la nouvelle valeur pour l'objet situe a l'indice
! <code>_i</code>
! */
! public void remplace(int _i, IObjet _o) {
! if ((_i >= 0) && (_i < v_.size())) {
! v_.setElementAt(_o, _i);
! }
! }
! /**
! * Renvoie le tableau sous forme d'un tableau d'IObjets.
! *
! * @return tous les elements du tableau.
! */
! public IObjet[] elements() {
! // JDK120: return (IObjet[])(v.toArray());
! /*
! * Enumeration e;
! * Object[] o = new Object[v_.size()];
! * for( i = 0, e = v_.elements(); e.hasMoreElements(); i++ )
! * {
! * o[i] = e.nextElement();
! * }
! */
! int i;
! Object[] o= v_.toArray();
! IObjet[] r= new IObjet[o.length];
! for (i= 0; i < o.length; i++) {
! r[i]= IObjetHelper.narrow((org.omg.CORBA.Object)o[i]);
! }
! return r;
! }
! /**
! * Vide le tableau et ajoute tous les objets du tableau <code>_o</code>.
! *
! * @param _o les nouveaux elements du tableau.
! */
! public void elements(IObjet[] _o) {
! vide();
! for (int i= 0; i < _o.length; i++) {
! ajoute(_o[i]);
! }
! }
! /*
! * public void ajouteTous( ICollection c )
! * {
! * }
! */
! /*
! * public void contientTous( ICollection c )
! * {
! * }
! */
! /*
! * public void enleveTous( ICollection c )
! * {
! * }
! */
! // Vector
! /*
! * JDK120:
! * public void ajoute(IObjet _o) { v_.add(_o); }
! * public void vide() { v_.clear(); }
! * public boolean contient(IObjet _o) { return v_.contains(_o); }
! * public boolean estVide() { return v_.isEmpty(); }
! * public void enleve(IObjet _o) { v_.remove(_o); }
! * public int taille() { return v_.size(); }
! * public IObjet element(int _i) { return (IObjet)v_.get(_i); }
! * public void remplace(int _i, IObjet _o) { v_.set(_i,_o); }
! */
! }
|
|
From: <de...@us...> - 2003-11-25 10:43:04
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fileChooser
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/commun/fileChooser
Modified Files:
FudaaFavoriteFiles.java FudaaFileChooser.java
Log Message:
reformat all files
Index: FudaaFavoriteFiles.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fileChooser/FudaaFavoriteFiles.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaFavoriteFiles.java 26 Sep 2003 11:45:44 -0000 1.4
--- FudaaFavoriteFiles.java 25 Nov 2003 10:13:34 -0000 1.5
***************
*** 8,12 ****
*/
package org.fudaa.fudaa.commun.fileChooser;
-
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
--- 8,11 ----
***************
*** 18,22 ****
import java.util.Enumeration;
import java.util.List;
-
import javax.swing.AbstractListModel;
import javax.swing.JComboBox;
--- 17,20 ----
***************
*** 25,29 ****
import javax.swing.JLabel;
import javax.swing.MutableComboBoxModel;
-
import com.memoire.bu.BuBorderLayout;
import com.memoire.bu.BuButtonLayout;
--- 23,26 ----
***************
*** 33,85 ****
import com.memoire.bu.BuResource;
import com.memoire.bu.BuToolButton;
-
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPreferences;
-
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
-
import org.fudaa.fudaa.commun.tableau.FudaaCellTextRenderer;
import org.fudaa.fudaa.commun.tableau.FudaaPanelListEditor;
import org.fudaa.fudaa.commun.tableau.FudaaPanelListEditorModel;
import org.fudaa.fudaa.ressource.FudaaResource;
-
/**
* @author deniger
* @version $Id$
*/
! public class FudaaFavoriteFiles
! {
! public static final String PREF_ID = "filechooser.favorite";
! public static final String PREF_LAST = "filechooser.last.dir";
! public static final FudaaFavoriteFiles INSTANCE = new FudaaFavoriteFiles();
!
List list_;
-
/**
*
*/
! private FudaaFavoriteFiles()
! {
loadFavorites();
}
!
! private void loadFavorites()
! {
! list_ = new ArrayList(20);
! for (Enumeration e = BuPreferences.BU.keys();
! e.hasMoreElements();
! )
! {
! String k = (String) e.nextElement();
! if (k.startsWith(PREF_ID))
! {
! String val=BuPreferences.BU.getStringProperty(k);
! File f=new File(val);
! if((!f.exists()) || (!f.isDirectory()) )
! {
BuPreferences.BU.removeProperty(k);
! }
! else
! {
list_.add(val);
}
--- 30,65 ----
import com.memoire.bu.BuResource;
import com.memoire.bu.BuToolButton;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPreferences;
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
import org.fudaa.fudaa.commun.tableau.FudaaCellTextRenderer;
import org.fudaa.fudaa.commun.tableau.FudaaPanelListEditor;
import org.fudaa.fudaa.commun.tableau.FudaaPanelListEditorModel;
import org.fudaa.fudaa.ressource.FudaaResource;
/**
* @author deniger
* @version $Id$
*/
! public class FudaaFavoriteFiles {
! public static final String PREF_ID= "filechooser.favorite";
! public static final String PREF_LAST= "filechooser.last.dir";
! public static final FudaaFavoriteFiles INSTANCE= new FudaaFavoriteFiles();
List list_;
/**
*
*/
! private FudaaFavoriteFiles() {
loadFavorites();
}
! private void loadFavorites() {
! list_= new ArrayList(20);
! for (Enumeration e= BuPreferences.BU.keys(); e.hasMoreElements();) {
! String k= (String)e.nextElement();
! if (k.startsWith(PREF_ID)) {
! String val= BuPreferences.BU.getStringProperty(k);
! File f= new File(val);
! if ((!f.exists()) || (!f.isDirectory())) {
BuPreferences.BU.removeProperty(k);
! } else {
list_.add(val);
}
***************
*** 88,205 ****
Collections.sort(list_);
}
-
private class FavoriteModel
extends AbstractListModel
! implements MutableComboBoxModel
! {
Object selected_;
-
/**
*
*/
! public Object getSelectedItem()
! {
return selected_;
}
!
!
! public void setSelectedItem(Object anItem)
! {
if (((anItem != null)
&& (!anItem.equals(selected_))
! || ((anItem == null) && selected_ != null)))
! {
! selected_ = anItem;
fireContentsChanged(this, -1, -1);
}
-
}
!
! public boolean contains(Object o)
! {
return list_.contains(o);
}
!
! public void addElement( Object obj )
! {
! if(obj instanceof String)
! {
list_.add(obj);
Collections.sort(list_);
fireContentsChanged(this, 0, list_.size());
}
-
}
-
-
/**
* Adds an item at a specific index
*/
! public void insertElementAt( Object obj, int index )
! {
addElement(obj);
}
-
/**
* Removes an item at a specific index
*/
! public void removeElementAt( int _i )
! {
! if(_i>=0)
! {
list_.remove(_i);
! fireIntervalRemoved(this,_i,_i);
}
}
!
! protected void update()
! {
! if(list_.contains(getSelectedItem()))
! {
setSelectedItem(null);
}
fireContentsChanged(this, 0, list_.size());
}
-
/**
*
*/
! public Object getElementAt(int arg0)
! {
return list_.get(arg0);
}
-
/**
*
*/
! public int getSize()
! {
return list_.size();
}
-
/**
*
*/
! public void removeElement(Object obj)
! {
removeElementAt(list_.indexOf(obj));
}
-
}
!
! public JComponent createComponent(final JFileChooser _f)
! {
! BuPanel pn = new BuPanel();
pn.setLayout(new BuBorderLayout(2, 2));
! JLabel lb = new JLabel(FudaaResource.getS("Favoris")+":");
pn.add(lb, BuBorderLayout.WEST);
! final FavoriteModel model=new FavoriteModel();
!
! final JComboBox j = new JComboBox(model);
! FudaaCellTextRenderer cellRenderer = new FudaaCellTextRenderer()
! {
! protected void setValue(Object value)
! {
! String s = (String) value;
setToolTipText(s);
setText(s);
--- 68,149 ----
Collections.sort(list_);
}
private class FavoriteModel
extends AbstractListModel
! implements MutableComboBoxModel {
Object selected_;
/**
*
*/
! public Object getSelectedItem() {
return selected_;
}
! public void setSelectedItem(Object anItem) {
if (((anItem != null)
&& (!anItem.equals(selected_))
! || ((anItem == null) && selected_ != null))) {
! selected_= anItem;
fireContentsChanged(this, -1, -1);
}
}
! public boolean contains(Object o) {
return list_.contains(o);
}
! public void addElement(Object obj) {
! if (obj instanceof String) {
list_.add(obj);
Collections.sort(list_);
fireContentsChanged(this, 0, list_.size());
}
}
/**
* Adds an item at a specific index
*/
! public void insertElementAt(Object obj, int index) {
addElement(obj);
}
/**
* Removes an item at a specific index
*/
! public void removeElementAt(int _i) {
! if (_i >= 0) {
list_.remove(_i);
! fireIntervalRemoved(this, _i, _i);
}
}
! protected void update() {
! if (list_.contains(getSelectedItem())) {
setSelectedItem(null);
}
fireContentsChanged(this, 0, list_.size());
}
/**
*
*/
! public Object getElementAt(int arg0) {
return list_.get(arg0);
}
/**
*
*/
! public int getSize() {
return list_.size();
}
/**
*
*/
! public void removeElement(Object obj) {
removeElementAt(list_.indexOf(obj));
}
}
! public JComponent createComponent(final JFileChooser _f) {
! BuPanel pn= new BuPanel();
pn.setLayout(new BuBorderLayout(2, 2));
! JLabel lb= new JLabel(FudaaResource.getS("Favoris") + ":");
pn.add(lb, BuBorderLayout.WEST);
! final FavoriteModel model= new FavoriteModel();
! final JComboBox j= new JComboBox(model);
! FudaaCellTextRenderer cellRenderer= new FudaaCellTextRenderer() {
! protected void setValue(Object value) {
! String s= (String)value;
setToolTipText(s);
setText(s);
***************
*** 208,220 ****
cellRenderer.setIcon(BuResource.BU.getToolIcon("ouvrir"));
j.setRenderer(cellRenderer);
! j.addItemListener(new ItemListener()
! {
! public void itemStateChanged(ItemEvent e)
! {
! if (e.getStateChange() == ItemEvent.SELECTED)
! {
! if(model.getSelectedItem()!=null)
! {
! _f.setCurrentDirectory(new File((String) model.getSelectedItem()));
}
}
--- 152,160 ----
cellRenderer.setIcon(BuResource.BU.getToolIcon("ouvrir"));
j.setRenderer(cellRenderer);
! j.addItemListener(new ItemListener() {
! public void itemStateChanged(ItemEvent e) {
! if (e.getStateChange() == ItemEvent.SELECTED) {
! if (model.getSelectedItem() != null) {
! _f.setCurrentDirectory(new File((String)model.getSelectedItem()));
}
}
***************
*** 222,264 ****
});
pn.add(j, BuBorderLayout.CENTER);
! BuToolButton bt =
! new BuToolButton(BuResource.BU.loadMenuCommandIcon("oui"));
! bt.setToolTipText(FudaaResource.getS("Ajouter le répertoire courant aux favoris"));
! bt.addActionListener(new ActionListener()
! {
! public void actionPerformed(ActionEvent _ae)
! {
! String s=_f.getCurrentDirectory().getAbsolutePath();
! if(!list_.contains(s))
! {
model.addElement(s);
}
}
});
! BuPanel pnBt = new BuPanel();
pnBt.setLayout(new BuButtonLayout(1, BuButtonLayout.CENTER));
pnBt.add(bt);
! bt = new BuToolButton(BuResource.BU.loadMenuCommandIcon("editer"));
! bt.addActionListener(new ActionListener()
! {
! public void actionPerformed(ActionEvent _ae)
! {
! FudaaPanelListEditorModel listmodel=new FudaaPanelListEditorModel(list_,false);
! FudaaPanelListEditor editor=new FudaaPanelListEditor(listmodel,false,true,false)
! {
! public void initCellRendererEditor()
! {
! FudaaCellTextRenderer txt=new FudaaCellTextRenderer();
txt.setIcon(BuResource.BU.getToolIcon("ouvrir"));
table_.getColumnModel().getColumn(0).setCellRenderer(txt);
}
-
};
! EbliSimpleDialogPanel pn=new EbliSimpleDialogPanel();
pn.setLayout(new BuBorderLayout());
! pn.add(editor,BuBorderLayout.CENTER);
! if(EbliSimpleDialogPanel.isOkResponse(pn.afficheModale(j, FudaaResource.getS("Edition des favoris"))))
! {
! list_=listmodel.getValuesInList();
model.update();
}
--- 162,199 ----
});
pn.add(j, BuBorderLayout.CENTER);
! BuToolButton bt= new BuToolButton(BuResource.BU.loadMenuCommandIcon("oui"));
! bt.setToolTipText(
! FudaaResource.getS("Ajouter le répertoire courant aux favoris"));
! bt.addActionListener(new ActionListener() {
! public void actionPerformed(ActionEvent _ae) {
! String s= _f.getCurrentDirectory().getAbsolutePath();
! if (!list_.contains(s)) {
model.addElement(s);
}
}
});
! BuPanel pnBt= new BuPanel();
pnBt.setLayout(new BuButtonLayout(1, BuButtonLayout.CENTER));
pnBt.add(bt);
! bt= new BuToolButton(BuResource.BU.loadMenuCommandIcon("editer"));
! bt.addActionListener(new ActionListener() {
! public void actionPerformed(ActionEvent _ae) {
! FudaaPanelListEditorModel listmodel=
! new FudaaPanelListEditorModel(list_, false);
! FudaaPanelListEditor editor=
! new FudaaPanelListEditor(listmodel, false, true, false) {
! public void initCellRendererEditor() {
! FudaaCellTextRenderer txt= new FudaaCellTextRenderer();
txt.setIcon(BuResource.BU.getToolIcon("ouvrir"));
table_.getColumnModel().getColumn(0).setCellRenderer(txt);
}
};
! EbliSimpleDialogPanel pn= new EbliSimpleDialogPanel();
pn.setLayout(new BuBorderLayout());
! pn.add(editor, BuBorderLayout.CENTER);
! if (EbliSimpleDialogPanel
! .isOkResponse(
! pn.afficheModale(j, FudaaResource.getS("Edition des favoris")))) {
! list_= listmodel.getValuesInList();
model.update();
}
***************
*** 269,298 ****
pn.add(pnBt, BuBorderLayout.EAST);
return pn;
-
}
-
/**
* Enregistre les preferences dans FudaaPreferences mais n'ecrit pas le fichier de pref.
*/
! public void saveFavorites()
! {
! for (Enumeration e = BuPreferences.BU.keys();
! e.hasMoreElements();
! )
! {
! String k = (String) e.nextElement();
! if (k.startsWith(PREF_ID))
! {
BuPreferences.BU.removeProperty(k);
}
}
! int n = list_.size();
! for (int i = 0; i < n; i++)
! {
BuPreferences.BU.putStringProperty(
DodicoPreferences.buildPrefKey(PREF_ID, DodicoLib.getString(i)),
! (String) list_.get(i));
}
}
-
}
--- 204,224 ----
pn.add(pnBt, BuBorderLayout.EAST);
return pn;
}
/**
* Enregistre les preferences dans FudaaPreferences mais n'ecrit pas le fichier de pref.
*/
! public void saveFavorites() {
! for (Enumeration e= BuPreferences.BU.keys(); e.hasMoreElements();) {
! String k= (String)e.nextElement();
! if (k.startsWith(PREF_ID)) {
BuPreferences.BU.removeProperty(k);
}
}
! int n= list_.size();
! for (int i= 0; i < n; i++) {
BuPreferences.BU.putStringProperty(
DodicoPreferences.buildPrefKey(PREF_ID, DodicoLib.getString(i)),
! (String)list_.get(i));
}
}
}
Index: FudaaFileChooser.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/fileChooser/FudaaFileChooser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FudaaFileChooser.java 26 Sep 2003 11:47:18 -0000 1.4
--- FudaaFileChooser.java 25 Nov 2003 10:13:34 -0000 1.5
***************
*** 8,22 ****
*/
package org.fudaa.fudaa.commun.fileChooser;
-
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Frame;
import java.io.File;
-
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-
import com.memoire.bu.BuBorderLayout;
import com.memoire.bu.BuFileChooser;
--- 8,19 ----
***************
*** 31,42 ****
*/
public class FudaaFileChooser extends BuFileChooser {
-
int response_;
JDialog dial_;
-
public FudaaFileChooser() {
this(true);
}
-
/**
* Si _lastDir, le fileChooser est ouvert dans le dernier repertoire ouvert.
--- 28,36 ----
***************
*** 48,52 ****
setCurrentDirectory(getLastDir());
}
-
public static File getLastDir() {
return new File(
--- 42,45 ----
***************
*** 55,62 ****
FuLib.getUserHome()));
}
-
public static void main(String[] args) {
JFrame f= new JFrame();
-
FudaaFileChooser tb= new FudaaFileChooser();
tb.setFileSelectionMode(FudaaFileChooser.FILES_ONLY);
--- 48,53 ----
***************
*** 68,74 ****
// jfc.setFileSelectionMode(FudaaFileChooser.FILES_ONLY);
// jfc.showOpenDialog(f);
-
}
-
/**
*
--- 59,63 ----
***************
*** 82,86 ****
return response_;
}
-
private void init(JDialog _dial) {
BuPanel pn= new BuPanel();
--- 71,74 ----
***************
*** 97,101 ****
_dial.pack();
}
-
/**
*
--- 85,88 ----
***************
*** 105,109 ****
return showDialog(parent);
}
-
/**
*
--- 92,95 ----
***************
*** 113,117 ****
return showDialog(parent);
}
-
/**
*
--- 99,102 ----
***************
*** 124,128 ****
return showDialog(frame);
}
-
/**
*
--- 109,112 ----
***************
*** 135,139 ****
return showOpenDialog(frame);
}
-
/**
*
--- 119,122 ----
***************
*** 146,150 ****
return showSaveDialog(frame);
}
-
/**
*
--- 129,132 ----
***************
*** 160,164 ****
}
}
-
/**
*
--- 142,145 ----
***************
*** 171,174 ****
}
}
-
}
--- 152,154 ----
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dimduc
In directory sc8-pr-cvs1:/tmp/cvs-serv2981/dimduc
Modified Files:
DCalculDimduc.java DParametresDimduc.java
DResultatsDimduc.java ServeurDimduc.java
Log Message:
reformat all files
Index: DCalculDimduc.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dimduc/DCalculDimduc.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DCalculDimduc.java 23 Sep 2003 19:28:51 -0000 1.3
--- DCalculDimduc.java 25 Nov 2003 10:11:30 -0000 1.4
***************
*** 1,2609 ****
! /*
! * @file DCalculDimduc.java
! * @creation 1999-06-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.dimduc;
[...5094 lines suppressed...]
! System.out.println(
! "Calcul cote moment maxi non convergent pour cote fiche = "
! + cote_fiche_m_
! + " m, force = "
! + force_maxi_t_
! + " t");
! System.out.println(" FIN DU CALCUL : SORTIE ");
! } // fin (convergence_cote_ == false)
! else if (convergence_cote_) {
! /*
! System.out.println (" ");
! System.out.println ("Calcul cote et valeur moment maxi convergents dans ccmm pour force = " + force_maxi_t_ + " t, energie = "
! + energie_totale_tm_ + " tm, moment maxi = " + moment_maxi_tm_ + " tm a la cote " + cote_moment_maxi_m_ + " m");
! System.out.println (" ");
! */
! } // fin else
! } // fin try
! catch (Exception e) {}
! } // fin methode calculeDuc v 1.05
! }
Index: DParametresDimduc.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dimduc/DParametresDimduc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DParametresDimduc.java 23 Sep 2003 19:28:51 -0000 1.4
--- DParametresDimduc.java 25 Nov 2003 10:11:30 -0000 1.5
***************
*** 1,123 ****
! /*
! * @file DParametresDimduc.java
! * @creation 1999-06-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.dimduc;
!
! import org.fudaa.dodico.calcul.DParametres;
! import org.fudaa.dodico.corba.dimduc.IParametresDimducOperations;
! import org.fudaa.dodico.corba.dimduc.SParametres01;
! import org.fudaa.dodico.corba.dimduc.SParametres02;
!
! /**
! * Classe d'implantation de l'interface IParametresDimduc gerant les parametres
! * du code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Christian Barou
! */
! public class DParametresDimduc
! extends DParametres
! implements IParametresDimducOperations
! {
!
! /**
! * Structure decrivant les parametres : diametres, epaisseurs...
! * cf "dimduc.idl".
! */
! private SParametres01 params01 = null;
!
! /**
! * Structure decrivant les parametres : contraintes admissibles,accostage...
! * cf "dimduc.idl".
! */
! private SParametres02 params02 = null;
!
!
! /**
! * Constructeur vide.
! */
! public DParametresDimduc()
! {
! super();
! }
!
!
! /**
! * Pas implanter completement.
! *
! * @return <code>new DParametresDimduc()</code>.
! */
! public Object clone()
! {
! return new DParametresDimduc();
! }
!
!
! /**
! * Description de la classe.
! *
! * @return "DParametresDimduc()"
! */
! public String toString()
! {
! return "DParametresDimduc()";
! }
!
!
! /**
! * Renvoie le structure interne utilisee pour decrire les diametres,
! * les epaisseurs...cf "dimduc.idl".
! */
! public SParametres01 parametres01()
! {
! if(params01 == null)
! {
! params01 = new SParametres01();
! }
! return params01;
! }
!
!
! /**
! * Modifie la structure interne correspondante.
! *
! * @param _p la nouvelle structure <code>SParametres01</code>
! */
! public void parametres01(SParametres01 _p)
! {
! params01 = _p;
! }
!
!
! /**
! * Renvoie la structure interne utilisee pour decrire les accostages, les
! * contraintes admissibles, ....
! */
! public SParametres02 parametres02()
! {
! if(params02 == null)
! {
! params02 = new SParametres02();
! }
! return params02;
! }
!
!
! /**
! * Modifie la structure interne correspondante.
! *
! * @param _p la nouvelle structure <code>SParametres02</code>
! */
! public void parametres02(SParametres02 _p)
! {
! params02 = _p;
! }
!
! }
!
--- 1,92 ----
! /*
! * @file DParametresDimduc.java
! * @creation 1999-06-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.dimduc;
! import org.fudaa.dodico.calcul.DParametres;
! import org.fudaa.dodico.corba.dimduc.IParametresDimducOperations;
! import org.fudaa.dodico.corba.dimduc.SParametres01;
! import org.fudaa.dodico.corba.dimduc.SParametres02;
! /**
! * Classe d'implantation de l'interface IParametresDimduc gerant les parametres
! * du code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Christian Barou
! */
! public class DParametresDimduc
! extends DParametres
! implements IParametresDimducOperations {
! /**
! * Structure decrivant les parametres : diametres, epaisseurs...
! * cf "dimduc.idl".
! */
! private SParametres01 params01= null;
! /**
! * Structure decrivant les parametres : contraintes admissibles,accostage...
! * cf "dimduc.idl".
! */
! private SParametres02 params02= null;
! /**
! * Constructeur vide.
! */
! public DParametresDimduc() {
! super();
! }
! /**
! * Pas implanter completement.
! *
! * @return <code>new DParametresDimduc()</code>.
! */
! public Object clone() {
! return new DParametresDimduc();
! }
! /**
! * Description de la classe.
! *
! * @return "DParametresDimduc()"
! */
! public String toString() {
! return "DParametresDimduc()";
! }
! /**
! * Renvoie le structure interne utilisee pour decrire les diametres,
! * les epaisseurs...cf "dimduc.idl".
! */
! public SParametres01 parametres01() {
! if (params01 == null) {
! params01= new SParametres01();
! }
! return params01;
! }
! /**
! * Modifie la structure interne correspondante.
! *
! * @param _p la nouvelle structure <code>SParametres01</code>
! */
! public void parametres01(SParametres01 _p) {
! params01= _p;
! }
! /**
! * Renvoie la structure interne utilisee pour decrire les accostages, les
! * contraintes admissibles, ....
! */
! public SParametres02 parametres02() {
! if (params02 == null) {
! params02= new SParametres02();
! }
! return params02;
! }
! /**
! * Modifie la structure interne correspondante.
! *
! * @param _p la nouvelle structure <code>SParametres02</code>
! */
! public void parametres02(SParametres02 _p) {
! params02= _p;
! }
! }
Index: DResultatsDimduc.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dimduc/DResultatsDimduc.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DResultatsDimduc.java 23 Sep 2003 19:28:51 -0000 1.3
--- DResultatsDimduc.java 25 Nov 2003 10:11:30 -0000 1.4
***************
*** 1,355 ****
! /*
! * @file DResultatsDimduc.java
! * @creation 1999-06-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.dimduc;
!
! import org.fudaa.dodico.corba.dimduc.IResultatsDimducOperations;
! import org.fudaa.dodico.corba.dimduc.STableauMoments;
! import org.fudaa.dodico.corba.dimduc.SSollicitationAccostage;
! import org.fudaa.dodico.corba.ducalbe.SPointEffortDeformation;
!
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.calcul.DResultats;
!
! /**
! * Classe d'implataion de l'interface IResultatsDimduc gerant les resultats du
! * code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Christian Barou
! */
! public class DResultatsDimduc
! extends DResultats
! implements IResultatsDimducOperations
! {
!
! //private String path;
!
! /**
! * Structures concernant les points de la courbe effort/deformation.
! */
! private SPointEffortDeformation[] pointsEDL = null;
!
! /**
! * Structures concernant les points de la courbe effort/deformation.
! */
! private SPointEffortDeformation[] pointsEDC = null;
!
! /**
! * Structures decrivant les moments legers.
! */
! private STableauMoments[] tableauMomentsLeger = null;
!
! /**
! * Structures decrivant les moments court.
! */
! private STableauMoments[] tableauMomentsCourt = null;
!
! /**
! * Structure decrivant les sollicitations d'accostage.
! */
! private SSollicitationAccostage[] sollicitationsAccostage = null;
!
!
! /**
! * Constructeur vide.
! */
! public DResultatsDimduc()
! {
! super();
! }
!
!
! /**
! * Initialise le tableau <code>pointsEDL</code> de la courbe
! * effort/deformation.
! */
! private void litPointsEDL()
! {
! try
! {
! pointsEDL = new SPointEffortDeformation[]{};
! }
! catch(Exception e)
! {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
!
!
! /**
! * Appelle <code>litPointsEDL()</code>.
! */
! private void analysePointsEDL()
! {
! litPointsEDL();
! }
!
!
! /**
! * Initialise le tableau <code>pointsEDC</code> des efforts de deformation.
! */
! private void litPointsEDC()
! {
! try
! {
! pointsEDC = new SPointEffortDeformation[]{};
! }
! catch(Exception e)
! {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
!
!
! /**
! * Appelle <code>litPointsEDC</code>.
! */
! private void analysePointsEDC()
! {
! litPointsEDC();
! }
!
!
! /**
! * appelle la methode <code>litTableauMomentsLeger()</code>.
! *
! * @see #litTableauMomentsLeger()
! */
! private void analyseTableauMomentsLeger()
! {
! litTableauMomentsLeger();
! }
!
!
! /**
! * Initialise le tableau des moments legers.
! */
! private void litTableauMomentsLeger()
! {
! try
! {
! tableauMomentsLeger = new STableauMoments[]{};
! }
! catch(Exception e)
! {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
!
!
! /**
! * Appelle <code>litTableauMomentsCourt()</code>.
! *
! * @see #litTableauMomentsCourt()
! */
! private void analyseTableauMomentsCourt()
! {
! litTableauMomentsCourt();
! }
!
!
! /**
! * Initialise le tableau des moments courts.
! */
! private void litTableauMomentsCourt()
! {
! try
! {
! tableauMomentsCourt = new STableauMoments[]{};
! }
! catch(Exception e)
! {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
!
!
!
!
! /**
! * Initialise le tableau des sollicitation d'accostage.
! */
! private void litSollicitationAccostage()
! {
! try
! {
! sollicitationsAccostage = new SSollicitationAccostage[]{};
! }
! catch(Exception e)
! {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
!
!
! /**
! * Appelle <code>litSollicitationAccostage()</code>
! *
! * @see #litSollicitationAccostage()
! */
! private void analyseSollicitationAccostage()
! {
! litSollicitationAccostage();
! }
!
!
! /**
! * Pas implanter completement.
! *
! * @return <code>new DResultatsDimduc()</code>.
! */
! public Object clone()
! {
! return new DResultatsDimduc();
! }
!
!
! /**
! * Modifie les point effort/deformation <code>_pointsEDL</code>.
! *
! * @param _pointsEDL.
! */
! public void pointsEDL(SPointEffortDeformation[] _pointsEDL)
! {
! pointsEDL = _pointsEDL;
! }
!
!
! /**
! * Renvoie la structure decrivant la les points de la courbe "EDL"
! * effort/deformation.
! *
! * @return structure interne apres analyse par
! <code>analysePointsEDL</code>.
! * @see #analysePointsEDL().
! */
! public SPointEffortDeformation[] pointsEDL()
! {
! if(pointsEDL == null)
! {
! analysePointsEDL();
! }
! return pointsEDL;
! }
!
!
!
! /**
! * Modifie les points "EDC" de la structure Effort/deformation.
! *
! * @param _pointsEDC nouvelle structure.
! */
! public void pointsEDC(SPointEffortDeformation[] _pointsEDC)
! {
! pointsEDC = _pointsEDC;
! }
!
!
! /**
! * Renvoie la structure des points de la courbe effort/deformation.
! */
! public SPointEffortDeformation[] pointsEDC()
! {
! if(pointsEDC == null)
! {
! analysePointsEDC();
! }
! return pointsEDC;
! }
!
!
! /**
! * Modifie le tableau des moments leger.
! *
! * @param _tablMomentsLeger le nouveau tableau.
! */
! public void tableauMomentsLeger(STableauMoments[] _tablMomentsLeger)
! {
! tableauMomentsLeger = _tablMomentsLeger;
! }
!
!
! /**
! * ....
! *
! * @return
! */
! public STableauMoments[] tableauMomentsLeger()
! {
! if(tableauMomentsLeger == null)
! {
! analyseTableauMomentsLeger();
! }
! return tableauMomentsLeger;
! }
!
!
!
!
! /**
! * Tableau moments duc + court
! *
! * @param _tablMomentsCourt
! */
! public void tableauMomentsCourt(STableauMoments[] _tablMomentsCourt)
! {
! tableauMomentsCourt = _tablMomentsCourt;
! }
!
!
! /**
! * Renvoie le tableau des moments courts apres
! * <code>analyseTableauMomentsCourt()</code>.
! *
! * @see #analyseTableauMomentsCourt()
! */
! public STableauMoments[] tableauMomentsCourt()
! {
! if(tableauMomentsCourt == null)
! {
! analyseTableauMomentsCourt();
! }
! return tableauMomentsCourt;
! }
!
!
! /**
! * renvoie le tableau des sollicitations d'accostage apres analyse:
! * <code>analyseSollicitationAccostage()</code>.
! *
! * @see #analyseSollicitationAccostage()
! */
! public SSollicitationAccostage[] sollicitationsAccostage()
! {
! if(sollicitationsAccostage == null)
! {
! analyseSollicitationAccostage();
! }
! return sollicitationsAccostage;
! }
!
!
! /**
! * Modifie la structure des sollicitations d'acostage.
! *
! * @param _sollicit la nouvelle structure.
! */
! public void sollicitationsAccostage(SSollicitationAccostage[] _sollicit)
! {
! sollicitationsAccostage = _sollicit;
! }
!
! }
!
--- 1,251 ----
! /*
! * @file DResultatsDimduc.java
! * @creation 1999-06-01
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.dimduc;
! import org.fudaa.dodico.corba.dimduc.IResultatsDimducOperations;
! import org.fudaa.dodico.corba.dimduc.STableauMoments;
! import org.fudaa.dodico.corba.dimduc.SSollicitationAccostage;
! import org.fudaa.dodico.corba.ducalbe.SPointEffortDeformation;
! import org.fudaa.dodico.objet.CDodico;
! import org.fudaa.dodico.calcul.DResultats;
! /**
! * Classe d'implataion de l'interface IResultatsDimduc gerant les resultats du
! * code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Christian Barou
! */
! public class DResultatsDimduc
! extends DResultats
! implements IResultatsDimducOperations {
! //private String path;
! /**
! * Structures concernant les points de la courbe effort/deformation.
! */
! private SPointEffortDeformation[] pointsEDL= null;
! /**
! * Structures concernant les points de la courbe effort/deformation.
! */
! private SPointEffortDeformation[] pointsEDC= null;
! /**
! * Structures decrivant les moments legers.
! */
! private STableauMoments[] tableauMomentsLeger= null;
! /**
! * Structures decrivant les moments court.
! */
! private STableauMoments[] tableauMomentsCourt= null;
! /**
! * Structure decrivant les sollicitations d'accostage.
! */
! private SSollicitationAccostage[] sollicitationsAccostage= null;
! /**
! * Constructeur vide.
! */
! public DResultatsDimduc() {
! super();
! }
! /**
! * Initialise le tableau <code>pointsEDL</code> de la courbe
! * effort/deformation.
! */
! private void litPointsEDL() {
! try {
! pointsEDL= new SPointEffortDeformation[] {};
! } catch (Exception e) {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
! /**
! * Appelle <code>litPointsEDL()</code>.
! */
! private void analysePointsEDL() {
! litPointsEDL();
! }
! /**
! * Initialise le tableau <code>pointsEDC</code> des efforts de deformation.
! */
! private void litPointsEDC() {
! try {
! pointsEDC= new SPointEffortDeformation[] {};
! } catch (Exception e) {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
! /**
! * Appelle <code>litPointsEDC</code>.
! */
! private void analysePointsEDC() {
! litPointsEDC();
! }
! /**
! * appelle la methode <code>litTableauMomentsLeger()</code>.
! *
! * @see #litTableauMomentsLeger()
! */
! private void analyseTableauMomentsLeger() {
! litTableauMomentsLeger();
! }
! /**
! * Initialise le tableau des moments legers.
! */
! private void litTableauMomentsLeger() {
! try {
! tableauMomentsLeger= new STableauMoments[] {};
! } catch (Exception e) {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
! /**
! * Appelle <code>litTableauMomentsCourt()</code>.
! *
! * @see #litTableauMomentsCourt()
! */
! private void analyseTableauMomentsCourt() {
! litTableauMomentsCourt();
! }
! /**
! * Initialise le tableau des moments courts.
! */
! private void litTableauMomentsCourt() {
! try {
! tableauMomentsCourt= new STableauMoments[] {};
! } catch (Exception e) {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
! /**
! * Initialise le tableau des sollicitation d'accostage.
! */
! private void litSollicitationAccostage() {
! try {
! sollicitationsAccostage= new SSollicitationAccostage[] {};
! } catch (Exception e) {
! System.err.println(e);
! CDodico.exception(this, e);
! }
! }
! /**
! * Appelle <code>litSollicitationAccostage()</code>
! *
! * @see #litSollicitationAccostage()
! */
! private void analyseSollicitationAccostage() {
! litSollicitationAccostage();
! }
! /**
! * Pas implanter completement.
! *
! * @return <code>new DResultatsDimduc()</code>.
! */
! public Object clone() {
! return new DResultatsDimduc();
! }
! /**
! * Modifie les point effort/deformation <code>_pointsEDL</code>.
! *
! * @param _pointsEDL.
! */
! public void pointsEDL(SPointEffortDeformation[] _pointsEDL) {
! pointsEDL= _pointsEDL;
! }
! /**
! * Renvoie la structure decrivant la les points de la courbe "EDL"
! * effort/deformation.
! *
! * @return structure interne apres analyse par
! <code>analysePointsEDL</code>.
! * @see #analysePointsEDL().
! */
! public SPointEffortDeformation[] pointsEDL() {
! if (pointsEDL == null) {
! analysePointsEDL();
! }
! return pointsEDL;
! }
! /**
! * Modifie les points "EDC" de la structure Effort/deformation.
! *
! * @param _pointsEDC nouvelle structure.
! */
! public void pointsEDC(SPointEffortDeformation[] _pointsEDC) {
! pointsEDC= _pointsEDC;
! }
! /**
! * Renvoie la structure des points de la courbe effort/deformation.
! */
! public SPointEffortDeformation[] pointsEDC() {
! if (pointsEDC == null) {
! analysePointsEDC();
! }
! return pointsEDC;
! }
! /**
! * Modifie le tableau des moments leger.
! *
! * @param _tablMomentsLeger le nouveau tableau.
! */
! public void tableauMomentsLeger(STableauMoments[] _tablMomentsLeger) {
! tableauMomentsLeger= _tablMomentsLeger;
! }
! /**
! * ....
! *
! * @return
! */
! public STableauMoments[] tableauMomentsLeger() {
! if (tableauMomentsLeger == null) {
! analyseTableauMomentsLeger();
! }
! return tableauMomentsLeger;
! }
! /**
! * Tableau moments duc + court
! *
! * @param _tablMomentsCourt
! */
! public void tableauMomentsCourt(STableauMoments[] _tablMomentsCourt) {
! tableauMomentsCourt= _tablMomentsCourt;
! }
! /**
! * Renvoie le tableau des moments courts apres
! * <code>analyseTableauMomentsCourt()</code>.
! *
! * @see #analyseTableauMomentsCourt()
! */
! public STableauMoments[] tableauMomentsCourt() {
! if (tableauMomentsCourt == null) {
! analyseTableauMomentsCourt();
! }
! return tableauMomentsCourt;
! }
! /**
! * renvoie le tableau des sollicitations d'accostage apres analyse:
! * <code>analyseSollicitationAccostage()</code>.
! *
! * @see #analyseSollicitationAccostage()
! */
! public SSollicitationAccostage[] sollicitationsAccostage() {
! if (sollicitationsAccostage == null) {
! analyseSollicitationAccostage();
! }
! return sollicitationsAccostage;
! }
! /**
! * Modifie la structure des sollicitations d'acostage.
! *
! * @param _sollicit la nouvelle structure.
! */
! public void sollicitationsAccostage(SSollicitationAccostage[] _sollicit) {
! sollicitationsAccostage= _sollicit;
! }
! }
Index: ServeurDimduc.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dimduc/ServeurDimduc.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ServeurDimduc.java 23 Sep 2003 19:28:51 -0000 1.3
--- ServeurDimduc.java 25 Nov 2003 10:11:30 -0000 1.4
***************
*** 1,47 ****
! /*
! * @file ServeurDimduc.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.dodico.dimduc;
!
! import java.util.Date;
!
! import org.fudaa.dodico.objet.CDodico;
!
! /**
! * Lance le serveur du code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurDimduc
! {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculDimduc</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args)
! {
! String nom = (args.length > 0
! ? args[0]
! : CDodico.generateName("::dimduc::ICalculDimduc"));
!
! DCalculDimduc s = new DCalculDimduc();
! CDodico.rebind(nom, s.tie());
!
! System.out.println("Dimduc server running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
!
!
--- 1,38 ----
! /*
! * @file ServeurDimduc.java
! * @creation 2000-02-16
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.dodico.dimduc;
! import java.util.Date;
! import org.fudaa.dodico.objet.CDodico;
! /**
! * Lance le serveur du code de calcul <code>dimduc</code>.
! *
! * @version $Revision$ $Date$ by $Author$
! * @author Guillaume Desnoix
! */
! public class ServeurDimduc {
! /**
! * Creation et connexion a l'orb d'une instance de <code>DCalculDimduc</code>.
! * Si non vide, le premier argument passe est utilise comme nom de connexion.
! * Sinon un nom est genere par <code>CDodico.generateName(String)</code>.
! *
! * @param args le premier argument sert de nom de connexion.
! * @see org.fudaa.dodico.objet.CDodico#generateName(String)
! */
! public static void main(String[] args) {
! String nom=
! (args.length > 0
! ? args[0]
! : CDodico.generateName("::dimduc::ICalculDimduc"));
! DCalculDimduc s= new DCalculDimduc();
! CDodico.rebind(nom, s.tie());
! System.out.println("Dimduc server running... ");
! System.out.println("Name: " + nom);
! System.out.println("Date: " + new Date());
! }
! }
|
|
From: <de...@us...> - 2003-11-25 10:43:04
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/modele
In directory sc8-pr-cvs1:/tmp/cvs-serv3074/commun/modele
Modified Files:
ModeleSMaillageElement.java ModeleTableauPoint.java
Log Message:
reformat all files
Index: ModeleSMaillageElement.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/modele/ModeleSMaillageElement.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ModeleSMaillageElement.java 23 Sep 2003 21:08:06 -0000 1.5
--- ModeleSMaillageElement.java 25 Nov 2003 10:13:34 -0000 1.6
***************
*** 1,424 ****
! /*
! * @file ModeleSMaillageElement.java
! * @creation 2002-06-13
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.modele;
!
! import java.util.Hashtable;
! import java.util.Enumeration;
! import java.util.Vector;
! import org.fudaa.ebli.geometrie.*;
! import org.fudaa.ebli.calque.ZModeleMaillageElement;
! import org.fudaa.dodico.corba.geometrie.*;
!
! /**
! * Un modele de maillage pour les structures SMaillage.
! *
! * @version $Id$
! * @author Frederic Deniger
! */
! public class ModeleSMaillageElement
! // implements ZModeleMaillageElement
! {
!
! SMaillage smaillage_;
! GrElement[][] elsPeau_;
! int nbAretes_;
! GrPoint ptOuestGarde_;
! GrPoint ptEstGarde_;
! GrBoite domaineRenvoye_;
! GrPolygone poly_;
! GrPoint p_;
!
! public ModeleSMaillageElement(SMaillage _s)
! {
! smaillage_=_s;
! nbAretes_=-1;
! }
!
! /**
! * @return Le nombre de polygone du modele
! */
! public int nombrePolygones()
! {
! return smaillage_.elements.length;
! }
!
!
! /**
! * @return Le nombre de points
! */
! public int getNombreNoeuds()
! {
! return smaillage_.noeuds.length;
! }
!
!
! /**
! * @return Le nombre d'elements composants le contours
! */
! public int nombreAretesContours()
! {
! if(nbAretes_<0)
! {
! if (elsPeau_==null) calculeAretes();
! nbAretes_=elsPeau_.length;
! }
! return nbAretes_;
! }
!
!
! /**
! * @param i le numero d'arete
! * @return Les elements support pour l'arete i
! */
! public int nombreElementsArete(int i)
! {
! if (elsPeau_==null) calculeAretes();
! return elsPeau_[i].length;
! }
!
!
! /**
! * L'element support j de l'arete i
! *
! * @param i le numero d'arete
! * @param j le numero de l'element support
! * @return le polygone de l'element support j de l'arete i
! */
! public GrPolygone aretesContours(int i, int j)
! {
! if (elsPeau_==null) calculeAretes();
! return elsPeau_[i][j].polygone();
! }
!
!
! /**
! * Renvoie Toujours la meme boite.
! *
! * @return Le domaine du maillage
! */
! public GrBoite domaine()
! {
! if(smaillage_.noeuds.length<=0) return null;
!
! if((ptEstGarde_==null) || (ptOuestGarde_==null) )
! {
! GrBoite temp=new GrBoite();
! for(int i=smaillage_.noeuds.length-1;i>=0;i--)
! {
! SPoint p=smaillage_.noeuds[i].point;
! temp.ajuste(p.x,p.y,p.z);
! }
! ptEstGarde_=temp.e;
! ptOuestGarde_=temp.o;
! }
! if(domaineRenvoye_==null)
! {
! domaineRenvoye_=new GrBoite();
! domaineRenvoye_.e=new GrPoint(ptEstGarde_.x,ptEstGarde_.y,ptEstGarde_.z);
! domaineRenvoye_.o=new GrPoint(ptOuestGarde_.x,ptOuestGarde_.y,ptOuestGarde_.z);
!
! }
! else
! {
! domaineRenvoye_.o.x=ptOuestGarde_.x;
! domaineRenvoye_.o.y=ptOuestGarde_.y;
! domaineRenvoye_.o.z=ptOuestGarde_.z;
! domaineRenvoye_.e.x=ptEstGarde_.x;
! domaineRenvoye_.e.y=ptEstGarde_.y;
! domaineRenvoye_.e.z=ptEstGarde_.z;
! }
! return domaineRenvoye_;
! }
!
!
!
! /**
! * @param i le numero du polygone voulu
! * @return le polygone i du maillage
! */
! public GrPolygone polygone(int i)
! {
! if(poly_==null)
! poly_=new GrPolygone();
! else
! poly_.sommets.vide();
! SNoeud[] temp=smaillage_.elements[i].noeuds;
! for(int j=temp.length-1;j>=0;j--)
! poly_.sommets.ajoute(new GrPoint(temp[j].point.x,temp[j].point.y,temp[j].point.z));
! temp=null;
! return poly_;
! }
!
!
! /**
! * Retourne toujours la meme instance de GrPoit mais avec les coordonnees
! * modifiees.
! * @param i le numero du noeud voulu
! * @return le noeud i du maillage
! */
! public GrPoint point(int i)
! {
! SPoint p=smaillage_.noeuds[i].point;
! if(p_==null)
! p_=new GrPoint(p.x,p.y,p.z);
! else
! {
! p_.x=p.x;
! p_.y=p.y;
! p_.z=p.z;
! }
! return p_;
! }
!
! /**
! * Methode entierement reprise de GrMaillageElement....A ameliorer
! */
! private void calculeAretes()
! {
! if (elsPeau_!=null) return;
! // long tI=System.currentTimeMillis();
! // long mI=Runtime.getRuntime().freeMemory();
! GrElement[] els=s2GrElement();
!
! // GrElement[] elsOrient=new GrElement[elements_.nombre()];
! GrElement[] elsOrient=new GrElement[nombrePolygones()];
!
! // Orientation des éléments tous dans l'ordre trigo
! for (int i=nombrePolygones()-1; i>=0; i--) {
! // GrElement el=elements_.renvoie(i);
! GrElement el=els[i];
! // GrElement el=s2GrElement(i);
! GrNoeud[] nds=new GrNoeud[el.noeuds.length];
! System.arraycopy(el.noeuds,0,nds,0,el.noeuds.length);
! elsOrient[i]=new GrElement(nds,el.type);
! elsOrient[i].orienteTrigo(true);
! }
! // System.out.println("Etape 1 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 1 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
!
! // Décomposition des éléments en arètes de contours
!
! System.out.print("Recherche des aretes de contours... ");
! Hashtable acs=new Hashtable(elsOrient.length*3);
! for (int i=elsOrient.length-1; i>=0; i--) {
! GrElement[] as=elsOrient[i].aretes();
!
! // Les arètes de contours pointent vers les éléments non orientés.
! // for (int j=as.length-1; j>=0; j--)
! // as[j].elementsSupport[0]=elements_.renvoie(i);
! // as[j].elementsSupport[0]=els[i];
! // as[j].elementsSupport[0]=s2GrElement(i);
!
! for (int j=as.length-1; j>=0; j--) {
! as[j].elementsSupport[0]=els[i];
! int ndDeb;
! int ndFin;
! Integer key;
! AreteChainee ac;
!
! ndDeb=as[j].noeuds[0] .hashCode();
! ndFin=as[j].noeuds[as[j].nombre()-1].hashCode();
! if (ndDeb>ndFin)
! key=new Integer(ndDeb); else key=new Integer(ndFin);
!
! if ((ac=(AreteChainee)acs.get(key))!=null) {
! while (ac.suivant!=null) ac=ac.suivant;
! ac.suivant=new AreteChainee(as[j]);
! }
! else {
! ac=new AreteChainee(as[j]);
! acs.put(key,ac);
! }
! }
! }
! // System.out.println("Etape 2 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 2 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
!
! // Suppression des doublons : seules les arètes restantes constituent les
! // frontières
!
! Vector aretes=new Vector(acs.size());
! for (Enumeration e=acs.elements(); e.hasMoreElements(); ) {
! AreteChainee ac=(AreteChainee)e.nextElement();
! AreteChainee acc;
!
! NEXTARETE: while (ac!=null) {
! acc=ac;
! while ((acc.suivant)!=null) {
! // Doublon => suppression du doublon
! if (GrMaillageElement.sontEgaux(ac.arete,acc.suivant.arete)) {
! acc.suivant=acc.suivant.suivant;
! ac=ac.suivant;
! continue NEXTARETE;
! }
! acc=acc.suivant;
! }
!
! // Pas de doublons => Stockage de l'arète
! aretes.add(ac.arete);
! ac=ac.suivant;
! }
! }
! // System.out.println("nombre Aretes "+aretes.size());
! // System.out.println("Etape 3 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 3 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
!
! // Ordonnancement des arètes par contours
!
! Hashtable nd2Arete=new Hashtable(aretes.size());
!
! for (Enumeration e=aretes.elements(); e.hasMoreElements();) {
! GrElement ar=(GrElement)e.nextElement();
! nd2Arete.put(ar.noeuds[0],ar);
! }
! // System.out.println("Etape 4 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 4 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
!
! Vector cntrs=new Vector();
! while (nd2Arete.size()>0) {
! Vector cntr=new Vector();
! GrElement ar;
! GrNoeud nd;
!
! nd=((GrElement)nd2Arete.elements().nextElement()).noeuds[0];
!
! while ((ar=(GrElement)nd2Arete.remove(nd))!=null) {
! // for (int i=0; i<ar.length-1; i++) cntr.add(ar[i]);
! cntr.add(ar);
! nd=ar.noeuds[ar.nombre()-1];
! }
!
! cntrs.add(cntr);
! }
! // System.out.println("Etape 5 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 5 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
!
! // Transfert vers un tableau d'arètes
! elsPeau_=new GrElement[cntrs.size()][];
! for (int i=0; i<elsPeau_.length; i++) {
! Vector cntr=(Vector)cntrs.get(i);
! elsPeau_[i]=new GrElement[cntr.size()];
! cntr.toArray(elsPeau_[i]);
! }
! // els=null;
! elsOrient=null;
! // System.out.println("Etape 6 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 6 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! }
!
! private GrElement[] s2GrElement()
! {
! int nb=nombrePolygones();
! Hashtable tableNoeud=new Hashtable(getNombreNoeuds());
! GrElement[] r=new GrElement[nb];
! for(int i=nb-1;i>=0;i--)
! {
! SNoeud[] e=smaillage_.elements[i].noeuds;
! GrNoeud[] noeuds=new GrNoeud[e.length];
! for (int j=noeuds.length-1; j>=0; j--)
! {
! if( !tableNoeud.containsKey(e[j]))
! {
! noeuds[j]=new GrNoeud(new GrPoint(e[j].point.x,e[j].point.y,e[j].point.z));
! tableNoeud.put(e[j],noeuds[j]);
! }
! else
! noeuds[j]=(GrNoeud)(tableNoeud.get(e[j]));
! }
! int type=-1;
! LTypeElement stype=smaillage_.elements[i].type;
! if (stype==LTypeElement.L2) type=GrElement.L2;
! else if (stype==LTypeElement.L3) type=GrElement.L3;
! else if (stype==LTypeElement.T3) type=GrElement.T3;
! else if (stype==LTypeElement.T6) type=GrElement.T6;
! else if (stype==LTypeElement.Q4) type=GrElement.Q4;
! else if (stype==LTypeElement.Q8) type=GrElement.Q8;
! r[i]=new GrElement(noeuds,type);
! }
! return r;
! }
!
! // private GrElement s2GrElement(int _i)
! // {
! // SNoeud[] snoeuds=smaillage_.elements[_i].noeuds;
! // GrNoeud[] noeuds=new GrNoeud[snoeuds.length];
! // for (int j=noeuds.length-1; j>=0; j--)
! // {
! // noeuds[j]=new GrNoeud(new GrPoint(snoeuds[j].point.x,snoeuds[j].point.y,snoeuds[j].point.z));
! // }
! // int type=-1;
! // LTypeElement stype=smaillage_.elements[_i].type;
! // if (stype==LTypeElement.L2) type=GrElement.L2;
! // else if (stype==LTypeElement.L3) type=GrElement.L3;
! // else if (stype==LTypeElement.T3) type=GrElement.T3;
! // else if (stype==LTypeElement.T6) type=GrElement.T6;
! // else if (stype==LTypeElement.Q4) type=GrElement.Q4;
! // else if (stype==LTypeElement.Q8) type=GrElement.Q8;
! // GrElement r=new GrElement(noeuds,type);
! // return r;
! // }
! //
! // private static final boolean sontEgaux(GrElement a, GrElement b) {
! // boolean egal;
! //
! // if (a.noeuds.length!=b.noeuds.length) return false;
! // int n=a.noeuds.length;
! //
! // egal=true;
! // for (int i=0; i<n; i++) {
! // if (!sontEgaux(a.noeuds[i],b.noeuds[i])) {
! // egal=false;
! // break;
! // }
! // }
! // if (!egal) {
! // egal=true;
! // for (int i=0; i<n; i++) {
! // if (!sontEgaux(a.noeuds[n-i-1],b.noeuds[i])) {
! // egal=false;
! // break;
! // }
! // }
! // }
! //
! // return egal;
! // }
! //
! // private static final boolean sontEgaux(GrNoeud a, GrNoeud b)
! // {
! // GrPoint ap=a.point;
! // GrPoint bp=b.point;
! // if( (sontEgaux(ap.x,bp.x)) && (sontEgaux(ap.y,bp.y)) && (sontEgaux(ap.z,bp.z)) )
! // return true;
! // else
! // return false;
! // }
! //
! // private static final boolean sontEgaux(double a, double b)
! // {
! // double eps=10;
! // if((a-b-eps<0) || (b-a-eps<0))
! // return true;
! // else
! // return false;
! // }
! //
!
! final class AreteChainee {
! GrElement arete;
! AreteChainee suivant;
!
! public AreteChainee(GrElement _arete) {
! arete=_arete;
! suivant=null;
! }
! }
!
! }
!
--- 1,369 ----
! /*
! * @file ModeleSMaillageElement.java
! * @creation 2002-06-13
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.modele;
! import java.util.Hashtable;
! import java.util.Enumeration;
! import java.util.Vector;
! import org.fudaa.ebli.geometrie.*;
! import org.fudaa.ebli.calque.ZModeleMaillageElement;
! import org.fudaa.dodico.corba.geometrie.*;
! /**
! * Un modele de maillage pour les structures SMaillage.
! *
! * @version $Id$
! * @author Frederic Deniger
! */
! public class ModeleSMaillageElement// implements ZModeleMaillageElement
! {
! SMaillage smaillage_;
! GrElement[][] elsPeau_;
! int nbAretes_;
! GrPoint ptOuestGarde_;
! GrPoint ptEstGarde_;
! GrBoite domaineRenvoye_;
! GrPolygone poly_;
! GrPoint p_;
! public ModeleSMaillageElement(SMaillage _s) {
! smaillage_= _s;
! nbAretes_= -1;
! }
! /**
! * @return Le nombre de polygone du modele
! */
! public int nombrePolygones() {
! return smaillage_.elements.length;
! }
! /**
! * @return Le nombre de points
! */
! public int getNombreNoeuds() {
! return smaillage_.noeuds.length;
! }
! /**
! * @return Le nombre d'elements composants le contours
! */
! public int nombreAretesContours() {
! if (nbAretes_ < 0) {
! if (elsPeau_ == null)
! calculeAretes();
! nbAretes_= elsPeau_.length;
! }
! return nbAretes_;
! }
! /**
! * @param i le numero d'arete
! * @return Les elements support pour l'arete i
! */
! public int nombreElementsArete(int i) {
! if (elsPeau_ == null)
! calculeAretes();
! return elsPeau_[i].length;
! }
! /**
! * L'element support j de l'arete i
! *
! * @param i le numero d'arete
! * @param j le numero de l'element support
! * @return le polygone de l'element support j de l'arete i
! */
! public GrPolygone aretesContours(int i, int j) {
! if (elsPeau_ == null)
! calculeAretes();
! return elsPeau_[i][j].polygone();
! }
! /**
! * Renvoie Toujours la meme boite.
! *
! * @return Le domaine du maillage
! */
! public GrBoite domaine() {
! if (smaillage_.noeuds.length <= 0)
! return null;
! if ((ptEstGarde_ == null) || (ptOuestGarde_ == null)) {
! GrBoite temp= new GrBoite();
! for (int i= smaillage_.noeuds.length - 1; i >= 0; i--) {
! SPoint p= smaillage_.noeuds[i].point;
! temp.ajuste(p.x, p.y, p.z);
! }
! ptEstGarde_= temp.e;
! ptOuestGarde_= temp.o;
! }
! if (domaineRenvoye_ == null) {
! domaineRenvoye_= new GrBoite();
! domaineRenvoye_.e=
! new GrPoint(ptEstGarde_.x, ptEstGarde_.y, ptEstGarde_.z);
! domaineRenvoye_.o=
! new GrPoint(ptOuestGarde_.x, ptOuestGarde_.y, ptOuestGarde_.z);
! } else {
! domaineRenvoye_.o.x= ptOuestGarde_.x;
! domaineRenvoye_.o.y= ptOuestGarde_.y;
! domaineRenvoye_.o.z= ptOuestGarde_.z;
! domaineRenvoye_.e.x= ptEstGarde_.x;
! domaineRenvoye_.e.y= ptEstGarde_.y;
! domaineRenvoye_.e.z= ptEstGarde_.z;
! }
! return domaineRenvoye_;
! }
! /**
! * @param i le numero du polygone voulu
! * @return le polygone i du maillage
! */
! public GrPolygone polygone(int i) {
! if (poly_ == null)
! poly_= new GrPolygone();
! else
! poly_.sommets.vide();
! SNoeud[] temp= smaillage_.elements[i].noeuds;
! for (int j= temp.length - 1; j >= 0; j--)
! poly_.sommets.ajoute(
! new GrPoint(temp[j].point.x, temp[j].point.y, temp[j].point.z));
! temp= null;
! return poly_;
! }
! /**
! * Retourne toujours la meme instance de GrPoit mais avec les coordonnees
! * modifiees.
! * @param i le numero du noeud voulu
! * @return le noeud i du maillage
! */
! public GrPoint point(int i) {
! SPoint p= smaillage_.noeuds[i].point;
! if (p_ == null)
! p_= new GrPoint(p.x, p.y, p.z);
! else {
! p_.x= p.x;
! p_.y= p.y;
! p_.z= p.z;
! }
! return p_;
! }
! /**
! * Methode entierement reprise de GrMaillageElement....A ameliorer
! */
! private void calculeAretes() {
! if (elsPeau_ != null)
! return;
! // long tI=System.currentTimeMillis();
! // long mI=Runtime.getRuntime().freeMemory();
! GrElement[] els= s2GrElement();
! // GrElement[] elsOrient=new GrElement[elements_.nombre()];
! GrElement[] elsOrient= new GrElement[nombrePolygones()];
! // Orientation des éléments tous dans l'ordre trigo
! for (int i= nombrePolygones() - 1; i >= 0; i--) {
! // GrElement el=elements_.renvoie(i);
! GrElement el= els[i];
! // GrElement el=s2GrElement(i);
! GrNoeud[] nds= new GrNoeud[el.noeuds.length];
! System.arraycopy(el.noeuds, 0, nds, 0, el.noeuds.length);
! elsOrient[i]= new GrElement(nds, el.type);
! elsOrient[i].orienteTrigo(true);
! }
! // System.out.println("Etape 1 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 1 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! // Décomposition des éléments en arètes de contours
! System.out.print("Recherche des aretes de contours... ");
! Hashtable acs= new Hashtable(elsOrient.length * 3);
! for (int i= elsOrient.length - 1; i >= 0; i--) {
! GrElement[] as= elsOrient[i].aretes();
! // Les arètes de contours pointent vers les éléments non orientés.
! // for (int j=as.length-1; j>=0; j--)
! // as[j].elementsSupport[0]=elements_.renvoie(i);
! // as[j].elementsSupport[0]=els[i];
! // as[j].elementsSupport[0]=s2GrElement(i);
! for (int j= as.length - 1; j >= 0; j--) {
! as[j].elementsSupport[0]= els[i];
! int ndDeb;
! int ndFin;
! Integer key;
! AreteChainee ac;
! ndDeb= as[j].noeuds[0].hashCode();
! ndFin= as[j].noeuds[as[j].nombre() - 1].hashCode();
! if (ndDeb > ndFin)
! key= new Integer(ndDeb);
! else
! key= new Integer(ndFin);
! if ((ac= (AreteChainee)acs.get(key)) != null) {
! while (ac.suivant != null)
! ac= ac.suivant;
! ac.suivant= new AreteChainee(as[j]);
! } else {
! ac= new AreteChainee(as[j]);
! acs.put(key, ac);
! }
! }
! }
! // System.out.println("Etape 2 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 2 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! // Suppression des doublons : seules les arètes restantes constituent les
! // frontières
! Vector aretes= new Vector(acs.size());
! for (Enumeration e= acs.elements(); e.hasMoreElements();) {
! AreteChainee ac= (AreteChainee)e.nextElement();
! AreteChainee acc;
! NEXTARETE : while (ac != null) {
! acc= ac;
! while ((acc.suivant) != null) {
! // Doublon => suppression du doublon
! if (GrMaillageElement.sontEgaux(ac.arete, acc.suivant.arete)) {
! acc.suivant= acc.suivant.suivant;
! ac= ac.suivant;
! continue NEXTARETE;
! }
! acc= acc.suivant;
! }
! // Pas de doublons => Stockage de l'arète
! aretes.add(ac.arete);
! ac= ac.suivant;
! }
! }
! // System.out.println("nombre Aretes "+aretes.size());
! // System.out.println("Etape 3 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 3 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! // Ordonnancement des arètes par contours
! Hashtable nd2Arete= new Hashtable(aretes.size());
! for (Enumeration e= aretes.elements(); e.hasMoreElements();) {
! GrElement ar= (GrElement)e.nextElement();
! nd2Arete.put(ar.noeuds[0], ar);
! }
! // System.out.println("Etape 4 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 4 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! Vector cntrs= new Vector();
! while (nd2Arete.size() > 0) {
! Vector cntr= new Vector();
! GrElement ar;
! GrNoeud nd;
! nd= ((GrElement)nd2Arete.elements().nextElement()).noeuds[0];
! while ((ar= (GrElement)nd2Arete.remove(nd)) != null) {
! // for (int i=0; i<ar.length-1; i++) cntr.add(ar[i]);
! cntr.add(ar);
! nd= ar.noeuds[ar.nombre() - 1];
! }
! cntrs.add(cntr);
! }
! // System.out.println("Etape 5 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 5 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! // Transfert vers un tableau d'arètes
! elsPeau_= new GrElement[cntrs.size()][];
! for (int i= 0; i < elsPeau_.length; i++) {
! Vector cntr= (Vector)cntrs.get(i);
! elsPeau_[i]= new GrElement[cntr.size()];
! cntr.toArray(elsPeau_[i]);
! }
! // els=null;
! elsOrient= null;
! // System.out.println("Etape 6 "+ ((int)((System.currentTimeMillis()-tI)/1000L)));
! // System.out.println("Etape 6 "+ ((int)((mI-Runtime.getRuntime().freeMemory())/1000L)));
! }
! private GrElement[] s2GrElement() {
! int nb= nombrePolygones();
! Hashtable tableNoeud= new Hashtable(getNombreNoeuds());
! GrElement[] r= new GrElement[nb];
! for (int i= nb - 1; i >= 0; i--) {
! SNoeud[] e= smaillage_.elements[i].noeuds;
! GrNoeud[] noeuds= new GrNoeud[e.length];
! for (int j= noeuds.length - 1; j >= 0; j--) {
! if (!tableNoeud.containsKey(e[j])) {
! noeuds[j]=
! new GrNoeud(new GrPoint(e[j].point.x, e[j].point.y, e[j].point.z));
! tableNoeud.put(e[j], noeuds[j]);
! } else
! noeuds[j]= (GrNoeud) (tableNoeud.get(e[j]));
! }
! int type= -1;
! LTypeElement stype= smaillage_.elements[i].type;
! if (stype == LTypeElement.L2)
! type= GrElement.L2;
! else if (stype == LTypeElement.L3)
! type= GrElement.L3;
! else if (stype == LTypeElement.T3)
! type= GrElement.T3;
! else if (stype == LTypeElement.T6)
! type= GrElement.T6;
! else if (stype == LTypeElement.Q4)
! type= GrElement.Q4;
! else if (stype == LTypeElement.Q8)
! type= GrElement.Q8;
! r[i]= new GrElement(noeuds, type);
! }
! return r;
! }
! // private GrElement s2GrElement(int _i)
! // {
! // SNoeud[] snoeuds=smaillage_.elements[_i].noeuds;
! // GrNoeud[] noeuds=new GrNoeud[snoeuds.length];
! // for (int j=noeuds.length-1; j>=0; j--)
! // {
! // noeuds[j]=new GrNoeud(new GrPoint(snoeuds[j].point.x,snoeuds[j].point.y,snoeuds[j].point.z));
! // }
! // int type=-1;
! // LTypeElement stype=smaillage_.elements[_i].type;
! // if (stype==LTypeElement.L2) type=GrElement.L2;
! // else if (stype==LTypeElement.L3) type=GrElement.L3;
! // else if (stype==LTypeElement.T3) type=GrElement.T3;
! // else if (stype==LTypeElement.T6) type=GrElement.T6;
! // else if (stype==LTypeElement.Q4) type=GrElement.Q4;
! // else if (stype==LTypeElement.Q8) type=GrElement.Q8;
! // GrElement r=new GrElement(noeuds,type);
! // return r;
! // }
! //
! // private static final boolean sontEgaux(GrElement a, GrElement b) {
! // boolean egal;
! //
! // if (a.noeuds.length!=b.noeuds.length) return false;
! // int n=a.noeuds.length;
! //
! // egal=true;
! // for (int i=0; i<n; i++) {
! // if (!sontEgaux(a.noeuds[i],b.noeuds[i])) {
! // egal=false;
! // break;
! // }
! // }
! // if (!egal) {
! // egal=true;
! // for (int i=0; i<n; i++) {
! // if (!sontEgaux(a.noeuds[n-i-1],b.noeuds[i])) {
! // egal=false;
! // break;
! // }
! // }
! // }
! //
! // return egal;
! // }
! //
! // private static final boolean sontEgaux(GrNoeud a, GrNoeud b)
! // {
! // GrPoint ap=a.point;
! // GrPoint bp=b.point;
! // if( (sontEgaux(ap.x,bp.x)) && (sontEgaux(ap.y,bp.y)) && (sontEgaux(ap.z,bp.z)) )
! // return true;
! // else
! // return false;
! // }
! //
! // private static final boolean sontEgaux(double a, double b)
! // {
! // double eps=10;
! // if((a-b-eps<0) || (b-a-eps<0))
! // return true;
! // else
! // return false;
! // }
! //
! final class AreteChainee {
! GrElement arete;
! AreteChainee suivant;
! public AreteChainee(GrElement _arete) {
! arete= _arete;
! suivant= null;
! }
! }
! }
Index: ModeleTableauPoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/modele/ModeleTableauPoint.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ModeleTableauPoint.java 23 Sep 2003 21:08:06 -0000 1.4
--- ModeleTableauPoint.java 25 Nov 2003 10:13:35 -0000 1.5
***************
*** 1,56 ****
! /*
! * @file ModeleTableauPoint.java
! * @creation 2002-06-17
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.commun.modele;
!
! import org.fudaa.ebli.geometrie.GrBoite;
! import org.fudaa.ebli.geometrie.GrPoint;
! import org.fudaa.ebli.calque.ZModelePoint;
!
! /**
! * Le modele du calque d'affichage de point.
! *
! * @version $Id$
! * @author Fred Deniger
! */
! public class ModeleTableauPoint
! // implements ZModelePoint
! {
! // private double[] x_;
! // private double[] y_;
! // private double[] z_;
! // private GrBoite boite_;
! //
! // public ModeleTableauPoint()
! // {
! // points_=_points;
! // }
! //
! // public int nombre()
! // {
! // return points_.length;
! // }
! // public GrBoite domaine()
! // {
! // if(boite_==null)
! // {
! // boite_=new GrBoite();
! // for(int i=points_.length-1;i>=0;i--)
! // boite_.ajuste(points_[i][0],points_[i][1],points_[i][2]);
! // }
! // return boite_;
! // }
! //
! // public GrPoint point(int _i)
! // {
! // return new GrPoint(points_[_i][0],points_[_i][1],points_[_i][2]);
! // }
! //
!
! }
--- 1,51 ----
! /*
! * @file ModeleTableauPoint.java
! * @creation 2002-06-17
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.fudaa.commun.modele;
! import org.fudaa.ebli.geometrie.GrBoite;
! import org.fudaa.ebli.geometrie.GrPoint;
! import org.fudaa.ebli.calque.ZModelePoint;
! /**
! * Le modele du calque d'affichage de point.
! *
! * @version $Id$
! * @author Fred Deniger
! */
! public class ModeleTableauPoint// implements ZModelePoint
! {
! // private double[] x_;
! // private double[] y_;
! // private double[] z_;
! // private GrBoite boite_;
! //
! // public ModeleTableauPoint()
! // {
! // points_=_points;
! // }
! //
! // public int nombre()
! // {
! // return points_.length;
! // }
! // public GrBoite domaine()
! // {
! // if(boite_==null)
! // {
! // boite_=new GrBoite();
! // for(int i=points_.length-1;i>=0;i--)
! // boite_.ajuste(points_[i][0],points_[i][1],points_[i][2]);
! // }
! // return boite_;
! // }
! //
! // public GrPoint point(int _i)
! // {
! // return new GrPoint(points_[_i][0],points_[_i][1],points_[_i][2]);
! // }
! //
! }
|
|
From: <bma...@us...> - 2003-11-24 16:16:37
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv20525/fudaa/src/org/fudaa/fudaa/reflux
Modified Files:
RefluxFillePost.java
Log Message:
Correction pour affichage des calques de résultats suite à introduction modele d'arbre calque.
Index: RefluxFillePost.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux/RefluxFillePost.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RefluxFillePost.java 29 Oct 2003 11:54:32 -0000 1.7
--- RefluxFillePost.java 24 Nov 2003 16:16:30 -0000 1.8
***************
*** 1,592 ****
! /*
! * @file RefondeFillePost.java
! * @creation 1999-08-09
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.reflux;
[...1751 lines suppressed...]
! btInfo.setToolTipText("Information sur l'objet sélectionné");
!
! btInfo.setIcon(RefluxResource.REFLUX.getIcon("information"));
!
! btInfo.setPaletteResizable(true);
!
! vcps.add(btInfo);
!
!
!
! btTools_=(JComponent[])vcps.toArray(new JComponent[0]);
!
!
!
! for (int i=0; i<btTools_.length; i++) if (btTools_[i]!=null) btTools_[i].setEnabled(true);
!
! }
!
! }
!
|
|
From: <bma...@us...> - 2003-11-24 16:13:53
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv19989/fudaa/src/org/fudaa/fudaa/reflux
Modified Files:
RefluxImplementation.java
Log Message:
Numéro de version 5.14c
Index: RefluxImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux/RefluxImplementation.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** RefluxImplementation.java 23 Sep 2003 21:31:44 -0000 1.8
--- RefluxImplementation.java 24 Nov 2003 16:13:50 -0000 1.9
***************
*** 1,1245 ****
! /*
! * @file RefluxImplementation.java
! * @creation 1998-06-17
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.fudaa.reflux;
[...3706 lines suppressed...]
! }
!
! });
!
! } else setEnabledForAction("CONNECTER", true);
!
! }
!
! });
!
! } else setEnabledForAction("CONNECTER", true);
!
! }
!
! });
!
! }
!
! }
!
|
|
From: <de...@us...> - 2003-11-21 15:07:17
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv9836/src/org/fudaa/fudaa/commun
Modified Files:
FudaaCommonImplementation.java FudaaLib.java
Log Message:
General update
Index: FudaaCommonImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaCommonImplementation.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FudaaCommonImplementation.java 14 Nov 2003 08:23:55 -0000 1.9
--- FudaaCommonImplementation.java 21 Nov 2003 15:06:43 -0000 1.10
***************
*** 16,19 ****
--- 16,20 ----
import javax.swing.JInternalFrame;
+ import javax.swing.JMenu;
import com.memoire.bu.BuBrowserPreferencesPanel;
***************
*** 28,31 ****
--- 29,33 ----
import com.memoire.bu.BuLookPreferencesPanel;
import com.memoire.bu.BuMainPanel;
+ import com.memoire.bu.BuMenuBar;
import com.memoire.bu.BuPreferences;
import com.memoire.bu.BuPreferencesFrame;
***************
*** 78,81 ****
--- 80,93 ----
if(cmdListener_==null) cmdListener_=new FudaaUndoCmdMngListener(this);
return cmdListener_;
+ }
+
+ public void addMenu(JMenu _m,int _idx) {
+ BuMenuBar b= getMainMenuBar();
+ b.add(_m, _idx);
+ b.computeMnemonics();
+ }
+
+ public int getNbMenuInMenuBar(){
+ return getMainMenuBar().getMenuCount();
}
/**
Index: FudaaLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaLib.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** FudaaLib.java 14 Nov 2003 08:23:56 -0000 1.11
--- FudaaLib.java 21 Nov 2003 15:06:43 -0000 1.12
***************
*** 35,39 ****
import org.fudaa.dodico.objet.CExec;
import org.fudaa.fudaa.ressource.FudaaResource;
! import org.fudaa.fudaa.tr.reflux.TrRefluxCalqueBord;
/**
* Une classe d'utilitaires inclassables.
--- 35,39 ----
import org.fudaa.dodico.objet.CExec;
import org.fudaa.fudaa.ressource.FudaaResource;
! import org.fudaa.fudaa.tr.reflux.TrRefluxBoudaryMiddleLayer;
/**
* Une classe d'utilitaires inclassables.
|
|
From: <de...@us...> - 2003-11-21 15:07:17
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv9836/src/org/fudaa/fudaa/test/tr
Modified Files:
TestTrMaillage.java
Log Message:
General update
Index: TestTrMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr/TestTrMaillage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestTrMaillage.java 14 Nov 2003 08:24:06 -0000 1.6
--- TestTrMaillage.java 21 Nov 2003 15:06:44 -0000 1.7
***************
*** 1 ****
! /*
* @file TestTrMaillage.java
* @creation 30 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.test.tr;
import java.awt.Color;
import java.awt.Dimension;
import java.io.File;
import java.util.HashMap;
import javax.swing.JFrame;
import com.memoire.bu.BuDesktop;
import com.memoire.bu.BuSplit2Pane;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.ebli.calque.BArbreCalque;
import org.fudaa.ebli.calque.BGroupeCalque;
import org.fudaa.ebli.calque.BVueCalque;
import org.fudaa.ebli.calque.ZCalqueLongPolygone;
import org.fudaa.ebli.calque.ZCalquePoint;
import org.fudaa.ebli.calque.ZCalquePolygone;
import org.fudaa.ebli.calque.ZEbliFilleCalques;
import org.fudaa.ebli.trace.TracePoint;
import org.fudaa.fudaa.tr.data.TrGroupeMaillage;
/**
* @author deniger
* @version $Id$
*/
public class TestTrMaillage {
ZEbliFilleCalques fc_;
BVueCalque vue_;
BArbreCalque arbre_;
/**
*
*/
public TestTrMaillage(TrGroupeMaillage _maillage) {
BGroupeCalque gc= new BGroupeCalque();
gc.setTitle("Mailleur");
ZCalquePoint zpt= new ZCalquePoint(_maillage.getModelePoint());
ZCalquePolygone zpoly= new ZCalquePolygone(_maillage.getModelePolygone());
ZCalqueLongPolygone zlpoly=
new ZCalqueLongPolygone(_maillage.getModeleBord());
zpt.setIcone(TracePoint.getIcone(TracePoint.POINT, 1, Color.black));
zpt.setName("cqPOINTMAILLEUR");
zpt.setTitle("points");
gc.add(zpt);
gc.add(zpoly);
gc.add(zlpoly);
fc_= new ZEbliFilleCalques(gc);
vue_= fc_.getVueCalque();
vue_.setBackground(Color.white);
vue_.setPreferredSize(new Dimension(500, 400));
arbre_= new BArbreCalque();
arbre_.setModel(fc_.getArbreCalqueModel());
// fc_.setSelectionVisible(true);
fc_.setName("MAILLEUR");
fc_.setTitle("Modele");
fc_.setCalque(gc);
fc_.setCalqueSelectionActif();
fc_.restaurer();
}
public static void main(String[] args) {
HashMap arg= DodicoLib.parseArgs(args);
String fileName= (String)arg.get("-f");
if (fileName == null)
fileName= (String)arg.get("-file");
if (fileName == null) {
System.err.println("Fichier non trouve");
System.exit(1);
}
File f= new File(fileName);
System.out.println("Debut Lecture");
FileOperationSynthese op=
SerafinFileFormat.getInstance().getLastVersionImpl().read(f, null);
SerafinInterface inter= (SerafinInterface)op.getSource();
System.out.println("fin Lecture");
if (op.containsFatalError()) {
op.getAnalyze().toAnalyze().printResume("!! ");
System.exit(1);
} else if (op.containsMessages()) {
op.getAnalyze().toAnalyze().printResume(" ");
}
// TrMaillage maillage =
// new TrMaillage(
// H2dLib.createFor(inter.getMaillage(), inter.getPtsFrontiere(), null));
System.out.println(inter.getPtsFrontiere()[0]);
long t1= System.currentTimeMillis();
inter.getMaillage().computeBord(null);
long t2= System.currentTimeMillis();
System.out.println("temps " + (t2 - t1));
TrGroupeMaillage maillage= new TrGroupeMaillage(inter.getMaillage());
TestTrMaillage test= new TestTrMaillage(maillage);
JFrame frame= new JFrame("Essai");
BuDesktop desk= new BuDesktop();
desk.setPreferredSize(new Dimension(300, 300));
test.arbre_.setPreferredSize(new Dimension(50, 300));
desk.add(test.fc_);
test.fc_.setVisible(true);
BuSplit2Pane split= new BuSplit2Pane(desk, test.arbre_);
frame.setContentPane(split);
test.fc_.restaurer();
test.vue_.changeRepere(test.fc_, maillage.getDomaine());
frame.pack();
frame.setVisible(true);
test.fc_.restaurer();
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestTrMaillage.java
* @creation 30 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.test.tr;
import java.awt.Color;
import java.awt.Dimension;
import java.io.File;
import java.util.HashMap;
import javax.swing.JFrame;
import com.memoire.bu.BuDesktop;
import com.memoire.bu.BuSplit2Pane;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.ebli.calque.BArbreCalque;
import org.fudaa.ebli.calque.BGroupeCalque;
import org.fudaa.ebli.calque.BVueCalque;
import org.fudaa.ebli.calque.ZCalqueLongPolygone;
import org.fudaa.ebli.calque.ZCalquePoint;
import org.fudaa.ebli.calque.ZCalquePolygone;
import org.fudaa.ebli.calque.ZEbliFilleCalques;
import org.fudaa.ebli.trace.TracePoint;
import org.fudaa.fudaa.tr.data.TrGridLayerGroup;
/**
* @author deniger
* @version $Id$
*/
public class TestTrMaillage {
ZEbliFilleCalques fc_;
BVueCalque vue_;
BArbreCalque arbre_;
/**
*
*/
public TestTrMaillage(TrGridLayerGroup _maillage) {
BGroupeCalque gc= new BGroupeCalque();
gc.setTitle("Mailleur");
ZCalquePoint zpt= new ZCalquePoint(_maillage.getModelePoint());
ZCalquePolygone zpoly= new ZCalquePolygone(_maillage.getModelePolygone());
ZCalqueLongPolygone zlpoly=
new ZCalqueLongPolygone(_maillage.getModeleBord());
zpt.setIcone(TracePoint.getIcone(TracePoint.POINT, 1, Color.black));
zpt.setName("cqPOINTMAILLEUR");
zpt.setTitle("points");
gc.add(zpt);
gc.add(zpoly);
gc.add(zlpoly);
fc_= new ZEbliFilleCalques(gc);
vue_= fc_.getVueCalque();
vue_.setBackground(Color.white);
vue_.setPreferredSize(new Dimension(500, 400));
arbre_= new BArbreCalque();
arbre_.setModel(fc_.getArbreCalqueModel());
// fc_.setSelectionVisible(true);
fc_.setName("MAILLEUR");
fc_.setTitle("Modele");
fc_.setCalque(gc);
fc_.setCalqueSelectionActif();
fc_.restaurer();
}
public static void main(String[] args) {
HashMap arg= DodicoLib.parseArgs(args);
String fileName= (String)arg.get("-f");
if (fileName == null)
fileName= (String)arg.get("-file");
if (fileName == null) {
System.err.println("Fichier non trouve");
System.exit(1);
}
File f= new File(fileName);
System.out.println("Debut Lecture");
FileOperationSynthese op=
SerafinFileFormat.getInstance().getLastVersionImpl().read(f, null);
SerafinInterface inter= (SerafinInterface)op.getSource();
System.out.println("fin Lecture");
if (op.containsFatalError()) {
op.getAnalyze().toAnalyze().printResume("!! ");
System.exit(1);
} else if (op.containsMessages()) {
op.getAnalyze().toAnalyze().printResume(" ");
}
// TrMaillage maillage =
// new TrMaillage(
// H2dLib.createFor(inter.getMaillage(), inter.getPtsFrontiere(), null));
System.out.println(inter.getPtsFrontiere()[0]);
long t1= System.currentTimeMillis();
inter.getMaillage().computeBord(null);
long t2= System.currentTimeMillis();
System.out.println("temps " + (t2 - t1));
TrGridLayerGroup maillage= new TrGridLayerGroup(inter.getMaillage());
TestTrMaillage test= new TestTrMaillage(maillage);
JFrame frame= new JFrame("Essai");
BuDesktop desk= new BuDesktop();
desk.setPreferredSize(new Dimension(300, 300));
test.arbre_.setPreferredSize(new Dimension(50, 300));
desk.add(test.fc_);
test.fc_.setVisible(true);
BuSplit2Pane split= new BuSplit2Pane(desk, test.arbre_);
frame.setContentPane(split);
test.fc_.restaurer();
test.vue_.changeRepere(test.fc_, maillage.getDomaine());
frame.pack();
frame.setVisible(true);
test.fc_.restaurer();
}
}
\ No newline at end of file
|
|
From: <de...@us...> - 2003-11-21 15:07:17
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv9836/src/org/fudaa/fudaa/dico
Modified Files:
FDicoParams.java
Log Message:
General update
Index: FDicoParams.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/dico/FDicoParams.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** FDicoParams.java 14 Nov 2003 08:24:06 -0000 1.11
--- FDicoParams.java 21 Nov 2003 15:06:43 -0000 1.12
***************
*** 41,44 ****
--- 41,45 ----
import org.fudaa.fudaa.commun.exec.FudaaEditor;
import org.fudaa.fudaa.ressource.FudaaResource;
+ import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
***************
*** 252,256 ****
public String getColumnName(int _c) {
if (_c == 1)
! return FudaaResource.getS("Mot-clé");
else if (_c == 2)
return BuResource.BU.getString("Fichier");
--- 253,257 ----
public String getColumnName(int _c) {
if (_c == 1)
! return TrResource.getS("Mot-clé");
else if (_c == 2)
return BuResource.BU.getString("Fichier");
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv9836/src/org/fudaa/fudaa/tr/telemac
Modified Files:
TrTelemacBordEditor.java TrTelemacBoundaryPtsEditor.java
TrTelemacCommunParametres.java
TrTelemacCommunProjectListener.java TrTelemacCommunProjet.java
Added Files:
TrTelemacBcPointLayer.java TrTelemacBoundaryBlockLayer.java
TrTelemacFilleVisu.java
Removed Files:
TrTelemacCalqueBord.java TrTelemacCalqueCL.java
Log Message:
General update
--- NEW FILE: TrTelemacBcPointLayer.java ---
/*
* @file TrTelemacCalqueCL.java
* @creation 28 oct. 2003
* @modification $Date: 2003/11/21 15:06:48 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.telemac;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBoundary;
import org.fudaa.dodico.h2d.telemac.H2dTelemacBcListener;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.fudaa.tr.data.TrBcPointLayer;
import org.fudaa.fudaa.tr.data.TrBcPointModel;
/**
* @author deniger
* @version $Id: TrTelemacBcPointLayer.java,v 1.1 2003/11/21 15:06:48 deniger Exp $
*/
public class TrTelemacBcPointLayer
extends TrBcPointLayer
implements H2dTelemacBcListener {
/**
* @param _cl
*/
public TrTelemacBcPointLayer(TrBcPointModel _cl) {
super(_cl);
}
/**
*
*/
public void bcPointsParametersChanged(H2dVariableType _t) {}
/**
*
*/
public void bcFrontierStructureChanged(H2dBcFrontierBlockInterface _b) {}
/**
*
*/
public void bcParametersChanged(H2dBoundary _b,H2dVariableType _t) {}
/**
*
*/
public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) {}
}
--- NEW FILE: TrTelemacBoundaryBlockLayer.java ---
/*
* @file TrTelemacCalqueBord.java
* @creation 28 oct. 2003
* @modification $Date: 2003/11/21 15:06:48 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.telemac;
import java.awt.event.ActionEvent;
import org.fudaa.dodico.commun.DodicoCommand;
import org.fudaa.dodico.commun.DodicoCommandComposite;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBoundary;
import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary;
import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacBcListener;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.calque.action.EbliActionInterface;
import org.fudaa.ebli.calque.action.EbliSimpleAction;
import org.fudaa.ebli.commun.EbliListeSelectionInterface;
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.tr.TrFilleVisu;
import org.fudaa.fudaa.tr.TrResource;
import org.fudaa.fudaa.tr.data.TrBcBoundaryBlockModel;
import org.fudaa.fudaa.tr.data.TrBcBoundaryBlockLayer;
/**
* @author deniger
* @version $Id: TrTelemacBoundaryBlockLayer.java,v 1.1 2003/11/21 15:06:48 deniger Exp $
*/
public class TrTelemacBoundaryBlockLayer
extends TrBcBoundaryBlockLayer
implements H2dTelemacBcListener {
/**
* @param _m
*/
public TrTelemacBoundaryBlockLayer(TrBcBoundaryBlockModel _m) {
super(_m);
}
/**
*
*/
public void bcPointsParametersChanged(H2dVariableType _t) {}
/**
*
*/
public void bcFrontierStructureChanged(H2dBcFrontierBlockInterface _b) {
repaint();
}
/**
*
*/
public void bcParametersChanged(H2dBoundary _b,H2dVariableType _t) {}
/**
*
*/
public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) {
repaint();
}
}
Index: TrTelemacBordEditor.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBordEditor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TrTelemacBordEditor.java 14 Nov 2003 08:24:08 -0000 1.6
--- TrTelemacBordEditor.java 21 Nov 2003 15:06:48 -0000 1.7
***************
*** 32,39 ****
import org.fudaa.dodico.commun.DodicoCommandComposite;
import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParametres;
! import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
--- 32,39 ----
import org.fudaa.dodico.commun.DodicoCommandComposite;
import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParameters;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
***************
*** 49,54 ****
extends EbliSimpleDialogPanel
implements ItemListener {
! H2dTelemacBord bord_;
! H2dTelemacCLManager clMng_;
JComboBox cbBord_;
ParametersBloc optionsBloc_;
--- 49,54 ----
extends EbliSimpleDialogPanel
implements ItemListener {
! H2dTelemacBoundary bord_;
! H2dTelemacBcManager clMng_;
JComboBox cbBord_;
ParametersBloc optionsBloc_;
***************
*** 61,66 ****
*/
public TrTelemacBordEditor(
! H2dTelemacCLManager _clMng,
! H2dTelemacBord _bord,
DodicoCommandComposite _mng) {
super(EbliSimpleDialogPanel.OK_CANCEL_OPTION);
--- 61,66 ----
*/
public TrTelemacBordEditor(
! H2dTelemacBcManager _clMng,
! H2dTelemacBoundary _bord,
DodicoCommandComposite _mng) {
super(EbliSimpleDialogPanel.OK_CANCEL_OPTION);
***************
*** 82,89 ****
setLayout(new BuVerticalLayout(5, true, false));
cbBord_= new JComboBox();
! List allBordType= H2dTelemacParametres.BORD_LIST;
Vector v= new Vector(allBordType.size());
for (Iterator it= allBordType.iterator(); it.hasNext();) {
! H2dBordType t= (H2dBordType)it.next();
if (t.isLiquide())
v.add(t);
--- 82,89 ----
setLayout(new BuVerticalLayout(5, true, false));
cbBord_= new JComboBox();
! List allBordType= H2dTelemacParameters.BORD_LIST;
Vector v= new Vector(allBordType.size());
for (Iterator it= allBordType.iterator(); it.hasNext();) {
! H2dBoundaryType t= (H2dBoundaryType)it.next();
if (t.isLiquide())
v.add(t);
***************
*** 151,155 ****
clMng_.changeLiquidBordTypeAndCmd(
bord_,
! (H2dBordType)cbBord_.getSelectedItem()));
}
boolean[] b= spaceCondBloc_.getUvState();
--- 151,155 ----
clMng_.changeLiquidBordTypeAndCmd(
bord_,
! (H2dBoundaryType)cbBord_.getSelectedItem()));
}
boolean[] b= spaceCondBloc_.getUvState();
***************
*** 157,161 ****
clMng_.updateLiquidBordAndCmd(
bord_,
- (H2dBordType)cbBord_.getSelectedItem(),
b[0],
b[1],
--- 157,160 ----
***************
*** 189,193 ****
_pn.add(t_);
threeIsUandVFixed_=
! H2dTelemacBord.canUandVBeSetAsFixedFor(bord_.getType());
uvValues_= addLabel(_pn, TrResource.getS("u et v"));
uv_= new JComboBox();
--- 188,192 ----
_pn.add(t_);
threeIsUandVFixed_=
! H2dTelemacBoundary.canUandVBeSetAsFixedFor(bord_.getType());
uvValues_= addLabel(_pn, TrResource.getS("u et v"));
uv_= new JComboBox();
***************
*** 233,250 ****
}
void updateStates() {
! H2dBordType b= (H2dBordType)cbBord_.getSelectedItem();
boolean enable=
! H2dTelemacBord.isVariableCompatible(b, H2dVariableType.TRACEUR);
t_.setEnabled(enable);
tValues_.setEnabled(enable);
! enable= H2dTelemacBord.isVariableCompatible(b, H2dVariableType.VITESSE_U);
uvValues_.setEnabled(enable);
uv_.setEnabled(enable);
if (enable) {
! if (threeIsUandVFixed_ != H2dTelemacBord.canUandVBeSetAsFixedFor(b)) {
! threeIsUandVFixed_= H2dTelemacBord.canUandVBeSetAsFixedFor(b);
if (uv_.getSelectedIndex() == 2)
uv_.setSelectedIndex(-1);
! if (threeIsUandVFixed_ == H2dTelemacBord.canUandVBeSetAsFreeFor(b)) {
new Throwable().printStackTrace();
}
--- 232,249 ----
}
void updateStates() {
! H2dBoundaryType b= (H2dBoundaryType)cbBord_.getSelectedItem();
boolean enable=
! H2dTelemacBoundary.isVariableCompatible(b, H2dVariableType.TRACEUR);
t_.setEnabled(enable);
tValues_.setEnabled(enable);
! enable= H2dTelemacBoundary.isVariableCompatible(b, H2dVariableType.VITESSE_U);
uvValues_.setEnabled(enable);
uv_.setEnabled(enable);
if (enable) {
! if (threeIsUandVFixed_ != H2dTelemacBoundary.canUandVBeSetAsFixedFor(b)) {
! threeIsUandVFixed_= H2dTelemacBoundary.canUandVBeSetAsFixedFor(b);
if (uv_.getSelectedIndex() == 2)
uv_.setSelectedIndex(-1);
! if (threeIsUandVFixed_ == H2dTelemacBoundary.canUandVBeSetAsFreeFor(b)) {
new Throwable().printStackTrace();
}
***************
*** 259,267 ****
}
private class ParametersBloc implements MouseListener {
! H2dTelemacCLManager.PrescribedParameters[] params_;
JLabel[] lbValues_;
FDicoEditorInterface[] edValues_;
public ParametersBloc(
! H2dTelemacCLManager.PrescribedParameters[] _params,
BuPanel _pn,
FDicoTableEditorChooser.EditorCreator _creator) {
--- 258,266 ----
}
private class ParametersBloc implements MouseListener {
! H2dTelemacBcManager.PrescribedParameters[] params_;
JLabel[] lbValues_;
FDicoEditorInterface[] edValues_;
public ParametersBloc(
! H2dTelemacBcManager.PrescribedParameters[] _params,
BuPanel _pn,
FDicoTableEditorChooser.EditorCreator _creator) {
***************
*** 296,300 ****
}
protected void updateStates() {
! H2dBordType b= (H2dBordType)cbBord_.getSelectedItem();
int n= params_.length;
for (int i= 0; i < n; i++) {
--- 295,299 ----
}
protected void updateStates() {
! H2dBoundaryType b= (H2dBoundaryType)cbBord_.getSelectedItem();
int n= params_.length;
for (int i= 0; i < n; i++) {
***************
*** 315,319 ****
int n= params_.length;
for (int i= 0; i < n; i++) {
! if (params_[i].hasToBeSet((H2dBordType)cbBord_.getSelectedItem())) {
String s= edValues_[i].getValue();
if ((s != null) && (s.length() > 0)) {
--- 314,318 ----
int n= params_.length;
for (int i= 0; i < n; i++) {
! if (params_[i].hasToBeSet((H2dBoundaryType)cbBord_.getSelectedItem())) {
String s= edValues_[i].getValue();
if ((s != null) && (s.length() > 0)) {
Index: TrTelemacBoundaryPtsEditor.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacBoundaryPtsEditor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrTelemacBoundaryPtsEditor.java 14 Nov 2003 08:24:08 -0000 1.1
--- TrTelemacBoundaryPtsEditor.java 21 Nov 2003 15:06:48 -0000 1.2
***************
*** 31,39 ****
import org.fudaa.dodico.commun.DodicoCommandManager;
import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.h2d.H2dBord;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacClListener;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.commun.EbliListeSelectionMultiInterface;
--- 31,39 ----
import org.fudaa.dodico.commun.DodicoCommandManager;
import org.fudaa.dodico.commun.DodicoLib;
! import org.fudaa.dodico.h2d.H2dBoundary;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcListener;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundaryCondition;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.ebli.commun.EbliListeSelectionMultiInterface;
***************
*** 49,55 ****
String[] initValues_;
int[] idx_;
! H2dTelemacBord bord;
H2dVariableType[] var_;
! H2dTelemacCLManager.TelemacBordParFrontiere frontier_;
/**
*
--- 49,55 ----
String[] initValues_;
int[] idx_;
! H2dTelemacBoundary bord;
H2dVariableType[] var_;
! H2dTelemacBcManager.TelemacBordParFrontiere frontier_;
/**
*
***************
*** 57,62 ****
public TrTelemacBoundaryPtsEditor(
DodicoCommandManager cmdMng,
! H2dTelemacCLManager.TelemacBordParFrontiere _frIdx,
! H2dTelemacBord b,
int[] idx) {
cmdMng_=cmdMng;
--- 57,62 ----
public TrTelemacBoundaryPtsEditor(
DodicoCommandManager cmdMng,
! H2dTelemacBcManager.TelemacBordParFrontiere _frIdx,
! H2dTelemacBoundary b,
int[] idx) {
cmdMng_=cmdMng;
Index: TrTelemacCommunParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunParametres.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrTelemacCommunParametres.java 14 Nov 2003 08:24:08 -0000 1.2
--- TrTelemacCommunParametres.java 21 Nov 2003 15:06:49 -0000 1.3
***************
*** 12,15 ****
--- 12,16 ----
import java.util.HashMap;
import java.util.Map;
+
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
***************
*** 17,27 ****
import org.fudaa.dodico.fichiers.FileFormat;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dParametres;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacDicoFileFormatVersion;
import org.fudaa.dodico.h2d.telemac.H2dTelemacDicoParams;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParametres;
import org.fudaa.dodico.telemac.io.SerafinAdapter;
import org.fudaa.dodico.telemac.io.SerafinInterface;
--- 18,28 ----
import org.fudaa.dodico.fichiers.FileFormat;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dGrid;
! import org.fudaa.dodico.h2d.H2dParameters;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacDicoFileFormatVersion;
import org.fudaa.dodico.h2d.telemac.H2dTelemacDicoParams;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParameters;
import org.fudaa.dodico.telemac.io.SerafinAdapter;
import org.fudaa.dodico.telemac.io.SerafinInterface;
***************
*** 29,32 ****
--- 30,34 ----
import org.fudaa.dodico.telemac.io.TelemacDicoFileFormatVersion;
import org.fudaa.dodico.telemac.io.TelemacLib;
+
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
***************
*** 34,39 ****
import org.fudaa.fudaa.tr.TrParametres;
import org.fudaa.fudaa.tr.TrResource;
! import org.fudaa.fudaa.tr.data.TrModeleBord;
! import org.fudaa.fudaa.tr.data.TrModeleBordAdapter;
/**
* @author deniger
--- 36,41 ----
import org.fudaa.fudaa.tr.TrParametres;
import org.fudaa.fudaa.tr.TrResource;
! import org.fudaa.fudaa.tr.data.TrBcBoundaryBlockModel;
! import org.fudaa.fudaa.tr.data.TrBcBoundaryBlockModelDefault;
/**
* @author deniger
***************
*** 43,47 ****
extends FDicoParams
implements TrParametres {
! H2dTelemacParametres params_;
TrTelemacCommunParametres(
FudaaCommonImplementation _ui,
--- 45,49 ----
extends FDicoParams
implements TrParametres {
! H2dTelemacParameters params_;
TrTelemacCommunParametres(
FudaaCommonImplementation _ui,
***************
*** 50,61 ****
File _f) {
super(_ui, _f, new H2dTelemacDicoParams(_inits, _dico));
! params_= new H2dTelemacParametres((H2dTelemacDicoParams)getDicoParams());
}
public boolean isValide() {
return super.isValide();
}
! public final TrModeleBord createModelBord() {
! return new TrModeleBordAdapter(params_.getTelemacCLManager());
! }
public FudaaCommonImplementation getImpl() {
return (FudaaCommonImplementation)getUI();
--- 52,61 ----
File _f) {
super(_ui, _f, new H2dTelemacDicoParams(_inits, _dico));
! params_= new H2dTelemacParameters((H2dTelemacDicoParams)getDicoParams());
}
public boolean isValide() {
return super.isValide();
}
!
public FudaaCommonImplementation getImpl() {
return (FudaaCommonImplementation)getUI();
***************
*** 143,147 ****
getUI().setMainProgression(70);
getUI().setMainMessage(TrResource.getS("Recherche des bords"));
! H2dMaillage.computeBordFast(
sInter.getMaillage(),
sInter.getPtsFrontiere(),
--- 143,147 ----
getUI().setMainProgression(70);
getUI().setMainMessage(TrResource.getS("Recherche des bords"));
! H2dGrid.computeBordFast(
sInter.getMaillage(),
sInter.getPtsFrontiere(),
***************
*** 232,247 ****
* le maillage avec {@link #loadGeometrie(ProgressionInterface) loadGeometrie}
*/
! public H2dMaillage getMaillage() {
if (params_ == null)
return null;
return params_.getMaillage();
}
! public H2dTelemacParametres getTelemacParametres() {
return params_;
}
! public H2dParametres getH2dParametres() {
return getTelemacParametres();
}
! public H2dTelemacCLManager getClManager() {
return params_.getTelemacCLManager();
}
--- 232,247 ----
* le maillage avec {@link #loadGeometrie(ProgressionInterface) loadGeometrie}
*/
! public H2dGrid getMaillage() {
if (params_ == null)
return null;
return params_.getMaillage();
}
! public H2dTelemacParameters getTelemacParametres() {
return params_;
}
! public H2dParameters getH2dParametres() {
return getTelemacParametres();
}
! public H2dTelemacBcManager getClManager() {
return params_.getTelemacCLManager();
}
Index: TrTelemacCommunProjectListener.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjectListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrTelemacCommunProjectListener.java 14 Nov 2003 08:24:08 -0000 1.2
--- TrTelemacCommunProjectListener.java 21 Nov 2003 15:06:49 -0000 1.3
***************
*** 11,19 ****
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoParams;
! import org.fudaa.dodico.h2d.H2dBord;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
import org.fudaa.dodico.h2d.telemac.H2dTelemacProjectDispatcherListener;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager.TelemacBordParFrontiere;
! import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.fudaa.commun.FudaaLib;
--- 11,21 ----
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoParams;
! import org.fudaa.dodico.h2d.H2dBoundary;
! import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary;
import org.fudaa.dodico.h2d.telemac.H2dTelemacProjectDispatcherListener;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager.TelemacBordParFrontiere;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
! import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.fudaa.commun.FudaaLib;
***************
*** 80,85 ****
*
*/
! public void clChanged(H2dBord b, H2dBordType _old) {
! super.clChanged(b, _old);
modifyBCFile();
}
--- 82,87 ----
*
*/
! public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) {
! super.bcBoundaryTypeChanged(b, _old);
modifyBCFile();
}
***************
*** 95,101 ****
*
*/
! public void clBordChanged(H2dTelemacBord _b) {
! FudaaLib.info(
! "CHANGE: BOUNDARY TYPE FOR " + _b );
modifyBCFile();
}
--- 97,102 ----
*
*/
! public void bcParametersChanged(H2dBoundary _b,H2dVariableType _t) {
! super.bcParametersChanged(_b,_t);
modifyBCFile();
}
***************
*** 103,108 ****
*
*/
! public void clFrontierStructureChange(TelemacBordParFrontiere _b) {
! FudaaLib.info("CHANGE: BOUNDARY LIQUID BORDER STRUCTURE");
modifyBCFile();
}
--- 104,109 ----
*
*/
! public void bcFrontierStructureChanged(H2dBcFrontierBlockInterface _b) {
! super.bcFrontierStructureChanged(_b);
modifyBCFile();
}
***************
*** 110,115 ****
*
*/
! public void clParametersBoundaryPointsChange() {
! FudaaLib.info("CHANGE: PARAMETERS FOR BOUNDARY POINTS");
modifyBCFile();
}
--- 111,116 ----
*
*/
! public void bcPointsParametersChanged(H2dVariableType _t) {
! super.bcPointsParametersChanged(_t);
modifyBCFile();
}
Index: TrTelemacCommunProjet.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/telemac/TrTelemacCommunProjet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrTelemacCommunProjet.java 14 Nov 2003 08:24:08 -0000 1.2
--- TrTelemacCommunProjet.java 21 Nov 2003 15:06:49 -0000 1.3
***************
*** 10,27 ****
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import javax.swing.JMenu;
import com.memoire.bu.BuDialogChoice;
import com.memoire.bu.BuDynamicMenu;
import com.memoire.bu.BuMenu;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuTaskOperation;
! import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParametres;
import org.fudaa.ebli.calque.action.EbliActionInterface;
import org.fudaa.ebli.calque.action.EbliComponentFactory;
import org.fudaa.ebli.calque.action.EbliSimpleAction;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.dico.FDicoProjet;
--- 10,33 ----
import java.awt.Dimension;
import java.awt.event.ActionEvent;
+
import javax.swing.Action;
import javax.swing.JMenu;
+
import com.memoire.bu.BuDialogChoice;
import com.memoire.bu.BuDynamicMenu;
import com.memoire.bu.BuMenu;
+ import com.memoire.bu.BuMenuBar;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuTaskOperation;
!
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacParameters;
!
import org.fudaa.ebli.calque.action.EbliActionInterface;
import org.fudaa.ebli.calque.action.EbliComponentFactory;
import org.fudaa.ebli.calque.action.EbliSimpleAction;
+
+ import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.dico.FDicoProjet;
***************
*** 33,40 ****
import org.fudaa.fudaa.tr.TrProjet;
import org.fudaa.fudaa.tr.TrResource;
! import org.fudaa.fudaa.tr.data.TrBordLegendePanel;
! import org.fudaa.fudaa.tr.data.TrCalque;
! import org.fudaa.fudaa.tr.data.TrGroupeCL;
! import org.fudaa.fudaa.tr.data.TrModeleCLAdapter;
/**
* @author deniger
--- 39,45 ----
import org.fudaa.fudaa.tr.TrProjet;
import org.fudaa.fudaa.tr.TrResource;
! import org.fudaa.fudaa.tr.data.TrBcLayerGroup;
! import org.fudaa.fudaa.tr.data.TrBcPointModelDefault;
! import org.fudaa.fudaa.tr.data.TrBcBoundaryLegendPanel;
/**
* @author deniger
***************
*** 43,52 ****
public class TrTelemacCommunProjet extends FDicoProjet implements TrProjet {
//TrTelemacCommunParametres params_;
! TrFilleVisu visu_;
DicoProjectMenu projectMenu_;
EbliSimpleAction visuAction_;
EbliSimpleAction projectAction_;
EbliSimpleAction loadAction_;
- EbliSimpleAction bcAction_;
public TrTelemacCommunProjet(TrTelemacCommunParametres _params) {
this(_params, true);
--- 48,56 ----
public class TrTelemacCommunProjet extends FDicoProjet implements TrProjet {
//TrTelemacCommunParametres params_;
! TrTelemacFilleVisu visu_;
DicoProjectMenu projectMenu_;
EbliSimpleAction visuAction_;
EbliSimpleAction projectAction_;
EbliSimpleAction loadAction_;
public TrTelemacCommunProjet(TrTelemacCommunParametres _params) {
this(_params, true);
***************
*** 62,65 ****
--- 66,74 ----
actions_.setEnableCalcul(true);
}
+
+ public void active(FudaaCommonImplementation _impl) {
+ super.active(_impl);
+ _impl.addMenu(getProjectMenu(), _impl.getNbMenuInMenuBar()-2);
+ }
// public final boolean isValide() {
***************
*** 97,101 ****
if (getTrTelemacParams().isGeometrieLoaded()) {
initVisu();
- projectMenu_.buildVisuMenu();
}
}
--- 106,109 ----
***************
*** 112,164 ****
if (visu_ != null)
return;
! visu_= new TrFilleVisu(getImpl()) {
! protected JMenu buildLayerMenu() {
! JMenu r= super.buildLayerMenu();
! if (getTrTelemacParams().getDicoFileFormatVersion().getCLEntiteFile()
! != null) {
! if (bcAction_ == null) {
! bcAction_=
! new EbliSimpleAction(
! TrResource.getS("Initialiser les conditions limites"),
! null,
! "DEFAULT_BC") {
! public void actionPerformed(ActionEvent _ae) {
! buildDefaultBoundary();
! }
! };
! bcAction_.putValue(
! Action.SHORT_DESCRIPTION,
! TrResource.getS(
! "Initialiser les conditions limites avec un unique bord solide"));
! };
! r.add(bcAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
! r.addSeparator();
! }
! TrCalque[] cq= getAllCalquesDonnees();
! int n= cq.length;
! for (int i= 0; i < n; i++) {
! BuMenu m= new BuMenu();
! m.setName(cq[i].getName());
! m.setText(cq[i].getTitle());
! fillMenuWithCalqueActions(m, cq[i]);
! if(m.getItemCount()>0)
! r.add(m);
! }
! return r;
! }
! };
//initialization for the boundaries layer
- visu_.addCqLegend();
- addBcLayers();
- visu_.addCqMaillage(getTrTelemacParams().getH2dParametres());
Dimension dim= getImpl().getMainPanel().getDesktop().getSize();
visu_.setSize((int) (dim.getWidth() * 0.8), (int) (dim.getHeight() * 0.8));
visu_.setLocation(10, 10);
! getImpl().addInternalFrame(visu_);
! if (getImpl() instanceof TrImplementation)
! visu_.refreshArbreCalque(((TrImplementation)getImpl()).getArbreCalque());
visu_.pack();
visu_.restaurer();
}
public void loadAll() {
if (getTrTelemacParams().isAllLoaded()) {
--- 120,137 ----
if (visu_ != null)
return;
! visu_= new TrTelemacFilleVisu(getImpl(),this);
! FudaaCommonImplementation impl=getImpl();
! impl.addMenu(visu_.getLayerMenu(), impl.getNbMenuInMenuBar()-2);
//initialization for the boundaries layer
Dimension dim= getImpl().getMainPanel().getDesktop().getSize();
visu_.setSize((int) (dim.getWidth() * 0.8), (int) (dim.getHeight() * 0.8));
visu_.setLocation(10, 10);
! impl.addInternalFrame(visu_);
! if (impl instanceof TrImplementation)
! visu_.refreshArbreCalque(((TrImplementation)impl).getArbreCalque());
visu_.pack();
visu_.restaurer();
}
+
public void loadAll() {
if (getTrTelemacParams().isAllLoaded()) {
***************
*** 172,176 ****
&& (visu_.getBoundaryGroup() == null)
&& (getTrTelemacParams().isBoundaryConditionLoaded())) {
! addBcLayers();
visu_.getArbreCalqueModel().refresh();
visu_.repaint();
--- 145,149 ----
&& (visu_.getBoundaryGroup() == null)
&& (getTrTelemacParams().isBoundaryConditionLoaded())) {
! visu_.addBcLayerIfNot();
visu_.getArbreCalqueModel().refresh();
visu_.repaint();
***************
*** 185,213 ****
if (loadAction_ != null)
loadAction_.setEnabled(false);
- if (bcAction_ != null)
- bcAction_.setEnabled(false);
- }
- }
- public void addBcLayers() {
- TrTelemacCommunParametres p= getTrTelemacParams();
- if (p.getClManager() != null) {
- if (FudaaLib.DEBUG)
- FudaaLib.debug("add TrGroupe Cl");
- TrGroupeCL gpCL= new TrGroupeCL();
- TrTelemacCalqueBord cqBord=
- new TrTelemacCalqueBord(p.createModelBord(), visu_);
- TrTelemacCalqueCL cqCL=
- new TrTelemacCalqueCL(new TrModeleCLAdapter(p.getClManager()), visu_);
- p.getClManager().addClChangedListener(cqBord);
- p.getClManager().addClChangedListener(cqCL);
- gpCL.addCalqueBord(cqBord);
- gpCL.addCalqueCL(cqCL);
- visu_.getCqLegend().ajoute(
- cqBord,
- new TrBordLegendePanel(
- cqBord,
- getTrTelemacParams().getH2dParametres().getBordList()));
- visu_.addCqCL(gpCL);
- visu_.getDonneesCalque().enPremier(visu_.getCqLegend());
}
}
--- 158,161 ----
***************
*** 218,263 ****
new TrExport(getTrTelemacParams(), getUI()).export(_actionCommand);
}
! public void buildDefaultBoundary() {
! DicoEntite e=
! getTrTelemacParams().getDicoFileFormatVersion().getCLEntiteFile();
! if (e == null) {
! if (bcAction_ != null)
! bcAction_.setEnabled(false);
! return;
! }
! H2dTelemacParametres p= getTrTelemacParams().getTelemacParametres();
! if (getTrTelemacParams().isBoundaryConditionLoaded()) {
! getImpl().message(
! TrResource.getS("Les conditions limites sont déjà définies"));
! majAction();
! return;
! }
! if (getDicoParams().isValueSetFor(e)) {
! BuDialogChoice d=
! new BuDialogChoice(
! getImpl(),
! getImpl().getInformationsSoftware(),
! TrResource.getS("Un fichier de conditions limites est défini"),
! TrResource.getS(
! "Un fichier de condition limite est défini par le fichier cas."),
! new String[] { "toto", "tata" });
! d.activate();
! String s= d.getValue();
! System.out.println(s);
! }
! if (!getTrTelemacParams().isGeometrieLoaded())
! return;
! if (e == null)
! return;
! if (p.getTelemacCLManager() == null) {
! p.setNoCL();
! getDicoParams().setLoaded(e, null, true);
! if (visu_ != null) {
! addBcLayers();
! visu_.getArbreCalqueModel().refresh();
! visu_.repaint();
! }
! } else {}
! }
/**
*
--- 166,170 ----
new TrExport(getTrTelemacParams(), getUI()).export(_actionCommand);
}
!
/**
*
***************
*** 324,331 ****
*/
public TrFilleVisu getVisuFille() {
! return null;
}
private class DicoProjectMenu extends BuDynamicMenu {
- private boolean visuMenu_;
public DicoProjectMenu() {
super(TrResource.getS("Projet"), "PROJET");
--- 231,237 ----
*/
public TrFilleVisu getVisuFille() {
! return visu_;
}
private class DicoProjectMenu extends BuDynamicMenu {
public DicoProjectMenu() {
super(TrResource.getS("Projet"), "PROJET");
***************
*** 343,358 ****
EbliComponentFactory.INSTANCE));
add(getDiffAction().buildMenuItem(EbliComponentFactory.INSTANCE));
- buildFilleActions();
- add(projectAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
add(loadAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
add(visuAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
! // buildVisuMenu();
! }
! public void buildVisuMenu() {
! if ((visu_ != null) && (!visuMenu_) && (getMenuComponentCount() != 0)) {
! visuMenu_= true;
! addSeparator();
! visu_.fillProjectMenu(this);
! }
}
}
--- 249,256 ----
EbliComponentFactory.INSTANCE));
add(getDiffAction().buildMenuItem(EbliComponentFactory.INSTANCE));
add(loadAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
+ addSeparator();
add(visuAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
! add(projectAction_.buildMenuItem(EbliComponentFactory.INSTANCE));
}
}
--- TrTelemacCalqueBord.java DELETED ---
--- TrTelemacCalqueCL.java DELETED ---
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data
In directory sc8-pr-cvs1:/tmp/cvs-serv9836/src/org/fudaa/fudaa/tr/data
Added Files:
TrBcBoundaryBlockLayer.java TrBcBoundaryBlockModel.java
TrBcBoundaryBlockModelDefault.java
TrBcBoundaryLayerAbstract.java TrBcBoundaryLegendLayer.java
TrBcBoundaryLegendPanel.java TrBcBoundaryMiddleLayer.java
TrBcBoundaryMiddleModel.java
TrBcBoundaryMiddleModelDefault.java TrBcLayerGroup.java
TrBcPointLayer.java TrBcPointModel.java
TrBcPointModelDefault.java TrElementLayer.java
TrGridLayerGroup.java TrLayerGroup.java TrPointLayer.java
Removed Files:
TrBordLegendePanel.java TrCalque.java TrCalqueBord.java
TrCalqueCL.java TrCalqueLegende.java TrCalquePoint.java
TrCalquePolygone.java TrGroupeCL.java TrGroupeCalque.java
TrGroupeMaillage.java TrModeleBord.java
TrModeleBordAdapter.java TrModeleCL.java
TrModeleCLAdapter.java
Log Message:
General update
--- NEW FILE: TrBcBoundaryBlockLayer.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrBcBoundaryBlockModel.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrBcBoundaryBlockModelDefault.java ---
/*
* @file TrModeleBordAdapter.java
* @creation 10 sept. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBcManagerBlockInterface;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id: TrBcBoundaryBlockModelDefault.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcBoundaryBlockModelDefault implements TrBcBoundaryBlockModel {
H2dBcManagerBlockInterface clMng_;
public TrBcBoundaryBlockModelDefault(H2dBcManagerBlockInterface _clMng) {
if (_clMng == null)
throw new IllegalArgumentException("Param is null");
clMng_= _clMng;
}
/**
*
*/
public int getNbFrontier() {
return clMng_.getGrid().getFrontiers().getNbFrontier();
}
/**
*
*/
public H2dBcFrontierBlockInterface getFrontier(int _idxFrontier) {
return clMng_.getBlockFrontier(_idxFrontier);
}
/**
*
*/
public void getPoint(GrPoint _p,int _idxFrontier,int idxOnFrontier) {
H2dPoint p= clMng_.getGrid().getPt(clMng_.getGrid().getFrontiers().getIdx(_idxFrontier, idxOnFrontier));
_p.setCoordonnees(p.getX(), p.getY(), p.getZ());
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.getDomaine(clMng_.getGrid());
}
/**
*
*/
public int getNombre() {
return getNbFrontier();
}
/**
*
*/
public Object getObject(int _ind) {
return null;
}
}
--- NEW FILE: TrBcBoundaryLayerAbstract.java ---
/*
* @file TrCalqueBordAbstract.java
* @creation 20 nov. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import java.awt.Color;
import java.util.HashMap;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.ebli.calque.ZCalqueAffichageDonneesMutliSelection;
import org.fudaa.ebli.trace.TraceLigne;
import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
* @version $Id: TrBcBoundaryLayerAbstract.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public abstract class TrBcBoundaryLayerAbstract extends ZCalqueAffichageDonneesMutliSelection {
public class BordTraceLigneData {
HashMap bdTypeTlDataMap_;
public BordTraceLigneData() {}
public TraceLigne.Data getTlData(H2dBoundaryType _bd) {
if (bdTypeTlDataMap_ == null)
bdTypeTlDataMap_= new HashMap(6);
TraceLigne.Data r= (TraceLigne.Data)bdTypeTlDataMap_.get(_bd);
if (r == null) {
r= initBordTraceLigneData(_bd);
bdTypeTlDataMap_.put(_bd, r);
}
return r;
}
protected TraceLigne.Data initBordTraceLigneData(H2dBoundaryType _t) {
if (_t == H2dBoundaryType.SOLIDE_FROTTEMENT)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.orange);
else if (_t == H2dBoundaryType.SOLIDE)
return new TraceLigne.Data(
TraceLigne.LISSE,
1f,
new Color(164, 95, 30));
else if (_t == H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.red);
else if (_t == H2dBoundaryType.LIQUIDE_ONDE_INCIDENCE)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.cyan);
else if (_t == H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.green);
else if (_t == H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.green);
else if (_t == H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.cyan);
//liquid
else if (_t.isLiquide())
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.cyan);
else
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.black);
}
}
protected BordTraceLigneData bdTlData_;
/**
*
*/
public TrBcBoundaryLayerAbstract() {
setTitle(TrResource.getS("Bords"));
}
public TraceLigne.Data getTlData(H2dBoundaryType _t) {
if(bdTlData_==null) bdTlData_=new BordTraceLigneData();
return bdTlData_.getTlData(_t);
}
}
--- NEW FILE: TrBcBoundaryLegendLayer.java ---
/*
* @file TrCalqueLegende.java
* @creation 3 nov. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.ebli.calque.BCalqueLegende;
import org.fudaa.ebli.calque.action.EbliActionInterface;
/**
* @author deniger
* @version $Id: TrBcBoundaryLegendLayer.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcBoundaryLegendLayer extends BCalqueLegende{
/**
*
*/
public TrBcBoundaryLegendLayer() {
super();
}
}
--- NEW FILE: TrBcBoundaryLegendPanel.java ---
/*
* @file TrBordLegendePanel.java
* @creation 8 oct. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import java.awt.LayoutManager;
import java.util.Iterator;
import java.util.List;
import com.memoire.bu.BuGridLayout;
import com.memoire.bu.BuLabel;
import com.memoire.bu.BuPanel;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.ebli.palette.BSelecteurTraitComponent;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.dico.FdicoLib;
import org.fudaa.fudaa.tr.TrLib;
/**
* @author deniger
* @version $Id: TrBcBoundaryLegendPanel.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcBoundaryLegendPanel extends BuPanel {
/**
*
*/
public TrBcBoundaryLegendPanel(TrBcBoundaryLayerAbstract _cqBord,List _bord) {
init(_cqBord,_bord);
setOpaque(false);
}
public void init(TrBcBoundaryLayerAbstract _cqBord,List _bord){
removeAll();
setLayout(new BuGridLayout(2,5,2));
for(Iterator it=_bord.iterator();it.hasNext();){
H2dBoundaryType b=(H2dBoundaryType)it.next();
BuLabel lb=new BuLabel(b.getNom());
lb.setOpaque(false);
lb.setFont(FdicoLib.FONT_DIALOG);
add(lb);
add(new BSelecteurTraitComponent(_cqBord.getTlData(b)));
}
}
}
--- NEW FILE: TrBcBoundaryMiddleLayer.java ---
/*
* @file TrBoundaryLayer.java
* @creation 21 nov. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import gnu.trove.TIntObjectIterator;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.Icon;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBcFrontierMiddleInterface;
import org.fudaa.dodico.h2d.H2dBoundary;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.commun.EbliListeSelectionMulti;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrMorphisme;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrPolygone;
import org.fudaa.ebli.geometrie.GrSegment;
import org.fudaa.ebli.trace.TraceLigne;
/**
* @author deniger
* @version $Id: TrBcBoundaryMiddleLayer.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcBoundaryMiddleLayer extends TrBcBoundaryLayerAbstract {
protected TrBcBoundaryMiddleModel m_;
protected TraceLigne tl_;
protected TraceLigne tlSelection_;
/**
*
*/
public TrBcBoundaryMiddleLayer(TrBcBoundaryMiddleModel _m) {
m_= _m;
}
public void paintComponent(Graphics g) {
GrBoite clip= getClipReel(g);
GrBoite domaine= m_.getDomaine();
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if (!domaine.intersectXY(clip)) {
return;
}
//on recupere le morphisme qui va bien (transfo coordonnees reelle
//en coordonnes ecran.
GrMorphisme versEcran= getVersEcran();
if (tl_ == null)
tl_= new TraceLigne((Graphics2D)g);
else
tl_.setGraphics((Graphics2D)g);
tl_.setEpaisseur(1f);
tl_.setCouleur(Color.red);
int n= m_.getNbFrontier();
GrSegment seg= new GrSegment();
seg.o= new GrPoint();
seg.e= new GrPoint();
GrPoint grpTemp= new GrPoint();
TraceLigne.Data data;
//une boite tempo contenenant les points fin et init
GrBoite b= new GrBoite();
H2dBoundaryType bType;
boolean extrem;
//on parcourt les frontiere du maillage
for (int i= n - 1; i >= 0; i--) {
H2dBcFrontierMiddleInterface bd= m_.getFrontier(i);
int nbPt= bd.getNbPt();
extrem= true;
//on parcourt les different type de bord pour la frontiere i
for (int j= nbPt - 1; j >= 0; j -= 2) {
bType= bd.getBcType(j);
data= getTlData(bType);
m_.getPoint(seg.o, i, j - 1);
m_.getPoint(seg.e, i, j);
grpTemp.initialiseAvec(seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
seg.autoApplique(versEcran);
tl_.init(data);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
}
seg.o.initialiseAvec(grpTemp);
m_.getPoint(seg.e, i, (extrem ? 0 : j + 1));
seg.boite(b);
if (clip.intersectXY(b)) {
seg.autoApplique(versEcran);
tl_.init(data);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
}
extrem= false;
}
}
if ((rapide_) || (isSelectionEmpty()))
return;
if (tlSelection_ == null) {
tlSelection_= new TraceLigne(g);
} else
tlSelection_.setGraphics((Graphics2D)g);
initIconeSelection();
initCouleurSelection();
Color cs= couleurSelection();
Icon ic= iconeSelection();
if (isAttenue()) {
cs= attenueCouleur(cs);
ic= attenueIcone(ic);
}
tlSelection_.setCouleur(cs);
int max, temp, idxFr;
TIntObjectIterator itIntObj= selection_.getIterator();
for (int i= selection_.getNbList() - 1; i >= 0; i--) {
itIntObj.advance();
idxFr= itIntObj.key();
EbliListeSelection s= (EbliListeSelection)itIntObj.value();
max= s.getMaxIndex();
n= m_.getFrontier(idxFr).getNbPt() - 1;
for (int j= s.getMinIndex(); j <= max; j++) {
if (s.isSelected(j)) {
temp= H2dLib.getIdxFromIdxMid(j);
m_.getPoint(seg.o, idxFr, temp - 1);
m_.getPoint(seg.e, idxFr, (temp == n ? 0 : temp + 1));
seg.boite(b);
if (clip.intersectXY(b)) {
seg.autoApplique(versEcran);
tlSelection_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
}
}
}
}
}
/**
*
*/
public EbliListeSelectionMulti selection(GrPoint _pt, int _tolerance) {
GrMorphisme versEcran= getVersEcran();
GrBoite bClip= getDomaine();
bClip.autoApplique(versEcran);
if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
return null;
bClip= getClipReel(getGraphics());
GrSegment seg= new GrSegment();
seg.e= new GrPoint();
seg.o= new GrPoint();
GrPoint eMem= new GrPoint();
GrPoint oMem= new GrPoint();
GrBoite boite= new GrBoite();
for (int i= m_.getNbFrontier() - 1; i >= 0; i--) {
//middle points ...
m_.getPoint(seg.e,i,0);
for (int j= m_.getFrontier(i).getNbPt() - 1; j >= 0; j -= 2) {
//on initialise le point du milieu.
m_.getPoint(seg.o,i,j);
oMem.initialiseAvec(seg.o);
seg.boite(boite);
if (boite.intersectXY(bClip)) {
seg.autoApplique(versEcran);
if (seg.estSelectionne(_tolerance, _pt)) {
EbliListeSelectionMulti r= new EbliListeSelectionMulti(1);
r.add(i, H2dLib.getIdxMidFromIdx(j));
return r;
}
}
seg.o.initialiseAvec(oMem);
m_.getPoint(seg.e,i,j-1);
eMem.initialiseAvec(seg.e);
seg.boite(boite);
if (boite.intersectXY(bClip)) {
seg.autoApplique(versEcran);
if (seg.estSelectionne(_tolerance, _pt)) {
EbliListeSelectionMulti r= new EbliListeSelectionMulti(1);
r.add(i, H2dLib.getIdxMidFromIdx(j));
return r;
}
}
//point e
seg.e.initialiseAvec(eMem);
}
}
return null;
}
/**
*
*/
public EbliListeSelectionMulti selection(GrPolygone _poly) {
GrPolygone polyReel= _poly.applique(getVersReel());
GrBoite bPolyReel= polyReel.boite();
if ((!bPolyReel.intersectXY(getDomaine()))
|| (!bPolyReel.intersectXY(getClipReel(getGraphics()))))
return null;
GrPoint pTemp= new GrPoint();
GrPoint pTemp2= new GrPoint();
EbliListeSelectionMulti r= new EbliListeSelectionMulti(m_.getNbFrontier());
EbliListeSelection lBord= null;
for (int i= m_.getNbFrontier() - 1; i >= 0; i--) {
lBord= null;
//middle points ...
m_.getPoint(pTemp,i,0);
int nbPt=m_.getFrontier(i).getNbPt();
for (int j= nbPt - 1; j >= 0; j -= 2) {
m_.getPoint(pTemp2,i,j - 1);
//test j+1
if ((bPolyReel.contientXY(pTemp))
&& (polyReel.contientXY(pTemp))
&& (bPolyReel.contientXY(pTemp2))
&& (polyReel.contientXY(pTemp2))) {
m_.getPoint(pTemp,i,j);
//test j
if ((bPolyReel.contientXY(pTemp)) && (polyReel.contientXY(pTemp))) {
m_.getPoint(pTemp,i,j - 1);
if (lBord == null) //divide by two
lBord= new EbliListeSelection(nbPt >> 1);
lBord.add(H2dLib.getIdxMidFromIdx(j));
}
}
pTemp.initialiseAvec(pTemp2);
}
if (lBord != null) {
r.set(i, lBord);
}
}
if (r.isEmpty())
return null;
else
return r;
}
/**
*
*/
public ZModeleDonnees modeleDonnees() {
return m_;
}
}
--- NEW FILE: TrBcBoundaryMiddleModel.java ---
/*
* @file TrBcboundaryMiddleModel.java
* @creation 21 nov. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.dodico.h2d.H2dBcFrontierMiddleInterface;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id: TrBcBoundaryMiddleModel.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public interface TrBcBoundaryMiddleModel extends ZModeleDonnees {
/**
* Le nombre de frontiere du maillage
*/
public int getNbFrontier();
/**
* Renvoie les bords de la frontiere _i
*/
public H2dBcFrontierMiddleInterface getFrontier(int _idxFrontier);
/**
* Initialise <code>_p</code> a partir des donnees du point
* d'indice <code>_idxGlobal</code> sur le domaine
*/
public void getPoint( GrPoint _p,int _idxFr,int _idxPtOnFrontier);
}
--- NEW FILE: TrBcBoundaryMiddleModelDefault.java ---
/*
* @file TrBcBoundaryMiddleModelDefault.java
* @creation 21 nov. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.dodico.h2d.H2dBcFrontierMiddleInterface;
import org.fudaa.dodico.h2d.H2dBcManagerMiddleInterface;
import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id: TrBcBoundaryMiddleModelDefault.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcBoundaryMiddleModelDefault
implements TrBcBoundaryMiddleModel {
H2dBcManagerMiddleInterface mng_;
H2dGrid grid_;
/**
*
*/
public TrBcBoundaryMiddleModelDefault(H2dBcManagerMiddleInterface _mng) {
mng_=_mng;
grid_=_mng.getGrid();
}
/**
*
*/
public int getNbFrontier() {
return grid_.getFrontiers().getNbFrontier();
}
/**
*
*/
public H2dBcFrontierMiddleInterface getFrontier(int _idxFrontier) {
return mng_.getMiddleFrontier(_idxFrontier);
}
/**
*
*/
public void getPoint(GrPoint _p, int _idxFr, int _idxPtOnFrontier) {
H2dPoint p=grid_.getPt(grid_.getFrontiers().getIdx(_idxFr,_idxPtOnFrontier));
_p.setCoordonnees(p.getX(),p.getY(),p.getZ());
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.getDomaine(grid_);
}
/**
*
*/
public int getNombre() {
return getNbFrontier();
}
/**
*
*/
public Object getObject(int _ind) {
return null;
}
}
--- NEW FILE: TrBcLayerGroup.java ---
/*
* @file TrGroupeCL.java
* @creation 11 sept. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.ebli.calque.ContextuelDelegator;
import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
* @version $Id: TrBcLayerGroup.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcLayerGroup extends TrLayerGroup {
public TrBcLayerGroup(){
setTitle(TrResource.getS("cl"));
setDestructible(false);
}
public final TrBcPointLayer getBcPointLayer() {
return (TrBcPointLayer)getCalqueParNom("cqCL");
}
public final TrBcBoundaryLayerAbstract getBcBoundaryLayer() {
return (TrBcBoundaryLayerAbstract)getCalqueParNom("cqBord");
}
public final void addBcPointLayer(TrBcPointLayer _c) {
_c.setName("cqCL");
_c.setDestructible(false);
add(_c);
}
public final void addBcBoundaryLayer(TrBcBoundaryLayerAbstract _c) {
_c.setName("cqBord");
_c.setDestructible(false);
add(_c);
}
public final void setContextuelDelegator(ContextuelDelegator _d) {
getBcPointLayer().setContextuelDelegator(_d);
getBcBoundaryLayer().setContextuelDelegator(_d);
}
}
--- NEW FILE: TrBcPointLayer.java ---
/*
* @file TrCalqueCL.java
* @creation 11 sept. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import gnu.trove.TIntObjectIterator;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.Icon;
import org.fudaa.dodico.commun.DodicoCommandManager;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.ebli.calque.ZCalqueAffichageDonneesMutliSelection;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.calque.action.EbliActionInterface;
import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.commun.EbliListeSelectionMulti;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrMorphisme;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrPolygone;
import org.fudaa.ebli.trace.TraceIcone;
import org.fudaa.fudaa.commun.FudaaCommonImplementation;
import org.fudaa.fudaa.tr.TrFilleVisu;
import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
* @version $Id: TrBcPointLayer.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcPointLayer
extends ZCalqueAffichageDonneesMutliSelection{
private TrBcPointModel m_;
private boolean isT6_;
TraceIcone mid;
public TrBcPointLayer(TrBcPointModel _cl) {
setTitle(TrResource.getS("points"));
m_= _cl;
isT6_=m_.isT6();
if(isT6_){ mid=new TraceIcone(TraceIcone.CROIX,1);}
}
public TrBcPointModel getModeleCl() {
return (TrBcPointModel)modeleDonnees();
}
public int[] isSelectionContiguous(int _i){
return super.isSelectionContiguous(_i,m_.getNbPointInFrontier(_i));
}
/**
* @param _g
*/
public void paintComponent(Graphics _g) {
if((!isT6_) &&( isRapide() || isSelectionEmpty()))
return;
GrBoite clip= getClipReel(_g);
GrBoite domaine= m_.getDomaine();
//Si le domaine des polys n'est pas dans le domaine d'affichage on arrete
if (!domaine.intersectXY(clip)) {
return;
}
GrMorphisme versEcran= getVersEcran();
boolean attenue= isAttenue();
GrPoint p=new GrPoint();
if(isT6_){
GrBoite b=domaine.applique(versEcran);
int taille=(int)(b.e.y-b.o.y)/10;
if(taille>3) taille=3;
mid.taille(taille);
Color old=_g.getColor();
if(attenue)
_g.setColor(attenueCouleur(Color.green));
else
_g.setColor(Color.green);
for(int i=m_.getNbFrontier()-1;i>=0;i--){
for(int j=m_.getNbPointInFrontier(i)-1;j>=0;j-=2){
m_.point(p, i, j);
if(clip.contientXY(p)){
p.autoApplique(versEcran);
mid.paintIcon(this, _g, (int)p.x, (int)p.y);
}
}
}
_g.setColor(old);
}
if (isSelectionEmpty() || isRapide())
return;
//boolean rapide= isRapide();
initIconeSelection();
initCouleurSelection();
Color cs= couleurSelection();
Icon ic= iconeSelection();
if (attenue) {
cs= attenueCouleur(cs);
ic= attenueIcone(ic);
}
_g.setColor(cs);
TIntObjectIterator it= selection_.getIterator();
for (int i= selection_.getNbList(); i-- > 0;) {
it.advance();
int fr=it.key();
EbliListeSelection l=(EbliListeSelection)it.value();
int max=l.getMaxIndex();
for (int j= l.getMinIndex();j<=max;j++) {
if(l.isSelected(j)){
m_.point(p,fr,j);
if (clip.contientXY(p)) {
p.autoApplique(versEcran);
ic.paintIcon(this, _g, (int)p.x, (int)p.y);
}
}
}
}
}
/**
*
*/
public ZModeleDonnees modeleDonnees() {
return m_;
}
/**
*
*/
public EbliListeSelectionMulti selection(GrPoint _pt, int _tolerance) {
GrMorphisme versEcran= getVersEcran();
GrBoite bClip= getDomaine();
bClip.autoApplique(versEcran);
if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
return null;
bClip= getClipReel(getGraphics());
GrPoint p= new GrPoint();
for (int i= m_.getNbFrontier() - 1; i >= 0; i--) {
for (int j= m_.getNbPointInFrontier(i)-1; j >= 0; j--) {
m_.point(p,i,j);
if (bClip.contientXY(p)) {
p.autoApplique(versEcran);
if (GrPoint.estSelectionne(p, _tolerance, _pt)) {
EbliListeSelectionMulti r= new EbliListeSelectionMulti(1);
r.add(i, j);
return r;
}
}
}
}
return null;
}
/**
*
*/
public EbliListeSelectionMulti selection(GrPolygone _poly) {
GrPolygone polyReel= _poly.applique(getVersReel());
GrBoite boitePolyReel= polyReel.boite();
//on verifie si la boite du polygone intersecte le domaine et le clip d'affichage
//surement inutile pour le clip d'affichage
if( (!boitePolyReel.intersectXY(getDomaine())) ||(!boitePolyReel.intersectXY(getClipReel(getGraphics()))))
return null;
EbliListeSelectionMulti r= createSelection();
GrPoint p= new GrPoint();
for (int i= m_.getNbFrontier() - 1; i >= 0; i--) {
EbliListeSelection l= null;
int nbPt=m_.getNbPointInFrontier(i);
for (int j= nbPt-1; j >= 0; j--) {
m_.point(p, i,j);
if ((boitePolyReel.contientXY(p))
&& (polyReel.contientXY(p))) {
if (l == null)
l= new EbliListeSelection(nbPt);
l.add(j);
}
}
if (l != null)
r.set(i, l);
}
if (r.isEmpty())
return null;
else
return r;
}
/**
*
*/
protected void buildActions() {}
}
--- NEW FILE: TrBcPointModel.java ---
/*
* @file TrModeleCL.java
* @creation 11 sept. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBcManagerBlockInterface;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id: TrBcPointModel.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public interface TrBcPointModel extends ZModeleDonnees{
public boolean point(GrPoint _p, int _idxFrontier,int idxPtOnFrontier);
public int getNbFrontier();
public int getNbPointInFrontier(int _i);
public boolean isT6();
}
--- NEW FILE: TrBcPointModelDefault.java ---
/*
* @file TrModeleCLAbstract.java
* @creation 11 sept. 2003
* @modification $Date: 2003/11/21 15:06:45 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
import org.fudaa.dodico.h2d.H2dBcManagerBlockInterface;
import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id: TrBcPointModelDefault.java,v 1.1 2003/11/21 15:06:45 deniger Exp $
*/
public class TrBcPointModelDefault implements TrBcPointModel {
H2dGrid m_;
public TrBcPointModelDefault(H2dGrid _m){
if(_m==null) throw new IllegalArgumentException("param null");
m_=_m;
}
public int getNbFrontier(){
return m_.getFrontiers().getNbFrontier();
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.getDomaine(m_);
}
/**
*
*/
public int getNombre() {
return m_.getFrontiers().getNbTotalPt();
}
/**
*
*/
public Object getObject(int _ind) {
return null;
}
/**
*
*/
public int getNbPointInFrontier(int _i) {
return m_.getFrontiers().getNbPt(_i);
}
/**
*
*/
public boolean point(GrPoint _p, int _idxFrontier, int idxPtOnFrontier) {
H2dPoint p=m_.getPt(m_.getFrontiers().getIdx(_idxFrontier, idxPtOnFrontier));
_p.setCoordonnees(p.getX(),p.getY(), p.getZ());
return true;
}
/**
*
*/
public boolean isT6() {
return m_.getEltType()==H2dElementType.T6;
}
}
--- NEW FILE: TrElementLayer.java ---
/*
* @file TrCalquePolygone.java
* @creation 13 nov. 2003
* @modification $Date: 2003/11/21 15:06:46 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.ebli.calque.ZCalquePolygone;
import org.fudaa.ebli.calque.ZModelePolygone;
import org.fudaa.ebli.calque.action.EbliActionInterface;
/**
* @author deniger
* @version $Id: TrElementLayer.java,v 1.1 2003/11/21 15:06:46 deniger Exp $
*/
public class TrElementLayer extends ZCalquePolygone {
/**
*
*/
public TrElementLayer() {
super();
}
/**
* @param _modele
*/
public TrElementLayer(ZModelePolygone _modele) {
super(_modele);
}
}
--- NEW FILE: TrGridLayerGroup.java ---
/*
* @file TrMaillage.java
* @creation 30 juin 2003
* @modification $Date: 2003/11/21 15:06:46 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import java.awt.Graphics;
import gnu.trove.TIntObjectHashMap;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.ebli.calque.ContextuelDelegator;
import org.fudaa.ebli.calque.ZCalquePoint;
import org.fudaa.ebli.calque.ZCalquePolygone;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.calque.ZModeleLongPolygone;
import org.fudaa.ebli.calque.ZModelePoint;
import org.fudaa.ebli.calque.ZModelePolygone;
import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrPolygone;
import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
* @version $Id: TrGridLayerGroup.java,v 1.1 2003/11/21 15:06:46 deniger Exp $
*/
public class TrGridLayerGroup extends TrLayerGroup {
H2dGrid mail_;
TrPointLayer cqPt_;
TrElementLayer cqPoly_;
// ZCalqueLongPolygone cqBord_;
/**
* @param _pts
* @param _elts
*/
public TrGridLayerGroup(H2dGrid _maill) {
setTitle(TrResource.getS("Maillage"));
setName("cqMaillage");
setDestructible(false);
mail_= _maill;
cqPt_= new TrPointLayer(new ModelePoint());
cqPt_.setName("cqPts");
cqPt_.setTitle(TrResource.getS("Points"));
cqPt_.setDestructible(false);
add(cqPt_);
cqPoly_= new TrElementLayer(new ModelePolygone());
cqPoly_.setDestructible(false);
cqPoly_.setName("cqPolygon");
cqPoly_.setTitle(TrResource.getS("Polygones"));
add(cqPoly_);
// cqBord_= new ZCalqueLongPolygone(new ModeleBord());
// cqBord_.setDestructible(false);
// cqBord_.setName("cqEdges");
// cqBord_.setTitle(TrResource.getS("Bords"));
// add(cqBord_);
}
public void setContextuelDelegator(ContextuelDelegator _d){
cqPt_.setContextuelDelegator(_d);
cqPoly_.setContextuelDelegator(_d);
// cqBord_.setContextuelDelegator(_d);
}
/**
*
*/
public GrBoite getDomaine() {
return getDomaine(mail_);
}
public static GrBoite getDomaine(H2dGrid _m) {
GrBoite b= new GrBoite();
H2dPoint pt= _m.getMinPoint();
b.o= new GrPoint(pt.getX(), pt.getY(), pt.getZ());
pt= _m.getMaxPoint();
b.e= new GrPoint(pt.getX(), pt.getY(), pt.getZ());
return b;
}
public ZModelePoint getModelePoint() {
return new ModelePoint();
}
public ZModelePolygone getModelePolygone() {
return new ModelePolygone();
}
public ZModeleLongPolygone getModeleBord() {
return new ModeleBord();
}
private class ModelePoint implements ZModelePoint {
/**
*
*/
public boolean point(GrPoint _p, int _i) {
return TrGridLayerGroup.this.point(_p, _i);
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.this.getDomaine();
}
/**
*
*/
public int getNombre() {
return TrGridLayerGroup.this.mail_.getPtsNb();
}
/**
*
*/
public Object getObject(int _ind) {
throw new UnsupportedOperationException("not implemented method");
}
}
protected class ModelePolygone implements ZModelePolygone {
/**
*
*/
public boolean polygone(GrPolygone _p, int _i) {
return TrGridLayerGroup.this.polygone(_p, _i);
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.this.getDomaine();
}
/**
*
*/
public int getNombre() {
return TrGridLayerGroup.this.mail_.getEltNb();
}
/**
*
*/
public Object getObject(int _ind) {
throw new UnsupportedOperationException("not implemented method");
}
/**
*
*/
public int nbPoints(int i) {
return TrGridLayerGroup.this.getNbPointsForElt(i);
}
}
public int getNbPointsForElt(int _indexElt) {
return mail_.getElement(_indexElt).getPtNb();
}
public static void initGrPoint(H2dPoint _pt, GrPoint _ptToinit) {
_ptToinit.x= _pt.getX();
_ptToinit.y= _pt.getY();
_ptToinit.z= _pt.getZ();
}
public static void initGrPolygone(
H2dGrid _ma,
H2dElement _pt,
GrPolygone _ptToinit) {
int n= _pt.getPtNb();
if (_ptToinit.nombre() != n) {
_ptToinit.sommets.setSize(n);
}
GrPoint grpt;
H2dPoint hpt;
for (int i= 0; i < n; i++) {
hpt= _ma.getPt(_pt.getPtIndex()[i]);
grpt= _ptToinit.sommets.renvoie(i);
if (grpt != null)
initGrPoint(hpt, grpt);
else {
grpt= new GrPoint(hpt.getX(), hpt.getY(), hpt.getZ());
_ptToinit.sommets.remplace(grpt, i);
}
}
}
private class ModeleBord implements ZModeleLongPolygone {
private TIntObjectHashMap indexMinMax_;
public ModeleBord() {
int n= mail_.getFrontiers().getNbFrontierIntern();
if (n > 0) {
indexMinMax_= new TIntObjectHashMap(n);
for (int i= 0; i < n; i++) {
indexMinMax_.put(i, mail_.getMinMaxPointFrontiere(i));
}
}
}
/**
*
*/
public GrBoite getDomaineForPolygoneIdx(int _idx) {
if (_idx == 0)
return TrGridLayerGroup.this.getDomaine();
if (indexMinMax_ == null) {
System.err.println("Prob !!!");
return null;
} else {
H2dPoint[] minMax= (H2dPoint[])indexMinMax_.get(_idx - 1);
GrBoite r= new GrBoite();
r.o= new GrPoint();
r.e= new GrPoint();
initGrPoint(minMax[0], r.o);
initGrPoint(minMax[1], r.e);
return r;
}
}
/**
*
*/
public int getNbPointForPolygoneIdx(int _idx) {
return TrGridLayerGroup.this.mail_.getFrontiers().getNbPt(_idx);
}
/**
*
*/
public int getPolygoneNb() {
return TrGridLayerGroup.this.mail_.getFrontiers().getNbFrontier();
}
/**
*
*/
public boolean point(GrPoint _p, int _polygoneIdx, int _pointIdx) {
H2dPoint pt=
mail_.getPt(
TrGridLayerGroup.this.mail_.getFrontiers().getIdx(
_polygoneIdx,
_pointIdx));
initGrPoint(pt, _p);
return true;
}
/**
*
*/
public GrBoite getDomaine() {
return TrGridLayerGroup.this.getDomaine();
}
/**
*
*/
public int getNombre() {
return TrGridLayerGroup.this.mail_.getFrontiers().getNbFrontier();
}
/**
*
*/
public Object getObject(int _ind) {
return null;
}
}
public void paintComponent(Graphics _g){
if( (!cqPoly_.isVisible()) || (!cqPt_.isSelectionEmpty()) || (cqPt_.getPaletteCouleur()!=null) )
super.paintComponent(_g);
else {cqPoly_.paintComponent(_g);}
}
/**
*
*/
public boolean point(GrPoint _p, int _i) {
initGrPoint(mail_.getPt(_i), _p);
return true;
}
/**
*
*/
public boolean polygone(GrPolygone _poly, int _i) {
initGrPolygone(this.mail_, mail_.getElement(_i), _poly);
return true;
}
/**
*
*/
public ZModeleDonnees modeleDonnees() {
return cqPt_.modeleDonnees();
}
/**
*
*/
public EbliListeSelection selection(
GrPoint _pt,
int _tolerance) {
return cqPt_.selection(_pt, _tolerance);
}
/**
*
*/
public EbliListeSelection selection(GrPolygone _poly) {
return cqPt_.selection(_poly);
}
private boolean polyOldValue= true;
/**
*
*/
public void setRapide(boolean _v) {
if (rapide_ != _v) {
boolean vp= rapide_;
rapide_= _v;
cqPt_.setRapide(_v);
// cqBord_.setRapide(_v);
if (_v) {
polyOldValue= cqPoly_.isVisible();
cqPoly_.setVisible(false);
} else
cqPoly_.setVisible(polyOldValue);
firePropertyChange("ajustement", vp, rapide_);
}
}
}
--- NEW FILE: TrLayerGroup.java ---
/*
* @file TrGroupeCalque.java
* @creation 6 nov. 2003
* @modification $Date: 2003/11/21 15:06:46 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.ebli.calque.BGroupeCalque;
import org.fudaa.ebli.calque.action.EbliActionInterface;
/**
* @author deniger
* @version $Id: TrLayerGroup.java,v 1.1 2003/11/21 15:06:46 deniger Exp $
*/
public class TrLayerGroup extends BGroupeCalque {
/**
*
*/
public TrLayerGroup() {
super();
}
}
--- NEW FILE: TrPointLayer.java ---
/*
* @file TrCalquePoint.java
* @creation 13 nov. 2003
* @modification $Date: 2003/11/21 15:06:46 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.fudaa.tr.data;
import org.fudaa.ebli.calque.ZCalquePoint;
import org.fudaa.ebli.calque.ZModelePoint;
import org.fudaa.ebli.calque.action.EbliActionInterface;
/**
* @author deniger
* @version $Id: TrPointLayer.java,v 1.1 2003/11/21 15:06:46 deniger Exp $
*/
public class TrPointLayer extends ZCalquePoint{
/**
*
*/
public TrPointLayer() {
super();
}
/**
* @param _modele
*/
public TrPointLayer(ZModelePoint _modele) {
super(_modele);
}
}
--- TrBordLegendePanel.java DELETED ---
--- TrCalque.java DELETED ---
--- TrCalqueBord.java DELETED ---
--- TrCalqueCL.java DELETED ---
--- TrCalqueLegende.java DELETED ---
--- TrCalquePoint.java DELETED ---
--- TrCalquePolygone.java DELETED ---
--- TrGroupeCL.java DELETED ---
--- TrGroupeCalque.java DELETED ---
--- TrGroupeMaillage.java DELETED ---
--- TrModeleBord.java DELETED ---
--- TrModeleBordAdapter.java DELETED ---
--- TrModeleCL.java DELETED ---
--- TrModeleCLAdapter.java DELETED ---
|