|
From: <de...@us...> - 2012-07-19 09:03:58
|
Revision: 7513
http://fudaa.svn.sourceforge.net/fudaa/?rev=7513&view=rev
Author: deniger
Date: 2012-07-19 09:03:51 +0000 (Thu, 19 Jul 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxe.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGGraphePersist.java
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxe.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxe.java 2012-07-18 22:31:53 UTC (rev 7512)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxe.java 2012-07-19 09:03:51 UTC (rev 7513)
@@ -1,8 +1,6 @@
/**
- * @creation 1999-07-29
- * @modification $Date: 2007-05-22 14:19:05 $
- * @license GNU General Public License 2
- * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @creation 1999-07-29 @modification $Date: 2007-05-22 14:19:05 $ @license GNU General Public License 2 @copyright (c)1998-2001 CETMEF 2 bd Gambetta
+ * F-60231 Compiegne
*/
package org.fudaa.ebli.courbe;
@@ -37,41 +35,29 @@
public static final String PROP_EXTREMITE_VISIBLE = "axeExtremiteVisible";
public static final String PROP_TITLE_VISIBLE = "axeTitleVisible";
public static final String PROP_UNIT_VISIBLE = "axeUnitVisible";
-
public static final String PROP_GRADUATIONS = "axeGraduations";
public static final String PROP_TRACE_GRADUATIONS = "traceGraduation";
public static final String PROP_TRACE_SOUS_GRADUATIONS = "traceSousGraduation";
public static final String PROP_IS_GRID_GRADUATIONS_PAINTED = "displayGraduation";
public static final String PROP_IS_GRID_SOUS_GRADUATIONS_PAINTED = "displaySousGraduation";
-
public static final String PROP_TITLE_CENTERED = "axeTitleCentered";
public static final String PROP_BOUNDS = "axeBounds";
-
final CtuluRange range_ = new CtuluRange();
-
TickIterator axisIterator_;
-
Font font_;
-
boolean graduations_;
-
/**
* Booleen qui indique si l'on trace ou non la graduation
*/
boolean traceGrille_ = false;
-
/**
* Booleen qui indique si l'on trcae
*/
boolean traceSousGrille_ = false;
-
TraceLigneModel traceGraduations_;
TraceLigneModel traceSousGraduations_;
-
boolean isIteratorUptodate_;
-
Color lineColor_;
-
public static int MANUEL_GRADUATIONS = 0;
public static int MANUEL_LONGUEURPAS = 1;
public static int AUTO_GRADUATIONS = 2;
@@ -81,41 +67,28 @@
protected boolean isGridPainted() {
return isTraceGrille() || isTraceSousGrille();
}
-
/**
- * Mode automatique ou manuel manuel graduations calcul le meme nombre de graduations . manuel calcul les graduations
- * tous les longueur pas. automatique graduations: calcul au mieux les graduations automatique longueur pas: calcul
- * les graduations puis au mieux logarithmique.
+ * Mode automatique ou manuel manuel graduations calcul le meme nombre de graduations . manuel calcul les graduations tous les longueur pas.
+ * automatique graduations: calcul au mieux les graduations automatique longueur pas: calcul les graduations puis au mieux logarithmique.
*/
protected int modeGraduations_ = AUTO_GRADUATIONS;
/**
* Mode nb graduations
*/
int nbPas_;
-
/**
* Mode on donne la longueur des pas
*/
double longueurPas_;
-
CtuluNumberFormatI specificFormat_;
-
String titre_;
-
boolean titreVisible_ = true;
-
String unite_;
-
boolean uniteVisible_ = true;
-
CtuluValueEditorI valueEditor_;
-
boolean visible_;
-
protected boolean isExtremiteDessinee_;
-
protected boolean isTitreCentre_ = true;
-
protected TickIterator reuseIterator_;
public EGAxe() {
@@ -160,10 +133,11 @@
isTitreCentre_ = _a.isTitreCentre_;
font_ = _a.font_;
nbPas_ = _a.nbPas_;
- modeGraduations_=_a.modeGraduations_;
- longueurPas_=_a.longueurPas_;
- if(_a.specificFormat_!=null)
- specificFormat_=_a.specificFormat_.getCopy();
+ modeGraduations_ = _a.modeGraduations_;
+ longueurPas_ = _a.longueurPas_;
+ if (_a.specificFormat_ != null) {
+ specificFormat_ = _a.specificFormat_.getCopy();
+ }
if (_a.traceGraduations_ != null) {
traceGraduations_ = new TraceLigneModel(_a.traceGraduations_);
}
@@ -175,12 +149,16 @@
/**
* Peut retour l'iterateur principal: ne pas faire de init.
- *
+ *
* @return un iterateur a jour.
*/
private TickIterator getUpdatedTickIterator() {
- if (axisIterator_ == null) { return buildUpToDateMainTickIterator(); }
- if (isIteratorUptodate_) { return axisIterator_; }
+ if (axisIterator_ == null) {
+ return buildUpToDateMainTickIterator();
+ }
+ if (isIteratorUptodate_) {
+ return axisIterator_;
+ }
try {
TickIterator r = null;
if (reuseIterator_ != null && reuseIterator_.getClass().equals(axisIterator_.getClass())) {
@@ -197,7 +175,6 @@
}
return null;
}
-
/**
* nombre de sous graduations
*/
@@ -256,7 +233,7 @@
/**
* Modifie la propriete extremite dessinee.
- *
+ *
* @param _isExtremiteDessinee
*/
final boolean setExtremiteDessinee(final boolean _isExtremiteDessinee) {
@@ -285,26 +262,25 @@
}
protected void firePropertyChange(final String _prop) {
- /*
- * if (listener_ != null) { listener_.firePropertyChange(_prop, false, true); }
- */
+ /*
+ * if (listener_ != null) { listener_.firePropertyChange(_prop, false, true); }
+ */
}
protected void firePropertyChange(final String _prop, final Object _old, final Object _new) {
- /*
- * if (listener_ != null) { listener_.firePropertyChange(_prop, _old, _new); }
- */
+ /*
+ * if (listener_ != null) { listener_.firePropertyChange(_prop, _old, _new); }
+ */
}
protected void firePropertyChange(final String _prop, final boolean _new) {
- /*
- * if (listener_ != null) { listener_.firePropertyChange(_prop, !_new, _new); }
- */
+ /*
+ * if (listener_ != null) { listener_.firePropertyChange(_prop, !_new, _new); }
+ */
}
/**
- * Met a jour l'iterateur reutilisable. Faire attention lorsque on parcourt cet iterateur: Acces concurrents non
- * geres.
+ * Met a jour l'iterateur reutilisable. Faire attention lorsque on parcourt cet iterateur: Acces concurrents non geres.
*/
protected void updateReuseIterator() {
// on cree si necessaire l'iterateur principal pour le cloner.
@@ -312,7 +288,9 @@
buildUpToDateMainTickIterator();
}
// prob on laisse tomber
- if (axisIterator_ == null) { return; }
+ if (axisIterator_ == null) {
+ return;
+ }
// le reuse iterateur n'est pas correct: on clone le principal
if (reuseIterator_ == null || (!reuseIterator_.getClass().equals(axisIterator_.getClass()))) {
try {
@@ -329,9 +307,8 @@
}
/**
- * Permet d'ajuster les bornes de cet axe par rapport � _a : si le min de _a est inf au min de cet axe, le this.min
- * est modifie.
- *
+ * Permet d'ajuster les bornes de cet axe par rapport � _a : si le min de _a est inf au min de cet axe, le this.min est modifie.
+ *
* @param _a l'axe a ajuster
*/
public void adjustBounds(final EGAxe _a) {
@@ -381,7 +358,6 @@
/*
* public double getPas(){ return getInitializedTickIterator().getIncrement(); }
*/
-
public double getMinimum() {
return range_.isNill() ? 0 : range_.getMin();
}
@@ -394,7 +370,9 @@
}
public double getPositionFromValue(final double _v) {
- if (axisIterator_ == null) { return _v; }
+ if (axisIterator_ == null) {
+ return _v;
+ }
return axisIterator_.getPositionFromValue(_v);
}
@@ -407,7 +385,9 @@
* @return la chaine a utiliser pour l'affichage
*/
public String getStringAffiche(final double _val) {
- if (specificFormat_ != null) { return specificFormat_.format(_val); }
+ if (specificFormat_ != null) {
+ return specificFormat_.format(_val);
+ }
return getUpdatedTickIterator().formatValue(_val);
}
@@ -416,7 +396,9 @@
* @return la chaine a utiliser pour l'affichage de valeur interpolee
*/
public String getStringInterpolatedAffiche(final double _val) {
- if (specificFormat_ != null) { return specificFormat_.format(_val); }
+ if (specificFormat_ != null) {
+ return specificFormat_.format(_val);
+ }
return getUpdatedTickIterator().formatSubValue(_val);
}
@@ -436,7 +418,9 @@
}
public double getValueFromPosition(final double _v) {
- if (axisIterator_ == null) { return _v; }
+ if (axisIterator_ == null) {
+ return _v;
+ }
return axisIterator_.getValueFromPosition(_v);
}
@@ -444,10 +428,9 @@
return graduations_;
}
-
public boolean isLogarithmique() {
return axisIterator_ != null
- && (axisIterator_ instanceof LogarithmicNumberIterator || modeGraduations_ == LOGARITHMIQUE);
+ && (axisIterator_ instanceof LogarithmicNumberIterator || modeGraduations_ == LOGARITHMIQUE);
}
@@ -469,7 +452,6 @@
return visible_;
}
-
public final void setAxisIterator(final TickIterator _axisIterator) {
axisIterator_ = _axisIterator;
isIteratorUptodate_ = false;
@@ -497,7 +479,7 @@
/**
* SetBounds versions nombre de graduations
- *
+ *
* @param _min
* @param _max
* @param _nbPas
@@ -532,7 +514,7 @@
nbPas_ = TickIterator.DEFAULT_STICK_NUMBER;
}
if (oldPas != nbPas_ || Double.doubleToLongBits(oldMin) != Double.doubleToLongBits(range_.min_)
- || Double.doubleToLongBits(oldMax) != Double.doubleToLongBits(range_.max_) || oldMode != modeGraduations_) {
+ || Double.doubleToLongBits(oldMax) != Double.doubleToLongBits(range_.max_) || oldMode != modeGraduations_) {
isIteratorUptodate_ = false;
firePropertyChange(PROP_BOUNDS);
return true;
@@ -543,7 +525,7 @@
/**
* SetBounds versions nombre de graduations
- *
+ *
* @param _min
* @param _max
* @param _nbPas
@@ -583,7 +565,7 @@
nbPas_ = TickIterator.DEFAULT_STICK_NUMBER;
}
if (oldLongPas != longueurPas_ || Double.doubleToLongBits(oldMin) != Double.doubleToLongBits(range_.min_)
- || Double.doubleToLongBits(oldMax) != Double.doubleToLongBits(range_.max_) || oldMode != modeGraduations_) {
+ || Double.doubleToLongBits(oldMax) != Double.doubleToLongBits(range_.max_) || oldMode != modeGraduations_) {
isIteratorUptodate_ = false;
firePropertyChange(PROP_BOUNDS);
return true;
@@ -612,7 +594,6 @@
}
// }
-
public boolean setLineColor(final Color _lineColor) {
if (lineColor_ != _lineColor) {
final Color old = lineColor_;
@@ -669,7 +650,21 @@
}
return false;
}
+ boolean titleModifiable = true;
+ boolean uniteModifiable = true;
+ public void setTitleModifiable(boolean titleModifiable) {
+ this.titleModifiable = titleModifiable;
+ }
+
+ public boolean isUniteModifiable() {
+ return uniteModifiable;
+ }
+
+ public void setUniteModifiable(boolean uniteModifiable) {
+ this.uniteModifiable = uniteModifiable;
+ }
+
public boolean isTitleModifiable() {
return false;
}
@@ -698,8 +693,7 @@
public boolean setTraceGrille(final boolean traceGrille) {
if (this.traceGrille_ != traceGrille) {
this.traceGrille_ = traceGrille;
- firePropertyChange(PROP_IS_GRID_GRADUATIONS_PAINTED, Boolean.valueOf(!traceGrille_), Boolean
- .valueOf(traceGrille_));
+ firePropertyChange(PROP_IS_GRID_GRADUATIONS_PAINTED, Boolean.valueOf(!traceGrille_), Boolean.valueOf(traceGrille_));
return true;
}
return false;
@@ -712,8 +706,7 @@
public boolean setTraceSousGrille(final boolean traceSousGrille) {
if (traceSousGrille != traceSousGrille_) {
this.traceSousGrille_ = traceSousGrille;
- firePropertyChange(PROP_IS_GRID_SOUS_GRADUATIONS_PAINTED, Boolean.valueOf(!traceSousGrille_), Boolean
- .valueOf(traceSousGrille_));
+ firePropertyChange(PROP_IS_GRID_SOUS_GRADUATIONS_PAINTED, Boolean.valueOf(!traceSousGrille_), Boolean.valueOf(traceSousGrille_));
return true;
}
return false;
@@ -749,7 +742,9 @@
* @param traceGraduations the traceGraduations_ to set
*/
public boolean setTraceGraduations(final TraceLigneModel traceGraduations) {
- if (traceGraduations == null) { return false; }
+ if (traceGraduations == null) {
+ return false;
+ }
if (!traceGraduations.equals(traceGraduations_)) {
traceGraduations_.updateData(traceGraduations);
firePropertyChange(PROP_TRACE_GRADUATIONS, Boolean.TRUE, Boolean.FALSE);
@@ -769,7 +764,9 @@
* @param traceSousGraduations the traceSousGraduations_ to set
*/
public boolean setTraceSousGraduations(final TraceLigneModel traceSousGraduations) {
- if (traceSousGraduations == null) { return false; }
+ if (traceSousGraduations == null) {
+ return false;
+ }
if (!traceSousGraduations.equals(traceSousGraduations_)) {
traceSousGraduations_.updateData(traceSousGraduations);
firePropertyChange(PROP_TRACE_SOUS_GRADUATIONS, Boolean.TRUE, Boolean.FALSE);
@@ -777,5 +774,4 @@
}
return false;
}
-
}
\ No newline at end of file
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2012-07-18 22:31:53 UTC (rev 7512)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2012-07-19 09:03:51 UTC (rev 7513)
@@ -66,16 +66,14 @@
* @version $Id: EGAxeRepereConfigurator.java,v 1.12 2007-05-04 13:49:41 deniger Exp $
*/
public class EGAxeRepereConfigurator extends BuPanel implements ActionListener, BuBorders, KeyListener,
- BSelecteurTargetInterface {
+ BSelecteurTargetInterface {
private final static CtuluValueEditorI DEFAULT_EDITOR = CtuluValueEditorDefaults.DOUBLE_EDITOR;
-
public static String GRILLE_AXE_X = "GRILLE_AXE_X";
-
public static String GRILLE_AXE_Y = "GRILLE_AXE_Y";
public static String SOUS_GRILLE_AXE_X = "SOUS_GRILLE_AXE_X";
-
public static String SOUS_GRILLE_AXE_Y = "SOUS_GRILLE_AXE_Y";
+
private static JPanel createPanel(JComponent... components) {
JPanel pn = new JPanel(new BuGridLayout(components.length, 1, 1, true, true));
for (JComponent jComponent : components) {
@@ -83,15 +81,16 @@
}
return pn;
}
+
protected static void initPanel(final JPanel _p, final String _title) {
_p.setLayout(new BuGridLayout(2, 5, 5));
_p.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(
- BorderFactory.createEtchedBorder(), _title), EMPTY2222));
+ BorderFactory.createEtchedBorder(), _title), EMPTY2222));
}
/**
* Rend les largeurs des labels homog\xE8nes.
- *
+ *
* @param _p un panneau contenant des panneaux contenant des labels en premiere ligne
*/
public static void updateLabelWidth(final JPanel _p) {
@@ -122,70 +121,54 @@
BuCheckBox axeYVisible;
BuCheckBox boxAfficheGraduationsX_ = new BuCheckBox(EbliLib.getS("Afficher la grille"));
BuCheckBox boxAfficheGraduationsY_ = new BuCheckBox(EbliLib.getS("Afficher la grille"));
-
BuCheckBox boxAfficheSousGraduationsX_ = new BuCheckBox(EbliLib.getS("Afficher la sous grille"));
-
BuCheckBox boxAfficheSousGraduationsY_ = new BuCheckBox(EbliLib.getS("Afficher la sous grille"));
-
private BuCheckBox boxChooserUserLimitY;
private BuCheckBox boxChooseUserLimitX_;
private BuCheckBox cbInitialConf_;
// private BuCheckBox cbUnblockBlockHView_;
private BuCheckBox cbUseSameAxe_;
-
BuComboBox comboHorizontal_ = null;
BuComboBox comboVertical_ = null;
private CtuluValueEditorI editorH_;
private CtuluValueEditorI editorV_;
private final CtuluNumberFormatFixedFigure formatter = new CtuluNumberFormatFixedFigure(6);
private final EGGraphe graphe_;
-
private Map mapRangesY_ = null;
/**
- * 4 mode pour les graduations: 0: mode manuel graduations 1: mode manuel longueurs de pas 2: mode automatique
- * graduations 3: mode automatique longueurs de pas
+ * 4 mode pour les graduations: 0: mode manuel graduations 1: mode manuel longueurs de pas 2: mode automatique graduations 3: mode automatique
+ * longueurs de pas
*/
public int modeGraduationX_ = EGAxe.AUTO_GRADUATIONS;
/**
- * 4 mode pour les graduations: 0: mode manuel graduations 1: mode manuel longueurs de pas 2: mode automatique
- * graduations 3: mode automatique longueurs de pas
+ * 4 mode pour les graduations: 0: mode manuel graduations 1: mode manuel longueurs de pas 2: mode automatique graduations 3: mode automatique
+ * longueurs de pas
*/
public int modeGraduationY_ = EGAxe.AUTO_GRADUATIONS;
BSelecteurLineModel modelGraduationsX_;
BSelecteurLineModel modelGraduationsY_;
-
BSelecteurLineModel modelSousGraduationsX_;
-
BSelecteurLineModel modelSousGraduationsY_;
-
private final BuPanel pnAxeX;
-
private final BuPanel pnAxeY_;
-
EGObject[] targets_;
-
private JComponent tfHorMax_;
-
private JComponent tfHorMin_;
private BuTextField tfHorPas_;
-
private BuTextField tfHorSousPas_;
private JComponent tfVertMax_;
private JComponent tfVertMin_;
private BuTextField tfVertPas_;
-
private BuTextField tfVertSousPas_;
private BuTextField titreAxeXNom;
BuCheckBox titreAxeXVisible;
private BuTextField titreAxeYNom;
-
BuCheckBox titreAxeYVisible;
private BuTextField uniteAxeXNom;
-
BuCheckBox uniteAxeXVisible;
private BuTextField uniteAxeY_;
-
BuCheckBox uniteAxeYVisible;
+
public EGAxeRepereConfigurator(final EGGraphe _m) {
graphe_ = _m;
// -- on recupere les valeurs des y --//
@@ -224,8 +207,8 @@
btValid.setMnemonic(KeyEvent.VK_A);
btValid.addActionListener(this);
add(bt);
- final EbliActionAbstract s = new EbliActionSimple(EbliResource.EBLI.getString("Restaurer"), EbliResource.EBLI
- .getIcon("restore"), "RESTORE") {
+ final EbliActionAbstract s = new EbliActionSimple(EbliResource.EBLI.getString("Restaurer"), EbliResource.EBLI.getIcon("restore"), "RESTORE") {
+
@Override
public void actionPerformed(final ActionEvent _e) {
// -- on reinitialise les mioin/max saisi par l'user --//
@@ -243,12 +226,15 @@
EGAxeRepereConfigurator.updateLabelWidth(this);
}
+
public void actionPerformed(final ActionEvent _e) {
apply();
}
protected void apply() {
- if ((axes_ == null && axeX_ == null)) { return; }
+ if ((axes_ == null && axeX_ == null)) {
+ return;
+ }
// un seul | pour forcer l'appel aux deux methodes
// normal ....
if (applyVertical() | applyHorizontal()) {
@@ -295,7 +281,7 @@
if (pasEdited) {
if (modeGraduationX_ == EGAxe.MANUEL_GRADUATIONS || modeGraduationX_ == EGAxe.AUTO_GRADUATIONS
- || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
+ || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
r = axeX_.setBounds(minVal, maxVal, (int) pasVal, modeGraduationX_);
} else if (modeGraduationX_ == EGAxe.MANUEL_LONGUEURPAS || modeGraduationX_ == EGAxe.AUTO_LONGUEURPAS) {
r = axeX_.setBounds(minVal, maxVal, pasVal, modeGraduationX_);
@@ -375,7 +361,9 @@
private boolean applyVertical() {
boolean r = false;
- if (CtuluLibArray.isEmpty(axes_)) { return false; }
+ if (CtuluLibArray.isEmpty(axes_)) {
+ return false;
+ }
double maxVal = 0;
double minVal = 0;
boolean minEdited = false;
@@ -428,7 +416,6 @@
if (!minEdited || !boxChooserUserLimitY.isSelected()) {
min = axe.getMinimum();
} else {
-
}
if (!maxEdited || !boxChooserUserLimitY.isSelected()) {
max = axe.getMaximum();
@@ -446,7 +433,7 @@
if (pasModif) {
if (modeGraduationY_ == EGAxe.MANUEL_GRADUATIONS || modeGraduationY_ == EGAxe.AUTO_GRADUATIONS
- || modeGraduationY_ == EGAxe.LOGARITHMIQUE) {
+ || modeGraduationY_ == EGAxe.LOGARITHMIQUE) {
r |= axe.setBounds(min, max, (int) pasVal, modeGraduationY_);
} else if (modeGraduationY_ == EGAxe.MANUEL_LONGUEURPAS || modeGraduationY_ == EGAxe.AUTO_LONGUEURPAS) {
r |= axe.setBounds(min, max, pasVal, modeGraduationY_);
@@ -560,7 +547,7 @@
tfHorPas_.addKeyListener(this);
if (axeX_.getModeGraduations() == EGAxe.AUTO_GRADUATIONS || modeGraduationX_ == EGAxe.MANUEL_GRADUATIONS
- || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
+ || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
tfHorPas_.setText("" + axeX_.nbPas_);
} else if (axeX_.getModeGraduations() == EGAxe.AUTO_LONGUEURPAS || modeGraduationX_ == EGAxe.MANUEL_LONGUEURPAS) {
tfHorPas_.setText("" + axeX_.longueurPas_);
@@ -611,25 +598,25 @@
pnAxeX.add(new BuLabel());
if (boxChooseUserLimitX_ == null) {
boxChooseUserLimitX_ = new BuCheckBox(EbliLib.getS("Affiche uniquement jusqu'aux limites"));
- boxChooseUserLimitX_.setToolTipText(EbliLib
- .getS("Si s\xE9lectionn\xE9, les donn\xE9es de la courbe ne pourront d\xE9passer les valeurs pr\xE9c\xE9dentes"));
+ boxChooseUserLimitX_.setToolTipText(EbliLib.getS("Si s\xE9lectionn\xE9, les donn\xE9es de la courbe ne pourront d\xE9passer les valeurs pr\xE9c\xE9dentes"));
}
pnAxeX.add(boxChooseUserLimitX_);
boxChooseUserLimitX_.setSelected(true);
// -- selection du type de graduations
if (comboHorizontal_ == null) {
- comboHorizontal_ = new BuComboBox(new String[] { EbliLib.getS("Manuel: Nombre de graduations"),
- EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
- EbliLib.getS("Automatique: Longueur des pas"), EbliLib.getS("Logarithmique") });
+ comboHorizontal_ = new BuComboBox(new String[]{EbliLib.getS("Manuel: Nombre de graduations"),
+ EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
+ EbliLib.getS("Automatique: Longueur des pas"), EbliLib.getS("Logarithmique")});
lb = new BuLabel(typePasTxt);
// -- listener de la combo --//
comboHorizontal_.addActionListener(new ActionListener() {
+
public void actionPerformed(final ActionEvent e) {
modeGraduationX_ = comboHorizontal_.getSelectedIndex();
if (modeGraduationX_ == EGAxe.AUTO_GRADUATIONS || modeGraduationX_ == EGAxe.AUTO_LONGUEURPAS
- || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
+ || modeGraduationX_ == EGAxe.LOGARITHMIQUE) {
tfHorSousPas_.setEnabled(false);
} else {
tfHorSousPas_.setEnabled(true);
@@ -645,7 +632,6 @@
// graphe_.axeUpdated();
}
-
});
}
@@ -684,8 +670,8 @@
final String pasTxt = EbliLib.getS("Graduation:");
final String tooltipPas = EbliLib.getS("Nombre maximal de graduations principales");
final String tooltipTxt = "<html>"
- + EbliLib.getS("Si plusieurs axes sont s\xE9lectionn\xE9s, ce champ est vide si les valeurs ne sont pas identiques")
- + "<br>" + EbliLib.getS("Utiliser une valeur vide pour garder la valeur initiale") + "</html>";
+ + EbliLib.getS("Si plusieurs axes sont s\xE9lectionn\xE9s, ce champ est vide si les valeurs ne sont pas identiques")
+ + "<br>" + EbliLib.getS("Utiliser une valeur vide pour garder la valeur initiale") + "</html>";
// les textes fields
if (editorV_ == null) {
tfVertMax_ = new BuLabel(EbliLib.getS("Non \xE9ditable"));
@@ -731,8 +717,8 @@
axeYVisible = new BuCheckBox();
}
- titreAxeYNom.setEnabled(enabled);
- uniteAxeYVisible.setEnabled(enabled);
+ titreAxeYNom.setEnabled(enabled && axeChoisi.isTitleModifiable());
+ uniteAxeYVisible.setEnabled(enabled && axeChoisi.isUniteModifiable());
axeYVisible.setEnabled(enabled);
uniteAxeY_.setEnabled(enabled);
if (enabled) {
@@ -766,8 +752,7 @@
pnAxeY_.add(new BuLabel());
if (boxChooserUserLimitY == null) {
boxChooserUserLimitY = new BuCheckBox(EbliLib.getS("Affiche uniquement jusqu'aux limites"));
- boxChooserUserLimitY.setToolTipText(EbliLib
- .getS("Si s\xE9lectionn\xE9, les donn\xE9es de la courbe ne pourront d\xE9passer les valeurs pr\xE9c\xE9dentes"));
+ boxChooserUserLimitY.setToolTipText(EbliLib.getS("Si s\xE9lectionn\xE9, les donn\xE9es de la courbe ne pourront d\xE9passer les valeurs pr\xE9c\xE9dentes"));
}
pnAxeY_.add(boxChooserUserLimitY);
boxChooserUserLimitY.setSelected(true);
@@ -778,9 +763,10 @@
// pnAxeV_.add(lb);
// -- selection du type de graduations
- comboVertical_ = new BuComboBox(new String[] { EbliLib.getS("Manuel: Nombre de graduations"),
- EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
- EbliLib.getS("Automatique: Longueur des pas"), EbliLib.getS("Logarithmique") }) {
+ comboVertical_ = new BuComboBox(new String[]{EbliLib.getS("Manuel: Nombre de graduations"),
+ EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
+ EbliLib.getS("Automatique: Longueur des pas"), EbliLib.getS("Logarithmique")}) {
+
public void setSelectedIndex(int anIndex) {
super.setSelectedIndex(anIndex);
@@ -794,10 +780,10 @@
pnAxeY_.add(tfVertSousPas_);
// -- listener de la combo --//
comboVertical_.addActionListener(new ActionListener() {
+
public void actionPerformed(final ActionEvent e) {
updateModeGraduationForY();
}
-
});
updateModeGraduationForY();
if (axeChoisi == null && axes_ != null && axes_.length > 0) {
@@ -843,8 +829,7 @@
// same axis
if (cbUseSameAxe_ == null) {
cbUseSameAxe_ = new BuCheckBox(EbliLib.getS("Utiliser le m\xEAme axe"));
- cbUseSameAxe_
- .setToolTipText(EbliLib.getS("Si s\xE9lectionn\xE9, toutes courbes s\xE9lectionn\xE9es utiliseront le m\xEAme axe"));
+ cbUseSameAxe_.setToolTipText(EbliLib.getS("Si s\xE9lectionn\xE9, toutes courbes s\xE9lectionn\xE9es utiliseront le m\xEAme axe"));
// cbUseSameAxe_.addItemListener(this);
}
pnAxeY_.add(new BuLabel());
@@ -852,8 +837,7 @@
// configuration initiale
if (cbInitialConf_ == null) {
cbInitialConf_ = new BuCheckBox(EbliLib.getS("Axes: configuration intiale"));
- cbInitialConf_.setToolTipText(EbliLib
- .getS("Si s\xE9lectionn\xE9, la configuration initiale des axes s\xE9lectionn\xE9s sera r\xE9tablie"));
+ cbInitialConf_.setToolTipText(EbliLib.getS("Si s\xE9lectionn\xE9, la configuration initiale des axes s\xE9lectionn\xE9s sera r\xE9tablie"));
// cbInitialConf_.addItemListener(this);
}
pnAxeY_.add(new BuLabel());
@@ -875,10 +859,11 @@
});
}
titreAxeXVisible.setSelected(axeX_.titreVisible_);
+
if (axeX_.titre_ != null) {
titreAxeXNom.setText(axeX_.titre_);
}
- titreAxeXNom.setEnabled(titreAxeXVisible.isSelected());
+ titreAxeXNom.setEnabled(titreAxeXVisible.isSelected() && axeX_.isTitleModifiable());
}
private void createAxeXUnitComponents() {
@@ -897,7 +882,7 @@
}
uniteAxeXVisible.setSelected(axeX_.uniteVisible_);
- uniteAxeXNom.setEnabled(uniteAxeXVisible.isSelected());
+ uniteAxeXNom.setEnabled(uniteAxeXVisible.isSelected() && axeX_.isUniteModifiable());
if (axeX_.unite_ != null) {
uniteAxeXNom.setText(axeX_.unite_);
}
@@ -912,10 +897,10 @@
titreAxeYVisible = new BuCheckBox();
titreAxeYVisible.setToolTipText(EbliLib.getS("Affichage ou non du titre de l'axe"));
titreAxeYVisible.addActionListener(new ActionListener() {
+
public void actionPerformed(ActionEvent e) {
titreAxeYNom.setEnabled(titreAxeYVisible.isSelected());
}
-
});
}
}
@@ -929,10 +914,10 @@
uniteAxeYVisible = new BuCheckBox();
uniteAxeYVisible.setToolTipText(EbliLib.getS("Affichage ou non de l'unit\xE9"));
uniteAxeYVisible.addActionListener(new ActionListener() {
+
public void actionPerformed(ActionEvent e) {
uniteAxeY_.setEnabled(uniteAxeYVisible.isSelected());
}
-
});
}
}
@@ -965,7 +950,7 @@
private String getPas(EGAxeVertical firstAxe) {
if (firstAxe.getModeGraduations() == EGAxe.AUTO_GRADUATIONS
- || firstAxe.getModeGraduations() == EGAxe.MANUEL_GRADUATIONS) {
+ || firstAxe.getModeGraduations() == EGAxe.MANUEL_GRADUATIONS) {
return CtuluLibString.getString(firstAxe.getNbPas());
} else {
return Double.toString(firstAxe.longueurPas_);
@@ -973,8 +958,12 @@
}
public Object getProperty(final String _key) {
- if (_key.equals(GRILLE_AXE_X)) { return axeX_.traceGraduations_; }
- if (_key.equals(SOUS_GRILLE_AXE_X)) { return axeX_.traceSousGraduations_; }
+ if (_key.equals(GRILLE_AXE_X)) {
+ return axeX_.traceGraduations_;
+ }
+ if (_key.equals(SOUS_GRILLE_AXE_X)) {
+ return axeX_.traceSousGraduations_;
+ }
EGAxe axeChoisi = null;
if (graphe_.getSelectedComponent() != null) {
@@ -988,13 +977,18 @@
// if(axes_==null || axes_.length==0)
return null;
}
- if (_key.equals(GRILLE_AXE_Y)) { return axeChoisi.traceGraduations_; }
- if (_key.equals(SOUS_GRILLE_AXE_Y)) { return axeChoisi.traceSousGraduations_; }
+ if (_key.equals(GRILLE_AXE_Y)) {
+ return axeChoisi.traceGraduations_;
+ }
+ if (_key.equals(SOUS_GRILLE_AXE_Y)) {
+ return axeChoisi.traceSousGraduations_;
+ }
return null;
}
- public void keyPressed(final KeyEvent _e) {}
+ public void keyPressed(final KeyEvent _e) {
+ }
public void keyReleased(final KeyEvent _e) {
if (_e.getKeyCode() == KeyEvent.VK_ENTER) {
@@ -1002,7 +996,8 @@
}
}
- public void keyTyped(final KeyEvent _e) {}
+ public void keyTyped(final KeyEvent _e) {
+ }
private void setAxeTargets() {
this.updateAxesValue();
@@ -1029,7 +1024,9 @@
graphe_.axeUpdated();
}
- if (axes_ == null || axes_.length == 0) { return false; }
+ if (axes_ == null || axes_.length == 0) {
+ return false;
+ }
if (_key.equals(GRILLE_AXE_Y)) {
for (int i = 0; i < axes_.length; i++) {
axes_[i].traceGraduations_.updateData((TraceLigneModel) prop);
@@ -1064,7 +1061,7 @@
int modeGraduations = axeX_.getModeGraduations();
comboHorizontal_.setSelectedIndex(modeGraduations);
if (modeGraduations == EGAxe.AUTO_GRADUATIONS || modeGraduations == EGAxe.MANUEL_GRADUATIONS
- || modeGraduations == EGAxe.LOGARITHMIQUE) {
+ || modeGraduations == EGAxe.LOGARITHMIQUE) {
tfHorPas_.setText(CtuluLibString.getString(axeX_.getNbPas()));
} else {
tfHorPas_.setText("" + axeX_.longueurPas_);
@@ -1184,7 +1181,7 @@
if (axeChoisi != null) {
int modeGraduations = axeChoisi.getModeGraduations();
if (modeGraduations == EGAxe.AUTO_GRADUATIONS || modeGraduations == EGAxe.MANUEL_GRADUATIONS
- || modeGraduations == EGAxe.LOGARITHMIQUE) {
+ || modeGraduations == EGAxe.LOGARITHMIQUE) {
tfVertPas_.setText("" + axeChoisi.nbPas_);
} else if (modeGraduations == EGAxe.AUTO_LONGUEURPAS || modeGraduations == EGAxe.MANUEL_LONGUEURPAS) {
tfVertPas_.setText("" + axeChoisi.longueurPas_);
@@ -1192,5 +1189,4 @@
}
}
-
}
\ No newline at end of file
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGGraphePersist.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGGraphePersist.java 2012-07-18 22:31:53 UTC (rev 7512)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGGraphePersist.java 2012-07-19 09:03:51 UTC (rev 7513)
@@ -416,6 +416,9 @@
}
courbeParameters.put(EGCourbePersistBuilder.GROUPE_KEY, container);
EGCourbeChild newCurve = builder.restoreObject(cbPersist, courbeParameters, log, getBinFileForCurve(cbPersist.getId()));
+ if(newCurve==null){
+ continue;
+ }
if (cbPersist.getId() >= 0) {
courbeById.put(cbPersist.getId(), newCurve);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|