|
From: <de...@us...> - 2012-07-18 22:24:00
|
Revision: 7510
http://fudaa.svn.sourceforge.net/fudaa/?rev=7510&view=rev
Author: deniger
Date: 2012-07-18 22:23:54 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
ajout m?\195?\169thode utilitaires
Modified Paths:
--------------
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableGraphePanel.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableModel.java
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableGraphePanel.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2012-07-18 15:37:07 UTC (rev 7509)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableGraphePanel.java 2012-07-18 22:23:54 UTC (rev 7510)
@@ -45,7 +45,6 @@
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.ressource.EbliResource;
-import org.geotools.math.Statistics;
/**
* Un panneau qui affiche une table de la courbe selectionne par le graphe.
@@ -60,8 +59,6 @@
private EGTableGraphePanel graphePanel;
Double newX_;
Double newY_;
- protected int xRowIndex = 0;
- protected int yRowIndex = 1;
public SpecTableModel(EGTableGraphePanel graphePanel) {
this.graphePanel = graphePanel;
@@ -493,7 +490,10 @@
}
public TableCellRenderer getDefaultRenderer(final Class _columnClass) {
- return renderer_;
+ if (Double.class.equals(_columnClass)) {
+ return renderer_;
+ }
+ return super.getDefaultRenderer(_columnClass);
}
};
t_.setDeleteAction(getActionDelete());
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableModel.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableModel.java 2012-07-18 15:37:07 UTC (rev 7509)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableModel.java 2012-07-18 22:23:54 UTC (rev 7510)
@@ -14,17 +14,19 @@
/**
* Un model pour pour les courbes.
- *
+ *
* @author Fred Deniger
* @version $Id: EGTableModel.java,v 1.16 2007-05-22 14:19:04 deniger Exp $
*/
public class EGTableModel extends AbstractTableModel {
EGCourbe c_;
-
EGGraphe a_;
+ protected int xRowIndex = 0;
+ protected int yRowIndex = 1;
- public EGTableModel() {}
+ public EGTableModel() {
+ }
protected void setGraphe(final EGGraphe _a) {
a_ = _a;
@@ -58,13 +60,13 @@
}
double x = c_.getModel().getX(_rowIndex);
double y = c_.getModel().getY(_rowIndex);
- if (_columnIndex == 0) {
+ if (_columnIndex == xRowIndex) {
try {
x = Double.parseDouble(_value.toString());
} catch (final NumberFormatException _e) {
return;
}
- } else if (_columnIndex == 1) {
+ } else if (_columnIndex == yRowIndex) {
try {
y = Double.parseDouble(_value.toString());
} catch (final NumberFormatException _e) {
@@ -75,9 +77,9 @@
}
public void setValueAt(final double _val, final int _rowIndex, final int _columnIndex,
- final CtuluCommandContainer _cmd) {
- final double x = _columnIndex == 0 ? _val : c_.getModel().getX(_rowIndex);
- final double y = _columnIndex == 1 ? _val : c_.getModel().getY(_rowIndex);
+ final CtuluCommandContainer _cmd) {
+ final double x = _columnIndex == xRowIndex ? _val : c_.getModel().getX(_rowIndex);
+ final double y = _columnIndex == yRowIndex ? _val : c_.getModel().getY(_rowIndex);
c_.getModel().setValue(_rowIndex, x, y, _cmd);
}
@@ -91,7 +93,7 @@
protected void selectedCourbeChanged(final EGCourbe _a) {
c_ = _a;
- fireTableStructureChanged();
+ fireTableDataChanged();
}
public EGAxeHorizontal getH() {
@@ -100,9 +102,9 @@
public String getColumnName(final int _column) {
String res = CtuluLibString.ESPACE;
- if (getH() != null && _column == 0) {
+ if (getH() != null && _column == xRowIndex) {
res = getH().titre_;
- } else if (c_ != null && c_.getAxeY() != null) {
+ } else if (_column == yRowIndex && c_ != null && c_.getAxeY() != null) {
res = c_.getAxeY().titre_;
}
return (res == null || res.length() == 0) ? CtuluLibString.ESPACE : res;
@@ -141,10 +143,12 @@
if (c_ == null || h == null || (_rowIndex >= c_.getModel().getNbValues())) {
return CtuluLibString.EMPTY_STRING;
}
- if (_columnIndex == 1) {
+ if (_columnIndex == yRowIndex) {
return getY(c_.getModel().getY(_rowIndex));
}
- return getX(c_.getModel().getX(_rowIndex));
+ if (_columnIndex == xRowIndex) {
+ return getX(c_.getModel().getX(_rowIndex));
+ }
+ return CtuluLibString.EMPTY_STRING;
}
-
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|