|
From: <bma...@us...> - 2011-06-16 11:41:34
|
Revision: 6301
http://fudaa.svn.sourceforge.net/fudaa/?rev=6301&view=rev
Author: bmarchan
Date: 2011-06-16 11:41:27 +0000 (Thu, 16 Jun 2011)
Log Message:
-----------
AME : Prise en compte du nombre de digits affich?\195?\169s pour les coordonn?\195?\169es
Modified Paths:
--------------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java
trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluTablePreferencesComponent.java
trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableAction.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliGISPreferencesComponent.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquePanelController.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZModeleDonnees.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/CalqueActionTable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicsEditorPanel.java
trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/commun/EbliTableInfoPanel.java
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -22,7 +22,7 @@
private String title_;
private boolean isDirty_=false;
- public BuContainerPreferencesPanel(BuAbstractPreferencesComponent[] _cmps, String _category, String _title) {
+ public BuContainerPreferencesPanel(String _category, String _title, BuAbstractPreferencesComponent[] _cmps) {
cmps_=_cmps;
category_=_category;
title_=_title;
Modified: trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluTablePreferencesComponent.java
===================================================================
--- trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluTablePreferencesComponent.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ctulu-ui/src/main/java/org/fudaa/ctulu/gui/CtuluTablePreferencesComponent.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -63,7 +63,7 @@
@Override
public String getTitle() {
- return CtuluLib.getS("Export du tableau des valeurs");
+ return CtuluLib.getS("Export CSV du tableau des valeurs");
}
@Override
Modified: trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableAction.java
===================================================================
--- trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableAction.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-1d/src/main/java/org/fudaa/ebli/courbe/EGTableAction.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -23,6 +23,7 @@
import com.memoire.bu.BuMenu;
import com.memoire.bu.BuResource;
import com.memoire.bu.BuTable;
+import org.fudaa.ctulu.CtuluNumberFormatDefault;
import org.fudaa.ctulu.gui.CtuluPopupMenu;
import org.fudaa.ctulu.gui.CtuluUIDialog;
@@ -49,7 +50,7 @@
public void actionPerformed(final ActionEvent _e) {
- final EbliTableInfoPanel pn = new EbliTableInfoPanel(new CtuluUIDialog(graphe_), this);
+ final EbliTableInfoPanel pn = new EbliTableInfoPanel(new CtuluUIDialog(graphe_), this, CtuluNumberFormatDefault.DEFAULT_FMT);
pn.showInDialog();
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -8,12 +8,16 @@
*/
package org.fudaa.ebli.calque;
+import java.text.DecimalFormat;
import javax.swing.JLabel;
import javax.units.SI;
+import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.CtuluLibString;
+import org.fudaa.ctulu.CtuluNumberFormatDefault;
import org.fudaa.ebli.commun.EbliFormatter;
import org.fudaa.ebli.commun.EbliFormatterInterface;
+import org.fudaa.ebli.commun.EbliPreferences;
import org.fudaa.ebli.repere.CoordonneesEvent;
import org.fudaa.ebli.repere.CoordonneesListener;
/**
@@ -27,14 +31,21 @@
JLabel label_;
// Les d\xE9finitions de coordonn\xE9es par defaut.
- private EbliCoordinateDefinition[] defs_=new EbliCoordinateDefinition[]{
- new EbliCoordinateDefinition("X", new EbliFormatter(SI.METER)),
- new EbliCoordinateDefinition("Y", new EbliFormatter(SI.METER)),
- new EbliCoordinateDefinition("Z", new EbliFormatter(SI.METER))
- };
+ private EbliCoordinateDefinition[] defs_;
public EbliAdapteurSuiviSouris(final JLabel _label) {
label_ = _label;
+
+ defs_=new EbliCoordinateDefinition[]{
+ new EbliCoordinateDefinition("X", new EbliFormatter(SI.METER)),
+ new EbliCoordinateDefinition("Y", new EbliFormatter(SI.METER)),
+ new EbliCoordinateDefinition("Z", new EbliFormatter(SI.METER))
+ };
+
+ for (EbliCoordinateDefinition def : defs_) {
+ DecimalFormat fmt=CtuluLib.getDecimalFormat(EbliPreferences.EBLI.getIntegerProperty(EbliGISPreferencesComponent.COORDS_VISU_NB_DIGITS,2));
+ ((CtuluNumberFormatDefault)def.getFormatter().getXYFormatter()).setFmt(fmt);
+ }
}
/**
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliGISPreferencesComponent.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliGISPreferencesComponent.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/EbliGISPreferencesComponent.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -1,7 +1,6 @@
package org.fudaa.ebli.calque;
import com.memoire.bu.BuAbstractPreferencesComponent;
-import com.memoire.bu.BuPreferences;
import com.memoire.bu.BuTextField;
import java.awt.BorderLayout;
import java.awt.Dimension;
@@ -9,6 +8,7 @@
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import org.fudaa.ctulu.CtuluLib;
+import org.fudaa.ebli.commun.EbliPreferences;
/**
* Un composant pour les pr\xE9f\xE9rences d'export de valeurs en CVS/TXT
@@ -20,7 +20,7 @@
private int visuNbDec;
public EbliGISPreferencesComponent() {
- options_=BuPreferences.BU;
+ options_=EbliPreferences.EBLI;
tfCoords_=BuTextField.createIntegerField();
tfCoords_.setPreferredSize(new Dimension(80,tfCoords_.getPreferredSize().height));
@@ -62,7 +62,7 @@
*/
@Override
protected void updateComponent() {
- visuNbDec=options_.getIntegerProperty(COORDS_VISU_NB_DIGITS, 3);
+ visuNbDec=options_.getIntegerProperty(COORDS_VISU_NB_DIGITS, 2);
tfCoords_.setValue(visuNbDec);
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquePanelController.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZEbliCalquePanelController.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -432,7 +432,7 @@
};
l.add(infoPalette_);
- l.add(new CalqueActionTable(pn_.getArbreCalqueModel(), ui_));
+ l.add(new CalqueActionTable(pn_.getArbreCalqueModel(), ui_,pn_));
}
standardActionGroup_ = new EbliActionInterface[l.size()];
l.toArray(standardActionGroup_);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZModeleDonnees.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZModeleDonnees.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/ZModeleDonnees.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -22,6 +22,13 @@
*/
public interface ZModeleDonnees {
+ /**
+ * Cr\xE9e la table pour le tableau des valeurs. Le tableau des valeurs contient
+ * les donn\xE9es du mod\xE8le, g\xE9om\xE9tries ou sommets.
+ *
+ * @param _layer Le calque associ\xE9 \xE0 this.
+ * @return Un tableau.
+ */
BuTable createValuesTable(ZCalqueAffichageDonneesInterface _layer);
/**
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/CalqueActionTable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/CalqueActionTable.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/action/CalqueActionTable.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -17,6 +17,7 @@
import org.fudaa.ctulu.CtuluUI;
import org.fudaa.ebli.calque.BArbreCalqueModel;
import org.fudaa.ebli.calque.BCalque;
+import org.fudaa.ebli.calque.ZEbliCalquesPanel;
import org.fudaa.ebli.commun.EbliActionSimple;
import org.fudaa.ebli.commun.EbliLib;
import org.fudaa.ebli.commun.EbliTableInfoPanel;
@@ -30,18 +31,20 @@
BArbreCalqueModel model_;
final CtuluUI ui_;
+ ZEbliCalquesPanel pnCalques_;
- public CalqueActionTable(final BArbreCalqueModel _model,final CtuluUI _ui) {
+ public CalqueActionTable(final BArbreCalqueModel _model,final CtuluUI _ui, ZEbliCalquesPanel _pnCalques) {
super(EbliLib.getS("Tableau des valeurs"), BuResource.BU.getToolIcon("tableau"), "TABLE");
model_ = _model;
ui_ = _ui;
+ pnCalques_=_pnCalques;
model_.addTreeSelectionListener(this);
valueChanged(null);
}
public void actionPerformed(final ActionEvent _e){
final EbliTableInfoPanel t = new EbliTableInfoPanel(ui_, (EbliTableInfoTarget) model_
- .getSelectedCalque());
+ .getSelectedCalque(),pnCalques_.getEbliFormatter().getXYFormatter());
t.showInDialog();
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicCoordinatesTableModel.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -22,11 +22,13 @@
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.ctulu.CtuluCommandComposite;
import org.fudaa.ctulu.CtuluLibString;
+import org.fudaa.ctulu.editor.CtuluValueEditorDefaults;
import org.fudaa.ctulu.editor.CtuluValueEditorI;
import org.fudaa.ctulu.gis.GISAttributeModel;
import org.fudaa.ctulu.gis.GISCoordinateSequence;
import org.fudaa.ctulu.gis.GISZoneCollection;
import org.fudaa.ctulu.gis.GISZoneCollectionPoint;
+import org.fudaa.ctulu.gui.CtuluCellDoubleRenderer;
import org.fudaa.ebli.calque.EbliCoordinateDefinition;
import org.fudaa.ebli.commun.EbliLib;
@@ -189,20 +191,27 @@
return selectedAtomic_ == null ? _rowIdx : selectedAtomic_[_rowIdx];
}
- public void updateCellEditor(final JTable _table) {
+ public void updateEditorAndRenderer(final JTable _table) {
final TableColumnModel cols = _table.getColumnModel();
// xy
- TableCellEditor edx = coordDefs_[0].getFormatter().createTableEditorComponent();
- TableCellEditor edy = coordDefs_[1].getFormatter().createTableEditorComponent();
- cols.getColumn(1).setCellEditor(edx);
- cols.getColumn(2).setCellEditor(edy);
+ TableCellEditor editorXY=CtuluValueEditorDefaults.DOUBLE_EDITOR.createTableEditorComponent();
+ cols.getColumn(1).setCellEditor(editorXY);
+ cols.getColumn(2).setCellEditor(editorXY);
+ cols.getColumn(1).setCellRenderer(new CtuluCellDoubleRenderer(coordDefs_[0].getFormatter().getXYFormatter()));
+ cols.getColumn(2).setCellRenderer(new CtuluCellDoubleRenderer(coordDefs_[1].getFormatter().getXYFormatter()));
+
// les attribut
if (modeles_ != null) {
for (int i = 0; i < modeles_.length; i++) {
+ // L'editor
final CtuluValueEditorI editor = modeles_[i].getAttribute().getEditor();
if (editor != null) {
cols.getColumn(3 + i).setCellEditor(editor.createTableEditorComponent());
}
+ // Le renderer pour les Double
+ if (modeles_[i].getAttribute().getDataClass().equals(Double.class)) {
+ cols.getColumn(3+i).setCellRenderer(new CtuluCellDoubleRenderer(coordDefs_[0].getFormatter().getXYFormatter()));
+ }
}
}
}
@@ -300,7 +309,14 @@
@Override
public Class<?> getColumnClass(int _columnIndex) {
- if (_columnIndex < 3) return String.class;
+ switch (_columnIndex) {
+ case 0:
+ return Integer.class;
+ case 1:
+ return Double.class;
+ case 2:
+ return Double.class;
+ }
final int idx = _columnIndex - 3;
return getAtomicClass(_columnIndex - 3);
}
@@ -309,11 +325,11 @@
final int realIdx = getRealIdx(_rowIndex);
switch (_columnIndex) {
case 0:
- return CtuluLibString.getString(realIdx + 1);
+ return realIdx+1;
case 1:
- return coordDefs_[0].getFormatter().getXYFormatter().format(getX(realIdx));
+ return getX(realIdx);
case 2:
- return coordDefs_[1].getFormatter().getXYFormatter().format(getY(realIdx));
+ return getY(realIdx);
default:
}
final int idx = _columnIndex - 3;
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicsEditorPanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicsEditorPanel.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliAtomicsEditorPanel.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -53,7 +53,7 @@
cmd_ = _cmd;
table_ = new CtuluTable();
table_.setModel(tableModel_);
- tableModel_.updateCellEditor(table_);
+ tableModel_.updateEditorAndRenderer(table_);
setLayout(new BuBorderLayout());
add(new BuScrollPane(table_));
}
Modified: trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/commun/EbliTableInfoPanel.java
===================================================================
--- trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/commun/EbliTableInfoPanel.java 2011-06-15 19:38:41 UTC (rev 6300)
+++ trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/commun/EbliTableInfoPanel.java 2011-06-16 11:41:27 UTC (rev 6301)
@@ -33,6 +33,7 @@
import com.memoire.bu.*;
import org.fudaa.ctulu.CtuluLib;
+import org.fudaa.ctulu.CtuluNumberFormatI;
import org.fudaa.ctulu.CtuluUI;
import org.fudaa.ctulu.gui.CtuluCellTextDecimalRenderer;
import org.fudaa.ctulu.gui.CtuluLibSwing;
@@ -154,7 +155,7 @@
/**
* @param _layer
*/
- public EbliTableInfoPanel(final CtuluUI _ui, final EbliTableInfoTarget _layer) {
+ public EbliTableInfoPanel(final CtuluUI _ui, final EbliTableInfoTarget _layer, CtuluNumberFormatI _fmt) {
super();
target_ = _layer;
ui_ = _ui;
@@ -176,9 +177,10 @@
for (int i = 0; i < nb; i++) {
TableColumn column = init.getColumn(i);
int modelIdx = column.getModelIndex();
- if (table_.getModel().getColumnClass(modelIdx) == Double.class) {
- column.setCellRenderer(new CtuluCellTextDecimalRenderer());
-
+ if (table_.getModel().getColumnClass(modelIdx).equals(Double.class)) {
+ CtuluCellTextDecimalRenderer renderer=new CtuluCellTextDecimalRenderer();
+ renderer.setFormatter(_fmt);
+ column.setCellRenderer(renderer);
}
colModel_.addColumn(column);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|