|
From: <bma...@us...> - 2011-04-06 08:36:43
|
Revision: 6207
http://fudaa.svn.sourceforge.net/fudaa/?rev=6207&view=rev
Author: bmarchan
Date: 2011-04-06 08:36:36 +0000 (Wed, 06 Apr 2011)
Log Message:
-----------
Add : Ajout d'un panneau graphe dans le dialogue d'?\195?\169dition.
Modified Paths:
--------------
trunk/business/fudaa-sig/pom.xml
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigEditor.java
Added Paths:
-----------
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigCurveModelProfile.java
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigGraphEditorPanel.java
Modified: trunk/business/fudaa-sig/pom.xml
===================================================================
--- trunk/business/fudaa-sig/pom.xml 2011-04-06 08:32:37 UTC (rev 6206)
+++ trunk/business/fudaa-sig/pom.xml 2011-04-06 08:36:36 UTC (rev 6207)
@@ -33,9 +33,12 @@
<dependency>
<groupId>org.fudaa.framework.ebli</groupId>
<artifactId>ebli-2d</artifactId>
- <!--version>1.2-SNAPSHOT</version-->
</dependency>
<dependency>
+ <groupId>org.fudaa.framework.ebli</groupId>
+ <artifactId>ebli-1d</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.fudaa.framework.fudaa</groupId>
<artifactId>fudaa-common-save</artifactId>
</dependency>
Added: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigCurveModelProfile.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigCurveModelProfile.java (rev 0)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigCurveModelProfile.java 2011-04-06 08:36:36 UTC (rev 6207)
@@ -0,0 +1,244 @@
+/*
+ * @creation 18 sept. 2008
+ * @modification $Date:$
+ * @license GNU General Public License 2
+ * @copyright (c)1998-2008 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @mail fud...@li...
+ */
+package org.fudaa.fudaa.sig;
+
+import java.util.Map;
+import org.fudaa.ctulu.CtuluCommandContainer;
+import org.fudaa.ctulu.CtuluListSelectionInterface;
+import org.fudaa.ctulu.CtuluUI;
+import org.fudaa.ebli.courbe.EGGrapheTreeModel;
+import org.fudaa.ebli.courbe.EGModel;
+import org.fudaa.ebli.palette.BPaletteInfo.InfoData;
+
+/**
+ * Cette class peut \xEAtre vu comme un adapteur entre les donn\xE9es de la courbe et
+ * la vue qui va les traiter.
+ *
+ * @author Emmanuel Martin
+ * @version $Id$
+ */
+public class FSigCurveModelProfile implements EGModel {
+
+ private String name_; // Nom de la courbe
+ private FSigGraphEditorPanel pnCurve_; // Le model \xE0 adapter
+
+ public FSigCurveModelProfile(FSigGraphEditorPanel _pnCurve, String _name){
+ name_ = _name;
+ pnCurve_ = _pnCurve;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#addValue(double, double, org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean addValue(double _x, double _y, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#addValue(double[], double[], org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean addValue(double[] _x, double[] _y, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#deplace(int[], double, double, org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean deplace(int[] _idx, double _deltax, double _deltay, CtuluCommandContainer _cmd) {
+ for (int i=0; i<_idx.length; i++)
+ pnCurve_.setY(_idx[i], pnCurve_.getY(_idx[i]) + _deltay, _cmd);
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#fillWithInfo(org.fudaa.ebli.palette.BPaletteInfo.InfoData, org.fudaa.ctulu.CtuluListSelectionInterface)
+ */
+ public void fillWithInfo(InfoData _table, CtuluListSelectionInterface pt) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getNbValues()
+ */
+ public int getNbValues() {
+ return pnCurve_.getNbValues();
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getTitle()
+ */
+ public String getTitle() {
+ return name_;
+ }
+
+ public String getPointLabel(int _i) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getX(int)
+ */
+ public double getX(int _idx) {
+ return pnCurve_.getX(_idx);
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getXMax()
+ */
+ public double getXMax() {
+ double xMax = 0;
+ for(int i=0; i < pnCurve_.getNbValues() ;i++)
+ xMax = xMax < pnCurve_.getX(i) ? pnCurve_.getX(i) : xMax;
+ return xMax;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getXMin()
+ */
+ public double getXMin() {
+ if(pnCurve_.getNbValues()==0)
+ return 0;
+ double xMin = pnCurve_.getX(0);
+ for(int i=1; i < pnCurve_.getNbValues() ;i++)
+ xMin = xMin > pnCurve_.getX(i) ? pnCurve_.getX(i) : xMin;
+ return xMin;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getY(int)
+ */
+ public double getY(int _idx) {
+ return pnCurve_.getY(_idx);
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getYMax()
+ */
+ public double getYMax() {
+ double yMax = 0;
+ for(int i=0; i < pnCurve_.getNbValues() ;i++)
+ yMax = yMax < pnCurve_.getY(i) ? pnCurve_.getY(i) : yMax;
+ return yMax;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#getYMin()
+ */
+ public double getYMin() {
+ if(pnCurve_.getNbValues()==0)
+ return 0;
+ double yMin = pnCurve_.getY(0);
+ for(int i=1; i < pnCurve_.getNbValues() ;i++)
+ yMin = yMin > pnCurve_.getY(i) ? pnCurve_.getY(i) : yMin;
+ return yMin;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isDuplicatable()
+ */
+ public boolean isDuplicatable() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isModifiable()
+ */
+ public boolean isModifiable() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isPointDrawn(int)
+ */
+ public boolean isPointDrawn(int _i) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isRemovable()
+ */
+ public boolean isRemovable() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isSegmentDrawn(int)
+ */
+ public boolean isSegmentDrawn(int _i) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isTitleModifiable()
+ */
+ public boolean isTitleModifiable() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#isXModifiable()
+ */
+ public boolean isXModifiable() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#removeValue(int, org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean removeValue(int _i, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#removeValue(int[], org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean removeValue(int[] _i, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#setTitle(java.lang.String)
+ */
+ public boolean setTitle(String name) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#setValue(int, double, double, org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean setValue(int _i, double _x, double _y, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.fudaa.ebli.courbe.EGModel#setValues(int[], double[], double[], org.fudaa.ctulu.CtuluCommandContainer)
+ */
+ public boolean setValues(int[] _idx, double[] _x, double[] _y, CtuluCommandContainer _cmd) {
+ return false;
+ }
+
+ public EGModel duplicate() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void viewGenerationSource(Map infos, CtuluUI impl) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void replayData(EGGrapheTreeModel model, Map infos, CtuluUI impl) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Object savePersistSpecificDatas() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void restoreFromSpecificDatas(Object data, Map infos) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
Property changes on: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigCurveModelProfile.java
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Added: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigGraphEditorPanel.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigGraphEditorPanel.java (rev 0)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigGraphEditorPanel.java 2011-04-06 08:36:36 UTC (rev 6207)
@@ -0,0 +1,390 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.fudaa.fudaa.sig;
+
+import com.memoire.bu.BuBorderLayout;
+import com.memoire.bu.BuPanel;
+import com.memoire.bu.BuScrollPane;
+import com.memoire.bu.BuSplit2Pane;
+import com.vividsolutions.jts.geom.CoordinateSequence;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.HashSet;
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableModel;
+import org.fudaa.ctulu.CtuluCommandContainer;
+import org.fudaa.ctulu.CtuluCommandManager;
+import org.fudaa.ctulu.CtuluLib;
+import org.fudaa.ctulu.CtuluListSelection;
+import org.fudaa.ctulu.CtuluListSelectionEvent;
+import org.fudaa.ctulu.CtuluListSelectionInterface;
+import org.fudaa.ctulu.CtuluListSelectionListener;
+import org.fudaa.ctulu.CtuluNumberFormatDefault;
+import org.fudaa.ctulu.editor.CtuluValueEditorI;
+import org.fudaa.ctulu.table.CtuluTable;
+import org.fudaa.ebli.calque.EbliCoordinateDefinition;
+import org.fudaa.ebli.calque.edition.TableModelModeleAdapter;
+import org.fudaa.ebli.commun.EbliActionInterface;
+import org.fudaa.ebli.commun.EbliComponentFactory;
+import org.fudaa.ebli.commun.EbliLib;
+import org.fudaa.ebli.courbe.EGAxeHorizontal;
+import org.fudaa.ebli.courbe.EGAxeVertical;
+import org.fudaa.ebli.courbe.EGCourbeSimple;
+import org.fudaa.ebli.courbe.EGFillePanel;
+import org.fudaa.ebli.courbe.EGGraphe;
+import org.fudaa.ebli.courbe.EGGrapheSimpleModel;
+import org.fudaa.ebli.trace.TraceIcon;
+import org.fudaa.ebli.trace.TraceIconModel;
+
+
+ /**
+ * Cette classe repr\xE9sente l'information z sous forme d'une courbe.
+ * Cette information peut-\xEAtre \xE9dit\xE9e via la courbe.
+ *
+ * @author MARTIN Emmanuel
+ * @version $Id: EbliSingleObjectEditorPanel.java,v 1.10.6.2 2008-04-01
+ * 07:28:15 emartin Exp $
+ */
+ public class FSigGraphEditorPanel extends BuPanel implements TableModelListener, CtuluListSelectionListener, ListSelectionListener {
+
+ /**
+ * Cette classe donne un acc\xE8s restraint au model 'model_'. Les X et Y sont
+ * remplac\xE9s par un abscisse curviligne en travers.
+ *
+ * @author Emmanuel MARTIN
+ * @version $Id:$
+ */
+ protected class LimitedTableModel extends AbstractTableModel implements TableModelListener {
+
+ /**
+ * Le renderer des cellules du tableau.
+ */
+ protected class Renderer extends DefaultTableCellRenderer {
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row,
+ int column) {
+
+ if(value instanceof Double)
+ return super.getTableCellRendererComponent(table, coordDefs_[0].getFormatter().getXYFormatter().format((Double) value), isSelected, hasFocus, row, column);
+ if(value instanceof Boolean)
+ return table.getDefaultRenderer(Boolean.class).getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ else
+ return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ }
+ }
+
+ private EbliCoordinateDefinition[] coordDefs_;
+
+ /**
+ * @param _defs les d\xE9finitions pour la colonne des abscisses en travers
+ */
+ public LimitedTableModel(EbliCoordinateDefinition[] _defs){
+ coordDefs_=_defs;
+ modelData_.addTableModelListener(this);
+ }
+
+ public int getColumnCount() {
+ return modelData_.getColumnCount()-1;
+ }
+
+ public int getRowCount() {
+ return modelData_.getRowCount();
+ }
+
+ public Object getValueAt(int _rowIndex, int _columnIndex) {
+ switch (_columnIndex) {
+ case 0:
+ return _rowIndex+1;
+ case 1:
+ return getX(_rowIndex);
+ default:
+ return modelData_.getValueAt(_rowIndex, _columnIndex+1);
+ }
+ }
+
+ @Override
+ public boolean isCellEditable(final int _rowIndex, final int _columnIndex) {
+ if (_columnIndex<2)
+ return false;
+
+ return modelData_.isCellEditable(_rowIndex, _columnIndex+1);
+ }
+
+ @Override
+ public void setValueAt(final Object _value, final int _rowIndex, final int _columnIndex) {
+ if(_columnIndex >= 2)
+ modelData_.setValueAt(_value, _rowIndex, _columnIndex+1);
+ }
+
+ @Override
+ public String getColumnName(int _column) {
+ switch (_column) {
+ case 0:
+ return EbliLib.getS(EbliLib.getS("Index"));
+ case 1:
+ return EbliLib.getS(EbliLib.getS("Abscisse"));
+ default:
+ return modelData_.getColumnName(_column+1);
+ }
+ }
+
+ @Override
+ public Class<?> getColumnClass(int _columnIndex) {
+ switch (_columnIndex) {
+ case 0:
+ return Integer.class;
+ case 1:
+ return Double.class;
+ default:
+ return modelData_.getColumnClass(_columnIndex);
+ }
+ }
+
+ @Override
+ public void tableChanged(TableModelEvent _e) {
+ int col=_e.getColumn();
+ if (_e.getColumn()==zCol_)
+ col=2;
+ fireTableChanged(new TableModelEvent((TableModel)_e.getSource(), _e.getFirstRow(), _e.getLastRow(), col, _e.getType()));
+ }
+
+ public void updateCellEditor(JTable _table) {
+ TableColumnModel cols=_table.getColumnModel();
+
+ // Renderer \\
+ Renderer renderer=new Renderer();
+ for(int i=0;i<cols.getColumnCount();i++)
+ cols.getColumn(i).setCellRenderer(renderer);
+
+ // Editors \\
+ // Colonnes des attributs
+ if (modelData_!=null) {
+ for (int i=3; i<modelData_.getColumnCount(); i++) {
+ CtuluValueEditorI editor=modelData_.getAttribute(i).getEditor();
+ if (editor!=null)
+ cols.getColumn(i-1).setCellEditor(editor.createTableEditorComponent());
+ }
+ }
+ }
+ }
+
+ // Taille de la polyligne, utile pour l'axe des abscisses
+ private double lengthPolyligne_;
+ // Association entre l'index du point et sa coordnn\xE9e x
+ private HashMap<Integer, Double> courbeModelIndCoordX_;
+ // Valeur actuelle maximal de z
+ private double maxZ_;
+ // Le conteneur de la courbe
+ private EGGraphe grapheVue_;
+ // Axes du la courbe
+ private EGAxeHorizontal axeX_;
+ private EGAxeVertical axeY_;
+ // Vue de la courbe
+ private EGCourbeSimple courbeVue_;
+ // Gestion de la selection
+ private CtuluListSelection listSelection_;
+ // Model du tableau
+ private CtuluTable tableauVue_;
+ // Selection update
+ private boolean disable;
+ /** Indice de la colonne z sur le modele data global. */
+ protected int zCol_;
+ /** Le modele de donn\xE9es \xE0 utiliser comme model de tabelau */
+ protected TableModelModeleAdapter modelData_;
+
+ public FSigGraphEditorPanel(TableModelModeleAdapter _modelData) {
+ disable = false;
+ zCol_=/*zone_.getIndiceOf(zone_.getAttributeIsZ())+*/3; // l'index + les colonnes index, x et y
+ modelData_=_modelData;
+ modelData_.addTableModelListener(this);
+ // Construction de la courbe \\
+ setPreferredSize(new Dimension(650,450));
+ EGGrapheSimpleModel grapheModel=new EGGrapheSimpleModel();
+ grapheVue_=new EGGraphe(grapheModel);
+ // Axe des X
+ axeX_=new EGAxeHorizontal(false);
+ axeX_.setTitre(EbliLib.getS("Abscisse curviligne"));
+ axeX_.setUnite(EbliLib.getS("m\xE8tre"));
+ axeX_.setGraduations(true);
+ grapheVue_.setXAxe(axeX_);
+ // Axe des Y
+ axeY_=new EGAxeVertical();
+ axeY_.setGraduations(true);
+ axeY_.setTitre(EbliLib.getS("Ordonn\xE9e") + " : " + modelData_.getColumnName(zCol_));
+ axeY_.setUnite(EbliLib.getS("m\xE8tre"));
+ DecimalFormat df=CtuluLib.getDecimalFormat();
+ df.setMaximumFractionDigits(2);
+ axeY_.setSpecificFormat(new CtuluNumberFormatDefault(df));
+ // Calcule des x
+ generateCoordX();
+ axeX_.setBounds(0, lengthPolyligne_);
+ axeY_.setBounds(0, maxZ_);
+ // La courbe
+ FSigCurveModelProfile courbeModel=new FSigCurveModelProfile(this, "");
+ courbeVue_=new EGCourbeSimple(axeY_, courbeModel);
+ courbeVue_.setAspectContour(Color.BLUE);
+ courbeVue_.setIconeModel(new TraceIconModel(TraceIcon.CARRE_PLEIN,2,Color.BLUE));
+ grapheModel.addCourbe(courbeVue_, new CtuluCommandManager());
+ // Conteneur de graphe
+ EGFillePanel pnD=new EGFillePanel(grapheVue_);
+ listSelection_ = pnD.getSelection();
+ listSelection_.addListeSelectionListener(this);
+ // Construction des boutons \\
+ EbliActionInterface[] actions=pnD.getSpecificActions();
+ Container buttons=new Container();
+ buttons.setLayout(new GridLayout(1, 6));
+ EbliLib.updateMapKeyStroke(this, actions);
+ String[] tmpAction = {"SELECT", "RESTORE", "AUTO_REST", "ZOOM", "SUIVI", "MOVE_POINT"};
+ HashSet<String> actionsKept = new HashSet<String>();
+ for(int i=0;i<tmpAction.length;i++)
+ actionsKept.add(tmpAction[i]);
+ for (int i=0; i<actions.length; i++) {
+ if(actions[i] != null && actionsKept.contains(actions[i].getValue(Action.ACTION_COMMAND_KEY))){
+ AbstractButton button = actions[i].buildButton(EbliComponentFactory.INSTANCE);
+ button.setText("");
+ buttons.add(button);
+ }
+ }
+ // Construction du tableau \\
+ LimitedTableModel tableau = new LimitedTableModel(modelData_.getCoordinateDefs());
+ tableauVue_ = new CtuluTable();
+ tableauVue_.setModel(tableau);
+ tableauVue_.getSelectionModel().addListSelectionListener(this);
+ tableau.updateCellEditor(tableauVue_);
+
+ // Ajout au panel \\
+ BuScrollPane scrollPane = new BuScrollPane(tableauVue_);
+ BuPanel left = new BuPanel();
+ left.setLayout(new BuBorderLayout());
+ scrollPane.setPreferredSize(new Dimension(130, 335));
+ left.add(buttons, BuBorderLayout.NORTH);
+ left.add(scrollPane, BuBorderLayout.CENTER);
+ BuSplit2Pane splitPane = new BuSplit2Pane(left, pnD, BuSplit2Pane.HORIZONTAL);
+ setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
+ setLayout(new BorderLayout(0,0));
+ add(splitPane,BorderLayout.CENTER);
+ }
+
+ public int getNbValues() {
+ return modelData_.getRowCount();
+ }
+
+ public double getX(int _id) {
+ return courbeModelIndCoordX_.get(_id);
+ }
+
+ public double getY(int _id) {
+ return (Double)modelData_.getValueAt(_id, zCol_);
+ }
+
+ public void setY(int _id, double _value, CtuluCommandContainer _cmd) {
+ modelData_.setValueAt(new Double(_value), _id, zCol_);
+ }
+
+ /**
+ * @return la s\xE9quence des coordonn\xE9es modifi\xE9es. Toujours null puisque ni x
+ * ni y ne sont modifi\xE9s (seulement z).
+ */
+ protected CoordinateSequence getNewCoordinate() {
+ return null;
+ }
+
+ /**
+ * Build or rebuild 'courbeModelIndCoordX_' with data in model_.
+ */
+ protected void generateCoordX() {
+ double oldLengthPolyligne = lengthPolyligne_;
+ double oldMaxZ = maxZ_;
+ lengthPolyligne_=0;
+ courbeModelIndCoordX_=new HashMap<Integer, Double>(modelData_.getRowCount());
+ if (modelData_.getRowCount()>0) {
+ double lastX=(Double)modelData_.getValueAt(0, 1);
+ double lastY=(Double)modelData_.getValueAt(0, 2);
+ double currentX, currentY;
+ // Remplissage et construction des attributs
+ courbeModelIndCoordX_.put(0, lengthPolyligne_);
+ maxZ_=getY(0); // Le Y de getY (y de la courbe) est le Z du model
+ for (int i=1; i<modelData_.getRowCount(); i++) {
+ currentX=(Double)modelData_.getValueAt(i, 1);
+ currentY=(Double)modelData_.getValueAt(i, 2);
+ lengthPolyligne_+=Math.sqrt(Math.pow(lastX-currentX, 2)+Math.pow(lastY-currentY, 2));
+ courbeModelIndCoordX_.put(i, lengthPolyligne_);
+ maxZ_=Math.max(maxZ_, (Double)modelData_.getValueAt(i, 3));
+ lastX=currentX;
+ lastY=currentY;
+ }
+ if (oldLengthPolyligne!=lengthPolyligne_)
+ axeX_.setBounds(0, lengthPolyligne_);
+ if (grapheVue_.isAutoRestore()) {
+ if (oldMaxZ!=maxZ_)
+ axeY_.setBounds(0, maxZ_);
+ }
+ }
+ }
+
+ public void tableChanged(TableModelEvent e) {
+ generateCoordX();
+ if(grapheVue_.isAutoRestore())
+ grapheVue_.restore();
+ else
+ grapheVue_.fullRepaint();
+ }
+
+ public void listeSelectionChanged(CtuluListSelectionEvent _e) {
+ // Un changement de selection a \xE9t\xE9 effectu\xE9 dans la courbe \\
+ if (!disable) {
+ // Suppression de l'\xE9coute des changement de selection de le tableau
+ disable=true;
+ // Changement de selection dans le tableau
+ int[] selectedIndex=((CtuluListSelectionInterface)_e.getSource()).getSelectedIndex();
+ ListSelectionModel lstTableauSelect=tableauVue_.getSelectionModel();
+ lstTableauSelect.clearSelection();
+ if (selectedIndex!=null && selectedIndex.length>0) {
+ for (int i=0; i<selectedIndex.length; i++)
+ lstTableauSelect.addSelectionInterval(selectedIndex[i], selectedIndex[i]);
+ tableauVue_.scrollRectToVisible(tableauVue_.getCellRect(selectedIndex[selectedIndex.length-1], 0, false));
+ }
+ // R\xE9activation de l'\xE9coute de changement de selection de le tableau
+ disable=false;
+ }
+ }
+
+ public void valueChanged(ListSelectionEvent _e) {
+ // Un changement de selection a \xE9t\xE9 effectu\xE9 dans le tableau \\
+ if (!disable) {
+ // Suppression de l'\xE9coute des changement de selection de la courbe
+ disable=true;
+ // Changement de selection de la courbe
+ CtuluListSelection lst=new CtuluListSelection();
+ ListSelectionModel lstSelect=tableauVue_.getSelectionModel();
+ listSelection_.clear();
+ for (int i=0; i<tableauVue_.getRowCount(); i++)
+ if (lstSelect.isSelectedIndex(i))
+ lst.add(i);
+ if (!lst.isEmpty())
+ listSelection_.setSelection(lst);
+ // R\xE9activation de l'\xE9coute de changement de selection de la courbe
+ disable=false;
+ }
+ }
+ }
Property changes on: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/FSigGraphEditorPanel.java
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigEditor.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigEditor.java 2011-04-06 08:32:37 UTC (rev 6206)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/layer/FSigEditor.java 2011-04-06 08:36:36 UTC (rev 6207)
@@ -53,6 +53,12 @@
import com.memoire.fu.Fu;
import com.memoire.fu.FuLog;
import com.vividsolutions.jts.geom.Geometry;
+import org.fudaa.ctulu.gis.GISAttributeDouble;
+import org.fudaa.ctulu.gis.GISPoint;
+import org.fudaa.ctulu.gis.GISZoneCollection;
+import org.fudaa.ebli.calque.edition.EbliSingleObjectEditorPanel;
+import org.fudaa.fudaa.sig.FSigGraphEditorPanel;
+import org.fudaa.fudaa.sig.FSigLib;
/**
* @author Fred Deniger
@@ -92,6 +98,35 @@
}
/**
+ * Contient l'index de l'onglet selectionn\xE9 dans le panel d'edition d'objet
+ * seul. C'est pour que d'une \xE9dition \xE0 l'autre le m\xEAme onglet soit
+ * automatiquement selectionn\xE9.
+ */
+ private int selectedTabInSingleObjectEditorPanel_=0;
+
+ /**
+ * L'\xE9dition pour un objet selectionn\xE9 unique.
+ * @param _target Le calque cible editable.
+ */
+ @Override
+ protected void editSingleObject(final ZCalqueEditable _target) {
+ final int idxSelected = ((ZCalqueAffichageDonnees) _target).getLayerSelection().getMaxIndex();
+ final EbliSingleObjectEditorPanel ed = new EbliSingleObjectEditorPanel(_target.getModelEditable(), idxSelected,
+ true, true, getCoordinateDefinitions());
+ ed.setCmd(getMng());
+ GISZoneCollection zone=_target.getModelEditable().getGeomData();
+ GISAttributeDouble zAttr=zone.getAttributeIsZ();
+ // Ajout de l'onglet "courbe"
+ if (!(zone.getGeometry(idxSelected) instanceof GISPoint) && zAttr!=null && zAttr.isAtomicValue()) {
+ FSigGraphEditorPanel pnCurve=new FSigGraphEditorPanel(ed.getTableModel());
+ ed.addNewTab(FSigLib.getS("Courbe"),pnCurve);
+ }
+ ed.setSelectedTab(selectedTabInSingleObjectEditorPanel_);
+ ed.afficheModale(getFrame(), _target.getTitle());
+ selectedTabInSingleObjectEditorPanel_=ed.getSelectedTab();
+ }
+
+ /**
* L'import peut \xEAtre fait si le calque selectionn\xE9 est un groupe de calques
* SIG ou un calque poss\xE9dant une geometrie modifiable
*
@@ -251,16 +286,19 @@
setDefaultToolTip(FudaaLib.getS("Visualise les objets s\xE9lectionn\xE9s"));
}
+ @Override
public void actionPerformed(final ActionEvent _e) {
visuSelectedLayer();
}
+ @Override
public void updateStateBeforeShow() {
final BCalque cq = FSigEditor.this.getPanel().getArbreCalqueModel().getSelectedCalque();
super.setEnabled((cq instanceof ZCalqueAffichageDonnees) && (!((ZCalqueAffichageDonnees) cq).isSelectionEmpty())
&& ((((ZCalqueAffichageDonnees) cq).modeleDonnees() instanceof ZModeleGeometry)));
}
+ @Override
public String getEnableCondition() {
return FudaaLib.getS("S\xE9lectionner au moins un objet");
}
@@ -273,14 +311,17 @@
setDefaultToolTip(FudaaLib.getS("Exporter les donn\xE9es"));
}
+ @Override
public void actionPerformed(final ActionEvent _e) {
exportSelectedLayer();
}
+ @Override
public void updateStateBeforeShow() {
super.setEnabled(canExportSelectedLayer());
}
+ @Override
public String getEnableCondition() {
return FudaaLib.getS("S\xE9lectionner un calque non vide");
}
@@ -293,14 +334,17 @@
setDefaultToolTip(FudaaLib.getS("Importer les donn\xE9es"));
}
+ @Override
public void actionPerformed(final ActionEvent _e) {
importSelectedLayer();
}
+ @Override
public void updateStateBeforeShow() {
super.setEnabled(canImportInSelectedLayer());
}
+ @Override
public String getEnableCondition() {
return FudaaLib.getS("S\xE9lectionner un calque non vide et \xE9ditable");
}
@@ -313,10 +357,12 @@
setDefaultToolTip(FudaaLib.getS("Editer les objets s\xE9lectionn\xE9s"));
}
+ @Override
public void actionPerformed(final ActionEvent _e) {
edit();
}
+ @Override
public void updateStateBeforeShow() {
if (Fu.DEBUG && FuLog.isDebug()) {
FuLog.debug("FTR gis target= " + FSigEditor.this.getTarget());
@@ -330,6 +376,7 @@
super.setEnabled(claquesWithSelectedObjects.size()>0);
}
+ @Override
public String getEnableCondition() {
return FudaaLib.getS("S\xE9lectionner au moins un objet");
}
@@ -349,6 +396,7 @@
}
+ @Override
public final Frame getFrame()
{
return CtuluLibSwing.getFrameAncestorHelper(getPanel().getCtuluUI().getParentComponent());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-06-26 10:14:31
|
Revision: 7398
http://fudaa.svn.sourceforge.net/fudaa/?rev=7398&view=rev
Author: deniger
Date: 2012-06-26 10:14:22 +0000 (Tue, 26 Jun 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/business/fudaa-sig/pom.xml
Added Paths:
-----------
trunk/business/fudaa-sig/nb-configuration.xml
Added: trunk/business/fudaa-sig/nb-configuration.xml
===================================================================
--- trunk/business/fudaa-sig/nb-configuration.xml (rev 0)
+++ trunk/business/fudaa-sig/nb-configuration.xml 2012-06-26 10:14:22 UTC (rev 7398)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+ <netbeans.hint.jdkPlatform>JDK_1.6</netbeans.hint.jdkPlatform>
+ </properties>
+</project-shared-configuration>
Modified: trunk/business/fudaa-sig/pom.xml
===================================================================
--- trunk/business/fudaa-sig/pom.xml 2012-06-25 23:06:39 UTC (rev 7397)
+++ trunk/business/fudaa-sig/pom.xml 2012-06-26 10:14:22 UTC (rev 7398)
@@ -32,10 +32,6 @@
</dependency>
<dependency>
<groupId>org.fudaa.framework.ebli</groupId>
- <artifactId>ebli-2d</artifactId>
- </dependency>
- <dependency>
- <groupId>org.fudaa.framework.ebli</groupId>
<artifactId>ebli-1d</artifactId>
</dependency>
<dependency>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2014-01-20 23:04:32
|
Revision: 8581
http://sourceforge.net/p/fudaa/svn/8581
Author: deniger
Date: 2014-01-20 23:04:26 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
CRUE-627
Modified Paths:
--------------
trunk/business/fudaa-sig/nbactions.xml
trunk/business/fudaa-sig/pom.xml
Modified: trunk/business/fudaa-sig/nbactions.xml
===================================================================
--- trunk/business/fudaa-sig/nbactions.xml 2014-01-20 22:59:20 UTC (rev 8580)
+++ trunk/business/fudaa-sig/nbactions.xml 2014-01-20 23:04:26 UTC (rev 8581)
@@ -4,6 +4,8 @@
<actionName>CUSTOM-deploy</actionName>
<displayName>deploy</displayName>
<goals>
+ <goal>-Dmaven.wagon.provider.http=httpclient</goal>
+ <goal>-e</goal>
<goal>deploy</goal>
</goals>
</action>
Modified: trunk/business/fudaa-sig/pom.xml
===================================================================
--- trunk/business/fudaa-sig/pom.xml 2014-01-20 22:59:20 UTC (rev 8580)
+++ trunk/business/fudaa-sig/pom.xml 2014-01-20 23:04:26 UTC (rev 8581)
@@ -3,6 +3,8 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<dodico-h2d.version>1.4-SNAPSHOT</dodico-h2d.version>
+ <javaCompiler>1.7</javaCompiler>
+ <targetJdk>1.7</targetJdk>
</properties>
<parent>
@@ -47,7 +49,7 @@
<build>
<pluginManagement>
<plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
@@ -80,5 +82,13 @@
</plugin>
</plugins>
</pluginManagement>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http</artifactId>
+ <version>2.1</version>
+ </extension>
+ </extensions>
</build>
+
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|