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/dodico/src/org/fudaa/dodico/h2d/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/h2d/telemac
Modified Files:
H2dTelemacCLElementSource.java
H2dTelemacCLSourceInterface.java
H2dTelemacProjectDispatcherListener.java
Added Files:
H2dTelemacBcListener.java H2dTelemacBcManager.java
H2dTelemacBoundary.java H2dTelemacBoundaryCondition.java
H2dTelemacBoundaryConditionMutable.java
H2dTelemacBoundaryMutable.java H2dTelemacParameters.java
Removed Files:
H2dTelemacBord.java H2dTelemacBordMutable.java
H2dTelemacCLManager.java H2dTelemacClListener.java
H2dTelemacConditionLimite.java
H2dTelemacConditionLimiteMutable.java
H2dTelemacParametres.java
Log Message:
Change the name of mutlipe classes
--- NEW FILE: H2dTelemacBcListener.java ---
/*
* @file H2dTelemacClListener.java
* @creation 23 oct. 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.H2dBoundary;
import org.fudaa.dodico.h2d.H2dBcListener;
/**
* @author deniger
* @version $Id: H2dTelemacBcListener.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public interface H2dTelemacBcListener extends H2dBcListener {
}
--- NEW FILE: H2dTelemacBcManager.java ---
/*
* @file H2dTelemacBordManager.java
* @creation 9 sept. 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import gnu.trove.TIntObjectHashMap;
import gnu.trove.TIntObjectIterator;
import gnu.trove.TObjectDoubleHashMap;
import gnu.trove.TObjectDoubleIterator;
import gnu.trove.TObjectIntHashMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
[...1402 lines suppressed...]
if (bord == null)
return false;
_ele.initFrom(cl, bord.getUType(), bord.getVType(), /*bord.getHType(),*/
bord.getTracerType(), bord.getType());
return true;
}
};
}
/**
*
*/
public void dicoParamsStateLoadedEntiteChanged(
DicoParams _cas,
DicoEntite _ent) {
}
/**
*
*/
public void dicoParamsProjectModifyStateChanged(DicoParams _cas) {}
}
--- NEW FILE: H2dTelemacBoundary.java ---
/*
* @file H2dTelemacBord.java
* @creation 23 oct. 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.h2d.H2dBoundary;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
* @author deniger
* @version $Id: H2dTelemacBoundary.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public class H2dTelemacBoundary extends H2dBoundary {
H2dBcType tracerType_;
H2dBcType uType_;
H2dBcType vType_;
// H2dClType hType_;
String elevation_;
String velocity_;
String flowrate_;
String tracer_;
String velocityProfil_;
String liquidOption_;
public final static DodicoPermanentList VARIABLE_TYPE=
new DodicoPermanentList(
DodicoLib
.sort(new H2dVariableType[] {
H2dVariableType.VITESSE_U,
H2dVariableType.VITESSE_V,
// H2dVariableType.COTE_EAU,
H2dVariableType.TRACEUR }));
private static Map BORD_TYPE_VARIABLE_ACCEPTED;
public final static void createMapBordTypeVar() {
BORD_TYPE_VARIABLE_ACCEPTED= new HashMap(10);
H2dVariableType[] vs=
new H2dVariableType[] {
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.LIQUIDE, vs);
vs=
new H2dVariableType[] {
H2dVariableType.DEBIT,
H2dVariableType.VITESSE_U,
H2dVariableType.VITESSE_V,
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE, vs);
vs=
new H2dVariableType[] {
H2dVariableType.COTE_EAU,
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE, vs);
vs=
new H2dVariableType[] {
H2dVariableType.COTE_EAU,
H2dVariableType.VITESSE_U,
H2dVariableType.VITESSE_V,
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(
H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES,
vs);
vs=
new H2dVariableType[] {
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.LIQUIDE_ONDE_INCIDENCE, vs);
vs=
new H2dVariableType[] {
H2dVariableType.VITESSE_U,
H2dVariableType.VITESSE_V,
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES, vs);
vs= new H2dVariableType[] { H2dVariableType.RUGOSITE };
Arrays.sort(vs);
BORD_TYPE_VARIABLE_ACCEPTED.put(H2dBoundaryType.SOLIDE, vs);
}
/**
*
*/
public H2dTelemacBoundary() {
tracerType_= H2dBcType.LIBRE;
uType_= H2dBcType.LIBRE;
vType_= H2dBcType.LIBRE;
//hType_= H2dClType.LIBRE;
}
public H2dTelemacBoundary(H2dTelemacBoundary _init) {
super(_init);
//telemac
initFrom(_init);
}
protected final void initFrom(H2dTelemacBoundary _init) {
tracerType_= _init.tracerType_;
elevation_= _init.elevation_;
velocity_= _init.velocity_;
flowrate_= _init.flowrate_;
tracer_= _init.tracer_;
velocityProfil_= _init.velocityProfil_;
liquidOption_= _init.liquidOption_;
uType_= _init.uType_;
vType_= _init.vType_;
// hType_= _init.hType_;
}
public final static boolean isVariableCompatible(
H2dBoundaryType _b,
H2dVariableType _v) {
if (BORD_TYPE_VARIABLE_ACCEPTED == null)
H2dTelemacBoundary.createMapBordTypeVar();
H2dVariableType[] v= (H2dVariableType[])BORD_TYPE_VARIABLE_ACCEPTED.get(_b);
if (v == null) {
new Throwable("boundary not found").printStackTrace();
return false;
}
return Arrays.binarySearch(v, _v) >= 0;
}
/**
* Pour les bords permettant de modifier les comportements des variables u et v,
* renvoie true si les 2 composantes peuvent etre initialisée en fixe
* (bord vitesses imposees et hauteur et vitesses imposees).
*
* For the boundaries for wich the velocity comportment ( u and v) can be modified (free or fixed)
* return true, if u an d v can be set to fixed.
*/
public final static boolean canUandVBeSetAsFixedFor(H2dBoundaryType _b) {
if ((_b == H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES)
|| (_b == H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES))
return true;
else
return false;
}
/**
* Pour les bords permettant de modifier les comportements des variables u et v,
* renvoie true si les 2 composantes peuvent etre initialisée en libre ( bord debit).
*
* For the boundaries for wich the velocity comportment ( u and v) can be modified (free or fixed)
* return true, if u an d v can be set to free.
*/
public final static boolean canUandVBeSetAsFreeFor(H2dBoundaryType _b) {
if (_b == H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE)
return true;
else
return false;
}
public boolean isVariableCompatibleWithBoundaryType(H2dVariableType _v) {
return isVariableCompatible(getType(), _v);
}
public H2dVariableType[] getVariablesAllowed() {
createMapBordTypeVar();
H2dVariableType[] ri=
(H2dVariableType[])BORD_TYPE_VARIABLE_ACCEPTED.get(getType());
if (ri == null)
return null;
H2dVariableType[] r= new H2dVariableType[ri.length];
System.arraycopy(ri, 0, r, 0, r.length);
return r;
}
/**
*
*/
public H2dBcType getTracerType() {
return tracerType_;
}
// public int isIntersectBy(int _min, int _max, int _nbPt) {
// if (isUnique())
// return 1;
// int deb= idxDeb_;
// int fin= idxFin_;
// if (!getType().isLiquide()) {
// deb++;
// fin--;
// }
// if (((idxDeb_ > idxFin_) && (deb < fin))
// || ((idxDeb_ < idxFin_) && (deb > fin)))
// new Throwable().printStackTrace();
// return isBordIntersectBy(deb, fin, _min, _max, _nbPt);
// }
/**
*
*/
// protected void setTracerType(H2dClType _type) {
// if (getType().isLiquide())
// tracerType_= _type;
// }
public boolean isTracerImposed() {
return tracerType_ == H2dBcType.PERMANENT;
}
public boolean isUTypeImposed() {
return uType_ == H2dBcType.PERMANENT;
}
public boolean isVTypeImposed() {
return vType_ == H2dBcType.PERMANENT;
}
// public boolean isHTypeImposed() {
// return hType_ == H2dClType.PERMANENT;
// }
private boolean setUTypeImposed(boolean _b) {
if (_b != isUTypeImposed()) {
uType_= _b ? H2dBcType.PERMANENT : H2dBcType.LIBRE;
return true;
}
return false;
}
private boolean setVTypeImposed(boolean _b) {
if (_b != isVTypeImposed()) {
vType_= _b ? H2dBcType.PERMANENT : H2dBcType.LIBRE;
return true;
}
return false;
}
// protected boolean setHTypeImposed(boolean _b) {
// if ((getType().isLiquide())
// && (_b != isHTypeImposed())
// && (isVariableCompatibleWithBoundaryType(H2dVariableType.COTE_EAU))) {
// hType_= _b ? H2dClType.PERMANENT : H2dClType.LIBRE;
// return true;
// }
// return false;
// }
protected boolean setTracerTypeImposed(boolean _b) {
if ((getType().isLiquide())
&& (_b != isTracerImposed())
&& (isVariableCompatibleWithBoundaryType(H2dVariableType.TRACEUR))) {
tracerType_= _b ? H2dBcType.PERMANENT : H2dBcType.LIBRE;
return true;
}
return false;
}
// protected boolean setUType(H2dClType _t) {
// if ((_t == H2dClType.PERMANENT) || (_t == H2dClType.LIBRE)) {
// return setUTypeImposed(_t == H2dClType.PERMANENT);
// }
// return false;
// }
// protected boolean setVType(H2dClType _t) {
// if ((_t == H2dClType.PERMANENT) || (_t == H2dClType.LIBRE)) {
// return setVTypeImposed(_t == H2dClType.PERMANENT);
// }
// return false;
// }
// protected boolean setHType(H2dClType _t) {
// if ((_t == H2dClType.PERMANENT) || (_t == H2dClType.LIBRE)) {
// return setHTypeImposed(_t == H2dClType.PERMANENT);
// }
// return false;
// }
protected boolean setTracerType(H2dBcType _t) {
if ((_t == H2dBcType.PERMANENT) || (_t == H2dBcType.LIBRE)) {
return setTracerTypeImposed(_t == H2dBcType.PERMANENT);
}
return false;
}
protected boolean setBordType(H2dBoundaryType _type) {
boolean r= super.setBordType(_type);
if (r) {
createMapBordTypeVar();
H2dVariableType[] vs=
(H2dVariableType[])BORD_TYPE_VARIABLE_ACCEPTED.get(getType());
H2dVariableType v;
for (int i= VARIABLE_TYPE.size() - 1; i >= 0; i--) {
v= (H2dVariableType)VARIABLE_TYPE.get(i);
//if the variable is not compatible with the type of boundary
if (Arrays.binarySearch(vs, v) < 0)
setTypeImposed(v, false);
}
}
return r;
}
/**
*
*/
protected void setIdxDeb(int _i) {
super.setIdxDeb(_i);
}
/**
*
*/
protected void setIdxFin(int _i) {
super.setIdxFin(_i);
}
/**
*
*/
protected void setIdxmaillageFrontiere(int _i) {
super.setIdxmaillageFrontiere(_i);
}
/**
*
*/
public String getElevation() {
return elevation_;
}
/**
*
*/
public String getFlowrate() {
return flowrate_;
}
/**
*
*/
public String getLiquidOption() {
return liquidOption_;
}
/**
*
*/
public String getTracer() {
return tracer_;
}
/**
*
*/
public String getVelocity() {
return velocity_;
}
/**
*
*/
public String getVelocityProfil() {
return velocityProfil_;
}
/**
*
*/
protected boolean setElevation(String _string) {
if (_string != elevation_) {
elevation_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setFlowrate(String _string) {
if (_string != flowrate_) {
flowrate_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setLiquidOption(String _string) {
if (_string != liquidOption_) {
liquidOption_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setTracer(String _string) {
if (_string != tracer_) {
tracer_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setVelocity(String _string) {
if (_string != velocity_) {
velocity_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setVelocityProfil(String _string) {
if (_string != velocityProfil_) {
velocityProfil_= _string;
return true;
}
return false;
}
protected boolean setValue(H2dVariableType _type, String _string) {
if (_type == H2dVariableType.VITESSE) {
return setVelocity(_string);
} else if (_type == H2dVariableType.COTE_EAU) {
return setElevation(_string);
} else if (_type == H2dVariableType.DEBIT) {
return setFlowrate(_string);
} else if (_type == H2dVariableType.TRACEUR) {
return setTracer(_string);
}
System.err.println("variable unknown for " + getClass().getName());
new Throwable().printStackTrace();
return false;
}
public boolean isTypeImposed(H2dVariableType _t) {
if (_t == H2dVariableType.VITESSE_U)
return isUTypeImposed();
else if (_t == H2dVariableType.VITESSE_V)
return isVTypeImposed();
// else if (_t == H2dVariableType.COTE_EAU)
// return isHTypeImposed();
else if (_t == H2dVariableType.TRACEUR)
return isTracerImposed();
else {
System.err.println("variable unknown " + _t);
new Throwable().printStackTrace();
return false;
}
}
protected boolean setTypeImposed(boolean _u, boolean _v, boolean _t) {
return setUVType(_u, _v) | setTracerTypeImposed(_t);
}
protected boolean setTypeImposed(H2dVariableType _t, boolean _b) {
if (_t == H2dVariableType.VITESSE_U)
return setUVType(_b, vType_ == H2dBcType.PERMANENT);
else if (_t == H2dVariableType.VITESSE_V)
return setUVType(uType_ == H2dBcType.PERMANENT, _b);
// else if (_t == H2dVariableType.COTE_EAU)
// return setHTypeImposed(_b);
else if (_t == H2dVariableType.TRACEUR)
return setTracerTypeImposed(_b);
else {
System.err.println("variable unknown " + _t);
new Throwable().printStackTrace();
return false;
}
}
protected boolean setUVType(
boolean _uImposed,
boolean _vImposed /*, H2dClType _h*/
) {
H2dBoundaryType t= getType();
if ((t == H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES)
|| (t == H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES)) {
if ((_uImposed) || (_vImposed)) {
return (setUTypeImposed(_uImposed) | setVTypeImposed(_vImposed));
}
} else if (t == H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE) {
if ((!_uImposed) || (!_vImposed)) {
return (setUTypeImposed(_uImposed) | setVTypeImposed(_vImposed));
}
}
return false;
}
protected boolean setUVType(H2dBcType _u, H2dBcType _v) {
return setUVType(_u == H2dBcType.PERMANENT, _v == H2dBcType.PERMANENT);
}
/**
* For a solid boundary, the extrem idx are not belonging to this boundary
* Si c'est un bord solid, les extremites ne sont pas prise en compte.
*/
public boolean containsIdx(int _idx) {
if (getType().isLiquide())
return super.containsIdx(_idx);
else
return idxDeb_ == idxFin_
? true
: ((idxDeb_ < idxFin_)
? ((_idx > idxDeb_) && (_idx < idxFin_))
: ((_idx >= 0) && ((_idx < idxFin_) || (_idx > idxDeb_))));
}
// /**
// *
// */
// public H2dClType getHType() {
// return hType_;
// }
/**
*
*/
public H2dBcType getUType() {
return uType_;
}
/**
*
*/
public H2dBcType getVType() {
return vType_;
}
}
--- NEW FILE: H2dTelemacBoundaryCondition.java ---
/*
* @file H2dConditionLimiteTelemac.java
* @creation 25 juin 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.h2d.H2dBoundaryCondition;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
* @author deniger
* @version $Id: H2dTelemacBoundaryCondition.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public class H2dTelemacBoundaryCondition extends H2dBoundaryCondition {
double traceur_;
double frottementParoi_;
double traceurCoefA_;
double traceurCoefB_;
public static final DodicoPermanentList VARIABLE_LIST=
new DodicoPermanentList(
DodicoLib.sort(
new H2dVariableType[] {
H2dVariableType.COTE_EAU,
H2dVariableType.VITESSE_U,
H2dVariableType.VITESSE_V,
H2dVariableType.TRACEUR,
H2dVariableType.TRACEUR_COEF_A,
H2dVariableType.TRACEUR_COEF_B,
H2dVariableType.RUGOSITE }));
/**
*
*/
public H2dTelemacBoundaryCondition() {
super();
}
protected void setIndexPt(int _i){
indexPt_=_i;
}
protected void initFrom(H2dTelemacCLElementSource _s){
u_=_s.u_;
v_=_s.v_;
h_=_s.h_;
frottementParoi_=_s.friction_;
traceur_=_s.tracer_;
traceurCoefA_=_s.tracerCoefA_;
traceurCoefB_=_s.tracerCoefB_;
indexPt_=_s.ptGlobalIdx_;
}
public static class TelemacCLMemento{
double u_;
double v_;
double h_;
double traceur_;
double traceurCoefA_;
double traceurCoefB_;
double frottementParoi_;
H2dBcType uType;
H2dBcType vType;
H2dBcType hType;
public String toString(){
return "u="+u_+" ,v="+v_+",h="+h_+", t="+traceur_+", ta="+traceurCoefA_+", tb="+frottementParoi_;
}
}
/**
*
*/
protected TelemacCLMemento createMemento() {
TelemacCLMemento r=new TelemacCLMemento();
r.u_=u_;
r.v_=v_;
r.h_=h_;
r.traceur_=traceur_;
r.traceurCoefA_=traceurCoefA_;
r.traceurCoefB_=traceurCoefB_;
r.frottementParoi_=frottementParoi_;
return r;
}
protected void initFromMemento(TelemacCLMemento _m) {
if ((_m != null)) {
u_= _m.u_;
v_= _m.v_;
h_= _m.h_;
traceur_= _m.traceur_;
traceurCoefA_= _m.traceurCoefA_;
traceurCoefB_= _m.traceurCoefB_;
frottementParoi_= _m.frottementParoi_;
}
}
/**
*
*/
public double getTracer() {
return traceur_;
}
/**
*
*/
public double getTracerCoeffA() {
return traceurCoefA_;
}
/**
*
*/
public double getTracerCoeffB() {
return traceurCoefB_;
}
/**
*
*/
public double getFriction() {
return frottementParoi_;
}
/**
* Set the value for the variable _variable and return true if change (or if the variable type is not
* supported).
* @return true if the change is done.
*/
protected boolean setValue(H2dVariableType _variable, double _d) {
if (_variable == H2dVariableType.COTE_EAU)
return setH(_d);
else if (_variable == H2dVariableType.VITESSE_U)
return setU(_d);
else if (_variable == H2dVariableType.VITESSE_V)
return setV(_d);
else if (_variable == H2dVariableType.TRACEUR)
return setT(_d);
else if (_variable == H2dVariableType.TRACEUR_COEF_A)
return setTraceurCoefA(_d);
else if (_variable == H2dVariableType.TRACEUR_COEF_B)
return setTraceurCoefB(_d);
else if (_variable == H2dVariableType.RUGOSITE)
return setFriction(_d);
new Throwable().printStackTrace();
return false;
}
/**
*
*/
protected boolean setFriction(double _d) {
if (_d == frottementParoi_)
return false;
frottementParoi_= _d;
return true;
}
/**
*
*/
protected boolean setT(double _d) {
if (_d == traceur_)
return false;
traceur_= _d;
return true;
}
/**
*
*/
protected boolean setTraceurCoefA(double _d) {
if (_d == traceurCoefA_)
return false;
traceurCoefA_= _d;
return true;
}
/**
*
*/
protected boolean setTraceurCoefB(double _d) {
if (_d == traceurCoefB_)
return false;
traceurCoefB_= _d;
return true;
}
protected boolean setU(double _d) {
if (_d == u_)
return false;
u_= _d;
return true;
}
protected boolean setV(double _d) {
if (_d == v_)
return false;
v_= _d;
return true;
}
protected boolean setH(double _d) {
if (_d == h_)
return false;
h_= _d;
return true;
}
}
--- NEW FILE: H2dTelemacBoundaryConditionMutable.java ---
/*
* @file H2dConditionLimiteTelemacMutable.java
* @creation 25 juin 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
/**
* @author deniger
* @version $Id: H2dTelemacBoundaryConditionMutable.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public class H2dTelemacBoundaryConditionMutable
extends H2dTelemacBoundaryCondition {
/**
*
*/
public H2dTelemacBoundaryConditionMutable() {
super();
}
/**
*
*/
public boolean setFriction(double _s) {
return super.setFriction(_s);
}
public void setTraceur(double _s) {
traceur_= _s;
}
public boolean setTraceurCoefA(double _s) {
return super.setTraceurCoefA(_s);
}
public boolean setTraceurCoefB(double _s) {
return super.setTraceurCoefB(_s);
}
public boolean setH(double _s) {
return super.setH(_s);
}
public void setIndexPt(int _s) {
indexPt_= _s;
}
public boolean setU(double _s) {
return super.setU(_s);
}
public boolean setV(double _s) {
return super.setV(_s);
}
}
--- NEW FILE: H2dTelemacBoundaryMutable.java ---
/*
* @file H2dTelemacBordMutable.java
* @creation 27 oct. 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
* @author deniger
* @version $Id: H2dTelemacBoundaryMutable.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public class H2dTelemacBoundaryMutable extends H2dTelemacBoundary {
/**
*
*/
public H2dTelemacBoundaryMutable() {
super();
}
/**
* @param _init
*/
public H2dTelemacBoundaryMutable(H2dTelemacBoundary _init) {
super(_init);
}
public boolean setFlowrate(String _string) {
return super.setFlowrate(_string);
}
public void setIdxDeb(int _i) {
super.setIdxDeb(_i);
}
public void setIdxFin(int _i) {
super.setIdxFin(_i);
}
public void setIdxmaillageFrontiere(int _i) {
super.setIdxmaillageFrontiere(_i);
}
public boolean setLiquidOption(String _string) {
return super.setLiquidOption(_string);
}
public void setName(String _string) {
super.setName(_string);
}
public boolean setTracer(String _string) {
return super.setTracer(_string);
}
public boolean setTracerTypeImposed(boolean _b) {
return super.setTracerTypeImposed(_b);
}
public boolean setBordType(H2dBoundaryType _type) {
return super.setBordType(_type);
}
public boolean setValue(H2dVariableType _type, String _string) {
return super.setValue(_type, _string);
}
public boolean setVelocity(String _string) {
return super.setVelocity(_string);
}
public boolean setVelocityProfil(String _string) {
return super.setVelocityProfil(_string);
}
}
--- NEW FILE: H2dTelemacParameters.java ---
(This appears to be a binary file; contents omitted.)
Index: H2dTelemacCLElementSource.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLElementSource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dTelemacCLElementSource.java 14 Nov 2003 08:22:20 -0000 1.1
--- H2dTelemacCLElementSource.java 21 Nov 2003 15:00:03 -0000 1.2
***************
*** 8,13 ****
*/
package org.fudaa.dodico.h2d.telemac;
! import org.fudaa.dodico.h2d.type.H2dBordType;
! import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
--- 8,13 ----
*/
package org.fudaa.dodico.h2d.telemac;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
! import org.fudaa.dodico.h2d.type.H2dBcType;
/**
* @author deniger
***************
*** 15,23 ****
*/
public class H2dTelemacCLElementSource {
! public H2dClType uType_;
! public H2dClType vType_;
//public H2dClType hType_;
! public H2dClType tracerType_;
! public H2dBordType bordType_;
public double u_, v_, h_, friction_, tracer_, tracerCoefA_, tracerCoefB_;
public int ptGlobalIdx_;
--- 15,23 ----
*/
public class H2dTelemacCLElementSource {
! public H2dBcType uType_;
! public H2dBcType vType_;
//public H2dClType hType_;
! public H2dBcType tracerType_;
! public H2dBoundaryType bordType_;
public double u_, v_, h_, friction_, tracer_, tracerCoefA_, tracerCoefB_;
public int ptGlobalIdx_;
***************
*** 29,38 ****
}
public void initFrom(
! H2dTelemacConditionLimite cl,
! H2dClType _uType,
! H2dClType _vType,
/*H2dClType _hType,*/
! H2dClType _tracerType,
! H2dBordType _bordType) {
friction_= cl.frottementParoi_;
u_= cl.getU();
--- 29,38 ----
}
public void initFrom(
! H2dTelemacBoundaryCondition cl,
! H2dBcType _uType,
! H2dBcType _vType,
/*H2dClType _hType,*/
! H2dBcType _tracerType,
! H2dBoundaryType _bordType) {
friction_= cl.frottementParoi_;
u_= cl.getU();
Index: H2dTelemacCLSourceInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLSourceInterface.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dTelemacCLSourceInterface.java 14 Nov 2003 08:22:20 -0000 1.3
--- H2dTelemacCLSourceInterface.java 21 Nov 2003 15:00:03 -0000 1.4
***************
*** 9,14 ****
package org.fudaa.dodico.h2d.telemac;
! import org.fudaa.dodico.h2d.type.H2dBordType;
! import org.fudaa.dodico.h2d.type.H2dClType;
/**
--- 9,14 ----
package org.fudaa.dodico.h2d.telemac;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
! import org.fudaa.dodico.h2d.type.H2dBcType;
/**
Index: H2dTelemacProjectDispatcherListener.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacProjectDispatcherListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dTelemacProjectDispatcherListener.java 14 Nov 2003 08:22:20 -0000 1.1
--- H2dTelemacProjectDispatcherListener.java 21 Nov 2003 15:00:03 -0000 1.2
***************
*** 15,18 ****
* @version $Id$
*/
! public interface H2dTelemacProjectDispatcherListener extends H2dProjectDispatcherListener,H2dTelemacClListener{
}
--- 15,18 ----
* @version $Id$
*/
! public interface H2dTelemacProjectDispatcherListener extends H2dProjectDispatcherListener,H2dTelemacBcListener{
}
--- H2dTelemacBord.java DELETED ---
--- H2dTelemacBordMutable.java DELETED ---
--- H2dTelemacCLManager.java DELETED ---
--- H2dTelemacClListener.java DELETED ---
--- H2dTelemacConditionLimite.java DELETED ---
--- H2dTelemacConditionLimiteMutable.java DELETED ---
--- H2dTelemacParametres.java DELETED ---
|
|
From: <de...@us...> - 2003-11-21 15:00:37
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/h2d/type
Modified Files:
H2dVariableType.java
Added Files:
H2dBcType.java H2dBoundaryType.java
H2dResolutionMethodType.java H2dResolutionSchemaType.java
Removed Files:
H2dBordType.java H2dClType.java H2dMethodeResolutionType.java
H2dSchemaResolutionType.java
Log Message:
Change the name of mutlipe classes
--- NEW FILE: H2dBcType.java ---
/*
* @file H2dClType.java
* @creation 26 juin 2003
* @modification $Date: 2003/11/21 15:00:03 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.type;
import org.fudaa.dodico.commun.DodicoResource;
import org.fudaa.dodico.h2d.H2dResource;
/**
* @author deniger
* @version $Id: H2dBcType.java,v 1.1 2003/11/21 15:00:03 deniger Exp $
*/
public class H2dBcType extends H2dEnumType {
public static H2dBcType MIXTE= new H2dBcType(0, H2dResource.getS("Mixte"));
public static H2dBcType LIBRE= new H2dBcType(1, H2dResource.getS("Libre"));
public static H2dBcType PERMANENT=
new H2dBcType(2, H2dResource.getS("Permanent"));
public static H2dBcType TRANSITOIRE=
new H2dBcType(3, H2dResource.getS("Transitoire"));
/**
*
*/
H2dBcType(int _id, String _nom) {
super(_id, _nom);
}
}
--- NEW FILE: H2dBoundaryType.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: H2dResolutionMethodType.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: H2dResolutionSchemaType.java ---
/*
* @file H2dSchemaResolutionType.java
* @creation 27 juin 2003
* @modification $Date: 2003/11/21 15:00:04 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.type;
import java.util.Iterator;
import java.util.List;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.h2d.H2dResource;
/**
* @author deniger
* @version $Id: H2dResolutionSchemaType.java,v 1.1 2003/11/21 15:00:04 deniger Exp $
*/
public class H2dResolutionSchemaType extends H2dEnumType {
public static H2dResolutionSchemaType STATIONNAIRE=
new H2dResolutionSchemaType(
1,
H2dResource.getS("Stationnaire"),
"STATIONNAIRE",
new H2dResolutionMethodType[] {
H2dResolutionMethodType.SELECT_LUMPING,
H2dResolutionMethodType.SELECT_LUMPING_BCD,
H2dResolutionMethodType.NEWTON_RAPHSON,
H2dResolutionMethodType.NEWTON_RAPHSON_BCD,
H2dResolutionMethodType.LINEAIRE });
public static H2dResolutionSchemaType KAWAHARA=
new H2dResolutionSchemaType(
2,
H2dResource.getS("Kawahara"),
"SELUMP",
new H2dResolutionMethodType[] {
H2dResolutionMethodType.SELECT_LUMPING,
H2dResolutionMethodType.SELECT_LUMPING_BCD });
public static H2dResolutionSchemaType EULER=
new H2dResolutionSchemaType(
3,
H2dResource.getS("Euler"),
"EULER",
new H2dResolutionMethodType[] {
H2dResolutionMethodType.NEWTON_RAPHSON,
H2dResolutionMethodType.NEWTON_RAPHSON_BCD,
H2dResolutionMethodType.LINEAIRE });
public static final List LIST=
new DodicoPermanentList(
DodicoLib.sort(
new H2dResolutionSchemaType[] { STATIONNAIRE, KAWAHARA, EULER }));
public static H2dResolutionSchemaType getTypeForRefluxId(String _id) {
H2dResolutionSchemaType t;
for (Iterator it= LIST.iterator(); it.hasNext();) {
t= (H2dResolutionSchemaType)it.next();
if (t.refluxId_.equals(_id))
return t;
}
return null;
}
String refluxId_;
DodicoPermanentList methodeList_;
/**
* @param _id
* @param _nom
*/
public H2dResolutionSchemaType(
int _id,
String _nom,
String refluxId,
H2dResolutionMethodType[] _methode) {
super(_id, _nom);
refluxId_= refluxId;
methodeList_= new DodicoPermanentList(_methode);
}
public boolean isSupported(H2dResolutionMethodType _methode) {
return methodeList_.contains(_methode);
}
public String getRefluxId() {
return refluxId_;
}
}
Index: H2dVariableType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** H2dVariableType.java 14 Nov 2003 08:22:20 -0000 1.4
--- H2dVariableType.java 21 Nov 2003 15:00:04 -0000 1.5
***************
*** 1 ****
! /*
* @file H2dVariable.java
* @creation 25 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.dodico.h2d.type;
import java.util.Iterator;
import java.util.List;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.h2d.H2dResource;
/**
* @author deniger
* @version $Id$
*/
public abstract class H2dVariableType extends H2dEnumType {
public static final H2dVariableType DEBIT=
new H2dVariableType(1, H2dResource.getS("Débit"), "Q") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getQ();
}
};
public static final H2dVariableType COTE_EAU=
new H2dVariableType(2, H2dResource.getS("Côte eau"), "SL") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getH();
}
};
public static final H2dVariableType TRACEUR=
new H2dVariableType(3, H2dResource.getS("Traceur"), "T") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracer();
}
};
public static final H2dVariableType TRACEUR_COEF_A=
new H2dVariableType(3, H2dResource.getS("Traceur coeff A"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracerCoeffA();
}
};
public static final H2dVariableType TRACEUR_COEF_B=
new H2dVariableType(3, H2dResource.getS("Traceur coeff B"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracerCoeffB();
}
};
public static final H2dVariableType VITESSE_U=
new H2dVariableType(4, H2dResource.getS("Vitesse u"), "U") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getU();
}
};
public static final H2dVariableType VITESSE_V=
new H2dVariableType(5, H2dResource.getS("Vitesse v"), "V") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getV();
}
};
public static final H2dVariableType RUGOSITE=
new H2dVariableType(6, H2dResource.getS("Rugosité"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getFriction();
}
};
public static final H2dVariableType VISCOSITE=
new H2dVariableType(7, H2dResource.getS("Viscosité"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getViscosity();
}
};
public static final H2dVariableType PERTE_CHARGE=
new H2dVariableType(8, H2dResource.getS("Perte de charge"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getPressureLoss();
}
};
public static final H2dVariableType ALPHA_LONGUEUR_MELANGE=
new H2dVariableType(
9,
H2dResource.getS("Alpha longueur mélange"),
null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getAlphaMixtureLength();
}
};
public static final H2dVariableType VITESSE=
new H2dVariableType(10, H2dResource.getS("Vitesse"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getVelocity();
}
};
private static DodicoPermanentList LIST_REFLUX;
public static List LIST_REFLUX() {
if (LIST_REFLUX == null)
LIST_REFLUX=
new DodicoPermanentList(
DodicoLib.sort(
new H2dVariableType[] {
ALPHA_LONGUEUR_MELANGE,
RUGOSITE,
VISCOSITE,
PERTE_CHARGE }));
return LIST_REFLUX;
}
public final static boolean isTracerVariable(H2dVariableType _t){
return (_t==H2dVariableType.TRACEUR) || (_t==H2dVariableType.TRACEUR_COEF_A)|| (_t==H2dVariableType.TRACEUR_COEF_B);
}
private String telemacID_;
/**
*
*/
H2dVariableType(int _id, String _nom, String _telemacID) {
super(_id, _nom);
telemacID_= _telemacID;
}
public String getTelemacID() {
return telemacID_;
}
public boolean equals(H2dVariableType _o) {
return equalsVariable(_o);
}
public boolean equalsVariable(H2dVariableType _o) {
return _o == null ? false : (_o.id_ == id_);
}
public abstract double getValue(H2dVariableTypeContainer _container);
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dVariable.java
* @creation 25 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.dodico.h2d.type;
import java.util.Iterator;
import java.util.List;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.h2d.H2dResource;
/**
* @author deniger
* @version $Id$
*/
public abstract class H2dVariableType extends H2dEnumType {
public static final H2dVariableType DEBIT=
new H2dVariableType(1, H2dResource.getS("Débit"), "Q") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getQ();
}
};
public static final H2dVariableType COTE_EAU=
new H2dVariableType(2, H2dResource.getS("Côte eau"), "SL") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getH();
}
};
public static final H2dVariableType TRACEUR=
new H2dVariableType(3, H2dResource.getS("Traceur"), "T") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracer();
}
};
public static final H2dVariableType TRACEUR_COEF_A=
new H2dVariableType(4, H2dResource.getS("Traceur coeff A"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracerCoeffA();
}
};
public static final H2dVariableType TRACEUR_COEF_B=
new H2dVariableType(5, H2dResource.getS("Traceur coeff B"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getTracerCoeffB();
}
};
public static final H2dVariableType VITESSE_U=
new H2dVariableType(6, H2dResource.getS("Vitesse u"), "U") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getU();
}
};
public static final H2dVariableType VITESSE_V=
new H2dVariableType(7, H2dResource.getS("Vitesse v"), "V") {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getV();
}
};
public static final H2dVariableType RUGOSITE=
new H2dVariableType(8, H2dResource.getS("Rugosité"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getFriction();
}
};
public static final H2dVariableType VISCOSITE=
new H2dVariableType(9, H2dResource.getS("Viscosité"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getViscosity();
}
};
public static final H2dVariableType PERTE_CHARGE=
new H2dVariableType(10, H2dResource.getS("Perte de charge"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getPressureLoss();
}
};
public static final H2dVariableType ALPHA_LONGUEUR_MELANGE=
new H2dVariableType(
11,
H2dResource.getS("Alpha longueur mélange"),
null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getAlphaMixtureLength();
}
};
public static final H2dVariableType VITESSE=
new H2dVariableType(12, H2dResource.getS("Vitesse"), null) {
public double getValue(H2dVariableTypeContainer _c) {
return _c.getVelocity();
}
};
private static DodicoPermanentList LIST_REFLUX;
public static List LIST_REFLUX() {
if (LIST_REFLUX == null)
LIST_REFLUX=
new DodicoPermanentList(
DodicoLib.sort(
new H2dVariableType[] {
ALPHA_LONGUEUR_MELANGE,
RUGOSITE,
VISCOSITE,
PERTE_CHARGE }));
return LIST_REFLUX;
}
public final static boolean isTracerVariable(H2dVariableType _t){
return (_t==H2dVariableType.TRACEUR) || (_t==H2dVariableType.TRACEUR_COEF_A)|| (_t==H2dVariableType.TRACEUR_COEF_B);
}
private String telemacID_;
/**
*
*/
H2dVariableType(int _id, String _nom, String _telemacID) {
super(_id, _nom);
telemacID_= _telemacID;
}
public String getTelemacID() {
return telemacID_;
}
public boolean equals(H2dVariableType _o) {
return equalsVariable(_o);
}
public boolean equalsVariable(H2dVariableType _o) {
return _o == null ? false : (_o.id_ == id_);
}
public abstract double getValue(H2dVariableTypeContainer _container);
}
\ No newline at end of file
--- H2dBordType.java DELETED ---
--- H2dClType.java DELETED ---
--- H2dMethodeResolutionType.java DELETED ---
--- H2dSchemaResolutionType.java DELETED ---
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/dunes/io
Modified Files:
DunesAdapter.java DunesFileFormat.java DunesInterface.java
DunesReader.java DunesWriter.java
Log Message:
Change the name of mutlipe classes
Index: DunesAdapter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesAdapter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DunesAdapter.java 23 Sep 2003 19:30:24 -0000 1.3
--- DunesAdapter.java 21 Nov 2003 15:00:00 -0000 1.4
***************
*** 11,15 ****
import org.fudaa.dodico.corba.geometrie.SMaillageIndex;
! import org.fudaa.dodico.h2d.H2dMaillage;
/**
--- 11,15 ----
import org.fudaa.dodico.corba.geometrie.SMaillageIndex;
! import org.fudaa.dodico.h2d.H2dGrid;
/**
***************
*** 21,25 ****
{
! H2dMaillage maillage_;
double[] adaptatif_;
--- 21,25 ----
{
! H2dGrid maillage_;
double[] adaptatif_;
***************
*** 27,31 ****
* @see org.fudaa.dodico.tr.reflux.DunesInterface#getMaillage()
*/
! public H2dMaillage getMaillage()
{
return maillage_;
--- 27,31 ----
* @see org.fudaa.dodico.tr.reflux.DunesInterface#getMaillage()
*/
! public H2dGrid getMaillage()
{
return maillage_;
***************
*** 53,57 ****
* @param maillage The maillage to set
*/
! public void setMaillage(H2dMaillage maillage)
{
maillage_ = maillage;
--- 53,57 ----
* @param maillage The maillage to set
*/
! public void setMaillage(H2dGrid maillage)
{
maillage_ = maillage;
Index: DunesFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesFileFormat.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DunesFileFormat.java 23 Sep 2003 19:30:24 -0000 1.7
--- DunesFileFormat.java 21 Nov 2003 15:00:00 -0000 1.8
***************
*** 19,23 ****
import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
--- 19,23 ----
import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion;
! import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
***************
*** 119,123 ****
public FileOperationSynthese writeMaillage(
File _f,
! H2dMaillage _m,
ProgressionInterface _prog) {
DunesAdapter inter=new DunesAdapter();
--- 119,123 ----
public FileOperationSynthese writeMaillage(
File _f,
! H2dGrid _m,
ProgressionInterface _prog) {
DunesAdapter inter=new DunesAdapter();
Index: DunesInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesInterface.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DunesInterface.java 23 Sep 2003 19:30:24 -0000 1.3
--- DunesInterface.java 21 Nov 2003 15:00:00 -0000 1.4
***************
*** 11,15 ****
import org.fudaa.dodico.corba.geometrie.SMaillageIndex;
! import org.fudaa.dodico.h2d.H2dMaillage;
/**
--- 11,15 ----
import org.fudaa.dodico.corba.geometrie.SMaillageIndex;
! import org.fudaa.dodico.h2d.H2dGrid;
/**
***************
*** 24,28 ****
* Renvoie le maillage.
*/
! H2dMaillage getMaillage();
/**
--- 24,28 ----
* Renvoie le maillage.
*/
! H2dGrid getMaillage();
/**
Index: DunesReader.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesReader.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DunesReader.java 23 Sep 2003 19:30:24 -0000 1.8
--- DunesReader.java 21 Nov 2003 15:00:00 -0000 1.9
***************
*** 19,23 ****
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dResource;
--- 19,23 ----
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
! import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dResource;
***************
*** 255,259 ****
}
//Le mot clef noeud est trouve, on peut creer le maillage.
! H2dMaillage maillage= new H2dMaillage(points, elems);
source_= new DunesAdapter();
source_.setMaillage(maillage);
--- 255,259 ----
}
//Le mot clef noeud est trouve, on peut creer le maillage.
! H2dGrid maillage= new H2dGrid(points, elems);
source_= new DunesAdapter();
source_.setMaillage(maillage);
Index: DunesWriter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesWriter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** DunesWriter.java 23 Sep 2003 19:30:24 -0000 1.8
--- DunesWriter.java 21 Nov 2003 15:00:00 -0000 1.9
***************
*** 20,24 ****
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dResource;
--- 20,24 ----
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
! import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dResource;
***************
*** 63,67 ****
return;
}
! H2dMaillage maillage= dunes_.getMaillage();
if (maillage == null) {
analyze_.addFatalError("Le maillage est nul");
--- 63,67 ----
return;
}
! H2dGrid maillage= dunes_.getMaillage();
if (maillage == null) {
analyze_.addFatalError("Le maillage est nul");
|
|
From: <de...@us...> - 2003-11-21 15:00:34
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/commun
Modified Files:
DodicoLib.java
Added Files:
DodicoPermanentTreeMap.java
Log Message:
Change the name of mutlipe classes
--- NEW FILE: DodicoPermanentTreeMap.java ---
/*
* @file DodicoPermanentTreeMap.java
* @creation 17 nov. 2003
* @modification $Date: 2003/11/21 15:00:00 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.commun;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
/**
* @author deniger
* @version $Id: DodicoPermanentTreeMap.java,v 1.1 2003/11/21 15:00:00 deniger Exp $
*/
public class DodicoPermanentTreeMap extends TreeMap {
/**
* @param m
*/
public DodicoPermanentTreeMap(Map m) {
Iterator it=m.entrySet().iterator();
while(it.hasNext()){
Map.Entry e=(Map.Entry)it.next();
super.put(e.getKey(),e.getValue());
}
}
/**
*
*/
public Object put(Object key, Object value) {
throw new UnsupportedOperationException();
}
/**
*
*/
public void putAll(Map map) {
throw new UnsupportedOperationException();
}
/**
*
*/
public Object remove(Object key) {
throw new UnsupportedOperationException();
}
/**
*
*/
public void clear() {
super.clear();
}
/**
*
*/
public SortedMap subMap(Object fromKey, Object toKey) {
return new DodicoPermanentTreeMap(super.subMap(fromKey, toKey));
}
/**
*
*/
public SortedMap tailMap(Object fromKey) {
return new DodicoPermanentTreeMap(super.tailMap(fromKey));
}
/**
*
*/
public SortedMap headMap(Object toKey) {
return new DodicoPermanentTreeMap(super.headMap(toKey));
}
}
Index: DodicoLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** DodicoLib.java 14 Nov 2003 08:22:19 -0000 1.16
--- DodicoLib.java 21 Nov 2003 15:00:00 -0000 1.17
***************
*** 63,66 ****
--- 63,69 ----
/** */
public final static String LINE_SEP= System.getProperty("line.separator");
+ public static void debug(String _s) {
+ System.out.println("DEBUG: " + _s);
+ }
public final static Object[] sort(Object[] _o) {
Arrays.sort(_o);
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/test/reflux
Modified Files:
TestCorEleBth.java TestDunes.java TestINP.java
TestRefluxParametres.java
Log Message:
Change the name of mutlipe classes
Index: TestCorEleBth.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestCorEleBth.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestCorEleBth.java 23 Sep 2003 20:22:12 -0000 1.9
--- TestCorEleBth.java 21 Nov 2003 15:00:07 -0000 1.10
***************
*** 17,21 ****
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.reflux.io.CorEleBthFileFormat;
--- 17,21 ----
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
! import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.reflux.io.CorEleBthFileFormat;
***************
*** 39,43 ****
assertNotNull(_inter);
CorEleBthInterface t= _inter;
! H2dMaillage maill= t.getMaillage();
assertNotNull(maill);
assertEquals(maill.getEltType(), H2dElementType.T6);
--- 39,43 ----
assertNotNull(_inter);
CorEleBthInterface t= _inter;
! H2dGrid maill= t.getMaillage();
assertNotNull(maill);
assertEquals(maill.getEltType(), H2dElementType.T6);
***************
*** 144,148 ****
DodicoAnalyze analyse= op.getAnalyze().toAnalyze();
printAnalyze("FICHIERS cor,ele,bth", analyse);
! H2dMaillage mail= t.getMaillage();
if (mail != null) {
DodicoLib.printFields(mail, false);
--- 144,148 ----
DodicoAnalyze analyse= op.getAnalyze().toAnalyze();
printAnalyze("FICHIERS cor,ele,bth", analyse);
! H2dGrid mail= t.getMaillage();
if (mail != null) {
DodicoLib.printFields(mail, false);
Index: TestDunes.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestDunes.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TestDunes.java 23 Sep 2003 20:22:12 -0000 1.10
--- TestDunes.java 21 Nov 2003 15:00:07 -0000 1.11
***************
*** 20,24 ****
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.test.TestIO;
--- 20,24 ----
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
! import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.test.TestIO;
***************
*** 51,55 ****
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! H2dMaillage m= t.getMaillage();
temp= m.getPtsNb();
assertEquals(temp, 9);
--- 51,55 ----
assertEquals(adapt[8], 1d, eps_);
assertNotNull(t.getMaillage());
! H2dGrid m= t.getMaillage();
temp= m.getPtsNb();
assertEquals(temp, 9);
Index: TestINP.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestINP.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TestINP.java 14 Nov 2003 08:22:21 -0000 1.11
--- TestINP.java 21 Nov 2003 15:00:07 -0000 1.12
***************
*** 1 ****
! /*
* @file TestINP.java
* @creation 25 mars 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.dodico.test.reflux;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionTestAdapter;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dGroupePasTemps;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dProprieteElementaire;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dMethodeResolutionType;
import org.fudaa.dodico.h2d.type.H2dProjetType;
import org.fudaa.dodico.h2d.type.H2dSchemaResolutionType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.dodico.h2d.reflux.H2dRefluxBordIndexGeneral;
import org.fudaa.dodico.h2d.reflux.H2dRefluxCLManager;
import org.fudaa.dodico.h2d.reflux.H2dRefluxConditionLimite;
import org.fudaa.dodico.h2d.reflux.H2dRefluxParametres;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
import org.fudaa.dodico.test.TestIO;
/**
*
* @author deniger
* @version $Id$
*/
public class TestINP extends TestIO {
public TestINP() {
super("canal_s.inp");
}
/**
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
public void _interfaceTest(INPInterface _t) {
INPFileFormat.INPVersion version=
INPFileFormat.getInstance().getLastINPVersionImpl();
INPInterface t= _t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
assertTrue(
t.getEntiteValue().containsKey(version.getDico().getEntite("ITERATION")));
H2dMaillage m= t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
H2dPoint pt= m.getPt(1790);
assertEquals(pt.getX(), 1000, eps_);
assertEquals(pt.getY(), 10, eps_);
assertEquals(pt.getZ(), 12, eps_);
pt= m.getPt(1770);
assertEquals(pt.getX(), 989.898987, eps_);
assertEquals(pt.getY(), 7.5, eps_);
assertEquals(pt.getZ(), 12.030303, eps_);
int[] itemp;
// int[] itemp=t.getPtsExtremitesElement();
// assertNotNull("Les points frontiere ne sont pas nuls",itemp);
// assertEquals(itemp[5], 18);
// assertEquals(itemp[499],1790);
//H2dRefluxConditionLimite[] tabCl= t.getConditionLimite();
H2dRefluxConditionLimite cl= t.getConditionLimite(818);
assertEquals(cl.getUType(), H2dClType.PERMANENT);
assertEquals(cl.getU(), 0, eps_);
cl= t.getConditionLimite( 1790);
assertEquals(cl.getVType(), H2dClType.PERMANENT);
assertEquals(cl.getV(), 0, eps_);
assertEquals(cl.getNormale(), 0, eps_);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
assertEquals(cl.getH(), 13.3, eps_);
cl= t.getConditionLimite(1781);
assertEquals(cl.getNormale(), 90.0000041, eps_);
cl= t.getConditionLimite( 0);
assertEquals(cl.getHType(), H2dClType.PERMANENT);
assertEquals(cl.getH(), 16.325, eps_);
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1430, 1421, _t.getBords());
assertEquals(H2dBordType.SOLIDE_FROTTEMENT, bord.getBord());
assertEquals(H2dClType.PERMANENT, bord.getRugositeType());
assertEquals(3d, bord.getRugosite(), eps_);
bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1412, 1403, _t.getBords());
assertEquals(H2dBordType.SOLIDE_FROTTEMENT, bord.getBord());
assertEquals(H2dClType.PERMANENT, bord.getRugositeType());
assertEquals(3d, bord.getRugosite(), eps_);
//H2dElement[] elems=t.getMaillage().getElts();
assertEquals(t.getMaillage().getEltNb(), 792);
itemp= t.getMaillage().getElement(791).getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
assertEquals(itemp[2], 1790);
assertEquals(itemp[3], 1780);
assertEquals(itemp[4], 1770);
assertEquals(itemp[5], 1779);
H2dProprieteElementaire[] propelem= t.getPropElementaires();
H2dProprieteElementaire prTemp= propelem[0];
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.01, eps_);
prTemp= propelem[1];
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.025, eps_);
assertEquals(prTemp.getPermanentValueForIndex(1), 0.025, eps_);
prTemp= propelem[2];
assertEquals(
prTemp.getVariableType(),
H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
prTemp= propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
assertEquals(0, prTemp.getValeurTransitoireNb());
assertEquals(792, prTemp.getPermanentSpecifieNb());
assertEquals(0, prTemp.getValeurLibreNb());
assertEquals(0.0, prTemp.getDefaultValue(), eps_);
assertEquals(0.0, prTemp.getPermanentValueForIndex(0), eps_);
for (int i= 790; i >= 0; i--) {
if (i != 758)
assertEquals(prTemp.getPermanentValueForIndex(i), 0.0, eps_);
else
assertEquals(prTemp.getPermanentValueForIndex(i), 0.01, eps_);
}
String[] fics= t.getFichiers();
assertEquals(fics.length, 3);
assertEquals(fics[0], "canal_s.siv");
assertEquals(fics[1], "canal_s.sov");
assertEquals(fics[2], "canal_s.sfv");
assertFalse(t.contientRadiations());
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
H2dGroupePasTemps[] gts= t.getGroupePasTemps();
assertNotNull(gts);
assertEquals(gts.length, 1);
H2dGroupePasTemps gt= gts[0];
assertNotNull(gt);
assertEquals(gt.getNbPasTemps(), 1);
assertEquals(gt.getSchema(), H2dSchemaResolutionType.STATIONNAIRE);
assertEquals(gt.getMethode(), H2dMethodeResolutionType.SELECT_LUMPING);
assertEquals(gt.getRelaxation(), 1, eps_);
assertEquals(gt.getPrecision(), 0.001, eps_);
assertEquals(gt.getPrecisionBancCouvrantDecouvrant(), 0.05, eps_);
assertEquals(gt.getNombreIterationMax(), 2);
Map dtemp= t.getEntiteValue();
assertNotNull(dtemp);
for (int i= 8; i >= 0; i--) {
DicoEntite ent= version.getCoefContribution(i);
assertNotNull(ent);
assertEquals(Double.parseDouble((String)dtemp.get(ent)), i, eps_);
}
}
private H2dRefluxConditionLimite getForIndex(
H2dRefluxConditionLimite[] _tab,
int _index) {
int l= _tab.length - 1;
for (int i= l; i >= 0; i--) {
if (_tab[i].getIndexPt() == _index)
return _tab[i];
}
return null;
}
/**
*
*/
public void testEcriture() {
// CorEleBthInterface inter=getInter(fic_);
// File tmpFile=createTempFile();
// FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
// assertNull(syntheseR.getAnalyze());
// _interfaceTest(getInter(tmpFile));
}
public INPInterface getInter(File _f) {
FileOperationSynthese syntheseR=
INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, null);
INPInterface r= (INPInterface)syntheseR.getSource();
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
assertNull(syntheseR.getAnalyze().toAnalyze());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
public void testAnalyze() {
INPInterface inter= getInter(fic_);
DodicoAnalyze.Editor anal= new DodicoAnalyze.Editor();
H2dRefluxParametres param=
H2dRefluxParametres.init(
inter,
new ProgressionTestAdapter(),
INPFileFormat.getInstance().getLastINPVersionImpl(),
anal);
assertTrue(anal.isEmpty());
assertNull(anal.toAnalyze());
H2dMaillageFrontiere maillageBord= param.getMaillage().getFrontiers();
int[] pointsFr= maillageBord.getArray();
int n= pointsFr.length - 1;
for (int i= n; i >= 0; i--) {
assertEquals(pointsFr[i], param.getRefluxCL(pointsFr[i]).getIndexPt());
}
assertEquals(1, maillageBord.getNbFrontier());
H2dRefluxCLManager mng= param.getRefluxClManager();
assertEquals(mng.getNbFrontiere(), 1);
H2dRefluxCLManager.RefluxBordParFrontiere frontiere0=
mng.getRefluxBorderByFrontier(0);
assertEquals(2, frontiere0.getNbBord());
assertEquals(H2dBordType.SOLIDE, frontiere0.getBord(0).getType());
assertEquals(
H2dBordType.SOLIDE_FROTTEMENT,
frontiere0.getBord(1).getType());
}
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("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
File f= new File(fileName);
if (!f.exists()) {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
INPFileFormat.INPVersion version=
INPFileFormat.getInstance().getLastINPVersionImpl();
FileOperationSynthese syntheseR=
version.read(f, new ProgressionTestAdapter());
INPInterface inpInter= (INPInterface)syntheseR.getSource();
DodicoAnalyze infos= syntheseR.getAnalyze().toAnalyze();
if (infos != null)
infos.printResume();
if ((infos != null) && (infos.containsFatalError()))
return;
fileName= (String)arg.get("-o");
if (fileName == null)
fileName= (String)arg.get("-out");
if (fileName == null)
return;
f= new File(fileName);
long t1= System.currentTimeMillis();
version.write(f, inpInter, new ProgressionTestAdapter());
long t2= System.currentTimeMillis();
System.out.println("temps ecriture " + (t2 - t1));
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestINP.java
* @creation 25 mars 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.dodico.test.reflux;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionTestAdapter;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dTimeStepGroup;
import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dFrontier;
import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.dodico.h2d.H2dNodalPropertyMixte;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.h2d.type.H2dResolutionMethodType;
import org.fudaa.dodico.h2d.type.H2dProjetType;
import org.fudaa.dodico.h2d.type.H2dResolutionSchemaType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
import org.fudaa.dodico.h2d.reflux.H2dRefluxBordIndexGeneral;
import org.fudaa.dodico.h2d.reflux.H2dRefluxBcManager;
import org.fudaa.dodico.h2d.reflux.H2dRefluxBoundaryCondition;
import org.fudaa.dodico.h2d.reflux.H2dRefluxBoundaryConditionMiddleFriction;
import org.fudaa.dodico.h2d.reflux.H2dRefluxParameters;
import org.fudaa.dodico.reflux.io.INPFileFormat;
import org.fudaa.dodico.reflux.io.INPInterface;
import org.fudaa.dodico.test.TestIO;
/**
*
* @author deniger
* @version $Id$
*/
public class TestINP extends TestIO {
public TestINP() {
super("canal_s.inp");
}
/**
* @see org.fudaa.dodico.test.TestIO#_interfaceTest(TrFileReadView)
*/
public void _interfaceTest(INPInterface _t) {
INPFileFormat.INPVersion version=
INPFileFormat.getInstance().getLastINPVersionImpl();
INPInterface t= _t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
assertTrue(
t.getEntiteValue().containsKey(version.getDico().getEntite("ITERATION")));
H2dGrid m= t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
H2dPoint pt= m.getPt(1790);
assertEquals(pt.getX(), 1000, eps_);
assertEquals(pt.getY(), 10, eps_);
assertEquals(pt.getZ(), 12, eps_);
pt= m.getPt(1770);
assertEquals(pt.getX(), 989.898987, eps_);
assertEquals(pt.getY(), 7.5, eps_);
assertEquals(pt.getZ(), 12.030303, eps_);
int[] itemp;
// int[] itemp=t.getPtsExtremitesElement();
// assertNotNull("Les points frontiere ne sont pas nuls",itemp);
// assertEquals(itemp[5], 18);
// assertEquals(itemp[499],1790);
//H2dRefluxConditionLimite[] tabCl= t.getConditionLimite();
H2dRefluxBoundaryCondition cl= t.getConditionLimite(818);
assertEquals(cl.getUType(), H2dBcType.PERMANENT);
assertEquals(cl.getU(), 0, eps_);
cl= t.getConditionLimite(1790);
assertEquals(cl.getVType(), H2dBcType.PERMANENT);
assertEquals(cl.getV(), 0, eps_);
assertEquals(cl.getNormale(), 0, eps_);
assertEquals(cl.getHType(), H2dBcType.PERMANENT);
assertEquals(cl.getH(), 13.3, eps_);
cl= t.getConditionLimite(1781);
assertEquals(cl.getNormale(), 90.0000041, eps_);
cl= t.getConditionLimite(0);
assertEquals(cl.getHType(), H2dBcType.PERMANENT);
assertEquals(cl.getH(), 16.325, eps_);
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1430, 1421, _t.getBords());
assertEquals(H2dBoundaryType.SOLIDE_FROTTEMENT, bord.getBord());
assertEquals(H2dBcType.PERMANENT, bord.getRugositeType());
assertEquals(3d, bord.getRugosite(), eps_);
bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(1412, 1403, _t.getBords());
assertEquals(H2dBoundaryType.SOLIDE_FROTTEMENT, bord.getBord());
assertEquals(H2dBcType.PERMANENT, bord.getRugositeType());
assertEquals(3d, bord.getRugosite(), eps_);
//H2dElement[] elems=t.getMaillage().getElts();
assertEquals(t.getMaillage().getEltNb(), 792);
itemp= t.getMaillage().getElement(791).getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
assertEquals(itemp[2], 1790);
assertEquals(itemp[3], 1780);
assertEquals(itemp[4], 1770);
assertEquals(itemp[5], 1779);
H2dNodalPropertyMixte[] propelem= t.getPropElementaires();
H2dNodalPropertyMixte prTemp= propelem[0];
assertEquals(prTemp.getVariableType(), H2dVariableType.VISCOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.01, eps_);
prTemp= propelem[1];
assertEquals(prTemp.getVariableType(), H2dVariableType.RUGOSITE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.025, eps_);
assertEquals(prTemp.getPermanentValueForIndex(1), 0.025, eps_);
prTemp= propelem[2];
assertEquals(
prTemp.getVariableType(),
H2dVariableType.ALPHA_LONGUEUR_MELANGE);
assertEquals(prTemp.getValeurTransitoireNb(), 0);
assertEquals(prTemp.getPermanentSpecifieNb(), 0);
assertEquals(prTemp.getValeurLibreNb(), 0);
assertEquals(prTemp.getDefaultValue(), 0.0, eps_);
prTemp= propelem[3];
assertEquals(prTemp.getVariableType(), H2dVariableType.PERTE_CHARGE);
assertEquals(0, prTemp.getValeurTransitoireNb());
assertEquals(792, prTemp.getPermanentSpecifieNb());
assertEquals(0, prTemp.getValeurLibreNb());
assertEquals(0.0, prTemp.getDefaultValue(), eps_);
assertEquals(0.0, prTemp.getPermanentValueForIndex(0), eps_);
for (int i= 790; i >= 0; i--) {
if (i != 758)
assertEquals(prTemp.getPermanentValueForIndex(i), 0.0, eps_);
else
assertEquals(prTemp.getPermanentValueForIndex(i), 0.01, eps_);
}
String[] fics= t.getFichiers();
assertEquals(fics.length, 3);
assertEquals(fics[0], "canal_s.siv");
assertEquals(fics[1], "canal_s.sov");
assertEquals(fics[2], "canal_s.sfv");
assertFalse(t.contientRadiations());
assertFalse(t.contientSollicitationsReparties());
assertFalse(t.contientVent());
H2dTimeStepGroup[] gts= t.getGroupePasTemps();
assertNotNull(gts);
assertEquals(gts.length, 1);
H2dTimeStepGroup gt= gts[0];
assertNotNull(gt);
assertEquals(gt.getNbPasTemps(), 1);
assertEquals(gt.getSchema(), H2dResolutionSchemaType.STATIONNAIRE);
assertEquals(gt.getMethode(), H2dResolutionMethodType.SELECT_LUMPING);
assertEquals(gt.getRelaxation(), 1, eps_);
assertEquals(gt.getPrecision(), 0.001, eps_);
assertEquals(gt.getPrecisionBancCouvrantDecouvrant(), 0.05, eps_);
assertEquals(gt.getNombreIterationMax(), 2);
Map dtemp= t.getEntiteValue();
assertNotNull(dtemp);
for (int i= 8; i >= 0; i--) {
DicoEntite ent= version.getCoefContribution(i);
assertNotNull(ent);
assertEquals(Double.parseDouble((String)dtemp.get(ent)), i, eps_);
}
}
private H2dRefluxBoundaryCondition getForIndex(
H2dRefluxBoundaryCondition[] _tab,
int _index) {
int l= _tab.length - 1;
for (int i= l; i >= 0; i--) {
if (_tab[i].getIndexPt() == _index)
return _tab[i];
}
return null;
}
/**
*
*/
public void testEcriture() {
// CorEleBthInterface inter=getInter(fic_);
// File tmpFile=createTempFile();
// FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
// assertNull(syntheseR.getAnalyze());
// _interfaceTest(getInter(tmpFile));
}
public INPInterface getInter(File _f) {
FileOperationSynthese syntheseR=
INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, null);
INPInterface r= (INPInterface)syntheseR.getSource();
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
assertNull(syntheseR.getAnalyze().toAnalyze());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
public void testAnalyze() {
INPInterface inter= getInter(fic_);
DodicoAnalyze.Editor anal= new DodicoAnalyze.Editor();
H2dRefluxParameters param=
H2dRefluxParameters.init(
inter,
new ProgressionTestAdapter(),
INPFileFormat.getInstance().getLastINPVersionImpl(),
anal);
assertTrue(anal.isEmpty());
assertNull(anal.toAnalyze());
H2dFrontier maillageBord= param.getMaillage().getFrontiers();
int[] pointsFr= maillageBord.getArray();
int n= pointsFr.length - 1;
for (int i= n; i >= 0; i--) {
assertEquals(pointsFr[i], param.getRefluxCL(pointsFr[i]).getIndexPt());
}
assertEquals(1, maillageBord.getNbFrontier());
H2dRefluxBcManager mng= param.getRefluxClManager();
assertEquals(mng.getGrid().getFrontiers().getNbFrontier(), 1);
H2dRefluxBcManager.RefluxBordParFrontiere frontiere0=
mng.getRefluxBorderByFrontier(0);
H2dRefluxBoundaryCondition cl;
for (int i= 0; i < n; i += 2) {
cl= (H2dRefluxBoundaryCondition)frontiere0.getCl(i);
assertFalse(cl.isMiddle());
assertFalse(cl.isMiddleWithFriction());
}
for (int i= 1; i < n; i += 2) {
cl= (H2dRefluxBoundaryCondition)frontiere0.getCl(i);
assertTrue(cl.isMiddle());
if ((i == 1421) || (i == 1403)) {
assertTrue(cl.isMiddleWithFriction());
H2dRefluxBoundaryConditionMiddleFriction clFr=cl.getMiddleFriction();
assertNotNull(clFr);
assertEquals(3, clFr.getFriction(),eps_);
assertEquals(H2dBcType.PERMANENT, clFr.getFrictionType());
} else
assertFalse(cl.isMiddleWithFriction());
}
}
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("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
File f= new File(fileName);
if (!f.exists()) {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
INPFileFormat.INPVersion version=
INPFileFormat.getInstance().getLastINPVersionImpl();
FileOperationSynthese syntheseR=
version.read(f, new ProgressionTestAdapter());
INPInterface inpInter= (INPInterface)syntheseR.getSource();
DodicoAnalyze infos= syntheseR.getAnalyze().toAnalyze();
if (infos != null)
infos.printResume();
if ((infos != null) && (infos.containsFatalError()))
return;
fileName= (String)arg.get("-o");
if (fileName == null)
fileName= (String)arg.get("-out");
if (fileName == null)
return;
f= new File(fileName);
long t1= System.currentTimeMillis();
version.write(f, inpInter, new ProgressionTestAdapter());
long t2= System.currentTimeMillis();
System.out.println("temps ecriture " + (t2 - t1));
}
}
\ No newline at end of file
Index: TestRefluxParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestRefluxParametres.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestRefluxParametres.java 23 Sep 2003 20:22:12 -0000 1.2
--- TestRefluxParametres.java 21 Nov 2003 15:00:07 -0000 1.3
***************
*** 9,14 ****
package org.fudaa.dodico.test.reflux;
! import org.fudaa.dodico.h2d.reflux.H2dRefluxConditionLimiteMutable;
! import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.reflux.io.INPAdapter;
import org.fudaa.dodico.test.h2d.TestMaillage;
--- 9,14 ----
package org.fudaa.dodico.test.reflux;
! import org.fudaa.dodico.h2d.reflux.H2dRefluxBoundaryConditionMutable;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.reflux.io.INPAdapter;
import org.fudaa.dodico.test.h2d.TestMaillage;
***************
*** 28,34 ****
INPAdapter inter=new INPAdapter();
inter.setMaillage(TestMaillage.createMaillage());
! H2dRefluxConditionLimiteMutable[] cl=new H2dRefluxConditionLimiteMutable[6];
int i=0;
! cl[i++]=new H2dRefluxConditionLimiteMutable();
//cl[i].setBordType(H2dBordType.LIQUIDE);
cl[i].setIndexPt(0);
--- 28,34 ----
INPAdapter inter=new INPAdapter();
inter.setMaillage(TestMaillage.createMaillage());
! H2dRefluxBoundaryConditionMutable[] cl=new H2dRefluxBoundaryConditionMutable[6];
int i=0;
! cl[i++]=new H2dRefluxBoundaryConditionMutable();
//cl[i].setBordType(H2dBordType.LIQUIDE);
cl[i].setIndexPt(0);
|
|
From: <de...@us...> - 2003-11-21 15:00:34
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv8748/test/telemac
Modified Files:
TestCL.java TestClMng.java TestSerafin.java
Log Message:
Change the name of mutlipe classes
Index: TestCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestCL.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TestCL.java 14 Nov 2003 08:22:21 -0000 1.11
--- TestCL.java 21 Nov 2003 15:00:07 -0000 1.12
***************
*** 1 ****
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(H2dTelemacCLSourceInterface _inter) {
assertNotNull(_inter);
int idx= 0;
H2dTelemacCLElementSource s= new H2dTelemacCLElementSource();
_inter.getLine(idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_ONDE_INCIDENCE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dClType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dClType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBordType.LIQUIDE);
assertEquals(s.uType_, H2dClType.LIBRE);
assertEquals(s.vType_, H2dClType.LIBRE);
assertEquals(s.tracerType_, H2dClType.PERMANENT);
int l= _inter.getNbLines();
assertEquals(18, l);
for (int i= 0; i < l; i++) {
_inter.getLine(i, s);
//les valeurs
assertEquals(s.h_, 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(s.u_, 0, eps_);
} else {
assertEquals(s.u_, 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(s.v_, 0, eps_);
} else {
assertEquals(s.v_, 300 + i, eps_);
}
assertEquals(s.friction_, 400 + i, eps_);
assertEquals(s.tracer_, 500 + i, eps_);
assertEquals(s.tracerCoefA_, 600 + i, eps_);
assertEquals(s.tracerCoefB_, 700 + i, eps_);
//les indices commencent a 0.
assertEquals(s.ptGlobalIdx_, 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
H2dTelemacCLSourceInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public H2dTelemacCLSourceInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
H2dTelemacCLSourceInterface r=
(H2dTelemacCLSourceInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundaryCondition;
import org.fudaa.dodico.h2d.type.H2dBoundaryType;
import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(H2dTelemacCLSourceInterface _inter) {
assertNotNull(_inter);
int idx= 0;
H2dTelemacCLElementSource s= new H2dTelemacCLElementSource();
_inter.getLine(idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_ONDE_INCIDENCE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_VITESSES_IMPOSEES);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.SOLIDE);
//assertEquals(s.hType_, H2dClType.LIBRE);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.PERMANENT);
assertEquals(s.v_, 0, eps_);
assertEquals(s.tracerType_, H2dBcType.LIBRE);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE);
//assertEquals(s.hType_, H2dClType.PERMANENT);
assertEquals(s.uType_, H2dBcType.PERMANENT);
assertEquals(s.u_, 0, eps_);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
_inter.getLine(++idx, s);
assertEquals(s.bordType_, H2dBoundaryType.LIQUIDE);
assertEquals(s.uType_, H2dBcType.LIBRE);
assertEquals(s.vType_, H2dBcType.LIBRE);
assertEquals(s.tracerType_, H2dBcType.PERMANENT);
int l= _inter.getNbLines();
assertEquals(18, l);
for (int i= 0; i < l; i++) {
_inter.getLine(i, s);
//les valeurs
assertEquals(s.h_, 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(s.u_, 0, eps_);
} else {
assertEquals(s.u_, 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(s.v_, 0, eps_);
} else {
assertEquals(s.v_, 300 + i, eps_);
}
assertEquals(s.friction_, 400 + i, eps_);
assertEquals(s.tracer_, 500 + i, eps_);
assertEquals(s.tracerCoefA_, 600 + i, eps_);
assertEquals(s.tracerCoefB_, 700 + i, eps_);
//les indices commencent a 0.
assertEquals(s.ptGlobalIdx_, 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
H2dTelemacCLSourceInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
if (syntheseR.containsMessages())
syntheseR.getAnalyze().toAnalyze().printResume();
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public H2dTelemacCLSourceInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
H2dTelemacCLSourceInterface r=
(H2dTelemacCLSourceInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
Index: TestClMng.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestClMng.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestClMng.java 14 Nov 2003 08:22:21 -0000 1.4
--- TestClMng.java 21 Nov 2003 15:00:07 -0000 1.5
***************
*** 11,24 ****
import junit.framework.TestCase;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dBord;
! import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
! import org.fudaa.dodico.h2d.H2dMaillage;
! import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
! import org.fudaa.dodico.h2d.type.H2dBordType;
! import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
--- 11,24 ----
import junit.framework.TestCase;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dBoundary;
! import org.fudaa.dodico.h2d.H2dBcFrontierBlockInterface;
! import org.fudaa.dodico.h2d.H2dGrid;
! import org.fudaa.dodico.h2d.H2dFrontier;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundary;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource;
! import org.fudaa.dodico.h2d.telemac.H2dTelemacBcManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
! import org.fudaa.dodico.h2d.type.H2dBoundaryType;
! import org.fudaa.dodico.h2d.type.H2dBcType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
***************
*** 30,34 ****
*/
public class TestClMng extends TestCase {
! H2dMaillage m_;
H2dTelemacCLSourceInterface cl_;
public TestClMng() {
--- 30,34 ----
*/
public class TestClMng extends TestCase {
! H2dGrid m_;
H2dTelemacCLSourceInterface cl_;
public TestClMng() {
***************
*** 41,45 ****
SerafinInterface inter= (SerafinInterface)op.getSource();
m_= inter.getMaillage();
! H2dMaillage.computeBord(m_, inter.getPtsFrontiere(), null);
op=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(
--- 41,45 ----
SerafinInterface inter= (SerafinInterface)op.getSource();
m_= inter.getMaillage();
! H2dGrid.computeBord(m_, inter.getPtsFrontiere(), null);
op=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(
***************
*** 52,56 ****
assertNotNull(m_);
assertNotNull(m_.getFrontiers());
! H2dMaillageFrontiere frontiere= m_.getFrontiers();
assertEquals(2, frontiere.getNbFrontier());
//test extern frontier
--- 52,56 ----
assertNotNull(m_);
assertNotNull(m_.getFrontiers());
! H2dFrontier frontiere= m_.getFrontiers();
assertEquals(2, frontiere.getNbFrontier());
//test extern frontier
***************
*** 73,151 ****
for (int i= 270; i < 282; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
}
_cl.getLine(0, s);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
// bord 1
for (int i= 1; i < 138; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBordType.SOLIDE, s.bordType_);
}
// bord 2
for (int i= 138; i < 149; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, s.bordType_);
}
// bord 3
for (int i= 149; i < 270; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBordType.SOLIDE, s.bordType_);
}
/**intern frontier**/
for (int i= 282; i < 298; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBordType.SOLIDE, s.bordType_);
}
}
public void testClMng() {
! H2dTelemacCLManager clMng= H2dTelemacCLManager.init(m_, cl_, null, null);
assertNotNull(clMng);
! assertEquals(2, clMng.getNbFrontiere());
/**extern frontier**/
! H2dBorderPerFrontierInterface bord= clMng.getBordPerFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dTelemacBord b= (H2dTelemacBord)bord.getBord(0);
! assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
! assertEquals(H2dClType.LIBRE, b.getTracerType());
// bord 1
! b= (H2dTelemacBord)bord.getBord(1);
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
// bord 2
! b= (H2dTelemacBord)bord.getBord(2);
! assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
// bord 3
! b= (H2dTelemacBord)bord.getBord(3);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, b.getType());
assertEquals(270, b.getIdxDeb());
assertEquals(0, b.getIdxFin());
! assertEquals(H2dClType.PERMANENT, b.getTracerType());
//intern frontier
! bord= clMng.getBordPerFrontier(1);
assertEquals(1, bord.getNbBord());
! assertEquals(H2dBordType.SOLIDE, bord.getBord(0).getType());
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
assertEquals(
! H2dClType.LIBRE,
! ((H2dTelemacBord)bord.getBord(0)).getTracerType());
for (int i= 270; i < 282; i++) {
assertEquals(
! H2dBordType.LIQUIDE_DEBIT_IMPOSE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
H2dTelemacCLElementSource s=new H2dTelemacCLElementSource();
cl_.getLine(0, s);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
// bord 1
for (int i= 1; i < 138; i++) {
assertEquals(
! H2dBordType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
--- 73,151 ----
for (int i= 270; i < 282; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
}
_cl.getLine(0, s);
! assertEquals(H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
// bord 1
for (int i= 1; i < 138; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBoundaryType.SOLIDE, s.bordType_);
}
// bord 2
for (int i= 138; i < 149; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE, s.bordType_);
}
// bord 3
for (int i= 149; i < 270; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBoundaryType.SOLIDE, s.bordType_);
}
/**intern frontier**/
for (int i= 282; i < 298; i++) {
_cl.getLine(i, s);
! assertEquals(H2dBoundaryType.SOLIDE, s.bordType_);
}
}
public void testClMng() {
! H2dTelemacBcManager clMng= H2dTelemacBcManager.init(m_, cl_, null, null);
assertNotNull(clMng);
! assertEquals(2, clMng.getNbBcFrontier());
/**extern frontier**/
! H2dBcFrontierBlockInterface bord= clMng.getBlockFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dTelemacBoundary b= (H2dTelemacBoundary)bord.getBord(0);
! assertEquals(H2dBoundaryType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
! assertEquals(H2dBcType.LIBRE, b.getTracerType());
// bord 1
! b= (H2dTelemacBoundary)bord.getBord(1);
! assertEquals(H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
// bord 2
! b= (H2dTelemacBoundary)bord.getBord(2);
! assertEquals(H2dBoundaryType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
// bord 3
! b= (H2dTelemacBoundary)bord.getBord(3);
! assertEquals(H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE, b.getType());
assertEquals(270, b.getIdxDeb());
assertEquals(0, b.getIdxFin());
! assertEquals(H2dBcType.PERMANENT, b.getTracerType());
//intern frontier
! bord= clMng.getBlockFrontier(1);
assertEquals(1, bord.getNbBord());
! assertEquals(H2dBoundaryType.SOLIDE, bord.getBord(0).getType());
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
assertEquals(
! H2dBcType.LIBRE,
! ((H2dTelemacBoundary)bord.getBord(0)).getTracerType());
for (int i= 270; i < 282; i++) {
assertEquals(
! H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
H2dTelemacCLElementSource s=new H2dTelemacCLElementSource();
cl_.getLine(0, s);
! assertEquals(H2dBoundaryType.LIQUIDE_DEBIT_IMPOSE, s.bordType_);
// bord 1
for (int i= 1; i < 138; i++) {
assertEquals(
! H2dBoundaryType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
***************
*** 153,157 ****
for (int i= 138; i < 149; i++) {
assertEquals(
! H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
--- 153,157 ----
for (int i= 138; i < 149; i++) {
assertEquals(
! H2dBoundaryType.LIQUIDE_HAUTEUR_IMPOSEE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
***************
*** 159,163 ****
for (int i= 149; i < 270; i++) {
assertEquals(
! H2dBordType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
--- 159,163 ----
for (int i= 149; i < 270; i++) {
assertEquals(
! H2dBoundaryType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
***************
*** 165,169 ****
for (int i= 282; i < 298; i++) {
assertEquals(
! H2dBordType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
--- 165,169 ----
for (int i= 282; i < 298; i++) {
assertEquals(
! H2dBoundaryType.SOLIDE,
clMng.getBordFromIdxOnFrontier(i).getType());
}
Index: TestSerafin.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestSerafin.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TestSerafin.java 14 Nov 2003 08:22:21 -0000 1.14
--- TestSerafin.java 21 Nov 2003 15:00:07 -0000 1.15
***************
*** 1 ****
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.apache.tools.ant.taskdefs.TempFile;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.fichiers.FileFormat;
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.mnt.MNTSemis;
import org.fudaa.dodico.mnt.MNTZone;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.SerafinMNTAdapter;
import org.fudaa.dodico.telemac.io.SerafinWriter;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestSerafin extends TestIO {
SerafinInterface inter_;
/** */
public TestSerafin() {
super("exemple.res");
inter_= getInter(fic_);
}
public void _interfaceTest(SerafinInterface _t) {
assertNotNull(_t);
//TITRE
assertEquals(
_t.getTitre(),
"MODELE MARITIME - CALCUL1 SERAPHIN");
//NBV1
assertEquals(_t.getNbv1(), 6);
//TEXT
String temp= _t.getVariable(0);
assertEquals(temp, "VITESSE U");
temp= _t.getVariable(5);
assertEquals(temp, "VITESSE SCALAIRE");
//LUNIT
temp= _t.getUnite(1);
assertEquals(temp, "M/S");
temp= _t.getUnite(4);
assertEquals(temp, "M");
//IPARAM
assertEquals(_t.getIparam()[0], 1);
//IDATE
assertEquals(_t.getIdate(), 0);
//NELEM
H2dMaillage maillage= _t.getMaillage();
assertEquals(maillage.getEltNb(), 3087);
//NPOIN1
assertEquals(maillage.getPtsNb(), 1676);
//NPPEL1
assertEquals(maillage.getEltType(), H2dElementType.T3);
//IKLE1
assertEquals(maillage.getElement(0).getPtIndex()[1], 1545);
assertEquals(
maillage.getElement(maillage.getEltNb() - 1).getPtIndex()[0],
219);
//IPOBO1
assertEquals(_t.getPtsFrontiere()[0], 4);
assertEquals(_t.getPtsFrontiere()[1], 226);
//X1
assertEquals(
maillage.getPt(9).getX(),
(double)Float.intBitsToFloat(1160462115),
eps_);
//Y1
assertEquals(
maillage.getPt(11).getY(),
(double)Float.intBitsToFloat(1140111573),
eps_);
//Nombre de pas temps
int tempInt= _t.getNbPasDeTemps();
assertEquals(tempInt, 2);
double tempDouble= _t.getPasDeTemps(1);
assertEquals(tempDouble, (double)Float.intBitsToFloat(1153138688), eps_);
//pas de temps 1, variable 3
//premiere variable
assertEquals(
_t.getDonnees(0, 2, 0),
(double)Float.intBitsToFloat(1076258406),
eps_);
//pas de temps 2, variable 4
//derniere variable
assertEquals(
_t.getDonnees(1, 3, maillage.getPtsNb() - 1),
(double)Float.intBitsToFloat(1093124747),
eps_);
}
public void testMntAdapter() {
SerafinInterface t= inter_;
assertNotNull(t);
int id= SerafinMNTAdapter.getIndex(t, "HAUTEUR D'EAU");
assertEquals(id, 2);
SerafinMNTAdapter a= new SerafinMNTAdapter(t, id, 0);
try {
String[] r= a.read();
if (r != null)
DodicoLib.printStringArray(r);
assertNull(r);
MNTZone[] zones= a.getMNTZones();
assertNotNull(zones);
assertNotNull(zones[0]);
MNTSemis semis= zones[0].getSemis();
assertNotNull(semis);
//X1
assertEquals(
semis.getX(9),
(double)Float.intBitsToFloat(1160462115),
eps_);
//Y1
assertEquals(
semis.getY(11),
(double)Float.intBitsToFloat(1140111573),
eps_);
assertEquals(
semis.getZ(0),
(double)Float.intBitsToFloat(1076258406),
eps_);
} catch (Exception _e) {
_e.printStackTrace();
}
}
/**
*
*/
public void testEcriture() {
SerafinInterface inter= inter_;
File tmpFile= createTempFile();
SerafinWriter w=
SerafinFileFormat
.getInstance()
.getLastVersionImpl()
.createSerafinWriter();
w.setMachineSPARC();
w.setFile(tmpFile);
FileOperationSynthese syntheseR= w.write(inter);
assertFalse(syntheseR.getAnalyze().containsErrors());
_interfaceTest(getInter(tmpFile));
}
public SerafinInterface getInter(File _f) {
FileOperationSynthese syntheseR=
SerafinFileFormat.getInstance().getLastVersionImpl().read(_f, null);
SerafinInterface r= (SerafinInterface)syntheseR.getSource();
assertFalse(syntheseR.getAnalyze().containsErrors());
return r;
}
public void testRechercheFrontiereWithIpobo() {
SerafinInterface inter= inter_;
H2dMaillage.computeBordFast(inter.getMaillage(), inter.getPtsFrontiere(), null);
H2dMaillageFrontiere b= inter.getMaillage().getFrontiers();
assertEquals(b.getNbFrontierIntern(), 1);
}
public void testRechercheFrontiereinterne() {
SerafinInterface inter= inter_;
inter.getMaillage().computeBord(null);
assertTrue(
inter.getMaillage().getFrontiers().isSame(inter.getPtsFrontiere()));
}
/**
*
*/
public void testLecture() {
_interfaceTest(inter_);
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.apache.tools.ant.taskdefs.TempFile;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.fichiers.FileFormat;
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.H2dGrid;
import org.fudaa.dodico.h2d.H2dFrontier;
import org.fudaa.dodico.h2d.type.H2dElementType;
import org.fudaa.dodico.mnt.MNTSemis;
import org.fudaa.dodico.mnt.MNTZone;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.SerafinMNTAdapter;
import org.fudaa.dodico.telemac.io.SerafinWriter;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestSerafin extends TestIO {
SerafinInterface inter_;
/** */
public TestSerafin() {
super("exemple.res");
inter_= getInter(fic_);
}
public void _interfaceTest(SerafinInterface _t) {
assertNotNull(_t);
//TITRE
assertEquals(
_t.getTitre(),
"MODELE MARITIME - CALCUL1 SERAPHIN");
//NBV1
assertEquals(_t.getNbv1(), 6);
//TEXT
String temp= _t.getVariable(0);
assertEquals(temp, "VITESSE U");
temp= _t.getVariable(5);
assertEquals(temp, "VITESSE SCALAIRE");
//LUNIT
temp= _t.getUnite(1);
assertEquals(temp, "M/S");
temp= _t.getUnite(4);
assertEquals(temp, "M");
//IPARAM
assertEquals(_t.getIparam()[0], 1);
//IDATE
assertEquals(_t.getIdate(), 0);
//NELEM
H2dGrid maillage= _t.getMaillage();
assertEquals(maillage.getEltNb(), 3087);
//NPOIN1
assertEquals(maillage.getPtsNb(), 1676);
//NPPEL1
assertEquals(maillage.getEltType(), H2dElementType.T3);
//IKLE1
assertEquals(maillage.getElement(0).getPtIndex()[1], 1545);
assertEquals(
maillage.getElement(maillage.getEltNb() - 1).getPtIndex()[0],
219);
//IPOBO1
assertEquals(_t.getPtsFrontiere()[0], 4);
assertEquals(_t.getPtsFrontiere()[1], 226);
//X1
assertEquals(
maillage.getPt(9).getX(),
(double)Float.intBitsToFloat(1160462115),
eps_);
//Y1
assertEquals(
maillage.getPt(11).getY(),
(double)Float.intBitsToFloat(1140111573),
eps_);
//Nombre de pas temps
int tempInt= _t.getNbPasDeTemps();
assertEquals(tempInt, 2);
double tempDouble= _t.getPasDeTemps(1);
assertEquals(tempDouble, (double)Float.intBitsToFloat(1153138688), eps_);
//pas de temps 1, variable 3
//premiere variable
assertEquals(
_t.getDonnees(0, 2, 0),
(double)Float.intBitsToFloat(1076258406),
eps_);
//pas de temps 2, variable 4
//derniere variable
assertEquals(
_t.getDonnees(1, 3, maillage.getPtsNb() - 1),
(double)Float.intBitsToFloat(1093124747),
eps_);
}
public void testMntAdapter() {
SerafinInterface t= inter_;
assertNotNull(t);
int id= SerafinMNTAdapter.getIndex(t, "HAUTEUR D'EAU");
assertEquals(id, 2);
SerafinMNTAdapter a= new SerafinMNTAdapter(t, id, 0);
try {
String[] r= a.read();
if (r != null)
DodicoLib.printStringArray(r);
assertNull(r);
MNTZone[] zones= a.getMNTZones();
assertNotNull(zones);
assertNotNull(zones[0]);
MNTSemis semis= zones[0].getSemis();
assertNotNull(semis);
//X1
assertEquals(
semis.getX(9),
(double)Float.intBitsToFloat(1160462115),
eps_);
//Y1
assertEquals(
semis.getY(11),
(double)Float.intBitsToFloat(1140111573),
eps_);
assertEquals(
semis.getZ(0),
(double)Float.intBitsToFloat(1076258406),
eps_);
} catch (Exception _e) {
_e.printStackTrace();
}
}
/**
*
*/
public void testEcriture() {
SerafinInterface inter= inter_;
File tmpFile= createTempFile();
SerafinWriter w=
SerafinFileFormat
.getInstance()
.getLastVersionImpl()
.createSerafinWriter();
w.setMachineSPARC();
w.setFile(tmpFile);
FileOperationSynthese syntheseR= w.write(inter);
assertFalse(syntheseR.getAnalyze().containsErrors());
_interfaceTest(getInter(tmpFile));
}
public SerafinInterface getInter(File _f) {
FileOperationSynthese syntheseR=
SerafinFileFormat.getInstance().getLastVersionImpl().read(_f, null);
SerafinInterface r= (SerafinInterface)syntheseR.getSource();
assertFalse(syntheseR.getAnalyze().containsErrors());
return r;
}
public void testRechercheFrontiereWithIpobo() {
SerafinInterface inter= inter_;
H2dGrid.computeBordFast(inter.getMaillage(), inter.getPtsFrontiere(), null);
H2dFrontier b= inter.getMaillage().getFrontiers();
assertEquals(b.getNbFrontierIntern(), 1);
}
public void testRechercheFrontiereinterne() {
SerafinInterface inter= inter_;
inter.getMaillage().computeBord(null);
assertTrue(
inter.getMaillage().getFrontiers().isSame(inter.getPtsFrontiere()));
}
/**
*
*/
public void testLecture() {
_interfaceTest(inter_);
}
}
\ No newline at end of file
|
|
From: <de...@us...> - 2003-11-21 14:58:04
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/trace
In directory sc8-pr-cvs1:/tmp/cvs-serv8513/trace
Modified Files:
TraceIcone.java
Log Message:
General update
Index: TraceIcone.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/trace/TraceIcone.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TraceIcone.java 23 Sep 2003 20:48:24 -0000 1.3
--- TraceIcone.java 21 Nov 2003 14:58:00 -0000 1.4
***************
*** 1,159 ****
! /*
! * @file TraceIcone.java
! * @creation 2002-10-08
! * @modification $Date$
! * @license GNU General Public License 2
! * @cop_yright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
!
! package org.fudaa.ebli.trace;
!
! import java.awt.*;
! import java.awt.geom.Line2D;
! import java.awt.geom.Ellipse2D;
! import java.awt.geom.Rectangle2D;
! import javax.swing.*;
!
! /**
! * Une classe de trace de points.
! *
! * @version $Revision$ $Date$ b_y $Author$
! * @author A_xel von Arnim
! */
! public class TraceIcone
! implements Icon
! {
! public final static int RIEN =0;
! public final static int POINT =1;
! public final static int PLUS =2;
! public final static int CROIX =3;
! public final static int CARRE =4;
! public final static int CARRE_PLEIN =5;
! public final static int LOSANGE =6;
! public final static int CERCLE =7;
! public final static int DISQUE =8;
!
! private int type_;
! private int taille_;
! private Color couleur_;
!
! public TraceIcone()
! {
! this(TracePoint.POINT,1);
! }
!
! public TraceIcone(int _type,int _taille)
! {
! type_=_type;
! taille_=_taille;
! }
! public void type(int _type)
! {
! type_=_type;
! }
!
! public int type()
! {
! return type_;
! }
!
!
! /**
! * Correspond a la taille/2 de l'icone
! */
! public void taille(int _taille)
! {
! taille_=_taille;
! }
!
! /**
! * Correspond a la taille/2 de l'icone
! */
! public int taille()
! {
! return taille_;
! }
!
! public void couleur(Color _couleur)
! {
! couleur_=_couleur;
! }
!
! public Color couleur()
! {
! return couleur_;
! }
!
! public int getIconWidth()
! {
! return 2*taille_;
! }
!
! public int getIconHeight()
! {
! return 2*taille_;
! }
!
! public void paintIcon(Component _c,Graphics _g,double _x, double _y)
! {
! paintIcon(_c,_g,_x, _y);
! }
!
!
!
! public void paintIcon(Component _c,Graphics _g,int _x, int _y)
! {
! Color old=null;
! if(couleur_!=null)
! {
! old=_g.getColor();
! _g.setColor(couleur_);
! }
! switch( type_ )
! {
! case RIEN:
! break;
! case POINT:
! _g.drawLine(_x, _y, _x, _y);
! break;
! case PLUS:
! _g.drawLine(_x-taille_, _y, _x+taille_, _y);
! _g.drawLine(_x, _y-taille_, _x, _y+taille_);
! break;
! case CROIX:
! _g.drawLine(_x-taille_, _y-taille_, _x+taille_, _y+taille_);
! _g.drawLine(_x+taille_, _y-taille_, _x-taille_, _y+taille_);
! break;
! case CARRE:
! _g.drawRect(_x-taille_, _y-taille_, 2*taille_-1, 2*taille_-1);
! break;
! case CARRE_PLEIN:
! _g.fillRect(_x-taille_, _y-taille_, 2*taille_-1, 2*taille_-1);
! break;
! case LOSANGE:
! _g.drawLine(_x-taille_, _y, _x, _y-taille_);
! _g.drawLine(_x, _y-taille_, _x+taille_, _y);
! _g.drawLine(_x+taille_, _y, _x, _y+taille_);
! _g.drawLine(_x, _y+taille_, _x-taille_, _y);
! break;
! case CERCLE:
! _g.drawArc(_x-taille_, _y-taille_, 2*taille_+1, 2*taille_+1, 0, 360);
! break;
! case DISQUE:
! _g.fillArc(_x-taille_, _y-taille_, 2*taille_+1, 2*taille_+1, 0, 360);
! break;
! default:
! break;
! }
! if(couleur_!=null)
! {
! _g.setColor(old);
! }
! }
!
!
!
!
! }
!
--- 1 ----
! /*
* @file TraceIcone.java
* @creation 2002-10-08
* @modification $Date$
* @license GNU General Public License 2
* @cop_yright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.ebli.trace;
import java.awt.*;
import java.awt.geom.Line2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import javax.swing.*;
/**
* Une classe de trace de points.
*
* @version $Revision$ $Date$ b_y $Author$
* @author A_xel von Arnim
*/
public class TraceIcone implements Icon {
public final static int RIEN= 0;
public final static int POINT= 1;
public final static int PLUS= 2;
public final static int CROIX= 3;
public final static int CARRE= 4;
public final static int CARRE_PLEIN= 5;
public final static int LOSANGE= 6;
public final static int CERCLE= 7;
public final static int DISQUE= 8;
private int type_;
private int taille_;
private Color couleur_;
public TraceIcone() {
this(TracePoint.POINT, 1);
}
public TraceIcone(int _type, int _taille) {
type_= _type;
taille_= _taille;
}
public void type(int _type) {
type_= _type;
}
public int type() {
return type_;
}
/**
* Correspond a la taille/2 de l'icone
*/
public void taille(int _taille) {
taille_= _taille;
}
/**
* Correspond a la taille/2 de l'icone
*/
public int taille() {
return taille_;
}
public void couleur(Color _couleur) {
couleur_= _couleur;
}
public Color couleur() {
return couleur_;
}
public int getIconWidth() {
return 2 * taille_;
}
public int getIconHeight() {
return 2 * taille_;
}
public void paintIcon(Component _c, Graphics _g, double _x, double _y) {
paintIcon(_c, _g, (int)_x,(int) _y);
}
public void paintIcon(Component _c, Graphics _g, int _x, int _y) {
Color old= null;
if (couleur_ != null) {
old= _g.getColor();
_g.setColor(couleur_);
}
switch (type_) {
case RIEN :
break;
case POINT :
_g.drawLine(_x, _y, _x, _y);
break;
case PLUS :
_g.drawLine(_x - taille_, _y, _x + taille_, _y);
_g.drawLine(_x, _y - taille_, _x, _y + taille_);
break;
case CROIX :
_g.drawLine(_x - taille_, _y - taille_, _x + taille_, _y + taille_);
_g.drawLine(_x + taille_, _y - taille_, _x - taille_, _y + taille_);
break;
case CARRE :
_g.drawRect(
_x - taille_,
_y - taille_,
2 * taille_ - 1,
2 * taille_ - 1);
break;
case CARRE_PLEIN :
_g.fillRect(
_x - taille_,
_y - taille_,
2 * taille_ - 1,
2 * taille_ - 1);
break;
case LOSANGE :
_g.drawLine(_x - taille_, _y, _x, _y - taille_);
_g.drawLine(_x, _y - taille_, _x + taille_, _y);
_g.drawLine(_x + taille_, _y, _x, _y + taille_);
_g.drawLine(_x, _y + taille_, _x - taille_, _y);
break;
case CERCLE :
_g.drawArc(
_x - taille_,
_y - taille_,
2 * taille_ + 1,
2 * taille_ + 1,
0,
360);
break;
case DISQUE :
_g.fillArc(
_x - taille_,
_y - taille_,
2 * taille_ + 1,
2 * taille_ + 1,
0,
360);
break;
default :
break;
}
if (couleur_ != null) {
_g.setColor(old);
}
}
}
\ No newline at end of file
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv8513/commun
Modified Files:
EbliListeSelection.java EbliListeSelectionInterface.java
EbliListeSelectionMulti.java
Log Message:
General update
Index: EbliListeSelection.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliListeSelection.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** EbliListeSelection.java 14 Nov 2003 08:30:15 -0000 1.7
--- EbliListeSelection.java 21 Nov 2003 14:58:00 -0000 1.8
***************
*** 1 ****
! /*
* @file EbliListeSelection.java
* @creation 2002-10-9
* @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.commun;
import java.util.BitSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* Liste de selection encapsulant un BitSet. Des methodes sont rajoutees pour
* gerer les operations avec d'autres listes d'index ou des inversions de selection
* dans un intervalle donne.
* @see java.util.BitSet
*
* @version $Id$
* @author Fred Deniger
*/
public class EbliListeSelection implements Cloneable,EbliListeSelectionInterface {
/** liste stockant les indexs*/
private BitSet index_;
/** les listeners de cette liste de selection*/
private Set listeners_;
/**
* initialise la liste de selection avec comme taille 32.
*/
public EbliListeSelection() {
this(new BitSet(32));
}
public synchronized void addListeSelectionListener(EbliListeSelectionListener _l) {
if (listeners_ == null) {
listeners_= new HashSet(5);
}
listeners_.add(_l);
}
public synchronized void removeListeSelectionListener(EbliListeSelectionListener _l) {
if (listeners_ != null) {
listeners_.remove(_l);
}
}
public int getMinIndex() {
int n= getMaxIndex();
for (int i= 0; i <= n; i++) {
if (index_.get(i))
return i;
}
return n;
}
public synchronized void clearListeSelectionListener() {
if (listeners_ != null) {
listeners_.clear();
}
}
private synchronized void fireSelectionEvent() {
if (listeners_ != null) {
EbliListeSelectionEvent evt= new EbliListeSelectionEvent(this);
for (Iterator iter= listeners_.iterator(); iter.hasNext();) {
EbliListeSelectionListener element=
(EbliListeSelectionListener)iter.next();
element.listeSelectionChanged(evt);
}
}
}
/**
* Initialise la liste de selection avec la taille <code>_taille</code>.
* @param _taille la taille de la liste de selection
*/
public EbliListeSelection(int _taille) {
this(new BitSet(_taille));
}
/**
* initialise la liste avec <code>_b</code>. Envoie une exception
* si <code>_b</code> est nul.
*
* @param _b la liste des indexs
*/
public EbliListeSelection(BitSet _b) {
if (_b == null) {
throw new RuntimeException(getClass().getName() + " BitSet est null");
}
index_= _b;
}
/**
* @param args
*/
public static void main(String[] args) {
EbliListeSelection list= new EbliListeSelection(45);
list.addInterval(1, 7);
EbliListeSelection list2= new EbliListeSelection(45);
list2.add(7);
list2.add(2);
if (list.contains(list2))
System.out.println("test 1:ok pour l'inclusion");
else
System.out.println("test 1:PAS OK pour l'inclusion");
if (list2.contains(list))
System.out.println("test 2: PAS OK pour l'inclusion");
else
System.out.println("test 2:ok pour l'inclusion");
list.clear();
list.add(1);
list.add(3);
list.add(8);
if (list.intersects(list2))
System.out.println("test 3:PAS OK pour l'intersection");
else
System.out.println("test 3:ok pour l'intersection");
//list=1,2,3,8
//list2=2,7
list.add(2);
if (list.intersects(list2))
System.out.println("test 4:ok pour l'intersection");
else
System.out.println("test 4:PAS OK pour l'intersection");
list.remove(list2);
System.out.println("evt !");
list.remove(list2);
System.out.println("pas evt!");
list2.add(list);
System.out.println("evt !");
list2.add(list);
System.out.println("pas evt !");
list2.add(2);
System.out.println("pas evt !");
list2.or(list);
System.out.println("pas evt!");
list.add(15);
System.out.println("evt !");
list2.or(list);
System.out.println("evt !");
}
/**
* @param _deb SelectionInterval
* @param _fin SelectionInterval
*/
public void setSelectionInterval(int _deb, int _fin) {
setSelectionInterval(_deb, _fin, true);
}
private boolean setSelectionInterval(int _deb, int _fin, boolean _event) {
boolean r= removeInterval(0, _deb - 1, false);
r |= addInterval(_deb, _fin, false);
r |= removeInterval(_fin + 1, getMaxIndex(), false);
if ((listeners_ != null) && r && _event)
fireSelectionEvent();
return r;
}
public EbliListeSelection(EbliListeSelection _l) {
this(_l.length());
setSelection(_l);
}
public final void setSelection(EbliListeSelection _l) {
if (equals(_l))
return;
clear(false);
or(_l, false);
if (listeners_ != null)
fireSelectionEvent();
}
/**
* @param _i
* @return Selected
*/
public boolean isSelected(int _i) {
if (_i > getMaxIndex())
return false;
return index_.get(_i);
}
public static int[] isSelectionContiguous(
EbliListeSelection _selection,
int _nbItem) {
int max= _selection.getMaxIndex();
int min= _selection.getMinIndex();
int[] rtab= new int[2];
rtab[0]=min;
rtab[1]=max;
int r= 0;
for (int i= min; i <= max; i++) {
if (_selection.isSelected(i)) {
//first bloc
if (r == 0) {
r= 1;
//second bloc verify if loop
} else if (r == 2) {
if ((_selection.isSelected(0))
&& (_selection.isSelected(_nbItem - 1))) {
r= 3;
rtab[0]= i;
} else
return null;
} else if (r == 4)
return null;
} else if ((r == 1) || (r == 3)) {
if (r == 1)
rtab[1]= i - 1;
r++;
}
}
return rtab;
}
/**
* @return Empty
*/
public boolean isEmpty() {
return index_.length() == 0;
}
/**
* Renvoie l'inverse de cette selection dans l'intervalle
* [0;length()[.
* @return l'inverse dans une nouvelle instance.
*/
public EbliListeSelection getInverse() {
return getInverse(length());
}
/**
* Renvoie l'inverse de cette selection dans l'intervalle
* [0;_taille[.
* @param _taille
* @return l'inverse dans une nouvelle instance.
*/
public EbliListeSelection getInverse(int _taille) {
EbliListeSelection r= (EbliListeSelection)clone();
r.inverse(_taille, false);
return r;
}
/**
* @return l'index selectionnee max.
*/
public int getMaxIndex() {
return index_.length() - 1;
}
/**
* Ajoute l'index <code>_i </code> a la selection.
* @param _i
*/
public boolean add(int _i) {
return add(_i, (listeners_ != null));
}
private boolean add(int _i, boolean _event) {
if (!isSelected(_i)) {
index_.set(_i);
if (_event)
fireSelectionEvent();
return true;
}
return false;
}
/**
* Enleve l'index <code>_i</code> a la selection.
* @param _i
*/
public boolean remove(int _i) {
return remove(_i, (listeners_ != null));
}
/**
*
*/
private boolean remove(int _i, boolean _event) {
if (isSelected(_i)) {
index_.clear(_i);
if (_event)
fireSelectionEvent();
return true;
}
return false;
}
/**
* Ajoute tous les indexs de [_deb,_fin];
* @param _deb l'index inferieur
* @param _fin l'index superieur
*/
public boolean addInterval(int _deb, int _fin) {
return addInterval(_deb, _fin, (listeners_ != null));
}
private boolean addInterval(int _deb, int _fin, boolean _event) {
boolean r= false;
for (int i= _deb; i <= _fin; i++)
r |= add(i, false);
if (r && _event)
fireSelectionEvent();
return r;
}
/**
* Enleve tous les indexs de [_deb,_fin];
* @param _deb l'index inferieur
* @param _fin l'index superieur
*/
private boolean removeInterval(int _deb, int _fin, boolean _event) {
boolean r= false;
for (int i= _deb; i <= _fin; i++)
r |= remove(i, false);
if (r && _event)
fireSelectionEvent();
return r;
}
public boolean removeInterval(int _deb, int _fin) {
return removeInterval(_deb, _fin, (listeners_ != null));
}
/**
* Fait appel a la methode equals de BitSet.
* @see java.util.BitSet#equals
*/
public boolean equals(Object _o) {
if (EbliListeSelection.class.isInstance(_o)) {
return index_.equals(((EbliListeSelection)_o).index_);
} else {
return false;
}
}
/**
* @see java.util.BitSet#hashcode()
*/
public int hashcode() {
return index_.hashCode();
}
private boolean clear(boolean _event) {
if (isEmpty())
return false;
removeInterval(0, getMaxIndex(), false);
if (_event)
fireSelectionEvent();
return true;
}
/**
* Enleve tous les indexs de la selection et envoie un evt.
*/
public void clear() {
clear((listeners_ != null));
}
/**
* @return la taille de la selection
* @see java.util.BitSet#length()
*/
public int length() {
return index_.length();
}
/**
* Inverse la selection dans l'intervalle [0, length()[.
* Envoie un evt si modification.
*/
public void inverse() {
inverse(index_.length(), (listeners_ != null));
}
/**
* Inverse la selection dans l'intervalle [0, _taille[.
* Envoie un evt si modification.
* @param _taille
*/
public void inverse(int _taille) {
inverse(_taille, (listeners_ != null));
}
/**
* Inverse la selection dans l'intervalle [0, _taille[.
* @param _taille
*/
private void inverse(int _taille, boolean _event) {
if (isEmpty()) {
setSelectionInterval(0, _taille - 1, false);
if (_event)
fireSelectionEvent();
return;
}
int max= getMaxIndex();
int maxT= max >= _taille ? _taille - 1 : max;
for (int i= 0; i <= maxT; i++) {
if (isSelected(i))
index_.clear(i);
else
index_.set(i);
}
if (max < _taille - 1)
addInterval(max + 1, _taille - 1, false);
if (_taille - 1 < max)
removeInterval(_taille, max, false);
if (_event)
fireSelectionEvent();
}
/**
* @return la liste des index selectionnes.
*/
public int[] getSelectedIndex() {
return getSelectedIndex(length());
}
/**
* Clone cet objet: creation d'une nouvelle instance avec le clone
* du BitSet.
* @return nouveau clone
*/
public Object clone() {
return new EbliListeSelection((BitSet)index_.clone());
}
/**
* Renvoie la liste des indexs selectionnes dans l'intervalle
* [0;_taille[.
* @param _taille l'index max
* @return la liste des index selectionnes
*/
public int[] getSelectedIndex(int _taille) {
//renvoie null si vide
if (isEmpty())
return null;
//Si l'index demande est plus grand que l'index max
// on prend l'index max
int max= getMaxIndex();
max= max >= _taille ? _taille - 1 : max;
//Tableau temporaire stockant les indices selectionnes
int[] r= new int[1 + max];
//n: l'indice du tableau en cours
int n= 0;
//on parcourt tous les indexs et les indexs selectionnes sont
// rajoutes.
for (int i= 0; i <= max; i++)
if (isSelected(i))
r[n++]= i;
//les indexs ne sont pas tous selectionnes : on reduit le tableau
if (n != r.length) {
int[] r2= new int[n];
System.arraycopy(r, 0, r2, 0, n);
return r2;
} else {
//les indexs sont tous selectionnes on renvoie le tableau temporaire
return r;
}
}
/**
* Operation or avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
private boolean or(EbliListeSelection _l, boolean _event) {
if (contains(_l))
return false;
index_.or(_l.index_);
if (_event)
fireSelectionEvent();
return true;
}
/**
* Operation or avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public boolean or(EbliListeSelection _l) {
return or(_l, (listeners_ != null));
}
/**
* Operation xor avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public boolean xor(EbliListeSelection _l) {
if ((_l == null) || (_l.isEmpty())) {
return false;
}
index_.xor(_l.index_);
if (listeners_ != null)
fireSelectionEvent();
return true;
}
/**
* Operation and avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public void and(EbliListeSelection _l) {
if ((_l == null) || (_l.isEmpty())) {
clear();
}
if (!_l.contains(this)) {
index_.and(_l.index_);
if (listeners_ != null)
fireSelectionEvent();
}
}
/**
* Operation intersection ( soit une operation and) avec la liste <code>_l</code>.
* @param _l l'argument de l'operation
*/
public void intersection(EbliListeSelection _l) {
and(_l);
}
/**
* Operation add ( soit une operation or ) avec la liste <code>_l</code>.
* Envoie un evt seulement si des changements sont effectues.
* @param _l l'argument de l'operation
*/
public boolean add(EbliListeSelection _l) {
return or(_l);
}
/**
* Enleve tous les indexs selectionnes de <code>_l</code>.
* @param _l la liste des indexs a enlever.
*/
public boolean remove(EbliListeSelection _l) {
if (isEmpty())
return false;
boolean r= false;
int max= getMaxIndex();
for (int i= 0; i <= max; i++) {
if ((isSelected(i)) && (_l.isSelected(i))) {
r= true;
remove(i, false);
}
}
if ((listeners_ != null) && r) {
fireSelectionEvent();
}
return r;
}
/**
* Renvoie true si cette selection contient totalement la selection _l.
* @return true si _l totalement inclue.
*/
public boolean contains(EbliListeSelection _l) {
//Si la selection est vide ou nulle elle est inclue dans this
if ((_l == null) || (_l.isEmpty()))
return true;
//Si les taille de l est superieure elle n'est pas inclue
if (_l.length() > length())
return false;
//les indices de _l
int[] indexL= _l.getSelectedIndex();
int n= indexL.length - 1;
//si un indice de _l n'est pas inclue, renvoie false
for (int i= n; i >= 0; i--) {
if (!isSelected(indexL[i]))
return false;
}
//tous les indices sont contenues... ok.
return true;
}
/**
* Renvoie true si l'intersection avec <code>_l</code> non vide.
* @return si intersection non vide.
*/
public boolean intersects(EbliListeSelection _l) {
//si l vide ou nul renvoie false
if ((_l == null) || (_l.isEmpty()))
return false;
int[] indexL= _l.getSelectedIndex();
int n= indexL.length - 1;
//si un indice de _l est present intersectin non vide
for (int i= n; i >= 0; i--) {
if (isSelected(indexL[i]))
return true;
}
//tous les indices sont differents pas d'inclusion
return false;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file EbliListeSelection.java
* @creation 2002-10-9
* @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.commun;
import java.util.BitSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* Liste de selection encapsulant un BitSet. Des methodes sont rajoutees pour
* gerer les operations avec d'autres listes d'index ou des inversions de selection
* dans un intervalle donne.
* @see java.util.BitSet
*
* @version $Id$
* @author Fred Deniger
*/
public class EbliListeSelection implements Cloneable,EbliListeSelectionInterface {
/** liste stockant les indexs*/
private BitSet index_;
/** les listeners de cette liste de selection*/
private Set listeners_;
/**
* initialise la liste de selection avec comme taille 32.
*/
public EbliListeSelection() {
this(new BitSet(32));
}
public synchronized void addListeSelectionListener(EbliListeSelectionListener _l) {
if (listeners_ == null) {
listeners_= new HashSet(5);
}
listeners_.add(_l);
}
public synchronized void removeListeSelectionListener(EbliListeSelectionListener _l) {
if (listeners_ != null) {
listeners_.remove(_l);
}
}
public int getNbSelectedIndex(){
int m=getMaxIndex();
int r=0;
for(int i=getMinIndex();i<=m;i++){
if(index_.get(i)) r++;
}
return r;
}
public int getMinIndex() {
int n= getMaxIndex();
for (int i= 0; i <= n; i++) {
if (index_.get(i))
return i;
}
return n;
}
public synchronized void clearListeSelectionListener() {
if (listeners_ != null) {
listeners_.clear();
}
}
private synchronized void fireSelectionEvent() {
if (listeners_ != null) {
EbliListeSelectionEvent evt= new EbliListeSelectionEvent(this);
for (Iterator iter= listeners_.iterator(); iter.hasNext();) {
EbliListeSelectionListener element=
(EbliListeSelectionListener)iter.next();
element.listeSelectionChanged(evt);
}
}
}
/**
* Initialise la liste de selection avec la taille <code>_taille</code>.
* @param _taille la taille de la liste de selection
*/
public EbliListeSelection(int _taille) {
this(new BitSet(_taille));
}
/**
* initialise la liste avec <code>_b</code>. Envoie une exception
* si <code>_b</code> est nul.
*
* @param _b la liste des indexs
*/
public EbliListeSelection(BitSet _b) {
if (_b == null) {
throw new RuntimeException(getClass().getName() + " BitSet est null");
}
index_= _b;
}
/**
* @param args
*/
public static void main(String[] args) {
EbliListeSelection list= new EbliListeSelection(45);
list.addInterval(1, 7);
EbliListeSelection list2= new EbliListeSelection(45);
list2.add(7);
list2.add(2);
if (list.contains(list2))
System.out.println("test 1:ok pour l'inclusion");
else
System.out.println("test 1:PAS OK pour l'inclusion");
if (list2.contains(list))
System.out.println("test 2: PAS OK pour l'inclusion");
else
System.out.println("test 2:ok pour l'inclusion");
list.clear();
list.add(1);
list.add(3);
list.add(8);
if (list.intersects(list2))
System.out.println("test 3:PAS OK pour l'intersection");
else
System.out.println("test 3:ok pour l'intersection");
//list=1,2,3,8
//list2=2,7
list.add(2);
if (list.intersects(list2))
System.out.println("test 4:ok pour l'intersection");
else
System.out.println("test 4:PAS OK pour l'intersection");
list.remove(list2);
System.out.println("evt !");
list.remove(list2);
System.out.println("pas evt!");
list2.add(list);
System.out.println("evt !");
list2.add(list);
System.out.println("pas evt !");
list2.add(2);
System.out.println("pas evt !");
list2.or(list);
System.out.println("pas evt!");
list.add(15);
System.out.println("evt !");
list2.or(list);
System.out.println("evt !");
}
/**
* @param _deb SelectionInterval
* @param _fin SelectionInterval
*/
public void setSelectionInterval(int _deb, int _fin) {
setSelectionInterval(_deb, _fin, true);
}
private boolean setSelectionInterval(int _deb, int _fin, boolean _event) {
boolean r= removeInterval(0, _deb - 1, false);
r |= addInterval(_deb, _fin, false);
r |= removeInterval(_fin + 1, getMaxIndex(), false);
if ((listeners_ != null) && r && _event)
fireSelectionEvent();
return r;
}
public EbliListeSelection(EbliListeSelection _l) {
this(_l.length());
setSelection(_l);
}
public final void setSelection(EbliListeSelection _l) {
if (equals(_l))
return;
clear(false);
or(_l, false);
if (listeners_ != null)
fireSelectionEvent();
}
/**
* @param _i
* @return Selected
*/
public boolean isSelected(int _i) {
if (_i > getMaxIndex())
return false;
return index_.get(_i);
}
public static int[] isSelectionContiguous(
EbliListeSelection _selection,
int _nbItem) {
int max= _selection.getMaxIndex();
int min= _selection.getMinIndex();
int[] rtab= new int[2];
rtab[0]=min;
rtab[1]=max;
int r= 0;
for (int i= min; i <= max; i++) {
if (_selection.isSelected(i)) {
//first bloc
if (r == 0) {
r= 1;
//second bloc verify if loop
} else if (r == 2) {
if ((_selection.isSelected(0))
&& (_selection.isSelected(_nbItem - 1))) {
r= 3;
rtab[0]= i;
} else
return null;
} else if (r == 4)
return null;
} else if ((r == 1) || (r == 3)) {
if (r == 1)
rtab[1]= i - 1;
r++;
}
}
return rtab;
}
/**
* @return Empty
*/
public boolean isEmpty() {
return index_.length() == 0;
}
/**
* Renvoie l'inverse de cette selection dans l'intervalle
* [0;length()[.
* @return l'inverse dans une nouvelle instance.
*/
public EbliListeSelection getInverse() {
return getInverse(length());
}
/**
* Renvoie l'inverse de cette selection dans l'intervalle
* [0;_taille[.
* @param _taille
* @return l'inverse dans une nouvelle instance.
*/
public EbliListeSelection getInverse(int _taille) {
EbliListeSelection r= (EbliListeSelection)clone();
r.inverse(_taille, false);
return r;
}
/**
* @return l'index selectionnee max.
*/
public int getMaxIndex() {
return index_.length() - 1;
}
/**
* Ajoute l'index <code>_i </code> a la selection.
* @param _i
*/
public boolean add(int _i) {
return add(_i, (listeners_ != null));
}
private boolean add(int _i, boolean _event) {
if (!isSelected(_i)) {
index_.set(_i);
if (_event)
fireSelectionEvent();
return true;
}
return false;
}
/**
* Enleve l'index <code>_i</code> a la selection.
* @param _i
*/
public boolean remove(int _i) {
return remove(_i, (listeners_ != null));
}
/**
*
*/
private boolean remove(int _i, boolean _event) {
if (isSelected(_i)) {
index_.clear(_i);
if (_event)
fireSelectionEvent();
return true;
}
return false;
}
/**
* Ajoute tous les indexs de [_deb,_fin];
* @param _deb l'index inferieur
* @param _fin l'index superieur
*/
public boolean addInterval(int _deb, int _fin) {
return addInterval(_deb, _fin, (listeners_ != null));
}
private boolean addInterval(int _deb, int _fin, boolean _event) {
boolean r= false;
for (int i= _deb; i <= _fin; i++)
r |= add(i, false);
if (r && _event)
fireSelectionEvent();
return r;
}
/**
* Enleve tous les indexs de [_deb,_fin];
* @param _deb l'index inferieur
* @param _fin l'index superieur
*/
private boolean removeInterval(int _deb, int _fin, boolean _event) {
boolean r= false;
for (int i= _deb; i <= _fin; i++)
r |= remove(i, false);
if (r && _event)
fireSelectionEvent();
return r;
}
public boolean removeInterval(int _deb, int _fin) {
return removeInterval(_deb, _fin, (listeners_ != null));
}
/**
* Fait appel a la methode equals de BitSet.
* @see java.util.BitSet#equals
*/
public boolean equals(Object _o) {
if (EbliListeSelection.class.isInstance(_o)) {
return index_.equals(((EbliListeSelection)_o).index_);
} else {
return false;
}
}
/**
* @see java.util.BitSet#hashcode()
*/
public int hashcode() {
return index_.hashCode();
}
private boolean clear(boolean _event) {
if (isEmpty())
return false;
removeInterval(0, getMaxIndex(), false);
if (_event)
fireSelectionEvent();
return true;
}
/**
* Enleve tous les indexs de la selection et envoie un evt.
*/
public void clear() {
clear((listeners_ != null));
}
/**
* @return la taille de la selection
*/
public int length() {
if(index_.length()==0) return 0;
int m=getMaxIndex();
int r=0;
for(int i=getMinIndex();i<=m;i++){
if(index_.get(i)) r++;
}
return r;
}
public boolean isOnlyOnIndexSelected(){
return (index_.length()>0) && (getMinIndex()==getMaxIndex());
}
/**
* Inverse la selection dans l'intervalle [0, length()[.
* Envoie un evt si modification.
*/
public void inverse() {
inverse(index_.length(), (listeners_ != null));
}
/**
* Inverse la selection dans l'intervalle [0, _taille[.
* Envoie un evt si modification.
* @param _taille
*/
public void inverse(int _taille) {
inverse(_taille, (listeners_ != null));
}
/**
* Inverse la selection dans l'intervalle [0, _taille[.
* @param _taille
*/
private void inverse(int _taille, boolean _event) {
if (isEmpty()) {
setSelectionInterval(0, _taille - 1, false);
if (_event)
fireSelectionEvent();
return;
}
int max= getMaxIndex();
int maxT= max >= _taille ? _taille - 1 : max;
for (int i= 0; i <= maxT; i++) {
if (isSelected(i))
index_.clear(i);
else
index_.set(i);
}
if (max < _taille - 1)
addInterval(max + 1, _taille - 1, false);
if (_taille - 1 < max)
removeInterval(_taille, max, false);
if (_event)
fireSelectionEvent();
}
/**
* @return la liste des index selectionnes.
*/
public int[] getSelectedIndex() {
return getSelectedIndex(getMaxIndex());
}
/**
* Clone cet objet: creation d'une nouvelle instance avec le clone
* du BitSet.
* @return nouveau clone
*/
public Object clone() {
return new EbliListeSelection((BitSet)index_.clone());
}
/**
* Renvoie la liste des indexs selectionnes dans l'intervalle
* [0;_taille].
* @param _taille l'index max
* @return la liste des index selectionnes
*/
public int[] getSelectedIndex(int _maxIndex) {
//renvoie null si vide
if (isEmpty())
return null;
//Si l'index demande est plus grand que l'index max
// on prend l'index max
int max= getMaxIndex();
max= max > _maxIndex? _maxIndex: max;
//Tableau temporaire stockant les indices selectionnes
int[] r= new int[1 + max];
//n: l'indice du tableau en cours
int n= 0;
//on parcourt tous les indexs et les indexs selectionnes sont
// rajoutes.
for (int i= 0; i <= max; i++)
if (isSelected(i))
r[n++]= i;
//les indexs ne sont pas tous selectionnes : on reduit le tableau
if (n != r.length) {
int[] r2= new int[n];
System.arraycopy(r, 0, r2, 0, n);
return r2;
} else {
//les indexs sont tous selectionnes on renvoie le tableau temporaire
return r;
}
}
/**
* Operation or avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
private boolean or(EbliListeSelection _l, boolean _event) {
if (contains(_l))
return false;
index_.or(_l.index_);
if (_event)
fireSelectionEvent();
return true;
}
/**
* Operation or avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public boolean or(EbliListeSelection _l) {
return or(_l, (listeners_ != null));
}
/**
* Operation xor avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public boolean xor(EbliListeSelection _l) {
if ((_l == null) || (_l.isEmpty())) {
return false;
}
index_.xor(_l.index_);
if (listeners_ != null)
fireSelectionEvent();
return true;
}
/**
* Operation and avec la liste <code>_l</code>
* @param _l l'argument de l'operation
*/
public void and(EbliListeSelection _l) {
if ((_l == null) || (_l.isEmpty())) {
clear();
}
if (!_l.contains(this)) {
index_.and(_l.index_);
if (listeners_ != null)
fireSelectionEvent();
}
}
/**
* Operation intersection ( soit une operation and) avec la liste <code>_l</code>.
* @param _l l'argument de l'operation
*/
public void intersection(EbliListeSelection _l) {
and(_l);
}
/**
* Operation add ( soit une operation or ) avec la liste <code>_l</code>.
* Envoie un evt seulement si des changements sont effectues.
* @param _l l'argument de l'operation
*/
public boolean add(EbliListeSelection _l) {
return or(_l);
}
/**
* Enleve tous les indexs selectionnes de <code>_l</code>.
* @param _l la liste des indexs a enlever.
*/
public boolean remove(EbliListeSelection _l) {
if (isEmpty())
return false;
boolean r= false;
int max= getMaxIndex();
for (int i= 0; i <= max; i++) {
if ((isSelected(i)) && (_l.isSelected(i))) {
r= true;
remove(i, false);
}
}
if ((listeners_ != null) && r) {
fireSelectionEvent();
}
return r;
}
/**
* Renvoie true si cette selection contient totalement la selection _l.
* @return true si _l totalement inclue.
*/
public boolean contains(EbliListeSelection _l) {
//Si la selection est vide ou nulle elle est inclue dans this
if ((_l == null) || (_l.isEmpty()))
return true;
//Si la taille de l est superieure elle n'est pas inclue
if (_l.getMaxIndex() > getMaxIndex())
return false;
//les indices de _l
int[] indexL= _l.getSelectedIndex();
int n= indexL.length - 1;
//si un indice de _l n'est pas inclue, renvoie false
for (int i= n; i >= 0; i--) {
if (!isSelected(indexL[i]))
return false;
}
//tous les indices sont contenues... ok.
return true;
}
/**
* Renvoie true si l'intersection avec <code>_l</code> non vide.
* @return si intersection non vide.
*/
public boolean intersects(EbliListeSelection _l) {
//si l vide ou nul renvoie false
if ((_l == null) || (_l.isEmpty()))
return false;
int[] indexL= _l.getSelectedIndex();
int n= indexL.length - 1;
//si un indice de _l est present intersectin non vide
for (int i= n; i >= 0; i--) {
if (isSelected(indexL[i]))
return true;
}
//tous les indices sont differents pas d'inclusion
return false;
}
}
\ No newline at end of file
Index: EbliListeSelectionInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliListeSelectionInterface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EbliListeSelectionInterface.java 14 Nov 2003 08:30:15 -0000 1.1
--- EbliListeSelectionInterface.java 21 Nov 2003 14:58:00 -0000 1.2
***************
*** 21,24 ****
--- 21,25 ----
public int[] getSelectedIndex();
public int length();
+ public boolean isOnlyOnIndexSelected();
}
Index: EbliListeSelectionMulti.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/commun/EbliListeSelectionMulti.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** EbliListeSelectionMulti.java 14 Nov 2003 08:30:15 -0000 1.2
--- EbliListeSelectionMulti.java 21 Nov 2003 14:58:00 -0000 1.3
***************
*** 10,13 ****
--- 10,15 ----
import gnu.trove.TIntObjectHashMap;
import gnu.trove.TIntObjectIterator;
+ import gnu.trove.TIntObjectProcedure;
+ import gnu.trove.TIntProcedure;
/**
* @author deniger
***************
*** 30,33 ****
--- 32,45 ----
}
+ public void forEachKey(TIntProcedure _p){
+ idxListSelection_.forEachKey(_p);
+ }
+
+ public void forEachEntry(TIntObjectProcedure _p){
+ idxListSelection_.forEachEntry(_p);
+ }
+
+
+
public int isSelectionInOneBloc(){
return (idxListSelection_.size()==1?idxListSelection_.keys()[0]:-1);
***************
*** 41,45 ****
}
public EbliListeSelectionInterface getSelection(int _idxSelected){
! return get(_idxSelected);
}
public boolean isEmpty() {
--- 53,57 ----
}
public EbliListeSelectionInterface getSelection(int _idxSelected){
! return (EbliListeSelection)idxListSelection_.get(_idxSelected);
}
public boolean isEmpty() {
|
|
From: <de...@us...> - 2003-11-21 14:58:03
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog
In directory sc8-pr-cvs1:/tmp/cvs-serv8513/dialog
Modified Files:
EbliSimpleDialogPanel.java
Log Message:
General update
Index: EbliSimpleDialogPanel.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/EbliSimpleDialogPanel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** EbliSimpleDialogPanel.java 14 Nov 2003 08:30:16 -0000 1.7
--- EbliSimpleDialogPanel.java 21 Nov 2003 14:58:00 -0000 1.8
***************
*** 95,98 ****
--- 95,99 ----
lbError_= new BuLabelMultiLine();
lbError_.setVisible(false);
+ lbError_.setWrapMode(BuLabelMultiLine.WORD);
lbError_.setForeground(Color.red);
title_= "";
***************
*** 104,107 ****
--- 105,109 ----
lbError_.setText(_error);
doLayout();
+ lbError_.revalidate();
}
}
***************
*** 311,314 ****
--- 313,317 ----
}
princ.add(lbError_, BuBorderLayout.NORTH);
+ princ.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
princ.add(this, BuBorderLayout.CENTER);
BuPanel pnAction= new BuPanel();
***************
*** 603,606 ****
--- 606,616 ----
}
}
+ }
+ }
+
+ protected void repackFrame(){
+ if(dialog_!=null){
+ dialog_.pack();
+ dialog_.repaint();
}
}
|
|
From: <cla...@us...> - 2003-11-13 09:59:53
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/lido
In directory sc8-pr-cvs1:/tmp/cvs-serv7472
Modified Files:
LidoImplementation.java
Log Message:
mise à jour des dates et nom du contact
Index: LidoImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/lido/LidoImplementation.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** LidoImplementation.java 23 Sep 2003 21:25:09 -0000 1.7
--- LidoImplementation.java 13 Nov 2003 09:59:41 -0000 1.8
***************
*** 1,2661 ****
! /*
! * @file LidoImplementation.java
! * @creation 1999-01-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.lido;
[...5293 lines suppressed...]
! {
! addInternalFrame(previsuFille_);
! }
!
! else
! {
! activateInternalFrame(previsuFille_);
! }
! }
! try
! {
! previsuFille_.setMaximum(true);
! }
! catch (java.beans.PropertyVetoException _e)
! {
! previsuFille_.setSize(100, 100);
! }
! }
!
! }
|
|
From: <de...@us...> - 2003-10-29 12:22:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv20003/telemac
Modified Files:
H2dTelemacCLManager.java
Log Message:
Add support for boundary modification
Index: H2dTelemacCLManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLManager.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** H2dTelemacCLManager.java 29 Oct 2003 11:41:27 -0000 1.6
--- H2dTelemacCLManager.java 29 Oct 2003 12:22:45 -0000 1.7
***************
*** 11,14 ****
--- 11,15 ----
import java.util.Arrays;
import java.util.Iterator;
+
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoCommand;
***************
*** 31,36 ****
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
- import org.fudaa.dodico.telemac.io.TelemacDicoFileFormatVersion;
- import sun.jdbc.odbc.OdbcDef;
/**
* @author deniger
--- 32,35 ----
***************
*** 362,370 ****
return _b.setFlowrate(_s);
}
!
! public boolean isValueFixed(H2dVariableType _v){
! if(_v==H2dVariableType.DEBIT)
! return isValueSetInDico();
! return true;
}
});
--- 361,372 ----
return _b.setFlowrate(_s);
}
! public boolean isValueFixedFor(H2dTelemacBord _b) {
! return false;
! }
! public boolean isParameterFor(H2dVariableType _v) {
! return _v == H2dVariableType.DEBIT;
! }
! public H2dVariableType getVariable() {
! return H2dVariableType.DEBIT;
}
});
***************
*** 385,388 ****
--- 387,406 ----
return _b.setVelocity(_s);
}
+ public boolean isValueFixedFor(H2dTelemacBord _b) {
+ if ((_b.getType().isLiquide()) && (isValueSetInDico())) {
+ if (getH2dFileFormat()
+ .isVelocitiesFixedByVelocityProfils(_b.getVelocityProfil()))
+ return true;
+ }
+ return false;
+ }
+ public boolean isParameterFor(H2dVariableType _v) {
+ return (_v == H2dVariableType.VITESSE)
+ || (_v == H2dVariableType.VITESSE_U)
+ || (_v == H2dVariableType.VITESSE_V);
+ }
+ public H2dVariableType getVariable() {
+ return H2dVariableType.VITESSE;
+ }
});
}
***************
*** 402,409 ****
return _b.setElevation(_s);
}
! public boolean isValueFixed(H2dVariableType _v){
! if(_v==H2dVariableType.VITESSE)
return isValueSetInDico();
! return true;
}
});
--- 420,431 ----
return _b.setElevation(_s);
}
! public boolean isValueFixedFor(H2dTelemacBord _b) {
return isValueSetInDico();
! }
! public boolean isParameterFor(H2dVariableType _v) {
! return _v == H2dVariableType.COTE_EAU;
! }
! public H2dVariableType getVariable() {
! return H2dVariableType.COTE_EAU;
}
});
***************
*** 426,429 ****
--- 448,460 ----
return _b.setTracer(_s);
}
+ public boolean isValueFixedFor(H2dTelemacBord _b) {
+ return isValueSetInDico();
+ }
+ public boolean isParameterFor(H2dVariableType _v) {
+ return _v == H2dVariableType.TRACEUR;
+ }
+ public H2dVariableType getVariable() {
+ return H2dVariableType.TRACEUR;
+ }
});
}
***************
*** 504,514 ****
return errorString_ == null;
}
!
! public boolean isValueSetInDico(){
return dico_.isValueSetFor(ent_);
}
!
! public abstract boolean isValueFixed(H2dVariableType _variable);
!
public boolean hasToBeSet(H2dBordType _t) {
return Arrays.binarySearch(bordType_, _t) >= 0;
--- 535,550 ----
return errorString_ == null;
}
! public boolean isValueSetInDico() {
return dico_.isValueSetFor(ent_);
}
! public boolean isValueFixedFor(H2dTelemacBord _b) {
! return false;
! }
! public boolean isParameterFor(H2dVariableType _v) {
! return false;
! }
! public H2dVariableType getVariable() {
! return null;
! }
public boolean hasToBeSet(H2dBordType _t) {
return Arrays.binarySearch(bordType_, _t) >= 0;
***************
*** 1288,1292 ****
return (H2dTelemacBord)bords_.get(0);
for (int i= 0; i < n; i++) {
! H2dTelemacBord b= ((H2dTelemacBord))bords_.get(i);
if (b.containsIdx(_indexToSearch))
return b;
--- 1324,1328 ----
return (H2dTelemacBord)bords_.get(0);
for (int i= 0; i < n; i++) {
! H2dTelemacBord b= (H2dTelemacBord)bords_.get(i);
if (b.containsIdx(_indexToSearch))
return b;
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/tr/data
Modified Files:
TrCalqueBord.java TrCalqueCL.java TrGroupeCL.java
TrModeleBord.java TrModeleBordAdapter.java TrModeleCL.java
TrModeleCLAbstract.java
Log Message:
boundary condition edition for telemac
Index: TrCalqueBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrCalqueBord.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrCalqueBord.java 8 Oct 2003 12:07:11 -0000 1.4
--- TrCalqueBord.java 29 Oct 2003 11:54:33 -0000 1.5
***************
*** 1 ****
! /*
* @file ZCalqueBord.java
* @creation 25 août 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.tr.data;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.HashMap;
import javax.swing.Icon;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.ebli.calque.ZCalqueAffichageDonnees;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.commun.EbliListeSelection;
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;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.tr.TrContextMenuBuilder;
import org.fudaa.fudaa.tr.TrResource;
/**
* Layer which manage the borders.
* @author deniger
* @version $Id$
*/
public class TrCalqueBord extends ZCalqueAffichageDonnees {
public class BordTraceLigneData {
HashMap bdTypeTlDataMap_;
public BordTraceLigneData() {}
public TraceLigne.Data getTlData(H2dBordType _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(H2dBordType _t) {
if (_t == H2dBordType.SOLIDE_FROTTEMENT)
return new TraceLigne.Data(
TraceLigne.MIXTE,
1f,
new Color(174, 105, 40));
else if (_t == H2dBordType.SOLIDE)
return new TraceLigne.Data(
TraceLigne.LISSE,
1f,
new Color(164, 95, 30));
else if (_t == H2dBordType.LIQUIDE_DEBIT_IMPOSE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.red);
else if (_t == H2dBordType.LIQUIDE_ONDE_INCIDENCE)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.cyan);
else if (_t == H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.green);
else if (_t == H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.green);
else if (_t == H2dBordType.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);
}
}
BordTraceLigneData bdTlData_;
TrContextMenuBuilder ctxBuilder_;
TrModeleBord m_;
TraceLigne tl_;
TraceLigne tlSelection_= null;
/**
*
*/
public TrCalqueBord(TrModeleBord _m) {
setTitle(TrResource.getS("Bords"));
m_= _m;
bdTlData_= new BordTraceLigneData();
}
public BordTraceLigneData getBordTraceLigneData() {
return bdTlData_;
}
private TraceLigne.Data getTlData(H2dBordType _t) {
return bdTlData_.getTlData(_t);
}
/**
*
*/
public ZModeleDonnees modeleDonnees() {
return 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();
int idxEnCours;
H2dBord.BordIndexIterator it= new H2dBord.BordIndexIterator();
H2dBord bdElt;
//on parcourt les frontiere du maillage
for (int i= 0; i < n; i++) {
H2dBorderPerFrontierInterface bd= m_.getBord(i);
int nbPt= m_.getNbPoint(i);
int nbBord= bd.getNbBord();
//on parcourt les different type de bord pour la frontiere i
for (int j= 0; j < nbBord; j++) {
bdElt= bd.getBord(j);
data= getTlData(bdElt.getType());
it.set(nbPt, bdElt);
idxEnCours= it.next();
m_.getPoint(i, idxEnCours, seg.o);
while (it.hasNext()) {
idxEnCours= it.next();
m_.getPoint(i, idxEnCours, seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
grpTemp.initialise(seg.e);
seg.autoApplique(versEcran);
tl_.init(data);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
seg.o.initialise(grpTemp);
} else
seg.o.initialise(seg.e);
}
//pour faire le tour si bord unique.
if (nbBord == 1) {
idxEnCours= bdElt.getIdxDeb();
m_.getPoint(i, idxEnCours, seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
tl_.init(data);
seg.autoApplique(versEcran);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
}
}
}
}
if ((!rapide_) && (!isSelectionEmpty())) {
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 nb= selection_.getMaxIndex();
int idxFrontiere;
for (int i= nb; i >= 0; i--) {
if (selection_.isSelected(i)) {
bdElt= m_.getBordInIdxGeneral(i);
idxFrontiere= bdElt.getIdxFrontiere();
it.set(m_.getNbPoint(idxFrontiere), bdElt);
idxEnCours= it.next();
m_.getPoint(idxFrontiere, idxEnCours, seg.o);
while (it.hasNext()) {
idxEnCours= it.next();
m_.getPoint(idxFrontiere, idxEnCours, seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
grpTemp.initialise(seg.e);
seg.autoApplique(versEcran);
tlSelection_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
seg.o.initialise(grpTemp);
} else
seg.o.initialise(seg.e);
}
//pour faire le tour si bord unique.
if (bdElt.isUnique()) {
idxEnCours= bdElt.getIdxDeb();
m_.getPoint(idxFrontiere, idxEnCours, seg.e);
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 EbliListeSelection selection(
GrPoint _pt,
int _tolerance) {
GrMorphisme versEcran= getVersEcran();
GrBoite bClip= getDomaine();
bClip.autoApplique(versEcran);
if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
return null;
int nb= m_.getNbTotalBord();
bClip= getClipReel(getGraphics());
H2dBord b;
GrSegment seg= new GrSegment();
seg.e= new GrPoint();
seg.o= new GrPoint();
GrPoint oReel= new GrPoint();
GrBoite boite= new GrBoite();
H2dBord.BordIndexIterator it= new H2dBord.BordIndexIterator();
int idxFrontiere, idxEnCours;
for (int i= 0; i < nb; i++) {
b= m_.getBordInIdxGeneral(i);
idxFrontiere= b.getIdxFrontiere();
it.set(m_.getNbPoint(idxFrontiere), b);
//le premier indice
idxEnCours= it.next();
//on initialise le point e.
m_.getPoint(idxFrontiere, idxEnCours, seg.e);
while (it.hasNext()) {
idxEnCours= it.next();
//on recupere les coordonnees du point suivant dans seg.o
m_.getPoint(idxFrontiere, idxEnCours, seg.o);
//le point e pour la prochaine iteration
oReel.initialise(seg.o);
seg.boite(boite);
if (boite.intersectXY(bClip)) {
seg.autoApplique(versEcran);
if (seg.estSelectionne(_tolerance, _pt)) {
EbliListeSelection r= new EbliListeSelection(nb);
r.setSelectionInterval(i, i);
return r;
}
//on initialise le point est avec les val sauv de o
seg.e.initialise(oReel);
}
}
}
return null;
}
/**
*
*/
public EbliListeSelection selection(GrPolygone _poly) {
return null;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file ZCalqueBord.java
* @creation 25 août 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.tr.data;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.HashMap;
import javax.swing.Icon;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.ebli.calque.ZCalqueAffichageDonnees;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.commun.EbliListeSelection;
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;
import org.fudaa.fudaa.commun.FudaaLib;
import org.fudaa.fudaa.tr.TrContextMenuBuilder;
import org.fudaa.fudaa.tr.TrResource;
/**
* Layer which manage the borders.
* @author deniger
* @version $Id$
*/
public class TrCalqueBord extends ZCalqueAffichageDonnees {
public class BordTraceLigneData {
HashMap bdTypeTlDataMap_;
public BordTraceLigneData() {}
public TraceLigne.Data getTlData(H2dBordType _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(H2dBordType _t) {
if (_t == H2dBordType.SOLIDE_FROTTEMENT)
return new TraceLigne.Data(
TraceLigne.MIXTE,
1f,
new Color(174, 105, 40));
else if (_t == H2dBordType.SOLIDE)
return new TraceLigne.Data(
TraceLigne.LISSE,
1f,
new Color(164, 95, 30));
else if (_t == H2dBordType.LIQUIDE_DEBIT_IMPOSE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.red);
else if (_t == H2dBordType.LIQUIDE_ONDE_INCIDENCE)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.cyan);
else if (_t == H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES)
return new TraceLigne.Data(TraceLigne.TIRETE, 1f, Color.green);
else if (_t == H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE)
return new TraceLigne.Data(TraceLigne.LISSE, 1f, Color.green);
else if (_t == H2dBordType.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);
}
}
BordTraceLigneData bdTlData_;
TrModeleBord m_;
TraceLigne tl_;
TraceLigne tlSelection_= null;
/**
*
*/
public TrCalqueBord(TrModeleBord _m) {
setTitle(TrResource.getS("Bords"));
m_= _m;
bdTlData_= new BordTraceLigneData();
}
public BordTraceLigneData getBordTraceLigneData() {
return bdTlData_;
}
private TraceLigne.Data getTlData(H2dBordType _t) {
return bdTlData_.getTlData(_t);
}
/**
*
*/
public ZModeleDonnees modeleDonnees() {
return 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();
int idxEnCours;
H2dBord.BordIndexIterator it= new H2dBord.BordIndexIterator();
H2dBord bdElt;
//on parcourt les frontiere du maillage
for (int i= 0; i < n; i++) {
H2dBorderPerFrontierInterface bd= m_.getBord(i);
int nbPt= bd.getNbPt();
int nbBord= bd.getNbBord();
//on parcourt les different type de bord pour la frontiere i
for (int j= 0; j < nbBord; j++) {
bdElt= bd.getBord(j);
data= getTlData(bdElt.getType());
it.set(nbPt, bdElt);
idxEnCours= it.next();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.o);
while (it.hasNext()) {
idxEnCours= it.next();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
grpTemp.initialise(seg.e);
seg.autoApplique(versEcran);
tl_.init(data);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
seg.o.initialise(grpTemp);
} else
seg.o.initialise(seg.e);
}
//pour faire le tour si bord unique.
if (nbBord == 1) {
idxEnCours= bdElt.getIdxDeb();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
tl_.init(data);
seg.autoApplique(versEcran);
tl_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
}
}
}
}
if ((!rapide_) && (!isSelectionEmpty())) {
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 nb= selection_.getMaxIndex();
for (int i= nb; i >= 0; i--) {
if (selection_.isSelected(i)) {
bdElt= m_.getBordInIdxGeneral(i);
// idxFrontiere= bdElt.getIdxFrontiere();
H2dBorderPerFrontierInterface bd= m_.getBord(bdElt.getIdxFrontiere());
it.set(bd.getNbPt(), bdElt);
idxEnCours= it.next();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.o);
while (it.hasNext()) {
idxEnCours= it.next();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.e);
seg.boite(b);
if (clip.intersectXY(b)) {
grpTemp.initialise(seg.e);
seg.autoApplique(versEcran);
tlSelection_.dessineTrait(seg.o.x, seg.o.y, seg.e.x, seg.e.y);
seg.o.initialise(grpTemp);
} else
seg.o.initialise(seg.e);
}
//pour faire le tour si bord unique.
if (bdElt.isUnique()) {
idxEnCours= bdElt.getIdxDeb();
m_.getPoint(bd.getCl(idxEnCours).getIndexPt(), seg.e);
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 EbliListeSelection selection(GrPoint _pt, int _tolerance) {
GrMorphisme versEcran= getVersEcran();
GrBoite bClip= getDomaine();
bClip.autoApplique(versEcran);
if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
return null;
int nb= m_.getNbTotalBord();
bClip= getClipReel(getGraphics());
H2dBord b;
GrSegment seg= new GrSegment();
seg.e= new GrPoint();
seg.o= new GrPoint();
GrPoint oReel= new GrPoint();
GrBoite boite= new GrBoite();
H2dBord.BordIndexIterator it= new H2dBord.BordIndexIterator();
int idxEnCours;
H2dBorderPerFrontierInterface frontierBord;
for (int i= 0; i < nb; i++) {
b= m_.getBordInIdxGeneral(i);
frontierBord= m_.getBord(b.getIdxFrontiere());
//idxFrontiere= b.getIdxFrontiere();
it.set(frontierBord.getNbPt(), b);
//le premier indice
idxEnCours= it.next();
//on initialise le point e.
m_.getPoint(frontierBord.getCl(idxEnCours).getIndexPt(), seg.e);
while (it.hasNext()) {
idxEnCours= it.next();
//on recupere les coordonnees du point suivant dans seg.o
m_.getPoint(frontierBord.getCl(idxEnCours).getIndexPt(), seg.o);
//le point e pour la prochaine iteration
oReel.initialise(seg.o);
seg.boite(boite);
if (boite.intersectXY(bClip)) {
seg.autoApplique(versEcran);
if (seg.estSelectionne(_tolerance, _pt)) {
EbliListeSelection r= new EbliListeSelection(nb);
r.setSelectionInterval(i, i);
return r;
}
//on initialise le point est avec les val sauv de o
seg.e.initialise(oReel);
}
}
}
return null;
}
/**
*
*/
public EbliListeSelection selection(GrPolygone _poly) {
return null;
}
}
\ No newline at end of file
Index: TrCalqueCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrCalqueCL.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TrCalqueCL.java 6 Oct 2003 08:09:07 -0000 1.2
--- TrCalqueCL.java 29 Oct 2003 11:54:33 -0000 1.3
***************
*** 8,27 ****
*/
package org.fudaa.fudaa.tr.data;
!
! import org.fudaa.ebli.calque.ZCalquePoint;
!
import org.fudaa.fudaa.tr.TrResource;
-
/**
* @author deniger
* @version $Id$
*/
! public class TrCalqueCL extends ZCalquePoint {
!
! public TrCalqueCL(TrModeleCL _cl){
! super(_cl);
setTitle(TrResource.getS("points"));
}
-
-
}
--- 8,157 ----
*/
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.h2d.H2dBorderPerFrontierInterface;
! import org.fudaa.ebli.calque.ZCalqueAffichageDonneesMutliSelection;
! 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.palette.BPaletteCouleur;
! import org.fudaa.ebli.palette.BPaletteIcone;
import org.fudaa.fudaa.tr.TrResource;
/**
* @author deniger
* @version $Id$
*/
! public class TrCalqueCL extends ZCalqueAffichageDonneesMutliSelection {
! private TrModeleCL m_;
! public TrCalqueCL(TrModeleCL _cl) {
setTitle(TrResource.getS("points"));
+ m_= _cl;
+ }
+
+ public TrModeleCL getModeleCl(){
+ return (TrModeleCL)modeleDonnees();
+ }
+ /**
+ * @param _g
+ */
+ public void paintComponent(Graphics _g) {
+ super.paintComponent(_g);
+ if (isSelectionEmpty() || isRapide())
+ return;
+ int nombre= m_.getNombre();
+ if ((m_ == null) || (nombre <= 0))
+ 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();
+ //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();
+ GrPoint p= new GrPoint();
+ for (int i= selection_.getNbList(); i-- > 0;) {
+ it.advance();
+ H2dBorderPerFrontierInterface frontier= m_.getClFrontier(it.key());
+ int[] selected= ((EbliListeSelection)it.value()).getSelectedIndex();
+ for (int j= selected.length - 1; j >= 0; j--) {
+ m_.point(p, frontier.getCl(selected[j]).getIndexPt());
+ 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;
+ int nb= m_.getNbFrontier() - 1;
+ bClip= getClipReel(getGraphics());
+ GrPoint p= new GrPoint();
+ for (int i= nb; i >= 0; i--) {
+ H2dBorderPerFrontierInterface frontier= m_.getClFrontier(i);
+ int nbPt= frontier.getNbPt() - 1;
+ for (int j= nbPt; j >= 0; j--) {
+ m_.point(p, frontier.getCl(j).getIndexPt());
+ 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) {
+ GrBoite boitePoly= _poly.boite();
+ GrMorphisme versEcran= getVersEcran();
+ GrBoite bClip= getDomaine();
+ bClip.autoApplique(versEcran);
+ if (!boitePoly.intersectXY(bClip))
+ return null;
+ EbliListeSelectionMulti r= createSelection();
+ GrPoint p= new GrPoint();
+ int nb= m_.getNbFrontier() - 1;
+ bClip= getClipReel(getGraphics());
+ for (int i= nb; i >= 0; i--) {
+ H2dBorderPerFrontierInterface frontier= m_.getClFrontier(i);
+ int nbPt= frontier.getNbPt() - 1;
+ EbliListeSelection l= null;
+ for (int j= nbPt; j >= 0; j--) {
+ m_.point(p, frontier.getCl(j).getIndexPt());
+ if (bClip.contientXY(p)) {
+ p.autoApplique(versEcran);
+ if (boitePoly.contientXY(p)) {
+ if (_poly.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;
}
}
Index: TrGroupeCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrGroupeCL.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TrGroupeCL.java 10 Oct 2003 14:49:09 -0000 1.4
--- TrGroupeCL.java 29 Oct 2003 11:54:33 -0000 1.5
***************
*** 8,21 ****
*/
package org.fudaa.fudaa.tr.data;
-
import org.fudaa.dodico.h2d.H2dCLManagerInterface;
-
import org.fudaa.ebli.calque.BGroupeCalque;
import org.fudaa.ebli.calque.ContextuelDelegator;
-
import org.fudaa.fudaa.tr.TrContextMenuBuilder;
import org.fudaa.fudaa.tr.TrParametres;
import org.fudaa.fudaa.tr.TrResource;
-
/**
* @author deniger
--- 8,17 ----
***************
*** 24,54 ****
public class TrGroupeCL extends BGroupeCalque {
! H2dCLManagerInterface clm_;
!
!
! public TrGroupeCL(TrParametres _param){
! if(_param==null) throw new IllegalArgumentException("param null");
setTitle(TrResource.getS("cl"));
! TrCalqueBord cqBord=new TrCalqueBord(_param.createModelBord());
! cqBord.setName("cqBord");
! add(cqBord);
! TrCalqueCL cqCL=new TrCalqueCL(new TrModeleCLAbstract(_param.getH2dParametres().getMaillage()));
! cqCL.setName("cqCL");
! add(cqCL);
}
!
! public TrCalqueCL getCalqueCL(){
! return (TrCalqueCL)getCalqueParNom("cqCL");
}
!
! public TrCalqueBord getCalqueBord(){
! return (TrCalqueBord)getCalqueParNom("cqBord");
}
!
! public void setContextuelDelegator(TrContextMenuBuilder _d){
getCalqueCL().setContextuelDelegator(_d);
getCalqueBord().setContextuelDelegator(_d);
}
-
-
}
--- 20,46 ----
public class TrGroupeCL extends BGroupeCalque {
! public TrGroupeCL(){
setTitle(TrResource.getS("cl"));
! setDestructible(false);
}
! public final TrCalqueCL getCalqueCL() {
! return (TrCalqueCL)getCalqueParNom("cqCL");
}
! public final TrCalqueBord getCalqueBord() {
! return (TrCalqueBord)getCalqueParNom("cqBord");
}
! public final void addCalqueCL(TrCalqueCL _c) {
! _c.setName("cqCL");
! _c.setDestructible(false);
! add(_c);
! }
! public final void addCalqueBord(TrCalqueBord _c) {
! _c.setName("cqBord");
! _c.setDestructible(false);
! add(_c);
! }
! public final void setContextuelDelegator(TrContextMenuBuilder _d) {
getCalqueCL().setContextuelDelegator(_d);
getCalqueBord().setContextuelDelegator(_d);
}
}
Index: TrModeleBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrModeleBord.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TrModeleBord.java 8 Oct 2003 12:07:11 -0000 1.3
--- TrModeleBord.java 29 Oct 2003 11:54:33 -0000 1.4
***************
*** 1 ****
! /*
* @file ZModeleBord.java
* @creation 25 août 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.tr.data;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.reflux.H2dRefluxCLManager;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id$
*/
public interface TrModeleBord extends ZModeleDonnees {
/**
* Le nombre de frontiere du maillage
*/
public int getNbFrontier();
/**
* Renvoie le nombre de points de la frontiere d'indice
* <code>_idxFrontiere</code>
*/
public int getNbPoint(int _idxFrontiere);
/**
* Renvoie les bords de la frontiere _i
*/
public H2dBorderPerFrontierInterface getBord(int _idxFrontier);
/**
* Renvoie le nb de bord total ( addition du nb de bord de chaque frontiere).
*/
public int getNbTotalBord();
/**
* Renvoie le bord d'index general donne.
*/
public H2dBord getBordInIdxGeneral(int _idxGeneral);
/**
* Initialise <code>_p</code> a partir des donnees du point
* d'indice <code>_idxPtSurFrontiere</code>
* de la frontiere d'indice <code>_idxFrontiere</code>.
*/
public void getPoint(int _idxFrontiere, int _idxPtSurFrontiere, GrPoint _p);
}
\ No newline at end of file
--- 1 ----
! /*
* @file ZModeleBord.java
* @creation 25 août 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.tr.data;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.H2dCLManagerInterface;
import org.fudaa.dodico.h2d.reflux.H2dRefluxCLManager;
import org.fudaa.ebli.calque.ZModeleDonnees;
import org.fudaa.ebli.geometrie.GrPoint;
/**
* @author deniger
* @version $Id$
*/
public interface TrModeleBord extends ZModeleDonnees {
/**
* Le nombre de frontiere du maillage
*/
public int getNbFrontier();
/**
* Renvoie les bords de la frontiere _i
*/
public H2dBorderPerFrontierInterface getBord(int _idxFrontier);
/**
* Renvoie le nb de bord total ( addition du nb de bord de chaque frontiere).
*/
public int getNbTotalBord();
/**
* Renvoie le bord d'index general donne.
*/
public H2dBord getBordInIdxGeneral(int _idxGeneral);
/**
* Initialise <code>_p</code> a partir des donnees du point
* d'indice <code>_idxGlobal</code> sur le domaine
*/
public void getPoint(int _idxGlobal, GrPoint _p);
public H2dCLManagerInterface getClMng();
}
\ No newline at end of file
Index: TrModeleBordAdapter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrModeleBordAdapter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrModeleBordAdapter.java 23 Sep 2003 21:49:47 -0000 1.1
--- TrModeleBordAdapter.java 29 Oct 2003 11:54:33 -0000 1.2
***************
*** 63,67 ****
*/
public H2dBord getBordInIdxGeneral(int _idxGeneral) {
! return clMng_.getBordFromIdxGeneral(_idxGeneral);
}
--- 63,67 ----
*/
public H2dBord getBordInIdxGeneral(int _idxGeneral) {
! return clMng_.getBord(_idxGeneral);
}
***************
*** 69,74 ****
*
*/
! public void getPoint(int _idxFrontiere, int _idxPtSurFrontiere, GrPoint _p) {
! H2dPoint p= clMng_.getPoint(_idxFrontiere, _idxPtSurFrontiere);
_p.setCoordonnees(p.getX(), p.getY(), p.getZ());
}
--- 69,74 ----
*
*/
! public void getPoint(int _idxGlobal, GrPoint _p) {
! H2dPoint p= clMng_.getMaillage().getPt(_idxGlobal);
_p.setCoordonnees(p.getX(), p.getY(), p.getZ());
}
***************
*** 93,96 ****
--- 93,103 ----
public Object getObject(int _ind) {
return null;
+ }
+
+ /**
+ *
+ */
+ public H2dCLManagerInterface getClMng() {
+ return clMng_;
}
Index: TrModeleCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrModeleCL.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrModeleCL.java 23 Sep 2003 21:49:47 -0000 1.1
--- TrModeleCL.java 29 Oct 2003 11:54:33 -0000 1.2
***************
*** 9,13 ****
package org.fudaa.fudaa.tr.data;
! import org.fudaa.ebli.calque.ZModelePoint;
/**
--- 9,17 ----
package org.fudaa.fudaa.tr.data;
! import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
! import org.fudaa.dodico.h2d.H2dCLManagerInterface;
!
! import org.fudaa.ebli.calque.ZModeleDonnees;
! import org.fudaa.ebli.geometrie.GrPoint;
/**
***************
*** 15,19 ****
* @version $Id$
*/
! public interface TrModeleCL extends ZModelePoint {
--- 19,30 ----
* @version $Id$
*/
! public interface TrModeleCL extends ZModeleDonnees{
! public boolean point(GrPoint _p, int _idxGlobal) ;
!
! public int getNbFrontier();
!
! public H2dBorderPerFrontierInterface getClFrontier(int _i);
! public H2dCLManagerInterface getClMng();
!
Index: TrModeleCLAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrModeleCLAbstract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrModeleCLAbstract.java 23 Sep 2003 21:49:47 -0000 1.1
--- TrModeleCLAbstract.java 29 Oct 2003 11:54:33 -0000 1.2
***************
*** 9,13 ****
--- 9,16 ----
package org.fudaa.fudaa.tr.data;
+ import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
+ import org.fudaa.dodico.h2d.H2dCLManagerInterface;
import org.fudaa.dodico.h2d.H2dMaillage;
+ import org.fudaa.dodico.h2d.H2dPoint;
import org.fudaa.ebli.geometrie.GrBoite;
***************
*** 20,28 ****
public class TrModeleCLAbstract implements TrModeleCL {
! H2dMaillage m_;
! public TrModeleCLAbstract(H2dMaillage _m){
! if(_m==null) throw new IllegalArgumentException("param null");
! m_=_m;
}
--- 23,31 ----
public class TrModeleCLAbstract implements TrModeleCL {
! private H2dCLManagerInterface clMng_;
! public TrModeleCLAbstract(H2dCLManagerInterface _clMng){
! if(_clMng==null) throw new IllegalArgumentException("param null");
! clMng_=_clMng;
}
***************
*** 30,44 ****
*
*/
! public boolean point(GrPoint _p, int _i) {
! int idxGeneral=m_.getPtsFrontiere().getIdxGeneral(_i);
! TrCalqueMaillage.initGrPoint(m_.getPt(idxGeneral), _p);
! return idxGeneral>=0;
}
!
/**
*
*/
public GrBoite getDomaine() {
! return TrCalqueMaillage.getDomaine(m_);
}
--- 33,55 ----
*
*/
! public boolean point(GrPoint _p, int _idxGlobal) {
! H2dPoint p= clMng_.getMaillage().getPt(_idxGlobal);
! _p.setCoordonnees(p.getX(),p.getY(), p.getZ());
! return true;
}
!
! public int getNbFrontier(){
! return clMng_.getNbFrontiere();
! }
!
! public H2dBorderPerFrontierInterface getClFrontier(int _i){
! return clMng_.getBordPerFrontier(_i);
! }
!
/**
*
*/
public GrBoite getDomaine() {
! return TrCalqueMaillage.getDomaine(clMng_.getMaillage());
}
***************
*** 47,51 ****
*/
public int getNombre() {
! return m_.getPtsFrontiere().getNbTotalPt();
}
--- 58,62 ----
*/
public int getNombre() {
! return clMng_.getMaillage().getPtsFrontiere().getNbTotalPt();
}
***************
*** 55,58 ****
--- 66,76 ----
public Object getObject(int _ind) {
return null;
+ }
+
+ /**
+ *
+ */
+ public H2dCLManagerInterface getClMng() {
+ return clMng_;
}
|
|
From: <de...@us...> - 2003-10-29 11:54:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/test/tr
Modified Files:
TestTelemacCasViewer.java
Log Message:
boundary condition edition for telemac
Index: TestTelemacCasViewer.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test/tr/TestTelemacCasViewer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestTelemacCasViewer.java 6 Oct 2003 08:09:06 -0000 1.6
--- TestTelemacCasViewer.java 29 Oct 2003 11:54:33 -0000 1.7
***************
*** 1 ****
! /*
* @file TestTelemacCasViewer.java
* @creation 12 mai 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.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import javax.swing.JFrame;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
import org.fudaa.fudaa.dico.FDicoEntitePanel;
import org.fudaa.fudaa.tr.TrPreferences;
import org.fudaa.fudaa.tr.telemac.TrTelemacProjectFactory;
import org.fudaa.fudaa.tr.telemac.TrTelemacProjet;
/**
* @author deniger
* @version $Id$
*/
public class TestTelemacCasViewer extends JFrame {
public TestTelemacCasViewer(File _fileCas) {
TrTelemacProjet p=
TrTelemacProjectFactory.createTelemacProject(
_fileCas,
(Telemac2dFileFormat.TelemacVersion)Telemac2dFileFormat
.getInstance()
.getLastVersionImpl(),
null,
null);
initFrame(p);
}
private final void initFrame(TrTelemacProjet _param) {
if (_param == null) {
System.err.println("params nuls");
}
if (_param != null) {
FDicoEntitePanel pn=
new FDicoEntitePanel(_param.getKeys().getDicoParams());
setContentPane(pn);
}
}
public static void main(String[] args) {
HashMap arg= DodicoLib.parseArgs(args);
String fileName= (String)arg.get("-f");
File f= null;
if (fileName == null) {
System.err.println("fichier null -> fichier par defaut");
URL url= TestTelemacCasViewer.class.getResource("cas1.txt");
if (url != null)
f= new File(url.getPath());
} else {
f= new File(fileName);
}
if ((f == null) || (!f.exists())) {
System.err.println("Fichier non trouvé");
return;
}
TestTelemacCasViewer frame= new TestTelemacCasViewer(f);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent _e) {
TrPreferences.TR.writeIniFile();
System.exit(0);
}
});
frame.pack();
frame.setSize(800, 800);
frame.setVisible(true);
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestTelemacCasViewer.java
* @creation 12 mai 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.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import javax.swing.JFrame;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
import org.fudaa.fudaa.dico.FDicoEntitePanel;
import org.fudaa.fudaa.dico.FDicoEntiteTableModel;
import org.fudaa.fudaa.tr.TrPreferences;
import org.fudaa.fudaa.tr.telemac.TrTelemacProjectFactory;
import org.fudaa.fudaa.tr.telemac.TrTelemac2dProject;
/**
* @author deniger
* @version $Id$
*/
public class TestTelemacCasViewer extends JFrame {
public TestTelemacCasViewer(File _fileCas) {
TrTelemac2dProject p=
TrTelemacProjectFactory.createTelemacProject(
_fileCas,
(Telemac2dFileFormat.TelemacVersion)Telemac2dFileFormat
.getInstance()
.getLastVersionImpl(),
null,
null);
initFrame(p);
}
private final void initFrame(TrTelemac2dProject _param) {
if (_param == null) {
System.err.println("params nuls");
}
if (_param != null) {
FDicoEntitePanel pn=
new FDicoEntitePanel(new FDicoEntiteTableModel(_param.getKeys().getDicoParams(),null));
setContentPane(pn);
}
}
public static void main(String[] args) {
HashMap arg= DodicoLib.parseArgs(args);
String fileName= (String)arg.get("-f");
File f= null;
if (fileName == null) {
System.err.println("fichier null -> fichier par defaut");
URL url= TestTelemacCasViewer.class.getResource("cas1.txt");
if (url != null)
f= new File(url.getPath());
} else {
f= new File(fileName);
}
if ((f == null) || (!f.exists())) {
System.err.println("Fichier non trouvé");
return;
}
TestTelemacCasViewer frame= new TestTelemacCasViewer(f);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent _e) {
TrPreferences.TR.writeIniFile();
System.exit(0);
}
});
frame.pack();
frame.setSize(800, 800);
frame.setVisible(true);
}
}
\ No newline at end of file
|
|
From: <de...@us...> - 2003-10-29 11:54:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/ressource
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/ressource
Modified Files:
fudaa_en.fr_txt fudaa_en.txt
Log Message:
boundary condition edition for telemac
Index: fudaa_en.fr_txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.fr_txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fudaa_en.fr_txt 8 Oct 2003 12:07:11 -0000 1.6
--- fudaa_en.fr_txt 29 Oct 2003 11:54:33 -0000 1.7
***************
*** 178,180 ****
Export=Export
Tous_droits_réservés=All_Rights_reserved
! Equipes_Dodico,_Ebli_et_Fudaa=Dodico,_Ebli_and_Fudaa_teams
\ No newline at end of file
--- 178,182 ----
Export=Export
Tous_droits_réservés=All_Rights_reserved
! Equipes_Dodico,_Ebli_et_Fudaa=Dodico,_Ebli_and_Fudaa_teams
! Le_fichier_{0}_ne_peut_pas_être_écrit._Vérifier_les_droits_utilisateur_de_votre_système=The_file_{0}_can't_be_written._Please,_check_the_file_access_permissions
! Supprimer_une_frontière_liquide=Remove_a_liquid_boundary
\ No newline at end of file
Index: fudaa_en.txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/ressource/fudaa_en.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fudaa_en.txt 8 Oct 2003 12:07:11 -0000 1.5
--- fudaa_en.txt 29 Oct 2003 11:54:33 -0000 1.6
***************
*** 179,180 ****
--- 179,182 ----
Tous_droits_r\u00e9serv\u00e9s=All_Rights_reserved
Equipes_Dodico,_Ebli_et_Fudaa=Dodico,_Ebli_and_Fudaa_teams
+ Le_fichier_{0}_ne_peut_pas_\u00eatre_\u00e9crit._V\u00e9rifier_les_droits_utilisateur_de_votre_syst\u00e8me=The_file_{0}_can't_be_written._Please,_check_the_file_access_permissions
+ Supprimer_une_fronti\u00e8re_liquide=Remove_a_liquid_boundary
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/tableau
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/commun/tableau
Modified Files:
FudaaCellBooleanEditor.java FudaaCellDialogEditor.java
FudaaPanelListEditorModel.java
Log Message:
boundary condition edition for telemac
Index: FudaaCellBooleanEditor.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/tableau/FudaaCellBooleanEditor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FudaaCellBooleanEditor.java 23 Sep 2003 21:08:06 -0000 1.2
--- FudaaCellBooleanEditor.java 29 Oct 2003 11:54:32 -0000 1.3
***************
*** 1,173 ****
! /*
! * @file TrCellBooleanEditor.java
! * @creation 13 mai 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.tableau;
!
! import java.awt.Component;
! import java.awt.event.ActionEvent;
! import java.awt.event.ActionListener;
! import java.awt.event.MouseEvent;
! import java.util.EventObject;
!
! import javax.swing.JTable;
! import javax.swing.event.CellEditorListener;
! import javax.swing.event.ChangeEvent;
! import javax.swing.table.TableCellEditor;
!
! import com.memoire.bu.BuCheckBox;
!
! /**
! * @author deniger
! * @version $Id$
! */
! public class FudaaCellBooleanEditor extends BuCheckBox implements TableCellEditor, ActionListener
! {
! private String trueValue_;
! private String falseValue_;
! private String oldValue_;
! private boolean oldBooleanValue_;
!
! public FudaaCellBooleanEditor()
! {
!
! this("true", "false");
! }
!
! public FudaaCellBooleanEditor(String _trueValue, String _falseValue)
! {
! trueValue_ = _trueValue;
! falseValue_ = _falseValue;
! addActionListener(this);
! setOpaque(true);
! }
!
! /**
! *
! */
! public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
! {
! setValue(value);
! return this;
! }
!
! /**
! *
! */
! public Object getCellEditorValue()
! {
! if (isSelected() == oldBooleanValue_)
! return oldValue_;
! else
! return isSelected() ? trueValue_ : falseValue_;
! }
!
! /**
! *
! */
! public boolean isCellEditable(EventObject anEvent)
! {
! return true;
! }
!
! /**
! *
! */
! public boolean shouldSelectCell(EventObject anEvent)
! {
! if (anEvent instanceof MouseEvent)
! {
! MouseEvent e = (MouseEvent) anEvent;
! return e.getID() != MouseEvent.MOUSE_DRAGGED;
! }
! return true;
! }
!
! /**
! *
! */
! public boolean stopCellEditing()
! {
! Object[] listeners = listenerList.getListenerList();
! for (int i = listeners.length - 2; i >= 0; i -= 2)
! {
! if (listeners[i] == CellEditorListener.class)
! {
! if (changeEvent == null)
! changeEvent = new ChangeEvent(this);
! ((CellEditorListener) listeners[i + 1]).editingStopped(changeEvent);
! }
! }
! return true;
! }
!
! public void setValue(Object _o)
! {
! oldValue_ = (String) _o;
! if (trueValue_ == oldValue_)
! setValue(true);
! else if (falseValue_ == oldValue_)
! setValue(false);
! else
! setValue(getValue(_o));
! }
!
! public boolean getValue(Object value)
! {
! return Boolean.getBoolean(value.toString());
! }
!
! public void setValue(boolean _b)
! {
! setSelected(_b);
! oldBooleanValue_ = _b;
! }
!
! /**
! *
! */
! public void cancelCellEditing()
! {
! Object[] listeners = listenerList.getListenerList();
! for (int i = listeners.length - 2; i >= 0; i -= 2)
! {
! if (listeners[i] == CellEditorListener.class)
! {
! if (changeEvent == null)
! changeEvent = new ChangeEvent(this);
! ((CellEditorListener) listeners[i + 1]).editingCanceled(changeEvent);
! }
! }
! }
!
! /**
! *
! */
! public void addCellEditorListener(CellEditorListener l)
! {
!
! listenerList.add(CellEditorListener.class, l);
! }
!
! /**
! *
! */
! public void removeCellEditorListener(CellEditorListener l)
! {
! listenerList.remove(CellEditorListener.class, l);
!
! }
!
! /**
! *
! */
! public void actionPerformed(ActionEvent e)
! {
! stopCellEditing();
! }
!
! }
--- 1 ----
! /*
* @file TrCellBooleanEditor.java
* @creation 13 mai 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.tableau;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JTable;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
import com.memoire.bu.BuCheckBox;
/**
* @author deniger
* @version $Id$
*/
public class FudaaCellBooleanEditor extends DefaultCellEditor {
public FudaaCellBooleanEditor() {
super(new BuCheckBox());
final JCheckBox ch= ((JCheckBox)editorComponent);
delegate= new EditorDelegate() {
public void setValue(Object value) {
ch.setSelected(getBooleanValue(value));
}
public Object getCellEditorValue() {
return getObjectValue(ch.isSelected());
}
};
}
public boolean getBooleanValue(Object _o) {
if (_o instanceof Boolean) {
return ((Boolean)_o).booleanValue();
} else if (_o instanceof String) {
return _o.equals("true");
}
return false;
}
public Object getObjectValue(boolean _o) {
return _o?Boolean.TRUE:Boolean.FALSE;
}
}
\ No newline at end of file
Index: FudaaCellDialogEditor.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/tableau/FudaaCellDialogEditor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FudaaCellDialogEditor.java 23 Sep 2003 21:08:06 -0000 1.2
--- FudaaCellDialogEditor.java 29 Oct 2003 11:54:32 -0000 1.3
***************
*** 1,219 ****
! /*
! * @file TrCellDialogEditor.java
! * @creation 13 mai 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.tableau;
!
! import java.awt.Component;
! import java.awt.event.ActionEvent;
! import java.awt.event.ActionListener;
! import java.awt.event.MouseEvent;
! import java.awt.event.MouseListener;
! import java.util.EventObject;
!
! import javax.swing.DefaultCellEditor;
! import javax.swing.JButton;
! import javax.swing.JOptionPane;
! import javax.swing.JTable;
! import javax.swing.SwingUtilities;
! import javax.swing.UIManager;
! import javax.swing.event.CellEditorListener;
! import javax.swing.event.ChangeEvent;
! import javax.swing.table.DefaultTableCellRenderer;
! import javax.swing.table.TableCellEditor;
!
! import com.memoire.bu.BuButton;
!
! import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
!
! /**
! * @author deniger
! * @version $Id$
! */
! public class FudaaCellDialogEditor extends JButton implements TableCellEditor, ActionListener
! {
! protected EbliSimpleDialogPanel dialog_;
! private transient ChangeEvent changeEvent = null;
! private FudaaCellDecorator decorator_;
! private Object value_;
! private boolean doubleClick_;
!
! public FudaaCellDialogEditor(EbliSimpleDialogPanel _dialog)
! {
! this(_dialog, null);
! }
!
! public FudaaCellDialogEditor(EbliSimpleDialogPanel _dialog, FudaaCellDecorator _deco)
! {
! setOpaque(false);
! setEnabled(true);
! addActionListener(this);
! decorator_ = _deco;
! setBorder(UIManager.getBorder("Label.border"));
! setFont(UIManager.getFont("Table.font"));
! setHorizontalAlignment(0);
! dialog_ = _dialog;
! }
!
! /**
! *
! */
! public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
! {
! value_ = value;
! setValue(value);
! if (decorator_ != null)
! decorator_.decore(this, table, value, row, column);
! return this;
! }
!
! public void setValue(Object _o)
! {
! setText(_o.toString());
! }
!
! /**
! *
! */
! public Object getCellEditorValue()
! {
! return value_;
! }
!
! /**
! *
! */
! public boolean isCellEditable(EventObject anEvent)
! {
! if(!doubleClick_) return true;
! if (anEvent instanceof MouseEvent)
! {
! return ((MouseEvent) anEvent).getClickCount() >= 2;
! }
! return true;
! }
!
! /**
! *
! */
! public boolean shouldSelectCell(EventObject anEvent)
! {
! return true;
! }
!
! /**
! *
! */
! public void cancelCellEditing()
! {
! Object[] listeners = listenerList.getListenerList();
! for (int i = listeners.length - 2; i >= 0; i -= 2)
! {
! if (listeners[i] == CellEditorListener.class)
! {
! if (changeEvent == null)
! changeEvent = new ChangeEvent(this);
! ((CellEditorListener) listeners[i + 1]).editingCanceled(changeEvent);
! }
! }
! }
!
! /**
! *
! */
! public void addCellEditorListener(CellEditorListener l)
! {
!
! listenerList.add(CellEditorListener.class, l);
! }
!
! /**
! *
! */
! public void removeCellEditorListener(CellEditorListener l)
! {
! listenerList.remove(CellEditorListener.class, l);
!
! }
! public boolean stopCellEditing()
! {
! Object[] listeners = listenerList.getListenerList();
! for (int i = listeners.length - 2; i >= 0; i -= 2)
! {
! if (listeners[i] == CellEditorListener.class)
! {
! if (changeEvent == null)
! changeEvent = new ChangeEvent(this);
! ((CellEditorListener) listeners[i + 1]).editingStopped(changeEvent);
! }
! }
! return false;
! }
!
! private void go()
! {
! dialog_.setValue(value_);
! dialog_.doLayout();
! int r = dialog_.afficheModale(this);
! if (EbliSimpleDialogPanel.isOkResponse(r))
! {
! value_=dialog_.getValue();
! setValue(value_);
! stopCellEditing();
! }
! else
! cancelCellEditing();
! if (getParent() != null)
! {
! getParent().requestFocus();
! }
!
! // }
!
! }
!
! /**
! *
! */
! public void actionPerformed(ActionEvent _ae)
! {
! go();
! }
!
! /**
! *
! */
! public FudaaCellDecorator getDecorator()
! {
! return decorator_;
! }
!
! /**
! *
! */
! public void setDecorator(FudaaCellDecorator _decorator)
! {
! decorator_ = _decorator;
! }
!
! /**
! *
! */
! public boolean isDoubleClick()
! {
! return doubleClick_;
! }
!
! /**
! *
! */
! public void setDoubleClick(boolean _b)
! {
! doubleClick_ = _b;
! }
!
! }
--- 1 ----
! /*
* @file TrCellDialogEditor.java
* @creation 13 mai 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.tableau;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.EventObject;
import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import com.memoire.bu.BuButton;
import org.fudaa.ebli.dialog.EbliSimpleDialogPanel;
/**
* @author deniger
* @version $Id$
*/
public class FudaaCellDialogEditor
extends JButton
implements TableCellEditor, ActionListener {
protected EbliSimpleDialogPanel dialog_;
private transient ChangeEvent changeEvent= null;
private FudaaCellDecorator decorator_;
private Object value_;
private boolean doubleClick_;
public FudaaCellDialogEditor(EbliSimpleDialogPanel _dialog) {
this(_dialog, null);
}
public FudaaCellDialogEditor(
EbliSimpleDialogPanel _dialog,
FudaaCellDecorator _deco) {
setOpaque(false);
setEnabled(true);
addActionListener(this);
decorator_= _deco;
setBorder(UIManager.getBorder("Label.border"));
setFont(UIManager.getFont("Table.font"));
setHorizontalAlignment(0);
dialog_= _dialog;
}
/**
*
*/
public Component getTableCellEditorComponent(
JTable table,
Object value,
boolean isSelected,
int row,
int column) {
value_= value;
setValue(value);
if (decorator_ != null)
decorator_.decore(this, table, value, row, column);
return this;
}
public void setValue(Object _o) {
setText(_o.toString());
}
/**
*
*/
public Object getCellEditorValue() {
return value_;
}
/**
*
*/
public boolean isCellEditable(EventObject anEvent) {
if (!doubleClick_)
return true;
if (anEvent instanceof MouseEvent) {
return ((MouseEvent)anEvent).getClickCount() >= 2;
}
return true;
}
/**
*
*/
public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
/**
*
*/
public void cancelCellEditing() {
Object[] listeners= listenerList.getListenerList();
for (int i= listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == CellEditorListener.class) {
if (changeEvent == null)
changeEvent= new ChangeEvent(this);
((CellEditorListener)listeners[i + 1]).editingCanceled(changeEvent);
}
}
}
/**
*
*/
public void addCellEditorListener(CellEditorListener l) {
listenerList.add(CellEditorListener.class, l);
}
/**
*
*/
public void removeCellEditorListener(CellEditorListener l) {
listenerList.remove(CellEditorListener.class, l);
}
public boolean stopCellEditing() {
Object[] listeners= listenerList.getListenerList();
for (int i= listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == CellEditorListener.class) {
if (changeEvent == null)
changeEvent= new ChangeEvent(this);
((CellEditorListener)listeners[i + 1]).editingStopped(changeEvent);
}
}
return false;
}
private void go() {
dialog_.setValue(value_);
dialog_.doLayout();
int r= dialog_.afficheModale(this);
if (EbliSimpleDialogPanel.isOkResponse(r)) {
value_= dialog_.getValue();
setValue(value_);
stopCellEditing();
} else
cancelCellEditing();
if (getParent() != null) {
getParent().requestFocus();
}
// }
}
/**
*
*/
public void actionPerformed(ActionEvent _ae) {
go();
}
/**
*
*/
public FudaaCellDecorator getDecorator() {
return decorator_;
}
/**
*
*/
public void setDecorator(FudaaCellDecorator _decorator) {
decorator_= _decorator;
}
/**
*
*/
public boolean isDoubleClick() {
return doubleClick_;
}
/**
*
*/
public void setDoubleClick(boolean _b) {
doubleClick_= _b;
}
}
\ No newline at end of file
Index: FudaaPanelListEditorModel.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/tableau/FudaaPanelListEditorModel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FudaaPanelListEditorModel.java 23 Sep 2003 21:08:07 -0000 1.2
--- FudaaPanelListEditorModel.java 29 Oct 2003 11:54:32 -0000 1.3
***************
*** 1,431 ****
! /*
! * @file FudaaListSelectionModelDefault.java
! * @creation 28 mai 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.tableau;
!
! import java.util.Arrays;
! import java.util.Collections;
! import java.util.List;
! import java.util.Vector;
!
! import javax.swing.AbstractListModel;
! import javax.swing.ComboBoxModel;
! import javax.swing.ListSelectionModel;
! import javax.swing.MutableComboBoxModel;
! import javax.swing.table.AbstractTableModel;
!
! import org.fudaa.dodico.commun.DodicoLib;
!
! /**
! * Le model attache au panel FudaaPanelListEditor.
! * @author deniger
! * @version $Id$
! */
! public class FudaaPanelListEditorModel extends AbstractTableModel {
!
! Vector v_;
! private boolean showNumber_;
! private int maxValueNb_;
! Vector proposedValues_;
! Object defaultValue_;
!
! public FudaaPanelListEditorModel() {
! this(-1);
! }
!
! public FudaaPanelListEditorModel(boolean _showNumber) {
! this(Collections.EMPTY_LIST, _showNumber, -1);
! }
!
! public FudaaPanelListEditorModel(int _maxNumber) {
! this(new Vector(_maxNumber > 0 ? _maxNumber : 10), false, _maxNumber);
! }
!
! /**
! * @param _l la liste des elements initiaux
! * @param _showNumber si true la premiere colonne affiche le num de ligne
! */
! public FudaaPanelListEditorModel(List _l, boolean _showNumber) {
! this(_l, _showNumber, -1);
! }
!
! public FudaaPanelListEditorModel(
! List _l,
! boolean _showNumber,
! int _maxNbValue) {
! this(new Vector(_l), _showNumber, _maxNbValue);
! }
!
! /**
! * @param _o tableau des elements initiaux
! * @param _showNumber si true la premiere colonne affiche le num de ligne
! */
! public FudaaPanelListEditorModel(Object[] _o, boolean _showNumber) {
! this(Arrays.asList(_o), _showNumber, -1);
! }
!
! public FudaaPanelListEditorModel(
! Object[] _o,
! boolean _showNumber,
! int _maxNbValue) {
! this(new Vector(Arrays.asList(_o)), _showNumber, _maxNbValue);
! }
!
! private FudaaPanelListEditorModel(
! Vector _v,
! boolean _showNumber,
! int _maxValueNb) {
! v_= _v;
! maxValueNb_= _maxValueNb;
! if ((maxValueNb_ > 0) && (v_.size() > _maxValueNb)) {
! v_.setSize(maxValueNb_);
! }
! showNumber_= _showNumber;
! defaultValue_=DodicoLib.EMPTY_STRING;
! }
!
! public void remove(ListSelectionModel _m) {
! if ((_m.isSelectionEmpty()) || (!canRemove()))
! return;
! int min= _m.getMinSelectionIndex();
! int max= _m.getMaxSelectionIndex();
! max= max >= v_.size() ? v_.size() - 1 : max;
! for (int i= max; i >= min; i--) {
! if (_m.isSelectedIndex(i)) {
! v_.remove(i);
! }
!
! }
! fireTableRowsDeleted(min, max);
! }
!
! public void addElement(Object _o) {
! if (canAdd()) {
! v_.add(_o);
! fireTableRowsInserted(v_.size() - 1, v_.size() - 1);
! }
! }
!
! public void getValues(Object[] _o) {
! v_.toArray(_o);
! }
!
! public Object[] getValues() {
! return v_.toArray();
! }
!
! public boolean canAdd() {
! return ((maxValueNb_ < 0) || (v_.size() < maxValueNb_));
! }
!
! public boolean canRemove() {
! return v_.size() > 0;
! }
!
! public void add(int _i, Object _o) {
! if (canAdd()) {
! v_.add(_i, _o);
! fireTableRowsInserted(_i, _i);
! }
! }
!
! public boolean isEmpty() {
! return v_.isEmpty();
! }
!
! /**
! *
! */
! public int getColumnCount() {
! return showNumber_ ? 2 : 1;
! }
!
! /**
! *
! */
! public int getRowCount() {
! return v_.size();
! }
!
! /**
! *
! */
! public Object getValueAt(int _row, int _col) {
! if (showNumber_) {
! if (_col == 0)
! return DodicoLib.getString(_row + 1);
! else if (_col == 1)
! return v_.get(_row);
! } else if (_col == 0) {
! return v_.get(_row);
! }
! return null;
! }
!
! public int getIndexOf(Object _o) {
! return v_.indexOf(_o);
! }
!
! public Object getValueAt(int _i) {
! if ((_i >= 0) && (_i < v_.size())) {
! return v_.get(_i);
! } else
! return null;
!
! }
!
! /**
! *
! */
! public boolean isCellEditable(int rowIndex, int columnIndex) {
! return showNumber_ ? (columnIndex == 1 ? true : false) : true;
! }
!
! /**
! *
! */
! public Class getColumnClass(int columnIndex) {
! return String.class;
! }
!
! /**
! *
! */
! public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
! v_.set(rowIndex, aValue);
! }
!
! /**
! * @return
! */
! public boolean isShowNumber() {
! return showNumber_;
! }
!
! public void setData(Object[] _o) {
! v_.removeAllElements();
! if (_o != null) {
!
! int n= _o.length;
! if (maxValueNb_ > 0) {
! n= n > maxValueNb_ ? maxValueNb_ : n;
! }
! v_.ensureCapacity(n);
! for (int i= 0; i < n; i++) {
! v_.add(_o[i]);
! }
! }
! fireTableDataChanged();
! }
!
! /**
! *
! */
! public int getMaxValueNb() {
! return maxValueNb_;
! }
!
! /**
! *
! */
! public void setMaxValueNb(int _i) {
! if (_i != maxValueNb_) {
! maxValueNb_= _i;
! int n= v_.size();
! if ((maxValueNb_ > 0) && (v_.size() > maxValueNb_)) {
! v_.setSize(maxValueNb_);
! fireTableRowsDeleted(maxValueNb_, n - 1);
! }
! }
! }
!
! public void setProposedValues(Object[] _o) {
! if (_o == null)
! return;
!
! else {
! if (proposedValues_ == null) {
!
! proposedValues_= new Vector(_o.length);
! } else {
! proposedValues_.clear();
! proposedValues_.ensureCapacity(_o.length);
! }
! int n= _o.length;
! for (int i= 0; i < n; i++) {
! proposedValues_.add(_o[i]);
! }
! }
! }
!
! public void setProposedValue(Object _o) {
! if (_o == null)
! return;
!
! else {
! if (proposedValues_ == null) {
!
! proposedValues_= new Vector(10);
! } else {
! proposedValues_.clear();
! proposedValues_.ensureCapacity(10);
! }
! proposedValues_.add(_o);
! }
! }
!
! public void addProposedValue(Object _o) {
! if (_o == null)
! return;
! if (proposedValues_ == null)
! setProposedValue(_o);
! else
! proposedValues_.add(_o);
! }
!
! public void addProposedValuesIfNotPresent(Object[] _o) {
! if (_o == null)
! return;
! if (proposedValues_ == null)
! setProposedValues(_o);
! else {
! int n= _o.length;
! for (int i= 0; i < n; i++) {
! if ((_o[i] != null) && (!proposedValues_.contains(_o[i])))
! proposedValues_.add(_o[i]);
! }
! }
! }
!
! public void addProposedValues(Object[] _o) {
! if (_o == null)
! return;
! if (proposedValues_ == null)
! setProposedValues(_o);
! else {
! int n= _o.length;
! for (int i= 0; i < n; i++) {
! if (_o[i] != null)
! proposedValues_.add(_o[i]);
! }
! }
! }
!
! public void emptyProposedValue() {
! if (proposedValues_ != null)
! proposedValues_.clear();
! }
!
! public boolean isProposedValueEmpty() {
! return proposedValues_ == null ? true : proposedValues_.isEmpty();
! }
!
! public void setDefaultValue(Object _o){
! defaultValue_=_o;
! }
!
! public Object createNewObject() {
! return defaultValue_;
! }
!
! public boolean actionAdd() {
! int n= v_.size();
! if ((maxValueNb_ > 0) && (n == maxValueNb_)) {
! return false;
! }
! if ((proposedValues_ != null) && (n < proposedValues_.size())) {
! addElement(proposedValues_.get(n));
! } else {
! Object o= createNewObject();
! if (o == null)
! return false;
! else
! addElement(o);
! }
! return true;
! }
!
! public boolean actionInserer(int _r) {
! int n= v_.size();
! if ((maxValueNb_ > 0) && (n == maxValueNb_)) {
! return false;
! }
! if ((proposedValues_ != null) && (_r < proposedValues_.size())) {
! add(_r, proposedValues_.get(_r));
! } else {
! Object o= createNewObject();
! if (o == null)
! return false;
! else
! add(_r, o);
! }
! return true;
! }
!
! public int getValueNb() {
! return v_.size();
! }
!
! public List getValuesInList() {
! return new Vector(v_);
! }
!
! /**
! *
! */
! public String getColumnName(int column) {
! return DodicoLib.EMPTY_STRING;
! }
!
! /**
! * Renvoie une model correspondant Attention ce model n'envoie pas d'evenements si le model
! * englobant est modifie;
! */
! public ComboBoxModel createComboBoxModel() {
! return new ListEditorComboBoxModel();
! }
!
! public class ListEditorComboBoxModel
! extends AbstractListModel
! implements ComboBoxModel {
!
! private Object selected_;
!
! public Object getElementAt(int _i) {
! return v_.get(_i);
! }
!
! public int getSize() {
! return v_.size();
! }
!
! public void update() {
! fireContentsChanged(this, 0, getSize());
! }
!
! /**
! *
! */
! public Object getSelectedItem() {
! return selected_;
! }
!
! /**
! *
! */
! public void setSelectedItem(Object anItem) {
! if ((selected_ == null && anItem != null)
! || (selected_ != null && !selected_.equals(anItem))) {
! selected_= anItem;
! fireContentsChanged(this, -1, -1);
! }
! }
!
! };
!
! }
--- 1 ----
! /*
* @file FudaaListSelectionModelDefault.java
* @creation 28 mai 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.tableau;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Vector;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
import javax.swing.ListSelectionModel;
import javax.swing.MutableComboBoxModel;
import javax.swing.table.AbstractTableModel;
import org.fudaa.dodico.commun.DodicoLib;
/**
* Le model attache au panel FudaaPanelListEditor.
* @author deniger
* @version $Id$
*/
public class FudaaPanelListEditorModel extends AbstractTableModel {
Vector v_;
private boolean showNumber_;
private int maxValueNb_;
Vector proposedValues_;
Object defaultValue_;
public FudaaPanelListEditorModel() {
this(-1);
}
public FudaaPanelListEditorModel(boolean _showNumber) {
this(Collections.EMPTY_LIST, _showNumber, -1);
}
public FudaaPanelListEditorModel(int _maxNumber) {
this(new Vector(_maxNumber > 0 ? _maxNumber : 10), false, _maxNumber);
}
/**
* @param _l la liste des elements initiaux
* @param _showNumber si true la premiere colonne affiche le num de ligne
*/
public FudaaPanelListEditorModel(List _l, boolean _showNumber) {
this(_l, _showNumber, -1);
}
public FudaaPanelListEditorModel(
List _l,
boolean _showNumber,
int _maxNbValue) {
this(new Vector(_l), _showNumber, _maxNbValue);
}
/**
* @param _o tableau des elements initiaux
* @param _showNumber si true la premiere colonne affiche le num de ligne
*/
public FudaaPanelListEditorModel(Object[] _o, boolean _showNumber) {
this(Arrays.asList(_o), _showNumber, -1);
}
public FudaaPanelListEditorModel(
Object[] _o,
boolean _showNumber,
int _maxNbValue) {
this(new Vector(Arrays.asList(_o)), _showNumber, _maxNbValue);
}
private FudaaPanelListEditorModel(
Vector _v,
boolean _showNumber,
int _maxValueNb) {
v_= _v;
maxValueNb_= _maxValueNb;
if ((maxValueNb_ > 0) && (v_.size() > _maxValueNb)) {
v_.setSize(maxValueNb_);
}
showNumber_= _showNumber;
defaultValue_= DodicoLib.EMPTY_STRING;
}
public void remove(ListSelectionModel _m) {
if ((_m.isSelectionEmpty()) || (!canRemove()))
return;
int min= _m.getMinSelectionIndex();
int max= _m.getMaxSelectionIndex();
max= max >= v_.size() ? v_.size() - 1 : max;
for (int i= max; i >= min; i--) {
if (_m.isSelectedIndex(i)) {
v_.remove(i);
}
}
fireTableRowsDeleted(min, max);
}
public void addElement(Object _o) {
if (canAdd()) {
v_.add(_o);
fireTableRowsInserted(v_.size() - 1, v_.size() - 1);
}
}
public void getValues(Object[] _o) {
v_.toArray(_o);
}
public Object[] getValues() {
return v_.toArray();
}
public boolean canAdd() {
return ((maxValueNb_ < 0) || (v_.size() < maxValueNb_));
}
public boolean canRemove() {
return v_.size() > 0;
}
public void add(int _i, Object _o) {
if (canAdd()) {
v_.add(_i, _o);
fireTableRowsInserted(_i, _i);
}
}
public boolean isEmpty() {
return v_.isEmpty();
}
/**
*
*/
public int getColumnCount() {
return showNumber_ ? 2 : 1;
}
/**
*
*/
public int getRowCount() {
return v_.size();
}
/**
*
*/
public Object getValueAt(int _row, int _col) {
if (showNumber_) {
if (_col == 0)
return DodicoLib.getString(_row + 1);
else if (_col == 1)
return v_.get(_row);
} else if (_col == 0) {
return v_.get(_row);
}
return null;
}
public int getIndexOf(Object _o) {
return v_.indexOf(_o);
}
public Object getValueAt(int _i) {
if ((_i >= 0) && (_i < v_.size())) {
return v_.get(_i);
} else
return null;
}
/**
*
*/
public boolean isCellEditable(int rowIndex, int columnIndex) {
return showNumber_ ? (columnIndex == 1 ? true : false) : true;
}
/**
*
*/
public Class getColumnClass(int columnIndex) {
return String.class;
}
/**
*
*/
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
v_.set(rowIndex, aValue);
}
/**
* @return
*/
public boolean isShowNumber() {
return showNumber_;
}
public void setData(Object[] _o) {
v_.removeAllElements();
if (_o != null) {
int n= _o.length;
if (maxValueNb_ > 0) {
n= n > maxValueNb_ ? maxValueNb_ : n;
}
v_.ensureCapacity(n);
for (int i= 0; i < n; i++) {
v_.add(_o[i]);
}
}
fireTableDataChanged();
}
/**
*
*/
public int getMaxValueNb() {
return maxValueNb_;
}
/**
*
*/
public void setMaxValueNb(int _i) {
if (_i != maxValueNb_) {
maxValueNb_= _i;
int n= v_.size();
if ((maxValueNb_ > 0) && (v_.size() > maxValueNb_)) {
v_.setSize(maxValueNb_);
fireTableRowsDeleted(maxValueNb_, n - 1);
}
}
}
public void setProposedValues(Object[] _o) {
if (_o == null)
return;
else {
if (proposedValues_ == null) {
proposedValues_= new Vector(_o.length);
} else {
proposedValues_.clear();
proposedValues_.ensureCapacity(_o.length);
}
int n= _o.length;
for (int i= 0; i < n; i++) {
proposedValues_.add(_o[i]);
}
}
}
public void setProposedValue(Object _o) {
if (_o == null)
return;
else {
if (proposedValues_ == null) {
proposedValues_= new Vector(10);
} else {
proposedValues_.clear();
proposedValues_.ensureCapacity(10);
}
proposedValues_.add(_o);
}
}
public void addProposedValue(Object _o) {
if (_o == null)
return;
if (proposedValues_ == null)
setProposedValue(_o);
else
proposedValues_.add(_o);
}
public void addProposedValuesIfNotPresent(Object[] _o) {
if (_o == null)
return;
if (proposedValues_ == null)
setProposedValues(_o);
else {
int n= _o.length;
for (int i= 0; i < n; i++) {
if ((_o[i] != null) && (!proposedValues_.contains(_o[i])))
proposedValues_.add(_o[i]);
}
}
}
public void addProposedValues(Object[] _o) {
if (_o == null)
return;
if (proposedValues_ == null)
setProposedValues(_o);
else {
int n= _o.length;
for (int i= 0; i < n; i++) {
if (_o[i] != null)
proposedValues_.add(_o[i]);
}
}
}
public void emptyProposedValue() {
if (proposedValues_ != null)
proposedValues_.clear();
}
public boolean isProposedValueEmpty() {
return proposedValues_ == null ? true : proposedValues_.isEmpty();
}
public void setDefaultValue(Object _o) {
defaultValue_= _o;
}
public Object createNewObject() {
return defaultValue_;
}
public boolean actionAdd() {
int n= v_.size();
if ((maxValueNb_ > 0) && (n == maxValueNb_)) {
return false;
}
if ((proposedValues_ != null) && (n < proposedValues_.size())) {
addElement(proposedValues_.get(n));
} else {
Object o= createNewObject();
if (o == null)
return false;
else
addElement(o);
}
return true;
}
public boolean actionInserer(int _r) {
int n= v_.size();
if ((maxValueNb_ > 0) && (n == maxValueNb_)) {
return false;
}
if ((proposedValues_ != null) && (_r < proposedValues_.size())) {
add(_r, proposedValues_.get(_r));
} else {
Object o= createNewObject();
if (o == null)
return false;
else
add(_r, o);
}
return true;
}
public int getValueNb() {
return v_.size();
}
public List getValuesInList() {
return new Vector(v_);
}
/**
*
*/
public String getColumnName(int column) {
return DodicoLib.EMPTY_STRING;
}
/**
* Renvoie une model correspondant Attention ce model n'envoie pas d'evenements si le model
* englobant est modifie;
*/
public ComboBoxModel createComboBoxModel() {
return new ListEditorComboBoxModel();
}
public class ListEditorComboBoxModel
extends AbstractListModel
implements ComboBoxModel {
private Object selected_;
public Object getElementAt(int _i) {
return v_.get(_i);
}
public int getSize() {
return v_.size();
}
public void update() {
fireContentsChanged(this, 0, getSize());
}
/**
*
*/
public Object getSelectedItem() {
return selected_;
}
/**
*
*/
public void setSelectedItem(Object anItem) {
if ((selected_ == null && anItem != null)
|| (selected_ != null && !selected_.equals(anItem))) {
selected_= anItem;
fireContentsChanged(this, -1, -1);
}
}
};
}
\ No newline at end of file
|
|
From: <de...@us...> - 2003-10-29 11:54:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/reflux
Modified Files:
RefluxFillePost.java
Log Message:
boundary condition edition for telemac
Index: RefluxFillePost.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/reflux/RefluxFillePost.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** RefluxFillePost.java 23 Sep 2003 21:31:44 -0000 1.6
--- RefluxFillePost.java 29 Oct 2003 11:54:32 -0000 1.7
***************
*** 446,453 ****
// Info sur le noeud
if (_evt.getSource()==cqNds_) {
! EbliListeSelection sel=cqNds_.modeleSelection();
ZModeleDonnees md=cqNds_.modeleDonnees();
! int[] isels=sel.getSelectedIndex();
! if (sel.isEmpty()) {
pnInfo_.setInfo("- Pas de sélection -");
}
--- 446,453 ----
// Info sur le noeud
if (_evt.getSource()==cqNds_) {
! //EbliListeSelection sel=cqNds_.modeleSelection();
ZModeleDonnees md=cqNds_.modeleDonnees();
! int[] isels=cqNds_.getSelectedIndex();
! if (cqNds_.isSelectionEmpty()) {
pnInfo_.setInfo("- Pas de sélection -");
}
|
|
From: <de...@us...> - 2003-10-29 11:54:35
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun
In directory sc8-pr-cvs1:/tmp/cvs-serv15821/commun
Modified Files:
FudaaCommonImplementation.java FudaaLib.java
Log Message:
boundary condition edition for telemac
Index: FudaaCommonImplementation.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaCommonImplementation.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** FudaaCommonImplementation.java 10 Oct 2003 14:49:07 -0000 1.7
--- FudaaCommonImplementation.java 29 Oct 2003 11:54:32 -0000 1.8
***************
*** 273,277 ****
FudaaLib.showError(this, _titre, _text);
if (printErr)
! System.err.println(_titre + DodicoLib.ESPACE + _text);
}
/**
--- 273,277 ----
FudaaLib.showError(this, _titre, _text);
if (printErr)
! FudaaLib.error(_titre + DodicoLib.ESPACE + _text);
}
/**
***************
*** 292,296 ****
public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult) {
if (_opResult.getClosingException() != null) {
! System.err.println(
"FATAL :can't close " + _opResult.getAnalyze().getRessource());
}
--- 292,296 ----
public boolean manageErrorOperationAndIsFatal(FileOperationSynthese _opResult) {
if (_opResult.getClosingException() != null) {
! FudaaLib.error(
"FATAL :can't close " + _opResult.getAnalyze().getRessource());
}
Index: FudaaLib.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/FudaaLib.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FudaaLib.java 6 Oct 2003 08:08:59 -0000 1.9
--- FudaaLib.java 29 Oct 2003 11:54:32 -0000 1.10
***************
*** 50,56 ****
--- 50,71 ----
public final static boolean DEBUG =
"TRUE".equals(System.getProperty("DEBUG"));
+
+ public final static boolean INFO =DEBUG||
+ "TRUE".equals(System.getProperty("INFO"));
private FudaaLib()
{
+ }
+
+ public static void debug(String _s){
+ System.out.println("DEBUG: "+_s);
+ }
+
+ public static void error(String _s){
+ System.out.println("ERROR: "+_s);
+ }
+
+ public static void info(String _s){
+ System.out.println("--> "+_s);
}
|
|
From: <de...@us...> - 2003-10-29 11:47:19
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa
In directory sc8-pr-cvs1:/tmp/cvs-serv15264/fudaa
Modified Files:
build.xml distribution.xml
Log Message:
General update
Index: build.xml
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/build.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** build.xml 29 Sep 2003 11:32:55 -0000 1.7
--- build.xml 29 Oct 2003 11:47:16 -0000 1.8
***************
*** 304,308 ****
<!-- Les fichiers de types fr_txt sont réécrit en ascii -->
<!--=========================================================================-->
! <target name="i18n" depends=".initialisation">
<replace dir="${fudaa.src.dir}" includes="**/*.fr_txt" token=" " value="_"/>
<native2ascii src="${fudaa.src.dir}" dest="${fudaa.src.dir}" includes="**/*.fr_txt" ext=".txt"/>
--- 304,309 ----
<!-- Les fichiers de types fr_txt sont réécrit en ascii -->
<!--=========================================================================-->
! <target name="i18n" depends=".initialisation"
! description="Appelez cette methode qui si un fichier d'internationalisation a ete modifie">
<replace dir="${fudaa.src.dir}" includes="**/*.fr_txt" token=" " value="_"/>
<native2ascii src="${fudaa.src.dir}" dest="${fudaa.src.dir}" includes="**/*.fr_txt" ext=".txt"/>
***************
*** 319,323 ****
</echo>
! <copy todir="${fudaa.classes.dir}">
<fileset dir="${fudaa.src.dir}"><patternset refid="ressources.fic"/></fileset>
</copy>
--- 320,324 ----
</echo>
! <copy todir="${fudaa.classes.dir}" verbose="true">
<fileset dir="${fudaa.src.dir}"><patternset refid="ressources.fic"/></fileset>
</copy>
Index: distribution.xml
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/distribution.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** distribution.xml 6 Oct 2003 08:10:48 -0000 1.9
--- distribution.xml 29 Oct 2003 11:47:16 -0000 1.10
***************
*** 83,88 ****
<property name="fudaaDist.classpath" refid="fudaaDist.classpath.id"/>
<patternset id="ressources.fic"
! excludes="*.properties,*.xml,**/*.txt,**/*.log,**/*.old,**/*.bck,**/.xvpics/**,
! **/CVS/**,**/Cvs/**,**/cvs/**,**/*.class,**/*.NEW" />
<taskdef resource="genjar.properties"/>
</target>
--- 83,88 ----
<property name="fudaaDist.classpath" refid="fudaaDist.classpath.id"/>
<patternset id="ressources.fic"
! excludes="*.properties,*.xml,**/*.log,**/*.old,**/*.bck,**/.xvpics/**,
! **/CVS/**,**/Cvs/**,**/cvs/**,**/*.class,**/*.NEW,**/*.save" />
<taskdef resource="genjar.properties"/>
</target>
***************
*** 105,108 ****
--- 105,109 ----
<property name="build.compiler" value="${build.compiler}"/>
<property name="build.compiler.target" value="${build.compiler.target}"/>
+ <property name="build.compiler.failonerror" value="false"/>
<property name="build.compiler.debug" value="${build.compiler.debug}"/>
<property name="ctulu.classes.dir" value="${fudaa.dist.classes.dir}"/>
***************
*** 249,253 ****
! <target name="jar_lido" depends="build"
description="cree fudaa_lido.jar">
<property name="fudaa.lido.jar.file" value="${fudaa.dist.jar.dir}/fudaa_lido.jar"/>
--- 250,254 ----
! <target name="jar_lido" depends=".initialisationCheck"
description="cree fudaa_lido.jar">
<property name="fudaa.lido.jar.file" value="${fudaa.dist.jar.dir}/fudaa_lido.jar"/>
***************
*** 338,349 ****
</fileset>
</class>
<resource>
<fileset dir="${fudaa.dist.classes.dir}">
! <patternset refid="ressources.fic"/>
! <include name="com/memoire/bu/"/>
! <include name="org/fudaa/ebli/ressource/"/>
! <include name="org/fudaa/fudaa/ressource/"/>
! <include name="org/fudaa/fudaa/tr/"/>
</fileset>
</resource>
--- 339,357 ----
</fileset>
</class>
+ <classfilter>
+ <exclude name="org.fudaa.dodico.corba."/>
+ <exclude name="org.fudaa.dodico.usine."/>
+ </classfilter>
<resource>
<fileset dir="${fudaa.dist.classes.dir}">
! <patternset refid="ressources.fic"/>
! <include name="org/fudaa/dodico/commun/"/>
! <include name="com/memoire/bu/"/>
! <include name="org/fudaa/dodico/h2d/"/>
! <include name="org/fudaa/ebli/ressource/"/>
! <include name="org/fudaa/fudaa/ressource/"/>
! <include name="org/fudaa/fudaa/tr/"/>
! <include name="org/fudaa/fudaa/dico/"/>
</fileset>
</resource>
|
|
From: <de...@us...> - 2003-10-29 11:47:19
|
Update of /cvsroot/fudaa/fudaa_devel/dodico
In directory sc8-pr-cvs1:/tmp/cvs-serv15264/dodico
Modified Files:
build.xml
Log Message:
General update
Index: build.xml
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/build.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** build.xml 29 Sep 2003 11:31:05 -0000 1.8
--- build.xml 29 Oct 2003 11:47:16 -0000 1.9
***************
*** 62,66 ****
<property name="build.compiler.optimize" value="off"/>
<property name="build.compiler.deprecation" value="off"/>
! <property name="build.compiler.failonerror" value="true"/>
<property name="build.compiler.javac" value="modern"/>
<property name="java.maxmemory" value="128M"/>
--- 62,66 ----
<property name="build.compiler.optimize" value="off"/>
<property name="build.compiler.deprecation" value="off"/>
! <property name="build.compiler.failonerror" value="false"/>
<property name="build.compiler.javac" value="modern"/>
<property name="java.maxmemory" value="128M"/>
***************
*** 502,506 ****
<!-- Compilation du projet dodico entier. -->
<!--=========================================================================-->
! <target name="build" depends="compileJavaGenere,compile"
description="Construction du projet dodico :idl, usine, java et ressources">
</target>
--- 502,506 ----
<!-- Compilation du projet dodico entier. -->
<!--=========================================================================-->
! <target name="build" depends="compileJavaGenere,compile,.prepare"
description="Construction du projet dodico :idl, usine, java et ressources">
</target>
|
|
From: <de...@us...> - 2003-10-29 11:47:19
|
Update of /cvsroot/fudaa/fudaa_devel In directory sc8-pr-cvs1:/tmp/cvs-serv15264 Modified Files: ant.default.properties Log Message: General update Index: ant.default.properties =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ant.default.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ant.default.properties 23 Sep 2003 20:55:40 -0000 1.5 --- ant.default.properties 29 Oct 2003 11:47:16 -0000 1.6 *************** *** 1,42 **** ! ## ! # @file ctulu.default.properties ! # @creation 2002-04-05 ! # @modification $Date$ ! # @license GNU General Public License 2 ! # @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! # @mail de...@fu... ! # @version $Id$ ! # @author Fred deniger ! ## ! ! ! ## ! # Certaines options par defaut du projet. ! # Pour modifier ces options, il faut creer le fichier ant.properties dans ce ! # repertoire et changer les options voulues. ! ## ! ! ! build.compiler = modern ! ! ! ## ! # ! # Les motifs des fichiers a ne pas compiler ! # ! ## ! ctulu.ignore.patterns= com/memoire/editor/EditorJext.java ! dodico.ignore.patterns= ! ebli.ignore.patterns= /org/fudaa/ebli/volume/ ! fudaa.ignore.patterns= ! ! ! ## ! # Certains fichiers ne compilent pas avec jikes (v1.15). ! # Les motifs des fichiers a compiler avec javac ! ## ! ctulu.javac.patterns= ! dodico.javac.patterns= ! ebli.javac.patterns=org/fudaa/ebli/calque/EbliFilleCalques.java ! fudaa.javac.patterns=org/fudaa/fudaa/sinavi/ ! --- 1,42 ---- ! ## ! # @file ctulu.default.properties ! # @creation 2002-04-05 ! # @modification $Date$ ! # @license GNU General Public License 2 ! # @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! # @mail de...@fu... ! # @version $Id$ ! # @author Fred deniger ! ## ! ! ! ## ! # Certaines options par defaut du projet. ! # Pour modifier ces options, il faut creer le fichier ant.properties dans ce ! # repertoire et changer les options voulues. ! ## ! ! ! build.compiler = modern ! ! ! ## ! # ! # Les motifs des fichiers a ne pas compiler ! # ! ## ! ctulu.ignore.patterns= com/memoire/editor/EditorJext.java com/memoire/script/ ! dodico.ignore.patterns= ! ebli.ignore.patterns= /org/fudaa/ebli/volume/ ! fudaa.ignore.patterns= ! ! ! ## ! # Certains fichiers ne compilent pas avec jikes (v1.15). ! # Les motifs des fichiers a compiler avec javac ! ## ! ctulu.javac.patterns= ! dodico.javac.patterns= ! ebli.javac.patterns=org/fudaa/ebli/calque/EbliFilleCalques.java ! fudaa.javac.patterns=org/fudaa/fudaa/sinavi/ ! |
|
From: <de...@us...> - 2003-10-29 11:42:21
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/test
In directory sc8-pr-cvs1:/tmp/cvs-serv14252/org/fudaa/ebli/test
Modified Files:
TestGr.java
Log Message:
Ajout calque pour selection multiple
Index: TestGr.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/test/TestGr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestGr.java 23 Sep 2003 20:52:33 -0000 1.1
--- TestGr.java 29 Oct 2003 11:42:18 -0000 1.2
***************
*** 8,18 ****
*/
package org.fudaa.ebli.test;
!
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrSegment;
-
import junit.framework.TestCase;
-
/**
* @author deniger
--- 8,17 ----
*/
package org.fudaa.ebli.test;
! import org.fudaa.ebli.commun.EbliLib;
! import org.fudaa.ebli.commun.EbliListeSelection;
import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.geometrie.GrPoint;
import org.fudaa.ebli.geometrie.GrSegment;
import junit.framework.TestCase;
/**
* @author deniger
***************
*** 20,24 ****
*/
public class TestGr extends TestCase {
-
private double eps_;
/**
--- 19,22 ----
***************
*** 28,34 ****
super();
eps_= 1E-15;
-
}
-
public void testGrSegment() {
GrSegment g= new GrSegment();
--- 26,30 ----
***************
*** 54,59 ****
assertEquals(-5, b.e.y, eps_);
assertEquals(2, b.e.z, eps_);
-
}
!
}
--- 50,102 ----
assertEquals(-5, b.e.y, eps_);
assertEquals(2, b.e.z, eps_);
}
! public void testSelection() {
! EbliListeSelection l= new EbliListeSelection(20);
! l.setSelectionInterval(0, 15);
! int[] r= l.isSelectionContiguous(l, 20);
! assertNotNull(r);
! assertEquals(r[0], 0);
! assertEquals(r[1], 15);
! l.remove(10);
! r= l.isSelectionContiguous(l, 20);
! assertNull(r);
! l.addInterval(15, 19);
! r= l.isSelectionContiguous(l, 20);
! assertNotNull(r);
! assertEquals(r[0], 11);
! assertEquals(r[1], 9);
! r= l.isSelectionContiguous(l, 21);
! assertNull(r);
! l.remove(11);
! r= l.isSelectionContiguous(l, 20);
! assertNotNull(r);
! assertEquals(r[0], 12);
! assertEquals(r[1], 9);
! l.remove(17);
! r= l.isSelectionContiguous(l, 20);
! assertNull(r);
! l.setSelectionInterval(0, 0);
! r= l.isSelectionContiguous(l, 20);
! assertNotNull(r);
! assertEquals(r[0], 0);
! assertEquals(r[1], 0);
! l.clear();
! l.add(163);
! l.add(164);
! l.add(165);
! l.add(166);
! r= l.isSelectionContiguous(l, 200);
! assertNotNull(r);
! assertEquals(r[0], 163);
! assertEquals(r[1], 166);
! }
! public void testSelectionArray() {
! int[] test= new int[] { 0, 1, 2, 3, 4 };
! assertEquals(0, EbliLib.isSelectionContiguous(test, 20));
! test= new int[] { 0, 1, 2, 3, 6 };
! assertEquals(-1, EbliLib.isSelectionContiguous(test, 20));
! assertEquals(4, EbliLib.isSelectionContiguous(test, 7));
! test= new int[] { 0, 1, 3, 6 };
! assertEquals(-1, EbliLib.isSelectionContiguous(test, 7));
! }
}
|
|
From: <de...@us...> - 2003-10-29 11:42:21
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog
In directory sc8-pr-cvs1:/tmp/cvs-serv14252/org/fudaa/ebli/dialog
Modified Files:
EbliSimpleDialogPanel.java
Log Message:
Ajout calque pour selection multiple
Index: EbliSimpleDialogPanel.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/dialog/EbliSimpleDialogPanel.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EbliSimpleDialogPanel.java 6 Oct 2003 07:59:34 -0000 1.5
--- EbliSimpleDialogPanel.java 29 Oct 2003 11:42:18 -0000 1.6
***************
*** 520,524 ****
}
! protected BuLabel addLabel(Container _c, String _l) {
BuLabel r= new BuLabel(_l);
_c.add(r);
--- 520,524 ----
}
! public BuLabel addLabel(Container _c, String _l) {
BuLabel r= new BuLabel(_l);
_c.add(r);
|
|
From: <de...@us...> - 2003-10-29 11:41:31
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/test/telemac
Modified Files:
TestCL.java TestClMng.java testClMng.cli
Log Message:
Ajout du pattern command pour annuler des operations
Index: TestCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestCL.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestCL.java 8 Oct 2003 11:54:19 -0000 1.9
--- TestCL.java 29 Oct 2003 11:41:28 -0000 1.10
***************
*** 1 ****
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(TelemacCLInterface _inter) {
assertNotNull(_inter);
int idx=0;
H2dTelemacConditionLimite cls= _inter.getLine(idx);
assertEquals(_inter.getBordType(idx), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
int l= _inter.getNbLines();
for (int i= 0; i < l; i++) {
cls= _inter.getLine(i);
//les valeurs
assertEquals(cls.getH(), 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(cls.getU(), 0, eps_);
} else {
assertEquals(cls.getU(), 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(cls.getV(), 0, eps_);
} else {
assertEquals(cls.getV(), 300 + i, eps_);
}
assertEquals(cls.getStrickler(), 400 + i, eps_);
assertEquals(cls.getTraceur(), 500 + i, eps_);
assertEquals(cls.getTraceurCoefA(), 600 + i, eps_);
assertEquals(cls.getTraceurCoefB(), 700 + i, eps_);
//les indices commencent a 0.
assertEquals(cls.getIndexPt(), 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
TelemacCLInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public TelemacCLInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
TelemacCLInterface r= (TelemacCLInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @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.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(H2dTelemacCLSourceInterface _inter) {
assertNotNull(_inter);
int idx=0;
H2dTelemacConditionLimite cls= _inter.getLine(idx);
assertEquals(_inter.getBordType(idx), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
int l= _inter.getNbLines();
for (int i= 0; i < l; i++) {
cls= _inter.getLine(i);
//les valeurs
assertEquals(cls.getH(), 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(cls.getU(), 0, eps_);
} else {
assertEquals(cls.getU(), 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(cls.getV(), 0, eps_);
} else {
assertEquals(cls.getV(), 300 + i, eps_);
}
assertEquals(cls.getFrottementParoi(), 400 + i, eps_);
assertEquals(cls.getTraceur(), 500 + i, eps_);
assertEquals(cls.getTraceurCoefA(), 600 + i, eps_);
assertEquals(cls.getTraceurCoefB(), 700 + i, eps_);
//les indices commencent a 0.
assertEquals(cls.getIndexPt(), 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
H2dTelemacCLSourceInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public H2dTelemacCLSourceInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
H2dTelemacCLSourceInterface r= (H2dTelemacCLSourceInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
Index: TestClMng.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestClMng.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestClMng.java 8 Oct 2003 11:54:19 -0000 1.2
--- TestClMng.java 29 Oct 2003 11:41:28 -0000 1.3
***************
*** 8,12 ****
*/
package org.fudaa.dodico.test.telemac;
-
import java.io.File;
--- 8,11 ----
***************
*** 18,33 ****
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
- import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
- import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
- import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.test.TestIO;
-
/**
* @author deniger
--- 17,29 ----
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
+ import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @author deniger
***************
*** 35,42 ****
*/
public class TestClMng extends TestCase {
-
H2dMaillage m_;
H2dTelemacCLSourceInterface cl_;
-
public TestClMng() {
Class c= getClass();
--- 31,36 ----
***************
*** 54,60 ****
null);
assertFalse(op.containsFatalError());
! cl_= ((TelemacCLInterface)op.getSource());
}
-
public void testMaillage() {
assertNotNull(m_);
--- 48,53 ----
null);
assertFalse(op.containsFatalError());
! cl_= ((H2dTelemacCLSourceInterface)op.getSource());
}
public void testMaillage() {
assertNotNull(m_);
***************
*** 62,139 ****
H2dMaillageFrontiere frontiere= m_.getPtsFrontiere();
assertEquals(2, frontiere.getNbFrontier());
-
//test extern frontier
assertEquals(282, frontiere.getNbPt(0));
assertEquals(13, frontiere.getBordPrincPointIdx(0));
assertEquals(28, frontiere.getBordPrincPointIdx(281));
-
//test intern frontier
assertEquals(16, frontiere.getNbPt(1));
assertEquals(232, frontiere.getIdx(1, 0));
assertEquals(23, frontiere.getIdx(1, 15));
-
}
-
public void testCl() {
! assertEquals(298, cl_.getNbLines());
!
! /**extern frontier**/
! //bord 0
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(i));
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(0));
!
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE, cl_.getBordType(i));
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
!
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
}
-
public void testClMng() {
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(m_, cl_, null, null);
assertNotNull(clMng);
assertEquals(2, clMng.getNbFrontiere());
-
/**extern frontier**/
H2dBorderPerFrontierInterface bord= clMng.getBordPerFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dBord b= bord.getBord(0);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, b.getType());
! assertEquals(270, b.getIdxDeb());
! assertEquals(0, b.getIdxFin());
!
! // bord 1
! b= bord.getBord(1);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
!
! // bord 2
! b= bord.getBord(2);
! assertEquals(H2dBordType.LIQUIDE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
!
! // bord 3
! b= bord.getBord(3);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
!
//intern frontier
bord= clMng.getBordPerFrontier(1);
--- 55,127 ----
H2dMaillageFrontiere frontiere= m_.getPtsFrontiere();
assertEquals(2, frontiere.getNbFrontier());
//test extern frontier
assertEquals(282, frontiere.getNbPt(0));
assertEquals(13, frontiere.getBordPrincPointIdx(0));
assertEquals(28, frontiere.getBordPrincPointIdx(281));
//test intern frontier
assertEquals(16, frontiere.getNbPt(1));
assertEquals(232, frontiere.getIdx(1, 0));
assertEquals(23, frontiere.getIdx(1, 15));
}
public void testCl() {
! _testCl(cl_);
! }
!
! private static void _testCl(H2dTelemacCLSourceInterface _cl){
! assertEquals(298, _cl.getNbLines());
! /**extern frontier**/
! //bord 0
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, _cl.getBordType(i));
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, _cl.getBordType(0));
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, _cl.getBordType(i));
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
!
}
public void testClMng() {
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(m_, cl_, null, null);
assertNotNull(clMng);
assertEquals(2, clMng.getNbFrontiere());
/**extern frontier**/
H2dBorderPerFrontierInterface bord= clMng.getBordPerFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dTelemacBord b= (H2dTelemacBord)bord.getBord(0);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
! assertEquals(H2dClType.LIBRE, b.getTracerType());
! // bord 1
! b= (H2dTelemacBord)bord.getBord(1);
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
! // bord 2
! b=(H2dTelemacBord) bord.getBord(2);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
! // bord 3
! b= (H2dTelemacBord)bord.getBord(3);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, b.getType());
! assertEquals(270, b.getIdxDeb());
! assertEquals(0, b.getIdxFin());
! assertEquals(H2dClType.PERMANENT, b.getTracerType());
!
//intern frontier
bord= clMng.getBordPerFrontier(1);
***************
*** 142,146 ****
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
!
}
}
--- 130,156 ----
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
! assertEquals(H2dClType.LIBRE, ((H2dTelemacBord)bord.getBord(0)).getTracerType());
!
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(0));
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! _testCl(clMng.createCLSourceInterface());
}
}
Index: testClMng.cli
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/testClMng.cli,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** testClMng.cli 23 Sep 2003 20:22:12 -0000 1.1
--- testClMng.cli 29 Oct 2003 11:41:28 -0000 1.2
***************
*** 1,27 ****
! 4 5 5 0.000000 0.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 14 1
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 10 2
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 124 3
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 246 4
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 210 5
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 31 6
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 147 7
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 247 8
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 49 9
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 169 10
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 77 11
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 57 12
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 178 13
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 254 14
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 28 15
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 199 16
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 219 17
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 101 18
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 234 19
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 69 20
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 264 21
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 212 22
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 261 23
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 64 24
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 226 25
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 86 26
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 78 27
--- 1,27 ----
! 4 5 5 1.000000 0.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 14 1
! 2 2 2 2.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 10 2
! 2 2 2 3.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 124 3
! 2 2 2 4.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 246 4
! 2 2 2 5.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 210 5
! 2 2 2 6.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 31 6
! 2 2 2 7.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 147 7
! 2 2 2 8.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 247 8
! 2 2 2 9.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 49 9
! 2 2 2 10.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 169 10
! 2 2 2 11.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 77 11
! 2 2 2 12.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 57 12
! 2 2 2 13.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 178 13
! 2 2 2 14.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 254 14
! 2 2 2 15.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 28 15
! 2 2 2 16.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 199 16
! 2 2 2 17.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 219 17
! 2 2 2 18.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 101 18
! 2 2 2 19.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 234 19
! 2 2 2 20.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 69 20
! 2 2 2 21.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 264 21
! 2 2 2 22.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 212 22
! 2 2 2 23.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 261 23
! 2 2 2 24.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 64 24
! 2 2 2 25.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 226 25
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 86 26
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 78 27
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/h2d
Modified Files:
H2dBord.java H2dBordMutable.java
H2dBorderPerFrontierInterface.java H2dCLManagerAbstract.java
H2dCLManagerInterface.java H2dMaillageFrontiere.java
H2dParametres.java H2dProjectListener.java h2d_en.fr_txt
h2d_en.txt
Added Files:
H2dClListener.java
Removed Files:
H2dClChangeListener.java
Log Message:
Ajout du pattern command pour annuler des operations
--- NEW FILE: H2dClListener.java ---
/*
* @file H2dClChangeListener.java
* @creation 29 sept. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id: H2dClListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dClListener {
public void clChanged(H2dBord b,H2dBordType _old);
}
Index: H2dBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBord.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** H2dBord.java 10 Oct 2003 14:43:19 -0000 1.8
--- H2dBord.java 29 Oct 2003 11:41:27 -0000 1.9
***************
*** 9,16 ****
*/
package org.fudaa.dodico.h2d;
-
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.h2d.type.H2dBordType;
-
/**
* @author deniger
--- 9,14 ----
***************
*** 18,36 ****
*/
public class H2dBord {
!
H2dBordType type_;
! int idxDeb_;
! int idxFin_;
!
/**
* La frontiere concerne par ce bord (0 =frontiere externe)
*/
int IdxmaillageFrontiere_;
-
/**
*
*/
public H2dBord() {}
!
/**
*
--- 16,106 ----
*/
public class H2dBord {
! public static int INTERSECT_NULL= -1;
! public static int INTERSECT_PARTIEL= 0;
! public static int INTERSECT_INCLUDE_IN_BORD= 1;
! public static int INTERSECT_TOTAL= 2;
H2dBordType type_;
! protected int idxDeb_;
! protected int idxFin_;
! String name_;
/**
* La frontiere concerne par ce bord (0 =frontiere externe)
*/
int IdxmaillageFrontiere_;
/**
*
*/
public H2dBord() {}
! public H2dBord(H2dBord _b) {
! type_= _b.type_;
! idxDeb_= _b.idxDeb_;
! idxFin_= _b.idxFin_;
! name_= _b.name_;
! }
! public boolean isBeginIdxSelected(int _min, int _max) {
! return (
! ((_min <= _max) && ((_min <= idxDeb_) && (_max >= idxDeb_)))
! || ((_min > _max) && ((idxDeb_ >= _min) || (idxDeb_ <= _max))));
! }
! /**
! *@return -1 if no intersection
! * 0 if intersection partiel
! * 1 if the segment [_min,_max] is strictly included in this border
! * 2 if this border is included in the segment [_min,_max]
! *
! */
! public int isIntersectBy(int _min, int _max, int _nbPt) {
! if (isUnique())
! return INTERSECT_INCLUDE_IN_BORD;
! return isBordIntersectBy(idxDeb_, idxFin_, _min, _max, _nbPt);
! }
! public static int isBordIntersectBy(
! int _debBord,
! int _finBord,
! int _minSelect,
! int _maxSelect,
! int _nbPt) {
! if (_debBord == _finBord)
! return INTERSECT_INCLUDE_IN_BORD;
! int deb= _debBord;
! int fin= _finBord;
! if (deb == _nbPt)
! deb= 0;
! if (fin < 0)
! fin= _nbPt - 1;
! if (deb < fin) {
! if (_minSelect <= _maxSelect) {
! if ((_maxSelect < deb) || (_minSelect > fin))
! return INTERSECT_NULL;
! else if ((_minSelect <= deb) && (_maxSelect >= fin))
! return INTERSECT_TOTAL;
! else if ((_minSelect > deb) && (_maxSelect < fin))
! return INTERSECT_INCLUDE_IN_BORD;
! else
! return INTERSECT_PARTIEL;
! } else {
! if ((deb > _maxSelect) && (fin < _minSelect))
! return INTERSECT_NULL;
! else if ((fin <= _maxSelect) || (deb >= _minSelect))
! return INTERSECT_TOTAL;
! else
! return INTERSECT_PARTIEL;
! }
! } else {
! if (_minSelect <= _maxSelect) {
! if ((_minSelect > fin) && (_maxSelect < deb))
! return INTERSECT_NULL;
! else if ((_maxSelect < fin) || (_minSelect > deb))
! return INTERSECT_INCLUDE_IN_BORD;
! return INTERSECT_PARTIEL;
! } else {
! if ((_minSelect > deb) && (_maxSelect < fin))
! return INTERSECT_INCLUDE_IN_BORD;
! else if ((_minSelect <= deb) && (_maxSelect >= fin))
! return INTERSECT_TOTAL;
! return INTERSECT_PARTIEL;
! }
! }
! }
/**
*
***************
*** 39,50 ****
return type_;
}
!
! void setType(H2dBordType _type) {
type_= _type;
}
!
!
public String toString() {
! return "H2DBord boundary number"
+ IdxmaillageFrontiere_
+ " ["
--- 109,140 ----
return type_;
}
! protected void setType(H2dBordType _type) {
type_= _type;
}
! /**
! *
! */
! protected void setIdxDeb(int _i) {
! idxDeb_= _i;
! }
! /**
! *
! */
! protected void setIdxFin(int _i) {
! idxFin_= _i;
! }
! /**
! *
! */
! protected void setIdxmaillageFrontiere(int _i) {
! IdxmaillageFrontiere_= _i;
! }
! /**
! *
! */
public String toString() {
! return "H2DBord "
! + (name_ == null ? DodicoLib.EMPTY_STRING : name_)
! + "("
+ IdxmaillageFrontiere_
+ " ["
***************
*** 53,112 ****
+ idxFin_
+ "] type "
! + type_;
}
!
! public String getResume(){
! return H2dResource.getS("Bord de type {0}",type_.toString());
}
!
! public static final class BordIndexIterator{
private int nbPt_;
private H2dBord bd_;
private int indexEnCours_;
private int indexFinal_;
! public BordIndexIterator(){
}
!
! public BordIndexIterator(int _nbPt,H2dBord _b){
! set(_nbPt,_b);
! }
!
! public final void set(int _nbPt,H2dBord _b){
! nbPt_=_nbPt;
! bd_=_b;
! if(_b.isUnique()){
! indexEnCours_=0;
! indexFinal_=nbPt_-1;
! }
! else if(_b.idxDeb_>_b.idxFin_){
! indexEnCours_=_b.idxDeb_;
! indexFinal_=nbPt_+_b.idxFin_;
! }
! else
! {
! indexEnCours_=_b.idxDeb_;
! indexFinal_=_b.idxFin_;
}
}
!
! public boolean hasNext(){
! return indexEnCours_<=indexFinal_;
}
!
! public int next(){
! if(indexEnCours_>indexFinal_) throw new IllegalAccessError("end of iterator");
! int r=(indexEnCours_<nbPt_)?indexEnCours_:indexEnCours_-nbPt_;
indexEnCours_++;
! return r;
}
-
-
}
!
! public BordIndexIterator createIterator(int _nb){
! return new BordIndexIterator(_nb,this);
}
-
-
/**
*
--- 143,189 ----
+ idxFin_
+ "] type "
! + type_
! + ")";
}
! public String getResume() {
! return H2dResource.getS("Bord de type {0}", type_.toString());
}
! public static final class BordIndexIterator {
private int nbPt_;
private H2dBord bd_;
private int indexEnCours_;
private int indexFinal_;
! public BordIndexIterator() {}
! public BordIndexIterator(int _nbPt, H2dBord _b) {
! set(_nbPt, _b);
}
! public final void set(int _nbPt, H2dBord _b) {
! nbPt_= _nbPt;
! bd_= _b;
! if (_b.isUnique()) {
! indexEnCours_= 0;
! indexFinal_= nbPt_ - 1;
! } else if (_b.idxDeb_ > _b.idxFin_) {
! indexEnCours_= _b.idxDeb_;
! indexFinal_= nbPt_ + _b.idxFin_;
! } else {
! indexEnCours_= _b.idxDeb_;
! indexFinal_= _b.idxFin_;
}
}
! public boolean hasNext() {
! return indexEnCours_ <= indexFinal_;
}
! public int next() {
! if (indexEnCours_ > indexFinal_)
! throw new IllegalAccessError("end of iterator");
! int r= (indexEnCours_ < nbPt_) ? indexEnCours_ : indexEnCours_ - nbPt_;
indexEnCours_++;
! return r;
}
}
! public BordIndexIterator createIterator(int _nb) {
! return new BordIndexIterator(_nb, this);
}
/**
*
***************
*** 115,119 ****
return idxDeb_;
}
-
/**
* Bord unique si l'index de debut=index de fin.
--- 192,195 ----
***************
*** 122,126 ****
return idxDeb_ == idxFin_;
}
-
public boolean containsIdx(int _idx) {
return idxDeb_ == idxFin_
--- 198,201 ----
***************
*** 128,134 ****
: ((idxDeb_ < idxFin_)
? ((_idx >= idxDeb_) && (_idx <= idxFin_))
! : ((_idx >= 0) && (_idx <= idxFin_) && (_idx >= idxDeb_)));
}
-
/**
*
--- 203,208 ----
: ((idxDeb_ < idxFin_)
? ((_idx >= idxDeb_) && (_idx <= idxFin_))
! : ((_idx >= 0) && ((_idx <= idxFin_) || (_idx >= idxDeb_))));
}
/**
*
***************
*** 137,141 ****
return idxFin_;
}
-
/**
* Renvoie l'index de la frontiere concernee par ce bord.
--- 211,214 ----
***************
*** 144,159 ****
return IdxmaillageFrontiere_;
}
-
public int getNPointInBord(int _nbPoint) {
! if (idxFin_> idxDeb_)
! return idxFin_- idxDeb_+ 1;
else {
! return idxFin_
! + 1
! + _nbPoint
! - idxDeb_;
}
-
}
!
}
--- 217,261 ----
return IdxmaillageFrontiere_;
}
public int getNPointInBord(int _nbPoint) {
! if (idxFin_ > idxDeb_)
! return idxFin_ - idxDeb_ + 1;
else {
! return idxFin_ + 1 + _nbPoint - idxDeb_;
}
}
! public static int getNbPointInBord(int _min, int _max, int _nbPoint) {
! if (_max > _min)
! return _max - _min + 1;
! else {
! return _max + 1 + _nbPoint - _min;
! }
! }
! /**
! *
! */
! public String getName() {
! return name_;
! }
! public boolean containsZeroIndex() {
! if (isUnique())
! return true;
! else if (idxDeb_ < idxFin_)
! return idxDeb_ == 0;
! else
! return idxFin_ >= 0;
! }
! public boolean isFirst() {
! if (isUnique())
! return true;
! else if (idxDeb_ < idxFin_)
! return idxDeb_ == 0;
! else
! return idxFin_ > 0;
! }
! /**
! *
! */
! public void setName(String _string) {
! name_= _string;
! }
}
Index: H2dBordMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBordMutable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** H2dBordMutable.java 10 Oct 2003 14:43:19 -0000 1.4
--- H2dBordMutable.java 29 Oct 2003 11:41:27 -0000 1.5
***************
*** 1 ****
! /*
* @file H2dBordMutable.java
* @creation 20 août 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.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dBordMutable extends H2dBord {
/**
*
*/
public H2dBordMutable() {
super();
}
/**
*
*/
public void setIdxDeb(int _i) {
idxDeb_= _i;
}
/**
*
*/
public void setIdxFin(int _i) {
idxFin_= _i;
}
/**
*
*/
public void setIdxmaillageFrontiere(int _i) {
IdxmaillageFrontiere_= _i;
}
/**
*
*/
public void setType(H2dBordType _type) {
super.setType(_type);
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dBordMutable.java
* @creation 20 août 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.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dBordMutable extends H2dBord {
/**
*
*/
public H2dBordMutable() {
}
/**
*
*/
public void setIdxDeb(int _i) {
idxDeb_= _i;
}
/**
*
*/
public void setIdxFin(int _i) {
idxFin_= _i;
}
/**
*
*/
public void setIdxmaillageFrontiere(int _i) {
IdxmaillageFrontiere_= _i;
}
/**
*
*/
public void setType(H2dBordType _type) {
super.setType(_type);
}
}
\ No newline at end of file
Index: H2dBorderPerFrontierInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBorderPerFrontierInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dBorderPerFrontierInterface.java 6 Oct 2003 07:43:02 -0000 1.2
--- H2dBorderPerFrontierInterface.java 29 Oct 2003 11:41:27 -0000 1.3
***************
*** 16,20 ****
public int getNbBord();
! public H2dBord getBord(int _i);
}
--- 16,23 ----
public int getNbBord();
! public H2dBord getBord(int _idxBord);
! public H2dBord getBordContainingIdx(int _indexToSearch);
! public H2dConditionLimite getCl(int _idxOnThisFrontier);
! public int getNbPt();
}
Index: H2dCLManagerAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dCLManagerAbstract.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dCLManagerAbstract.java 10 Oct 2003 14:43:19 -0000 1.3
--- H2dCLManagerAbstract.java 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 20,24 ****
protected H2dMaillage maillage_;
protected H2dBorderPerFrontierInterface[] bordByFrontier_;
! private ArrayList listeners_;
protected H2dCLManagerAbstract(
H2dMaillage _m,
--- 20,29 ----
protected H2dMaillage maillage_;
protected H2dBorderPerFrontierInterface[] bordByFrontier_;
! protected ArrayList listeners_;
! protected H2dCLManagerAbstract(
! H2dMaillage _m) {
! maillage_= _m;
! }
!
protected H2dCLManagerAbstract(
H2dMaillage _m,
***************
*** 50,90 ****
return r;
}
! /**
! * Return the liquid boundary number _i (or null if not).
! */
! public H2dBord getLiquidBoundary(int _i) {
! int n= bordByFrontier_.length;
! int r= -1;
! for (int i= 0; i < n; i++) {
! H2dBorderPerFrontierInterface bordBound= bordByFrontier_[i];
! int nbBord= bordBound.getNbBord();
! for (int j= 0; j < nbBord; j++) {
! if (bordBound.getBord(j).getType().isLiquide()) {
! r++;
! }
! if (r == _i)
! return bordBound.getBord(j);
! }
! }
! return null;
! }
! public int getIdxLiquidBord(H2dBord _b) {
! if (!_b.getType().isLiquide())
! return -1;
! int n= bordByFrontier_.length;
! int r= -1;
! for (int i= 0; i < n; i++) {
! H2dBorderPerFrontierInterface bordBound= bordByFrontier_[i];
! int nbBord= bordBound.getNbBord();
! for (int j= 0; j < nbBord; j++) {
! if (bordBound.getBord(j) == _b) {
! return ++r;
! } else if (bordBound.getBord(j).getType().isLiquide()) {
! r++;
! }
! }
! }
! return -1;
! }
/**
* Renvoie le nombre de bord elementaire contenu par ce manager.
--- 55,59 ----
return r;
}
!
/**
* Renvoie le nombre de bord elementaire contenu par ce manager.
***************
*** 109,113 ****
*
*/
! public final H2dBord getBordFromIdxGeneral(int _idxGeneral) {
int n= bordByFrontier_.length;
int shiftL= 0;
--- 78,82 ----
*
*/
! public final H2dBord getBord(int _idxGeneral) {
int n= bordByFrontier_.length;
int shiftL= 0;
***************
*** 136,164 ****
protected void setBordType(H2dBord _b,H2dBordType _type){
_b.setType(_type);
}
protected void fireCLChange(H2dBord _b,H2dBordType _old){
for(Iterator it=listeners_.iterator();it.hasNext(); ){
! ((H2dClChangeListener)it.next()).clChanged(_b, _old);
! }
! }
! /**
! *
! */
! public void addClChangedListener(H2dClChangeListener _l) {
! if (listeners_ == null) {
! listeners_= new ArrayList(10);
! listeners_.add(_l);
! } else if (!listeners_.contains(_l)) {
! listeners_.add(_l);
}
}
! /**
! *
! */
! public void removeClChangedListener(H2dClChangeListener _l) {
! if (listeners_ != null)
! listeners_.remove(_l);
! }
}
--- 105,119 ----
protected void setBordType(H2dBord _b,H2dBordType _type){
+ H2dBordType old=_b.getType();
_b.setType(_type);
+ fireCLChange(_b,old);
}
protected void fireCLChange(H2dBord _b,H2dBordType _old){
for(Iterator it=listeners_.iterator();it.hasNext(); ){
! ((H2dClListener)it.next()).clChanged(_b, _old);
}
}
!
!
}
Index: H2dCLManagerInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dCLManagerInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dCLManagerInterface.java 6 Oct 2003 07:43:02 -0000 1.2
--- H2dCLManagerInterface.java 29 Oct 2003 11:41:27 -0000 1.3
***************
*** 39,49 ****
* Renvoie le bord d'index general donne.
*/
! public H2dBord getBordFromIdxGeneral(int _idxGeneral);
- /**
- * Renvoie le point d'indice frontiere <code>_idxPtSurFrontiere</code>
- * de la frontiere d'indice <code>_idxFrontiere</code>.
- */
- public H2dPoint getPoint(int _idxFrontiere, int _idxPtSurFrontiere);
/**
--- 39,44 ----
* Renvoie le bord d'index general donne.
*/
! public H2dBord getBord(int _idxGeneral);
/**
***************
*** 54,58 ****
public H2dMaillage getMaillage();
! public void addClChangedListener(H2dClChangeListener _l);
! public void removeClChangedListener(H2dClChangeListener _l);
}
--- 49,53 ----
public H2dMaillage getMaillage();
! // public void addClChangedListener(H2dClChangeListener _l);
! // public void removeClChangedListener(H2dClChangeListener _l);
}
Index: H2dMaillageFrontiere.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillageFrontiere.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** H2dMaillageFrontiere.java 8 Oct 2003 11:53:08 -0000 1.5
--- H2dMaillageFrontiere.java 29 Oct 2003 11:41:27 -0000 1.6
***************
*** 1 ****
! /*
* @file H2dMaillageBord.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.dodico.h2d;
import gnu.trove.TIntArrayList;
import gnu.trove.TIntIntIterator;
import gnu.trove.TIntIterator;
import java.util.List;
import org.fudaa.dodico.commun.DodicoIntIterator;
import org.fudaa.dodico.commun.DodicoLib;
import sun.security.action.GetPropertyAction;
/**
* @author deniger
* @version $Id$
*/
public class H2dMaillageFrontiere {
protected int[][] bords_;
/**
*
*/
public H2dMaillageFrontiere(List _l) {
int n= _l.size();
if (n > 0) {
bords_= new int[n][];
_l.toArray(bords_);
} else
bords_= new int[0][];
}
public H2dMaillageFrontiere(int[] _l) {
bords_= new int[1][];
bords_[0]= _l;
}
public FrontiereIdxIterator getFrontierIterator(){
return new FrontiereIdxIterator();
}
public class FrontiereIdxIterator implements DodicoIntIterator{
int bordIdx_;
int ptIdx_;
int frontierIdx=-1;
FrontiereIdxIterator(){
}
public boolean hasNext(){
return bordIdx_<bords_.length-1?true:(bordIdx_==bords_.length-1?ptIdx_<bords_[bordIdx_].length:false);
}
/**
* After calling next(), you can use this method to know the current boundary numbering.
*/
public int getBoundaryIdx(){
return frontierIdx;
}
/**
* Return the next index in the general numbering.
*/
public int next(){
int r=bords_[bordIdx_][ptIdx_++];
frontierIdx++;
if(ptIdx_==bords_[bordIdx_].length)
{
bordIdx_++;
ptIdx_=0;
}
return r;
}
}
/**
* Return [ frontier index, point index in the frontier] from the general index.
*/
public int[] getIdxFrontierIdxPtInFrontier(int _IdxGeneralPt) {
for (int i= 0; i < bords_.length; i++) {
int n= bords_[i].length;
for (int j= 0; j < n; j++) {
if (bords_[i][j] == _IdxGeneralPt)
return new int[] { i, j };
}
}
return null;
}
/**
* Return the general index from the index on the frontier.
*/
public final int getIdxGeneral(int _idxOnFrontier) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
return bords_[i][_idxOnFrontier - shiftL];
} else {
shiftL += bords_[i].length;
}
}
return -1;
}
/**
* Renvoie le nombre total de points des frontieres.
*/
public int getNbTotalPt() {
int r= 0;
for (int i= bords_.length - 1; i >= 0; i--) {
r += bords_[i].length;
}
return r;
}
/**
* Permet de verifier si les indices de bords
* sont dans le meme ordre que celui donne
* par _ipobo.
*/
public boolean isSame(int[] _ipobo) {
if (_ipobo == null)
return false;
int nBI= bords_.length;
int indexIpobo= 0;
int nbFI;
for (int i= 0; i < nBI; i++) {
nbFI= bords_[i].length;
for (int j= 0; j < nbFI; j++) {
if (_ipobo[indexIpobo + j] != bords_[i][j]) {
System.out.println("Error intern");
return false;
}
}
indexIpobo += nbFI;
}
return true;
}
/**
* Renvoie les bords sous forme d'un tableau ( conforme tableau ipobo
* de telemac/serafin).
*/
public int[] getArray() {
int[] r=new int[getNbTotalPt()];
for(FrontiereIdxIterator it=new FrontiereIdxIterator();it.hasNext();){
int i=it.next();
r[it.getBoundaryIdx()]=i;
}
return r;
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord principal
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordPrinc() {
return DodicoLib._printObject(bords_[0], true);
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord interne d'indice _id
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordInterne(int _id) {
return DodicoLib._printObject(bords_[_id + 1], true);
}
public String toString() {
return "H2dMaillageFrontiere main frontier["
+ bords_[0].length
+ "] intern frontier ["
+ getNbFrontierIntern()
+ "]";
}
public void printFullString(){
System.out.println("extern "+DodicoLib._printObject(bords_[0],true));
if(getNbFrontierIntern()>0){
int n=getNbFrontierIntern();
for(int i=0;i<n;i++){
System.out.println("intern "+i+ DodicoLib._printObject(bords_[i+1],true));
}
}
}
public H2dPoint[] getMinMax(H2dMaillage _mail, int _idxFrontier) {
int[] bordIdx= bords_[_idxFrontier];
int i0= bordIdx[0];
H2dPoint pt= _mail.pts_[i0];
H2dPointMutable pMin= new H2dPointMutable(pt);
H2dPointMutable pMax= new H2dPointMutable(pt);
int nb= bordIdx.length - 1;
for (int i= nb; i >= 1; i--) {
pt= _mail.pts_[bordIdx[i]];
if (pt.x_ < pMin.x_)
pMin.x_= pt.x_;
if (pt.y_ < pMin.y_)
pMin.y_= pt.y_;
if (pt.z_ < pMin.z_)
pMin.z_= pt.z_;
if (pt.x_ > pMax.x_)
pMax.x_= pt.x_;
if (pt.y_ > pMax.y_)
pMax.y_= pt.y_;
if (pt.z_ > pMax.z_)
pMax.z_= pt.z_;
}
return new H2dPoint[] { pMin, pMax };
}
public int getNbFrontierIntern() {
return bords_.length - 1;
}
public int getNbFrontier() {
return bords_.length;
}
public int getBordPrincPointIdx(int _idx) {
return bords_[0][_idx];
}
/**
* Return the general index for the point <code>_idxPtInFrontier</code>
* in the frontier <code>_idxFrontier</code>
*/
public int getIdx(int _idxFrontier, int _idxPt) {
return bords_[_idxFrontier][_idxPt];
}
public int getNbPt(int _idxFrontier) {
return bords_[_idxFrontier].length;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dMaillageBord.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.dodico.h2d;
import java.util.List;
import org.fudaa.dodico.commun.DodicoIntIterator;
import org.fudaa.dodico.commun.DodicoLib;
/**
* @author deniger
* @version $Id$
*/
public class H2dMaillageFrontiere {
protected int[][] bords_;
/**
*
*/
public H2dMaillageFrontiere(List _l) {
int n= _l.size();
if (n > 0) {
bords_= new int[n][];
_l.toArray(bords_);
} else
bords_= new int[0][];
}
public H2dMaillageFrontiere(int[] _l) {
bords_= new int[1][];
bords_[0]= _l;
}
public FrontiereIdxIterator getFrontierIterator() {
return new FrontiereIdxIterator();
}
/**
* Return [ frontier index, point index in the frontier] from the general index.
*/
public int[] getIdxFrontierIdxPtInFrontierFromGlobal(int _idx) {
for (int i= 0; i < bords_.length; i++) {
int n= bords_[i].length;
for (int j= 0; j < n; j++) {
if (bords_[i][j] == _idx)
return new int[] { i, j };
}
}
return null;
}
public boolean getIdxFrontierIdxPtInFrontierFromFrontier(
int _idxOnFrontier,
int[] _idxFridxPt) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
_idxFridxPt[0]= i;
_idxFridxPt[1]= _idxOnFrontier - shiftL;
return true;
} else {
shiftL += bords_[i].length;
}
}
return false;
}
/**
* Return the general index from the index on the frontier.
*/
public final int getIdxGeneral(int _idxOnFrontier) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
return bords_[i][_idxOnFrontier - shiftL];
} else {
shiftL += bords_[i].length;
}
}
return -1;
}
/**
* Renvoie le nombre total de points des frontieres.
*/
public int getNbTotalPt() {
int r= 0;
for (int i= bords_.length - 1; i >= 0; i--) {
r += bords_[i].length;
}
return r;
}
/**
* Permet de verifier si les indices de bords
* sont dans le meme ordre que celui donne
* par _ipobo.
*/
public boolean isSame(int[] _ipobo) {
if (_ipobo == null)
return false;
int nBI= bords_.length;
int indexIpobo= 0;
int nbFI;
for (int i= 0; i < nBI; i++) {
nbFI= bords_[i].length;
for (int j= 0; j < nbFI; j++) {
if (_ipobo[indexIpobo + j] != bords_[i][j]) {
System.out.println("Error intern");
return false;
}
}
indexIpobo += nbFI;
}
return true;
}
/**
* Renvoie les bords sous forme d'un tableau ( conforme tableau ipobo
* de telemac/serafin).
*/
public int[] getArray() {
int[] r= new int[getNbTotalPt()];
for (FrontiereIdxIterator it= new FrontiereIdxIterator(); it.hasNext();) {
int i= it.next();
r[it.getBoundaryIdx()]= i;
}
return r;
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord principal
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordPrinc() {
return DodicoLib._printObject(bords_[0], true);
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord interne d'indice _id
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordInterne(int _id) {
return DodicoLib._printObject(bords_[_id + 1], true);
}
public String toString() {
return "H2dMaillageFrontiere main frontier["
+ bords_[0].length
+ "] intern frontier ["
+ getNbFrontierIntern()
+ "]";
}
public void printFullString() {
System.out.println("extern " + DodicoLib._printObject(bords_[0], true));
if (getNbFrontierIntern() > 0) {
int n= getNbFrontierIntern();
for (int i= 0; i < n; i++) {
System.out.println(
"intern " + i + DodicoLib._printObject(bords_[i + 1], true));
}
}
}
public H2dPoint[] getMinMax(H2dMaillage _mail, int _idxFrontier) {
int[] bordIdx= bords_[_idxFrontier];
int i0= bordIdx[0];
H2dPoint pt= _mail.pts_[i0];
H2dPointMutable pMin= new H2dPointMutable(pt);
H2dPointMutable pMax= new H2dPointMutable(pt);
int nb= bordIdx.length - 1;
for (int i= nb; i >= 1; i--) {
pt= _mail.pts_[bordIdx[i]];
if (pt.x_ < pMin.x_)
pMin.x_= pt.x_;
if (pt.y_ < pMin.y_)
pMin.y_= pt.y_;
if (pt.z_ < pMin.z_)
pMin.z_= pt.z_;
if (pt.x_ > pMax.x_)
pMax.x_= pt.x_;
if (pt.y_ > pMax.y_)
pMax.y_= pt.y_;
if (pt.z_ > pMax.z_)
pMax.z_= pt.z_;
}
return new H2dPoint[] { pMin, pMax };
}
public int getNbFrontierIntern() {
return bords_.length - 1;
}
public int getNbFrontier() {
return bords_.length;
}
public int getBordPrincPointIdx(int _idx) {
return bords_[0][_idx];
}
/**
* Return the general index for the point <code>_idxPtInFrontier</code>
* in the frontier <code>_idxFrontier</code>
*/
public int getIdx(int _idxFrontier, int _idxPt) {
return bords_[_idxFrontier][_idxPt];
}
public int getNbPt(int _idxFrontier) {
return bords_[_idxFrontier].length;
}
public class FrontiereIdxIterator implements DodicoIntIterator {
int bordIdx_;
int ptIdx_;
int frontierIdx= -1;
FrontiereIdxIterator() {}
public boolean hasNext() {
return ((bordIdx_ < bords_.length - 1)
? true
: ((bordIdx_ == bords_.length - 1)
? (ptIdx_ < bords_[bordIdx_].length)
: false));
}
/**
* After calling next(), you can use this method to know the current boundary numbering.
*/
public int getBoundaryIdx() {
return frontierIdx;
}
/**
* Return the next index in the general numbering.
*/
public int next() {
int r= bords_[bordIdx_][ptIdx_++];
frontierIdx++;
if (ptIdx_ == bords_[bordIdx_].length) {
bordIdx_++;
ptIdx_= 0;
}
return r;
}
}
}
\ No newline at end of file
Index: H2dParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dParametres.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** H2dParametres.java 10 Oct 2003 14:43:19 -0000 1.8
--- H2dParametres.java 29 Oct 2003 11:41:27 -0000 1.9
***************
*** 1 ****
! /*
* @file TrProjetH2d.java
* @creation 20 mars 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.dodico.h2d;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersionAbstract;
import org.fudaa.dodico.dico.DicoParams;
/**
*
* @author deniger
* @version $Id$
*/
public abstract class H2dParametres {
private H2dMaillage maillage_;
private DicoParams dicoParams_;
private H2dCLManagerInterface clMng_;
private H2dProjectListener listener_;
protected H2dParametres(DicoParams _dico) {
dicoParams_= _dico;
}
public final H2dMaillage getMaillage() {
return maillage_;
}
public void setProjectListener(H2dProjectListener _l) {
if (listener_ != null) {
if (clMng_ != null)
clMng_.removeClChangedListener(listener_);
if (dicoParams_ != null)
dicoParams_.removeModelListener(listener_);
}
if (_l != null) {
if (clMng_ != null)
clMng_.addClChangedListener(_l);
if (dicoParams_ != null)
dicoParams_.addModelListener(_l);
}
listener_=_l;
}
public final void setMaillage(
H2dMaillage _m,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (DodicoLib.DEBUG)
System.out.println("H2d setMaillage");
if (maillage_ != null) {
if (_analyze != null)
_analyze.addFatalError(H2dResource.getS("Maillage déjà spécifié"));
new Throwable().printStackTrace();
return;
}
maillage_= _m;
if (_m.getPtsFrontiere() == null) {
_m.computeBord(_inter);
}
}
public int getNPointInBord(H2dBord _b) {
int deb= _b.getIdxDeb();
int fin= _b.getIdxFin();
if (fin > deb)
return fin - deb + 1;
else {
return fin
+ 1
+ maillage_.getPtsFrontiere().getNbPt(_b.getIdxFrontiere())
- deb;
}
}
public DicoParams getDicoParams() {
return dicoParams_;
}
public DicoCasFileFormatVersionAbstract getVersion() {
return dicoParams_.getDicoFileFormatVersion();
}
public H2dCLManagerInterface getCLManager() {
return clMng_;
}
public void setClManager(H2dCLManagerInterface _clMng) {
clMng_= _clMng;
if(listener_!=null){
clMng_.addClChangedListener(listener_);
}
}
public abstract DodicoPermanentList getBordList();
}
\ No newline at end of file
--- 1 ----
! /*
* @file TrProjetH2d.java
* @creation 20 mars 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.dodico.h2d;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersionAbstract;
import org.fudaa.dodico.dico.DicoParams;
/**
*
* @author deniger
* @version $Id$
*/
public abstract class H2dParametres {
protected H2dMaillage maillage_;
protected DicoParams dicoParams_;
protected H2dParametres(DicoParams _dico) {
dicoParams_= _dico;
}
public final H2dMaillage getMaillage() {
return maillage_;
}
public final void setMaillage(
H2dMaillage _m,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (DodicoLib.DEBUG)
System.out.println("H2d setMaillage");
if (maillage_ != null) {
if (_analyze != null)
_analyze.addFatalError(H2dResource.getS("Maillage déjà spécifié"));
new Throwable().printStackTrace();
return;
}
maillage_= _m;
if (_m.getPtsFrontiere() == null) {
_m.computeBord(_inter);
}
}
public int getNPointInBord(H2dBord _b) {
int deb= _b.getIdxDeb();
int fin= _b.getIdxFin();
if (fin > deb)
return fin - deb + 1;
else {
return fin
+ 1
+ maillage_.getPtsFrontiere().getNbPt(_b.getIdxFrontiere())
- deb;
}
}
public DicoParams getDicoParams() {
return dicoParams_;
}
public DicoCasFileFormatVersionAbstract getVersion() {
return dicoParams_.getDicoFileFormatVersion();
}
public abstract H2dCLManagerInterface getCLManager();
public abstract DodicoPermanentList getBordList();
}
\ No newline at end of file
Index: H2dProjectListener.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProjectListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProjectListener.java 8 Oct 2003 12:14:47 -0000 1.1
--- H2dProjectListener.java 29 Oct 2003 11:41:27 -0000 1.2
***************
*** 15,17 ****
* @version $Id$
*/
! public interface H2dProjectListener extends H2dClChangeListener,DicoParamsListener{}
--- 15,17 ----
* @version $Id$
*/
! public interface H2dProjectListener extends H2dClListener,DicoParamsListener{}
Index: h2d_en.fr_txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.fr_txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** h2d_en.fr_txt 10 Oct 2003 14:43:19 -0000 1.4
--- h2d_en.fr_txt 29 Oct 2003 11:41:27 -0000 1.5
***************
*** 201,203 ****
Les_paramètres_du_fichiers_dico_ne_correspondent_pas_à_un_projet_hydraulique_2D=The_dictionnary_parameters_are_not_suitable_for_a_2D_hydraulic_project
{0}_n'est_pas_un_mot-clé_contenant_des_réels={0}_is_not_a_keyword_for_real
! Bord_de_type_{0}=The_boundary's_type_is_{0}
\ No newline at end of file
--- 201,206 ----
Les_paramètres_du_fichiers_dico_ne_correspondent_pas_à_un_projet_hydraulique_2D=The_dictionnary_parameters_are_not_suitable_for_a_2D_hydraulic_project
{0}_n'est_pas_un_mot-clé_contenant_des_réels={0}_is_not_a_keyword_for_real
! Bord_de_type_{0}=The_boundary's_type_is_{0}
! Le_mot-clé_{0}_doit_contenir_{1}_champs_(soit_le_nombre_de_frontières_liquides)=The_keyword_{0}_must_contains_{1}_fields_(_the_number_of_liquid_boundaries)
! Les_indices_de_points_de_bords_sont_incorrects=The_boundary_indices_are_not_valids
! Le_traceur_n'est_pas_homogène_sur_le_même_bord_(point_{0}_dans_la_numérotation_des_points_de_bords)=The_tracer_is_not_homogenous_for_the_entire_border(point_{0}_in_the_boundary_point_numbering)
\ No newline at end of file
Index: h2d_en.txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** h2d_en.txt 10 Oct 2003 14:43:19 -0000 1.3
--- h2d_en.txt 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 202,203 ****
--- 202,206 ----
{0}_n'est_pas_un_mot-cl\u00e9_contenant_des_r\u00e9els={0}_is_not_a_keyword_for_real
Bord_de_type_{0}=The_boundary's_type_is_{0}
+ Le_mot-cl\u00e9_{0}_doit_contenir_{1}_champs_(soit_le_nombre_de_fronti\u00e8res_liquides)=The_keyword_{0}_must_contains_{1}_fields_(_the_number_of_liquid_boundaries)
+ Les_indices_de_points_de_bords_sont_incorrects=The_boundary_indices_are_not_valids
+ Le_traceur_n'est_pas_homog\u00e8ne_sur_le_m\u00eame_bord_(point_{0}_dans_la_num\u00e9rotation_des_points_de_bords)=The_tracer_is_not_homogenous_for_the_entire_border(point_{0}_in_the_boundary_point_numbering)
--- H2dClChangeListener.java DELETED ---
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/h2d/telemac
Modified Files:
H2dTelemacCLManager.java H2dTelemacCLSourceInterface.java
H2dTelemacConditionLimite.java
H2dTelemacConditionLimiteMutable.java
H2dTelemacDicoFileFormatVersion.java H2dTelemacParametres.java
Added Files:
H2dTelemacBord.java H2dTelemacBordMutable.java
H2dTelemacClListener.java H2dTelemacProjectListener.java
Removed Files:
H2dTelemacListener.java
Log Message:
Ajout du pattern command pour annuler des operations
--- NEW FILE: H2dTelemacBord.java ---
/*
* @file H2dTelemacBord.java
* @creation 23 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.commun.DodicoCommand;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
* @author deniger
* @version $Id: H2dTelemacBord.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public class H2dTelemacBord extends H2dBord {
H2dClType tracerType_;
String elevation_;
String velocity_;
String flowrate_;
String tracer_;
String velocityProfil_;
String liquidOption_;
/**
*
*/
public H2dTelemacBord() {
tracerType_= H2dClType.LIBRE;
}
public H2dTelemacBord(H2dTelemacBord _init) {
super(_init);
//telemac
tracerType_= _init.tracerType_;
elevation_= _init.elevation_;
velocity_= _init.velocity_;
flowrate_= _init.flowrate_;
tracer_= _init.tracer_;
velocityProfil_= _init.velocityProfil_;
liquidOption_= _init.liquidOption_;
}
/**
*
*/
public H2dClType getTracerType() {
return tracerType_;
}
/**
*@return -1 if no intersection
* 0 if intersection partiel
* 1 if the segment [_min,_max] is strictly included in this border
* 2 if this border is included in the segment [_min,_max]
*
*/
public int isIntersectBy(int _min, int _max, int _nbPt) {
if (isUnique())
return 1;
int deb= idxDeb_;
int fin= idxFin_;
if (!getType().isLiquide()) {
deb++;
fin--;
}
if (((idxDeb_ > idxFin_) && (deb < fin))
|| ((idxDeb_ < idxFin_) && (deb > fin)))
new Throwable().printStackTrace();
return isBordIntersectBy(deb, fin, _min, _max, _nbPt);
}
/**
*
*/
protected void setTracerType(H2dClType _type) {
if (getType().isLiquide())
tracerType_= _type;
}
public boolean isTracerImposed() {
return tracerType_ == H2dClType.PERMANENT;
}
protected void setTracerTypeImposed(boolean _b) {
if (getType().isLiquide())
tracerType_= _b ? H2dClType.PERMANENT : H2dClType.LIBRE;
}
/**
*
*/
protected void setType(H2dBordType _type) {
super.setType(_type);
}
/**
*
*/
protected void setIdxDeb(int _i) {
super.setIdxDeb(_i);
}
/**
*
*/
protected void setIdxFin(int _i) {
super.setIdxFin(_i);
}
/**
*
*/
protected void setIdxmaillageFrontiere(int _i) {
super.setIdxmaillageFrontiere(_i);
}
/**
*
*/
public String getElevation() {
return elevation_;
}
/**
*
*/
public String getFlowrate() {
return flowrate_;
}
/**
*
*/
public String getLiquidOption() {
return liquidOption_;
}
/**
*
*/
public String getTracer() {
return tracer_;
}
/**
*
*/
public String getVelocity() {
return velocity_;
}
/**
*
*/
public String getVelocityProfil() {
return velocityProfil_;
}
/**
*
*/
protected boolean setElevation(String _string) {
if (_string != elevation_) {
elevation_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setFlowrate(String _string) {
if (_string != flowrate_) {
flowrate_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setLiquidOption(String _string) {
if (_string != liquidOption_) {
liquidOption_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setTracer(String _string) {
if (_string != tracer_) {
tracer_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setVelocity(String _string) {
if (_string != velocity_) {
velocity_= _string;
return true;
}
return false;
}
/**
*
*/
protected boolean setVelocityProfil(String _string) {
if (_string != velocityProfil_) {
velocityProfil_= _string;
return true;
}
return false;
}
protected boolean setValue(H2dVariableType _type, String _string) {
if (_type == H2dVariableType.VITESSE) {
return setVelocity(_string);
} else if (_type == H2dVariableType.COTE_EAU) {
return setElevation(_string);
} else if (_type == H2dVariableType.DEBIT) {
return setFlowrate(_string);
} else if (_type == H2dVariableType.TRACEUR) {
return setTracer(_string);
}
System.err.println("variable unknown for " + getClass().getName());
new Throwable().printStackTrace();
return false;
}
/**
*
*/
public boolean containsIdx(int _idx) {
if (getType().isLiquide())
return super.containsIdx(_idx);
else
return idxDeb_ == idxFin_
? true
: ((idxDeb_ < idxFin_)
? ((_idx > idxDeb_) && (_idx < idxFin_))
: ((_idx >= 0) && ((_idx < idxFin_) || (_idx > idxDeb_))));
}
}
--- NEW FILE: H2dTelemacBordMutable.java ---
/*
* @file H2dTelemacBordMutable.java
* @creation 27 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
* @author deniger
* @version $Id: H2dTelemacBordMutable.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public class H2dTelemacBordMutable extends H2dTelemacBord {
/**
*
*/
public H2dTelemacBordMutable() {
super();
}
/**
* @param _init
*/
public H2dTelemacBordMutable(H2dTelemacBord _init) {
super(_init);
}
/**
*
*/
public boolean setFlowrate(String _string) {
return super.setFlowrate(_string);
}
/**
*
*/
public void setIdxDeb(int _i) {
super.setIdxDeb(_i);
}
/**
*
*/
public void setIdxFin(int _i) {
super.setIdxFin(_i);
}
/**
*
*/
public void setIdxmaillageFrontiere(int _i) {
super.setIdxmaillageFrontiere(_i);
}
/**
*
*/
public boolean setLiquidOption(String _string) {
return super.setLiquidOption(_string);
}
/**
*
*/
public void setName(String _string) {
super.setName(_string);
}
/**
*
*/
public boolean setTracer(String _string) {
return super.setTracer(_string);
}
/**
*
*/
public void setTracerType(H2dClType _type) {
super.setTracerType(_type);
}
/**
*
*/
public void setTracerTypeImposed(boolean _b) {
super.setTracerTypeImposed(_b);
}
/**
*
*/
public void setType(H2dBordType _type) {
super.setType(_type);
}
/**
*
*/
public boolean setValue(H2dVariableType _type, String _string) {
return super.setValue(_type, _string);
}
/**
*
*/
public boolean setVelocity(String _string) {
return super.setVelocity(_string);
}
/**
*
*/
public boolean setVelocityProfil(String _string) {
return super.setVelocityProfil(_string);
}
}
--- NEW FILE: H2dTelemacClListener.java ---
/*
* @file H2dTelemacClListener.java
* @creation 23 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.H2dClListener;
/**
* @author deniger
* @version $Id: H2dTelemacClListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dTelemacClListener extends H2dClListener {
public void TracerImposedChanged(H2dTelemacBord _b);
public void CLFrontierStructureChange(H2dTelemacCLManager.TelemacBordParFrontiere _b);
}
--- NEW FILE: H2dTelemacProjectListener.java ---
/*
* @file H2dTelemacListener.java
* @creation 8 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d.telemac;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoEntiteFile;
import org.fudaa.dodico.dico.DicoParams;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dProjectListener;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id: H2dTelemacProjectListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dTelemacProjectListener extends H2dProjectListener,H2dTelemacClListener{
}
Index: H2dTelemacCLManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** H2dTelemacCLManager.java 13 Oct 2003 10:00:14 -0000 1.5
--- H2dTelemacCLManager.java 29 Oct 2003 11:41:27 -0000 1.6
***************
*** 12,25 ****
import java.util.Iterator;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
- import org.fudaa.dodico.dico.DicoDataType;
import org.fudaa.dodico.dico.DicoEntite;
import org.fudaa.dodico.dico.DicoParams;
import org.fudaa.dodico.dico.DicoParamsListener;
import org.fudaa.dodico.h2d.H2dBord;
- import org.fudaa.dodico.h2d.H2dBordMutable;
[...1677 lines suppressed...]
+ .getBordContainingIdx(temp[1])
+ .getType();
+ }
+ public H2dClType getTracerType(int _i) {
+ if ((_i == bordIdx_) && (bord_ != null))
+ return bord_.getTracerType();
+ getMaillage()
+ .getPtsFrontiere()
+ .getIdxFrontierIdxPtInFrontierFromFrontier(
+ _i,
+ temp);
+ saveBord(_i);
+ return (
+ (H2dTelemacBord)getBordPerFrontier(temp[0]).getBordContainingIdx(
+ temp[1]))
+ .getTracerType();
+ }
+ };
}
}
Index: H2dTelemacCLSourceInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLSourceInterface.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dTelemacCLSourceInterface.java 8 Oct 2003 12:14:47 -0000 1.1
--- H2dTelemacCLSourceInterface.java 29 Oct 2003 11:41:27 -0000 1.2
***************
*** 10,13 ****
--- 10,14 ----
import org.fudaa.dodico.h2d.type.H2dBordType;
+ import org.fudaa.dodico.h2d.type.H2dClType;
/**
***************
*** 17,21 ****
public interface H2dTelemacCLSourceInterface {
public int getNbLines();
-
/**
* Doit renvoyer les conditions limites dans l'ordre de numérotation
--- 18,21 ----
***************
*** 28,31 ****
--- 28,33 ----
*/
public H2dBordType getBordType(int _i);
+
+ public H2dClType getTracerType(int _i);
Index: H2dTelemacConditionLimite.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacConditionLimite.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dTelemacConditionLimite.java 8 Oct 2003 11:53:08 -0000 1.3
--- H2dTelemacConditionLimite.java 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 1 ****
! /*
* @file H2dConditionLimiteTelemac.java
* @creation 25 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.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacConditionLimite extends H2dConditionLimite {
H2dClType traceurType_;
double traceur_;
H2dClType stricklerType_;
double strickler_;
double traceurCoefA_;
double traceurCoefB_;
// protected H2dBordType bordType_;
/**
*
*/
public H2dTelemacConditionLimite() {
super();
}
/**
*
*/
// public H2dBordType getBordType() {
// return bordType_;
// }
/**
*
*/
public double getStrickler() {
return strickler_;
}
/**
*
*/
public H2dClType getStricklerType() {
return stricklerType_;
}
/**
*
*/
public double getTraceur() {
return traceur_;
}
/**
*
*/
public double getTraceurCoefA() {
return traceurCoefA_;
}
/**
*
*/
public double getTraceurCoefB() {
return traceurCoefB_;
}
/**
*
*/
public H2dClType getTraceurType() {
return traceurType_;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dConditionLimiteTelemac.java
* @creation 25 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.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacConditionLimite extends H2dConditionLimite {
double traceur_;
double frottementParoi_;
double traceurCoefA_;
double traceurCoefB_;
/**
*
*/
public H2dTelemacConditionLimite() {
super();
}
/**
*
*/
public double getFrottementParoi() {
return frottementParoi_;
}
/**
*
*/
public double getTraceur() {
return traceur_;
}
/**
*
*/
public double getTraceurCoefA() {
return traceurCoefA_;
}
/**
*
*/
public double getTraceurCoefB() {
return traceurCoefB_;
}
}
\ No newline at end of file
Index: H2dTelemacConditionLimiteMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacConditionLimiteMutable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dTelemacConditionLimiteMutable.java 8 Oct 2003 11:53:08 -0000 1.3
--- H2dTelemacConditionLimiteMutable.java 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 1 ****
! /*
* @file H2dConditionLimiteTelemacMutable.java
* @creation 25 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.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacConditionLimiteMutable
extends H2dTelemacConditionLimite {
/**
*
*/
public H2dTelemacConditionLimiteMutable() {
super();
}
/**
*
*/
public void setStrickler(double _s) {
strickler_= _s;
}
/**
*
*/
public void setStricklerType(H2dClType _s) {
stricklerType_= _s;
}
/**
*
*/
public void setTraceur(double _s) {
traceur_= _s;
}
/**
*
*/
public void setTraceurCoefA(double _s) {
traceurCoefA_= _s;
}
/**
*
*/
public void setTraceurCoefB(double _s) {
traceurCoefB_= _s;
}
/**
*
*/
public void setTraceurType(H2dClType _s) {
traceurType_= _s;
}
/**
*
*/
// public void setBordType(H2dBordType _s) {
// bordType_= _s;
// }
/**
*
*/
public void setH(double _s) {
h_= _s;
}
/**
*
*/
public void setHType(H2dClType _s) {
hType_= _s;
}
/**
*
*/
public void setIndexPt(int _s) {
indexPt_= _s;
}
/**
*
*/
public void setU(double _s) {
u_= _s;
}
/**
*
*/
public void setUType(H2dClType _s) {
uType_= _s;
}
/**
*
*/
public void setV(double _s) {
v_= _s;
}
/**
*
*/
public void setVType(H2dClType _s) {
vType_= _s;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dConditionLimiteTelemacMutable.java
* @creation 25 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.dodico.h2d.telemac;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacConditionLimiteMutable
extends H2dTelemacConditionLimite {
/**
*
*/
public H2dTelemacConditionLimiteMutable() {
super();
}
/**
*
*/
public void setStrickler(double _s) {
frottementParoi_= _s;
}
/**
*
*/
// public void setStricklerType(H2dClType _s) {
// stricklerType_= _s;
// }
/**
*
*/
public void setTraceur(double _s) {
traceur_= _s;
}
/**
*
*/
public void setTraceurCoefA(double _s) {
traceurCoefA_= _s;
}
/**
*
*/
public void setTraceurCoefB(double _s) {
traceurCoefB_= _s;
}
/**
*
*/
// public void setTraceurType(H2dClType _s) {
// traceurType_= _s;
// }
/**
*
*/
// public void setBordType(H2dBordType _s) {
// bordType_= _s;
// }
/**
*
*/
public void setH(double _s) {
h_= _s;
}
/**
*
*/
public void setHType(H2dClType _s) {
hType_= _s;
}
/**
*
*/
public void setIndexPt(int _s) {
indexPt_= _s;
}
/**
*
*/
public void setU(double _s) {
u_= _s;
}
/**
*
*/
public void setUType(H2dClType _s) {
uType_= _s;
}
/**
*
*/
public void setV(double _s) {
v_= _s;
}
/**
*
*/
public void setVType(H2dClType _s) {
vType_= _s;
}
}
\ No newline at end of file
Index: H2dTelemacDicoFileFormatVersion.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacDicoFileFormatVersion.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dTelemacDicoFileFormatVersion.java 10 Oct 2003 14:43:19 -0000 1.2
--- H2dTelemacDicoFileFormatVersion.java 29 Oct 2003 11:41:27 -0000 1.3
***************
*** 37,40 ****
--- 37,46 ----
public abstract DicoEntite getVelocityProfils();
public abstract DicoEntite getLiquidBoundaryOption();
+
+ /**
+ * @see #getVelocityProfils()
+ * @return true if the velocities (or flowrate) are fixed for this value of velocity profil.
+ */
+ public abstract boolean isVelocitiesFixedByVelocityProfils(String _v);
}
Index: H2dTelemacParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacParametres.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** H2dTelemacParametres.java 10 Oct 2003 14:43:19 -0000 1.5
--- H2dTelemacParametres.java 29 Oct 2003 11:41:27 -0000 1.6
***************
*** 1 ****
! /*
* @file H2dTelemacParametres.java
* @creation 20 août 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.dodico.h2d.telemac;
import java.util.List;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.h2d.H2dCLManagerInterface;
import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacParametres extends H2dParametres {
public static final DodicoPermanentList BORD_LIST=
new DodicoPermanentList(
DodicoLib.sort(
new H2dBordType[] {
H2dBordType.SOLIDE,
H2dBordType.LIQUIDE_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE,
H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_DEBIT_IMPOSE,
H2dBordType.LIQUIDE_ONDE_INCIDENCE }));
/**
* @param _m
*/
public H2dTelemacParametres(H2dTelemacDicoParams _p) {
super(_p);
}
public H2dTelemacDicoParams getTelemacDicoParams(){
return (H2dTelemacDicoParams)getDicoParams();
}
public DodicoPermanentList getBordList(){
return BORD_LIST;
}
public void initCL(
H2dTelemacCLSourceInterface _cls,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (getMaillage() == null) {
if (_analyze != null)
_analyze.addFatalError(
H2dResource.getS("Le maillage n'est pas spécifié"));
new Throwable().printStackTrace();
return;
}
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(getMaillage(), _cls, _analyze, _inter);
clMng.setDicoParams(getDicoParams(), _analyze);
super.setClManager(clMng);
}
public void setNoCL(){
super.setClManager(H2dTelemacCLManager.init(getMaillage()));
}
/**
*
*/
public H2dTelemacCLManager getTelemacCLManager() {
return (H2dTelemacCLManager)getCLManager();
}
/**
*
*/
public void setClManager(H2dCLManagerInterface _clMng) {
throw new IllegalAccessError("call initCL");
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dTelemacParametres.java
* @creation 20 août 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.dodico.h2d.telemac;
import java.util.List;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.h2d.H2dCLManagerInterface;
import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dTelemacParametres extends H2dParametres {
private H2dTelemacProjectListener listener_;
private H2dTelemacCLManager clMng_;
public static final DodicoPermanentList BORD_LIST=
new DodicoPermanentList(
DodicoLib.sort(
new H2dBordType[] {
H2dBordType.SOLIDE,
H2dBordType.LIQUIDE_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE,
H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_DEBIT_IMPOSE,
H2dBordType.LIQUIDE_ONDE_INCIDENCE }));
/**
* @param _m
*/
public H2dTelemacParametres(H2dTelemacDicoParams _p) {
super(_p);
}
public H2dTelemacDicoParams getTelemacDicoParams(){
return (H2dTelemacDicoParams)getDicoParams();
}
public DodicoPermanentList getBordList(){
return BORD_LIST;
}
public void setProjectListener(H2dTelemacProjectListener _l) {
if(_l==listener_) return;
if (listener_ != null) {
if (clMng_ != null)
clMng_.removeClChangedListener(listener_);
if (dicoParams_ != null)
dicoParams_.removeModelListener(listener_);
}
if (_l != null) {
listener_=_l;
if (clMng_ != null)
clMng_.addClChangedListener(_l);
if (dicoParams_ != null)
dicoParams_.addModelListener(_l);
}
}
public void initCL(
H2dTelemacCLSourceInterface _cls,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (getMaillage() == null) {
if (_analyze != null)
_analyze.addFatalError(
H2dResource.getS("Le maillage n'est pas spécifié"));
new Throwable().printStackTrace();
return;
}
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(getMaillage(), _cls, _analyze, _inter);
clMng.setDicoParams(getDicoParams(), _analyze);
setClManager(clMng);
}
public void setNoCL(){
setClManager(H2dTelemacCLManager.init(getMaillage()));
}
protected void setClManager(H2dTelemacCLManager _clMng){
if((clMng_!=_clMng) && (_clMng!=null)){
if(_clMng!=null) _clMng.removeClChangedListener(listener_);
clMng_=_clMng;
clMng_.addClChangedListener(listener_);
}
}
/**
*
*/
public H2dTelemacCLManager getTelemacCLManager() {
return clMng_;
}
/**
*
*/
public H2dCLManagerInterface getCLManager() {
return clMng_;
}
}
\ No newline at end of file
--- H2dTelemacListener.java DELETED ---
|