|
From: <bma...@us...> - 2011-04-06 08:32:44
|
Revision: 6206
http://fudaa.svn.sourceforge.net/fudaa/?rev=6206&view=rev
Author: bmarchan
Date: 2011-04-06 08:32:37 +0000 (Wed, 06 Apr 2011)
Log Message:
-----------
Fix : Pb d'?\195?\169dition d'un segment de g?\195?\169om?\195?\169trie
Add : Possibilit?\195?\169 d'ajout d'un panneau de repr?\195?\169sentation graphe dans le dialogue d'?\195?\169dition.
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/TableModelModeleAdapter.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorDefault.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2011-04-04 13:44:43 UTC (rev 6205)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2011-04-06 08:32:37 UTC (rev 6206)
@@ -25,7 +25,6 @@
import org.fudaa.ctulu.CtuluCommandContainer;
import org.fudaa.ctulu.CtuluLib;
import org.fudaa.ctulu.gis.GISAttributeConstants;
-import org.fudaa.ctulu.gis.GISAttributeDouble;
import org.fudaa.ctulu.gis.GISAttributeModel;
import org.fudaa.ctulu.gis.GISCoordinateSequenceUnique;
import org.fudaa.ctulu.gis.GISPoint;
@@ -261,328 +260,6 @@
}
}
- /**
- * 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 CourbeRepresentation extends BuPanel /*implements TableModelListener, CtuluListSelectionListener, ListSelectionListener*/ {
-//
-// /**
-// * Cette classe donne un acc\xE8s restraint au model 'model_'. Le X et Y sont remplac\xE9s par un asbcisse curviligne.
-// *
-// * @author Emmanuel MARTIN
-// * @version $Id:$
-// */
-// protected class LimitedTableModel extends AbstractTableModel implements TableModelListener {
-//
-// /**
-// * Le renderer des cellules du tableau.
-// */
-// protected class Renderer extends DefaultTableCellRenderer {
-// public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row,
-// int column) {
-//
-// if(value instanceof Double)
-// return super.getTableCellRendererComponent(table, xyFormatter_.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 EbliFormatterInterface xyFormatter_;
-//
-// /**
-// * @param _xyFormatter le formateur pour la colonne des curvilignes
-// */
-// public LimitedTableModel(EbliFormatterInterface _xyFormatter){
-// xyFormatter_=_xyFormatter;
-// 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);
-// }
-// }
-//
-// public boolean isCellEditable(final int _rowIndex, final int _columnIndex) {
-// if (_columnIndex<2)
-// return false;
-//
-// return modelData_.isCellEditable(_rowIndex, _columnIndex+1);
-// }
-//
-// public void setValueAt(final Object _value, final int _rowIndex, final int _columnIndex) {
-// if(_columnIndex >= 2)
-// modelData_.setValueAt(_value, _rowIndex, _columnIndex+1);
-// }
-//
-// 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);
-// }
-// }
-//
-// public Class<?> getColumnClass(int _columnIndex) {
-// switch (_columnIndex) {
-// case 0:
-// return Integer.class;
-// case 1:
-// return Double.class;
-// default:
-// return modelData_.getColumnClass(_columnIndex);
-// }
-// }
-//
-// 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_;
-//
-// public CourbeRepresentation() {
-// disable = false;
-// zCol_=/*zone_.getIndiceOf(zone_.getAttributeIsZ())+*/3; // l'index + les colonnes index, x et y
-// 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
-// EGCourbeModelProfile courbeModel=new EGCourbeModelProfile(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_.getFormatter());
-// 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;
-// }
-// }
- }
-
private CtuluCommandContainer cmd_;
// Num\xE9ro de la g\xE9om\xE9rie dans zone_ que l'on veut traiter
private final int idx_;
@@ -592,8 +269,6 @@
private final GISZoneCollection zone_;
// Onglet repr\xE9sentant les informations sous forme de table
private TableRepresentation tableRep_;
- // Onglet repr\xE9sentant une information sous forme de courbe
- private CourbeRepresentation courbeRep_;
/** Le modele de donn\xE9es \xE0 utiliser comme model de tabelau */
protected TableModelModeleAdapter modelData_;
// Tableau des attributs globaux
@@ -654,24 +329,31 @@
}
add(pnAttrGlobaux, BuBorderLayout.NORTH);
// Contruction du model de donn\xE9es commun aux deux repr\xE9sentations
- GISAttributeDouble zAttr=zone_.getAttributeIsZ();
- if (!(zone_.getGeometry(idx_) instanceof GISPoint)&&zAttr!=null&&zAttr.isAtomicValue()) {
- modelData_=new TableModelModeleAdapter(modeleSrc_, idx_, _defs, new CtuluCommandComposite(), _editVertexAttribut);
- // Gestionnaire d'onglet
+
+ modelData_=new TableModelModeleAdapter(modeleSrc_, idx_, _defs, new CtuluCommandComposite(), _editVertexAttribut);
+ tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _defs);
+ add(tableRep_, BuBorderLayout.CENTER);
+ }
+
+ public TableModelModeleAdapter getTableModel() {
+ return modelData_;
+ }
+
+ /**
+ * Ajoute un nouveau panneau en plus du panneau tableau. Des onglets sont
+ * apparents dans ce cas.
+ * @param _title Le titre
+ * @param _pn Le panneau.
+ */
+ public void addNewTab(String _title, BuPanel _pn) {
+ if (tabbedPane_==null) {
tabbedPane_=new JTabbedPane();
- // Les onglets
- tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _defs);
- courbeRep_=new CourbeRepresentation();
- // Ajout
+
+ remove(tableRep_);
tabbedPane_.add(EbliLib.getS("Table"), tableRep_);
- tabbedPane_.add(EbliLib.getS("Courbe"), courbeRep_);
add(tabbedPane_, BuBorderLayout.CENTER);
}
- else {
- modelData_=new TableModelModeleAdapter(modeleSrc_, idx_, _defs, new CtuluCommandComposite(), _editVertexAttribut);
- tableRep_=new TableRepresentation(_editAttribut, _editVertexAttribut, _defs);
- add(tableRep_, BuBorderLayout.CENTER);
- }
+ tabbedPane_.add(_title, _pn);
}
/**
@@ -701,6 +383,7 @@
* Enregistre les modifications effectu\xE9es. Cette m\xE9thode est automatiquement
* appell\xE9e lors du click sur le bouton 'Valider'
*/
+ @Override
public void apply() {
CtuluCommandComposite cmd=new CtuluCommandComposite("Modifications de la g\xE9om\xE9trie");
if (tableRep_!=null)
@@ -734,6 +417,7 @@
* Appell\xE9 lors du click sur le bouton 'valider' pour sortir de la fen\xEAtre.
* Retourne vrai si toutes les modifications sont valides.
*/
+ @Override
public boolean isDataValid() {
if (tableRep_!=null) {
tableRep_.stopCellEditing();
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/TableModelModeleAdapter.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/TableModelModeleAdapter.java 2011-04-04 13:44:43 UTC (rev 6205)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/TableModelModeleAdapter.java 2011-04-06 08:32:37 UTC (rev 6206)
@@ -73,6 +73,7 @@
*/
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)
@@ -499,11 +500,11 @@
}
/**
- * Retourne le formatter utilis\xE9.
+ * Retourne les d\xE9finitions de coordonn\xE9es.
*/
-// public EbliFormatterInterface getFormatter() {
-// return coorDefs_;
-// }
+ public EbliCoordinateDefinition[] getCoordinateDefs() {
+ return coordDefs_;
+ }
/**
* Change le formatter utilis\xE9.
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorDefault.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2011-04-04 13:44:43 UTC (rev 6205)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorDefault.java 2011-04-06 08:32:37 UTC (rev 6206)
@@ -478,9 +478,11 @@
private void buildActions() {
actionDelete_ = new EbliActionSimple(CtuluLib.getS("Supprimer"), BuResource.BU.getIcon("enlever"),"DeleteSelectedAction") {
+ @Override
public void actionPerformed(final ActionEvent _e) {
delete();
}
+ @Override
public void updateStateBeforeShow() {
super.setEnabled(target_ != null && !target_.isSelectionEmpty());
}
@@ -488,9 +490,11 @@
actionDelete_.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
actionCancel_ = new EbliActionSimple(CtuluLib.getS("Annuler"), BuResource.BU.getIcon("annuler"),"CancelEditionAction") {
+ @Override
public void actionPerformed(final ActionEvent _e) {
cancelEdition();
}
+ @Override
public void updateStateBeforeShow() {
super.setEnabled(dessin_ != null && !dessin_.isGele() && dessin_.isEnCours());
}
@@ -784,8 +788,7 @@
ZCalqueEditable calque=(ZCalqueEditable)calquesWithSelectedObjects.get(0);
// G\xE9n\xE9ration d'une boite d'\xE9dition selon le type de selection et
// d'\xE9dition \\
- /** TODO B.M. Gerer le mode segment */
- if (((ZCalqueEditable)calque).isAtomicMode()) {
+ if (calque.getSelectionMode() == SelectionMode.ATOMIC) {
// On controle qu'en mode sommet, une seule g\xE9om\xE9trie est selectionn\xE9e.
if (getSupport().getSelectionHelper().getUniqueSelectedIdx()==-1) {
ui_.warn(EbliLib.getS("Edition impossible"), EbliLib.getS("L'\xE9dition ne peut se faire simultan\xE9ment que sur\n des sommets d'une m\xEAme g\xE9om\xE9trie."), false);
@@ -793,6 +796,9 @@
}
editVertexObject(calque);
}
+ else if(calque.getSelectionMode() == SelectionMode.SEGMENT) {
+ editSegmentObject(calque);
+ }
else if (calque.isOnlyOneObjectSelected())
// Une seule g\xE9om\xE9trie est \xE0 \xE9diter
editSingleObject(calque);
@@ -813,13 +819,6 @@
}
return null;
}
-
- /**
- * 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.
@@ -830,11 +829,7 @@
final EbliSingleObjectEditorPanel ed = new EbliSingleObjectEditorPanel(_target.getModelEditable(), idxSelected,
true, true, getCoordinateDefinitions());
ed.setCmd(getMng());
- if(ed.hasTab())
- ed.setSelectedTab(selectedTabInSingleObjectEditorPanel_);
ed.afficheModale(getFrame(), _target.getTitle());
- if(ed.hasTab())
- selectedTabInSingleObjectEditorPanel_=ed.getSelectedTab();
}
protected void editVertexObject(final ZCalqueEditable _target) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bma...@us...> - 2011-05-05 09:15:04
|
Revision: 6246
http://fudaa.svn.sourceforge.net/fudaa/?rev=6246&view=rev
Author: bmarchan
Date: 2011-05-05 09:14:57 +0000 (Thu, 05 May 2011)
Log Message:
-----------
FIX : PB d'affichage de la fenetre d'export de valeurs vers excel
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2011-05-04 16:11:12 UTC (rev 6245)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeDefault.java 2011-05-05 09:14:57 UTC (rev 6246)
@@ -106,7 +106,7 @@
return Integer.class;
}
if (_columnIndex >= 4) {
- return ligne_.getAttribute(_columnIndex - 4).getDataClass();
+ return att_[_columnIndex - 4].getDataClass();
}
return Double.class;
}
@@ -123,7 +123,7 @@
return EbliLib.getS("Y");
default:
}
- return ligne_.getAttribute(_column - 4).getLongName();
+ return att_[_column - 4].getName();
}
public int getRowCount() {
@@ -154,10 +154,10 @@
}
final LineString s = (LineString) ligne_.getGeometry(idxLine);
if (_columnIndex == 2) {
- return Double.toString(s.getCoordinateSequence().getX(idxAtom));
+ return s.getCoordinateSequence().getX(idxAtom);
}
if (_columnIndex == 3) {
- return Double.toString(s.getCoordinateSequence().getY(idxAtom));
+ return s.getCoordinateSequence().getY(idxAtom);
}
final CtuluCollection model = (CtuluCollection) ligne_.getModel(att_[_columnIndex - 4]).getObjectValueAt(idxLine);
return model.getObjectValueAt(idxAtom);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2011-05-04 16:11:12 UTC (rev 6245)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleMultiPointEditable.java 2011-05-05 09:14:57 UTC (rev 6246)
@@ -100,7 +100,7 @@
return Integer.class;
}
if (_columnIndex >= 4) {
- return ligne_.getAttribute(_columnIndex - 4).getDataClass();
+ return att_[_columnIndex - 4].getDataClass();
}
return Double.class;
}
@@ -117,7 +117,7 @@
return EbliLib.getS("Y");
default:
}
- return ligne_.getAttribute(_column - 4).getLongName();
+ return att_[_column - 4].getName();
}
public int getRowCount() {
@@ -148,10 +148,10 @@
}
final Geometry s = (Geometry) ligne_.getGeometry(idxLine);
if (_columnIndex == 2) {
- return Double.toString(s.getCoordinates()[idxAtom].x);
+ return s.getCoordinates()[idxAtom].x;
}
if (_columnIndex == 3) {
- return Double.toString(s.getCoordinates()[idxAtom].y);
+ return s.getCoordinates()[idxAtom].y;
}
final CtuluCollection model = (CtuluCollection) ligne_.getModel(att_[_columnIndex - 4]).getObjectValueAt(idxLine);
return model.getObjectValueAt(idxAtom);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2011-05-04 16:11:12 UTC (rev 6245)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2011-05-05 09:14:57 UTC (rev 6246)
@@ -68,7 +68,7 @@
}
final int r = _column - 3;
final GISZoneCollection pt = ZModelePointEditable.this.getGeomData();
- return pt.getAttribute(r).getLongName();
+ return pt.getAttribute(r).getName();
}
public int getRowCount() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bma...@us...> - 2011-09-08 15:43:35
|
Revision: 6378
http://fudaa.svn.sourceforge.net/fudaa/?rev=6378&view=rev
Author: bmarchan
Date: 2011-09-08 15:43:29 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Mod : Panneau d'edition de geometrie : L'ordre des atrributs est conserv?\195?\169, l'attribut pour Z apparait en premier.
Fix : Traceback lors de la cr?\195?\169ation d'un rectangle ou ellipse avec keyPressed=CTRL
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java 2011-09-08 08:56:10 UTC (rev 6377)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditionInteraction.java 2011-09-08 15:43:29 UTC (rev 6378)
@@ -18,8 +18,6 @@
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map.Entry;
import javax.swing.JComponent;
@@ -578,7 +576,8 @@
private ZEditionAttibutesContainer.LigneBriseeData data_;
private boolean moved_; // Vrai quand le curseur est en mouvement
private List<Integer> keyPresse_; // Pour la gestion du mode 'carre'
- private HashMap<GISAttributeInterface, JComponent> attributs_;
+ private List<JComponent> editorComp_;
+ private List<GISAttributeInterface> attEditable_;
public FormDelegateEllipse(){
keyPresse_=new ArrayList<Integer>();
@@ -721,7 +720,7 @@
*/
public void keyReleased(KeyEvent _e) {
if (keyPresse_.contains(_e.getKeyCode()))
- keyPresse_.remove(_e.getKeyCode());
+ keyPresse_.remove((Integer)_e.getKeyCode());
}
/*
@@ -731,20 +730,21 @@
*/
public void keyTyped(KeyEvent _e) {}
- public void setDataAttributs(HashMap<GISAttributeInterface, JComponent> _attributs){
- attributs_ = _attributs;
+ public void setDataAttributs(List<GISAttributeInterface> _attEditable, List<JComponent> _comps){
+ attEditable_ = _attEditable;
+ editorComp_=_comps;
}
public boolean isSetDataAttributs(){
- return attributs_ != null;
+ return attEditable_ != null && editorComp_!=null;
}
private void addData() {
- if (data_!=null&&attributs_!=null) {
+ if (data_!=null&&attEditable_!=null) {
// Pour chaque propri\xE9t\xE9es
- for (Entry<GISAttributeInterface, JComponent> element : attributs_.entrySet()) {
- GISAttributeInterface key=element.getKey();
- Object value=key.getEditor().getValue(element.getValue());
+ for (int j=0; j<attEditable_.size(); j++) {
+ GISAttributeInterface key=attEditable_.get(j);
+ Object value=key.getEditor().getValue(editorComp_.get(j));
// Si elle existe : inscrire la valeur
if (data_.atomicAttribute_.containsKey(key)) {
ArrayList<Object> values=data_.atomicAttribute_.get(key);
@@ -920,7 +920,8 @@
private GrPoint pointDep_, pointFin_; // Les deux points d\xE9finissant le rectangle
private List<Integer> keyPresse_; // Pour la gestion du mode 'carre'
private int nbPointsLargeur_, nbPointsHauteur_; // Nombres de point ajout\xE9 sur les cot\xE9s
- private HashMap<GISAttributeInterface, JComponent> attributs_;
+ private List<JComponent> editorComp_;
+ private List<GISAttributeInterface> attEditable_;
public FormDelegateRectangle() {
super();
@@ -928,13 +929,14 @@
nbPointsLargeur_ = 0;
nbPointsHauteur_ = 0;
}
-
- public void setDataAttributs(HashMap<GISAttributeInterface, JComponent> _attributs){
- attributs_ = _attributs;
+
+ public void setDataAttributs(List<GISAttributeInterface> _attEditable, List<JComponent> _comps){
+ attEditable_ = _attEditable;
+ editorComp_=_comps;
}
public boolean isSetDataAttributs(){
- return attributs_ != null;
+ return attEditable_ != null && editorComp_!=null;
}
/**
@@ -1134,7 +1136,7 @@
*/
public void keyReleased(KeyEvent _e) {
if (keyPresse_.contains(_e.getKeyCode()))
- keyPresse_.remove(_e.getKeyCode());
+ keyPresse_.remove((Integer)_e.getKeyCode());
}
/*
@@ -1145,11 +1147,11 @@
public void keyTyped(KeyEvent _e) {}
private void addData() {
- if (data_!=null&&attributs_!=null) {
+ if (data_!=null&&attEditable_!=null) {
// Pour chaque propri\xE9t\xE9es
- for (Entry<GISAttributeInterface, JComponent> element : attributs_.entrySet()) {
- GISAttributeInterface key=element.getKey();
- Object value=key.getEditor().getValue(element.getValue());
+ for (int j=0; j<attEditable_.size(); j++) {
+ GISAttributeInterface key=attEditable_.get(j);
+ Object value=key.getEditor().getValue(editorComp_.get(j));
// Si elle existe : inscrire la valeur
if (data_.atomicAttribute_.containsKey(key)) {
ArrayList<Object> values=data_.atomicAttribute_.get(key);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java 2011-09-08 08:56:10 UTC (rev 6377)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZEditorLigneBriseePanel.java 2011-09-08 15:43:29 UTC (rev 6378)
@@ -15,7 +15,6 @@
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -49,6 +48,7 @@
import com.memoire.bu.BuVerticalLayout;
import com.memoire.fu.Fu;
import com.memoire.fu.FuLog;
+import java.util.LinkedHashMap;
import org.fudaa.ctulu.CtuluNumberFormatI;
import org.fudaa.ebli.commun.EbliCoordinateDefinition;
@@ -74,10 +74,9 @@
}
protected final void updateAtomicArrays() {
- if (editorComps_ != null && editorAttribute_ != null && editorAttribute_.size() > 0) {
- final List r = new ArrayList(editorAttribute_.size());
- for (final Iterator it = editorAttribute_.keySet().iterator(); it.hasNext();) {
- final GISAttributeInterface att = (GISAttributeInterface) it.next();
+ if (editorComps_ != null && attEditable_ != null && attEditable_.size() > 0) {
+ final List r = new ArrayList(attEditable_.size());
+ for (GISAttributeInterface att : attEditable_) {
if (att.isAtomicValue()) {
r.add(att);
}
@@ -293,7 +292,7 @@
*/
public void update() {
if (edition_!=null&&edition_.getFormeEnCours()!=null&&edition_.getFormeEnCours().enCours()) {
- ((FormDelegateEllipse)edition_.getFormeEnCours()).setDataAttributs(editorAttribute_);
+ ((FormDelegateEllipse)edition_.getFormeEnCours()).setDataAttributs(attEditable_,editorComps_);
GrPoint pointOrigine=((FormDelegateEllipse)edition_.getFormeEnCours()).getPointOrigine();
if (pointOrigine!=null) {
if (coordDefs_!=null) {
@@ -374,7 +373,7 @@
ell.setRayonX(rayonX);
ell.setRayonY(rayonY);
ell.setNbPoints(nbPoints);
- ell.setDataAttributs(editorAttribute_);
+ ell.setDataAttributs(attEditable_,editorComps_);
if(ell.buildEllipse())
reinitialisation();
}
@@ -546,7 +545,7 @@
public void update() {
if (edition_!=null&&edition_.getFormeEnCours()!=null&&edition_.getFormeEnCours().enCours()) {
GrPoint pointOrigine=(GrPoint)edition_.getFormeEnCours().getFormeEnCours();
- ((FormDelegateRectangle)edition_.getFormeEnCours()).setDataAttributs(editorAttribute_);
+ ((FormDelegateRectangle)edition_.getFormeEnCours()).setDataAttributs(attEditable_,editorComps_);
if (pointOrigine!=null) {
if (coordDefs_!=null) {
tfCoordX_.setText(coordDefs_[0].getFormatter().getXYFormatter().format(new Double(pointOrigine.x_)));
@@ -628,7 +627,7 @@
rec.setPointFin(new GrPoint(pointEndX, pointEndY, 0));
rec.setNbPointsLargeur(nbPointsX);
rec.setNbPointsHauteur(nbPointsY);
- rec.setDataAttributs(editorAttribute_);
+ rec.setDataAttributs(attEditable_,editorComps_);
if(rec.buildRectangle())
reinitialisation();
}
@@ -743,7 +742,7 @@
ZCalqueEditionInteraction edition_;
- HashMap<GISAttributeInterface, JComponent> editorAttribute_;
+// LinkedHashMap<GISAttributeInterface, JComponent> editorAttribute_;
/** Type de g\xE9ometrie a \xE9diter */
int typeForme_;
@@ -753,8 +752,12 @@
BPaletteEdition palette_;
protected GISAttributeInterface[] attributes_;
-
- protected JComponent[] editorComps_;
+ /** L'attribut utilis\xE9 pour Z s'il y en a 1 */
+ protected GISAttributeInterface attIsZ_;
+ /** Les editeurs pour chacun des attributs editables */
+ protected List<JComponent> editorComps_;
+ /** Les attributs editables, dans le meme ordre que les editeurs */
+ protected List<GISAttributeInterface> attEditable_=new ArrayList<GISAttributeInterface>();
/** Le nom des coordonn\xE9es */
protected EbliCoordinateDefinition[] coordDefs_;
@@ -895,28 +898,40 @@
final BuPanel pnFeature = new BuPanel();
pnFeature.setLayout(new BuGridLayout(2, 0, 0));
final List editor = new ArrayList(attributes_.length);
- if (editorAttribute_ == null) {
- editorAttribute_ = new HashMap();
- } else {
- editorAttribute_.clear();
- }
+// if (editorAttribute_ == null) {
+// editorAttribute_ = new LinkedHashMap<GISAttributeInterface, JComponent>();
+// } else {
+// editorAttribute_.clear();
+// }
+ attEditable_.clear();
for (int i = 0; i < attributes_.length; i++) {
final GISAttributeInterface attr = attributes_[i];
if (Fu.DEBUG && FuLog.isDebug()) {
FuLog.trace("EZM: add for " + attr.getName());
}
if (attr.isEditable()) {
- pnFeature.add(new BuLabel(attr.getName() + ':'));
final CtuluValueEditorI ed = attr.getEditor();
final JComponent ci = ed.createEditorComponent();
- editorAttribute_.put(attr, ci);
- editor.add(ci);
+// editorAttribute_.put(attr, ci);
final Object defaultVal = attr.getDefaultValue();
ed.setValue(defaultVal == null ? null : defaultVal.toString(), ci);
- pnFeature.add(ci);
+ // Si l'attribut est pris pour Z, on le place en premier.
+ if (attr.equals(attIsZ_)) {
+ attEditable_.add(0,attr);
+ editor.add(0,ci);
+ pnFeature.add(new BuLabel(attr.getName() + ':'),0);
+ pnFeature.add(ci,1);
+ }
+ else {
+ attEditable_.add(attr);
+ editor.add(ci);
+ pnFeature.add(new BuLabel(attr.getName() + ':'));
+ pnFeature.add(ci);
+ }
}
}
- editorComps_ = (JComponent[]) editor.toArray(new JComponent[editor.size()]);
+// editorComps_ = (JComponent[]) editor.toArray(new JComponent[editor.size()]);
+ editorComps_=editor;
add(pnFeature);
}
}
@@ -1000,8 +1015,9 @@
}
return null;
}
- final JComponent c = (JComponent) editorAttribute_.get(_attr);
- if (c != null) {
+ int ind=attEditable_.indexOf(_attr);
+ if (ind != -1) {
+ final JComponent c = (JComponent) editorComps_.get(ind);
if (Fu.DEBUG && FuLog.isDebug()) {
FuLog.trace("EZM: " + getClass().getName() + " component for attribute " + _attr.getName() + " value= "
+ _attr.getEditor().getValue(c));
@@ -1029,11 +1045,14 @@
public void targetChanged(final ZCalqueEditable _new) {
GISAttributeInterface[] newAtt = null;
+ GISAttributeInterface attIsZ=null;
if (_new != null && _new.getModelEditable() != null && _new.getModelEditable().getGeomData() != null) {
newAtt = _new.getModelEditable().getGeomData().getAttributes();
+ attIsZ = _new.getModelEditable().getGeomData().getAttributeIsZ();
}
- if (!Arrays.equals(newAtt, attributes_)) {
+ if (!Arrays.equals(newAtt, attributes_) || attIsZ_!=attIsZ) {
attributes_ = newAtt;
+ attIsZ_=attIsZ;
container_ = null;
removeAll();
add(btReprise_);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bma...@us...> - 2011-09-27 15:53:34
|
Revision: 6453
http://fudaa.svn.sourceforge.net/fudaa/?rev=6453&view=rev
Author: bmarchan
Date: 2011-09-27 15:53:27 +0000 (Tue, 27 Sep 2011)
Log Message:
-----------
Mod : Pull-up des m?\195?\169thodes setEditor() et getEditor() dans ZCalqueEditable
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditable.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueEditable.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -79,10 +79,11 @@
/**
* Joint 2 g\xE9ometries.
* @param _cmd La pile de commandes.
+ * @param _ui l'interface utilisateur
* @return true si les objets ont \xE9t\xE9 joints.
*/
- public boolean joinSelectedObjects(final CtuluCommandContainer _cmd);
-
+ public boolean joinSelectedObjects(final CtuluCommandContainer _cmd, CtuluUI _ui);
+
/**
* Retourne si la forme d'un certain type peut \xEAtre ajout\xE9e.
* @param _typeForme Le type de forme
@@ -146,6 +147,17 @@
*/
ZModeleEditable getModelEditable();
+ /**
+ * @return L'editeur, notamment pour l'edition de la g\xE9om\xE9trie s\xE9lectionn\xE9e.
+ */
+ ZEditorInterface getEditor();
+ /**
+ * D\xE9finit l'editeur.
+ * @param _editor L'editeur, notamment pour l'edition de la g\xE9om\xE9trie s\xE9lectionn\xE9e.
+ */
+ void setEditor(final ZEditorInterface _editor);
+
+
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueLigneBriseeEditable.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -35,7 +35,7 @@
*/
public class ZCalqueLigneBriseeEditable extends ZCalqueLigneBrisee implements ZCalqueEditable {
- ZEditorDefault editor_;
+ ZEditorInterface editor_;
/** Les formes autoris\xE9e par le calque */
protected int[] enabledForms_={DeForme.POLYGONE,DeForme.LIGNE_BRISEE,DeForme.RECTANGLE,DeForme.ELLIPSE};
@@ -77,7 +77,8 @@
* @param _cmd La pile de commandes.
* @return true si les polylignes ont \xE9t\xE9 jointes.
*/
- public boolean joinSelectedObjects(final CtuluCommandContainer _cmd) {
+ @Override
+ public boolean joinSelectedObjects(final CtuluCommandContainer _cmd, CtuluUI _ui) {
if (isSelectionEmpty() || (getSelectionMode() != SelectionMode.ATOMIC)) return false;
int[] idxLines = new int[2];
@@ -89,7 +90,7 @@
// On vide la selection, les 2 lignes sont supprim\xE9es par la jonction.
clearSelection();
- return getModelePoly().joinGeometries(idxLines, idxSels, editor_, _cmd)!=-1;
+ return getModelePoly().joinGeometries(idxLines, idxSels, _ui, _cmd)!=-1;
}
private boolean removeAtomicObjects(final CtuluCommandContainer _cmd, final CtuluUI _ui) {
@@ -283,7 +284,7 @@
return true;
}
- public final ZEditorDefault getEditor() {
+ public final ZEditorInterface getEditor() {
return editor_;
}
@@ -438,7 +439,7 @@
return r;
}
- public final void setEditor(final ZEditorDefault _editor) {
+ public final void setEditor(final ZEditorInterface _editor) {
editor_ = _editor;
}
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalqueMultiPointEditable.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -15,7 +15,6 @@
import org.fudaa.ctulu.CtuluCommandContainer;
import org.fudaa.ctulu.CtuluListSelectionInterface;
import org.fudaa.ctulu.CtuluUI;
-import org.fudaa.ctulu.gis.GISCoordinateSequenceContainerInterface;
import org.fudaa.ctulu.gis.GISGeometryFactory;
import org.fudaa.ctulu.gis.GISMultiPoint;
@@ -38,7 +37,7 @@
*/
public class ZCalqueMultiPointEditable extends ZCalqueMultiPoint implements ZCalqueEditable {
- ZEditorDefault editor_;
+ ZEditorInterface editor_;
/**
* Le seul constructeur, avec le modele \xE9ditable.
@@ -130,7 +129,7 @@
* Retourne l'\xE9diteur pour les objets selectionn\xE9s.
* @return L'editeur. Peut \xEAtre null.
*/
- public final ZEditorDefault getEditor() {
+ public final ZEditorInterface getEditor() {
return editor_;
}
@@ -355,7 +354,7 @@
* Definit l'\xE9diteur pour les objets selectionn\xE9s.
* @param _editor L'editeur.
*/
- public final void setEditor(final ZEditorDefault _editor) {
+ public final void setEditor(final ZEditorInterface _editor) {
editor_ = _editor;
}
@@ -365,7 +364,8 @@
* @param _cmd La pile de commandes.
* @return true si les semis de points ont \xE9t\xE9 jointes.
*/
- public boolean joinSelectedObjects(final CtuluCommandContainer _cmd) {
+ @Override
+ public boolean joinSelectedObjects(final CtuluCommandContainer _cmd, CtuluUI _ui) {
if (isSelectionEmpty())
return false;
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZCalquePointEditable.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -311,7 +311,7 @@
}
/* Sans objet */
- public boolean joinSelectedObjects(final CtuluCommandContainer _cmd) {
+ public boolean joinSelectedObjects(final CtuluCommandContainer _cmd, CtuluUI _ui) {
return false;
}
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleLigneBriseeEditable.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -483,11 +483,11 @@
*
* @param _ligneIdx Les index des 2 lignes.
* @param _idx Les index des 2 sommets des 2 lignes.
- * @param _editor le ZEditorDefault pour pouvoir demander \xE0 l'utilisateur la valeur de Z. Peut \xEAtre null.
+ * @param _ui l'interface pour pouvoir demander \xE0 l'utilisateur la valeur de Z. Peut \xEAtre null.
* @param _cmd Le conteneur de commandes.
* @return L'index de la nouvelle ligne si OK, -1 sinon.
*/
- public int joinGeometries(int[] _ligneIdx, int[] _idx, final ZEditorDefault _editor, final CtuluCommandContainer _cmd) {
+ public int joinGeometries(int[] _ligneIdx, int[] _idx, final CtuluUI _ui, final CtuluCommandContainer _cmd) {
if (geometries_ == null) {
return -1;
}
@@ -583,7 +583,7 @@
public myDialogModal(Frame _frame){
super(_frame, EbliLib.getS("Choix du Z"), true);
// Position & resizable
- setLocation(_frame.getLocation().x+_frame.getSize().width/2, _frame.getLocation().y+_frame.getSize().height/2);
+ setLocationRelativeTo(_frame);
setResizable(false);
// Contenu
JPanel container=new JPanel(new BuBorderLayout(2, 2));
@@ -605,7 +605,7 @@
return (Double) GISAttributeConstants.BATHY.getEditor().getValue(text_);
}
}
- myDialogModal dialog =new myDialogModal(_editor.getFrame());
+ myDialogModal dialog =new myDialogModal(_ui==null ? null:(Frame)_ui.getParentComponent());
dialog.setVisible(true);
dataline[att]=geometries_.getModel(att).getAttribute().createDataForGeom(dialog.getValue(),1);
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2011-09-26 19:23:17 UTC (rev 6452)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZSceneEditor.java 2011-09-27 15:53:27 UTC (rev 6453)
@@ -139,7 +139,7 @@
public void joinSelectedObjects() {
int[] idxs=getScene().getSelectionHelper().getSelectedIndexes();
ZCalqueEditable cq=(ZCalqueEditable)getScene().getLayerForId(idxs[0]);
- cq.joinSelectedObjects(mng_);
+ cq.joinSelectedObjects(mng_,ui_);
}
protected void methodNotImplemented() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-06-04 22:42:25
|
Revision: 7269
http://fudaa.svn.sourceforge.net/fudaa/?rev=7269&view=rev
Author: deniger
Date: 2012-06-04 22:42:19 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-06-04 22:41:58 UTC (rev 7268)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-06-04 22:42:19 UTC (rev 7269)
@@ -71,6 +71,9 @@
}
geometries_ = geometries;
+ if (geometries_ == null) {
+ return;
+ }
if (geometries_.getListener() instanceof GISZoneListenerDispatcher) {
((GISZoneListenerDispatcher) geometries_.getListener()).addListener(this);
} else {
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2012-06-04 22:41:58 UTC (rev 7268)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModelePointEditable.java 2012-06-04 22:42:19 UTC (rev 7269)
@@ -142,8 +142,9 @@
}
protected ZModelePointEditable(final boolean _create) {
+ super(null);
if (_create) {
- pts_ = new GISZoneCollectionPoint(null);
+ setGeometries(new GISZoneCollectionPoint(null));
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-02 18:11:01
|
Revision: 7850
http://fudaa.svn.sourceforge.net/fudaa/?rev=7850&view=rev
Author: deniger
Date: 2012-11-02 18:10:54 +0000 (Fri, 02 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2012-11-02 14:43:25 UTC (rev 7849)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2012-11-02 18:10:54 UTC (rev 7850)
@@ -479,9 +479,11 @@
*/
@Override
public void apply() {
+ //la g\xE9ometrie peut ne pas \xEAtre modifiable par contre les attributs si...
if(!isGeomModifiable()){
return;
}
+ modeleSrc_.modificationWillBeDone();
CtuluCommandComposite cmd = new CtuluCommandComposite("Modifications de la g\xE9om\xE9trie");
if (tableRep_ != null) {
tableRep_.apply(cmd);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2012-11-02 14:43:25 UTC (rev 7849)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2012-11-02 18:10:54 UTC (rev 7850)
@@ -10,29 +10,32 @@
import com.vividsolutions.jts.geom.CoordinateSequence;
import org.fudaa.ctulu.CtuluAnalyze;
-import org.fudaa.ebli.calque.ZModeleGeometry ;
+import org.fudaa.ebli.calque.ZModeleGeometry;
-
/**
* @author Fred Deniger
* @version $Id$
*/
public interface ZModeleEditable extends ZModeleGeometry {
-
-
+
/**
+ * pour \xE9ventuellement avertir d'une modification.
+ */
+ void modificationWillBeDone();
+
+ /**
* @param _seq la sequence pour la nouvel objet
* @param _analyze le receveur d'info
* @return true si valide.
*/
- boolean isCoordinateValid(CoordinateSequence _seq,CtuluAnalyze _analyze);
-
+ boolean isCoordinateValid(CoordinateSequence _seq, CtuluAnalyze _analyze);
+
/**
* V\xE9rifie la conformit\xE9 de la g\xE9om\xE9trie avant cr\xE9ation.
+ *
* @param _seq Les coordonn\xE9es
* @param _data Le transporteur de datas.
- * @param _ana Le container d'analyse. Un message d'erreur en fatalError est retourn\xE9 si probl\xE8me sur les
- * donn\xE9es.
+ * @param _ana Le container d'analyse. Un message d'erreur en fatalError est retourn\xE9 si probl\xE8me sur les donn\xE9es.
* @return True si la g\xE9om\xE9trie est valide.
*/
public boolean isDataValid(CoordinateSequence _seq, ZEditionAttributesDataI _data, CtuluAnalyze _ana);
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-11-02 14:43:25 UTC (rev 7849)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-11-02 18:10:54 UTC (rev 7850)
@@ -38,6 +38,7 @@
/**
* Une impl\xE9mentation par defaut d'un mod\xE8le contenant des g\xE9om\xE9tries de tous types.
+ *
* @author Bertrand Marchand
* @version $Id$
*/
@@ -52,6 +53,9 @@
this(new GISZoneCollectionGeometry());
}
+ public void modificationWillBeDone() {
+ }
+
public ZModeleGeometryDefault(GISZoneCollectionGeometry _zone) {
setGeometries(_zone);
@@ -59,6 +63,7 @@
/**
* Called from constructor !
+ *
* @param geometries
*/
public void setGeometries(GISZoneCollectionGeometry geometries) {
@@ -177,7 +182,7 @@
if (!attr.isAtomicValue() && attr.isUserVisible()) {
if (attr.isEditable()) {
_d.put(attr.getLongName(), geometries_.getValue(i, geometrySelected), attr.getEditor(),
- null, this, new int[]{geometrySelected});
+ null, this, new int[]{geometrySelected});
} else {
_d.put(attr.getLongName(), geometries_.getValue(i, geometrySelected).toString());
}
@@ -211,9 +216,8 @@
// Ajout de cette valeur
if (attr.isEditable()) {
TableCellRenderer renderer = new DefaultTableCellRenderer() {
-
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
- int row, int column) {
+ int row, int column) {
if (value == null) {
value = "<" + EbliLib.getS("Mixte") + ">";
}
@@ -319,7 +323,7 @@
}
protected void fireAttributeValueChangeAction(Object _source, int _idxAtt, GISAttributeInterface _att, int _indexGeom,
- Object _newValue) {
+ Object _newValue) {
for (int i = 0; i < listeners_.size(); i++) {
if (listeners_.get(i) instanceof ZModelGeometryListener) {
((ZModelGeometryListener) listeners_.get(i)).attributeValueChangeAction(this, _idxAtt, _att, _indexGeom, _newValue);
@@ -328,7 +332,7 @@
}
public void attributeValueChangeAction(Object _source, int _indexAtt, GISAttributeInterface _att, int _indexGeom,
- Object _newValue) {
+ Object _newValue) {
fireAttributeValueChangeAction(_source, _indexAtt, _att, _indexGeom, _newValue);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-05 13:58:00
|
Revision: 7857
http://fudaa.svn.sourceforge.net/fudaa/?rev=7857&view=rev
Author: deniger
Date: 2012-11-05 13:57:48 +0000 (Mon, 05 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2012-11-05 10:44:40 UTC (rev 7856)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2012-11-05 13:57:48 UTC (rev 7857)
@@ -294,11 +294,14 @@
boolean modification = false; // true si une modification a \xE9t\xE9 faite
// Application des modifications des attributs globaux
for (int i = globalAttr_.length - 1; i >= 0; i--) {
+ if (!globalAttrEditor_[i].isEditable()) {
+ continue;
+ }
final Object val = globalAttrEditor_[i].getValue(globalComp_[i]);
// Si une modificatin a \xE9t\xE9 faite, modification est mis \xE0 true, sauf si
// cette modification est faite sur ETAT_GEOM
- modification = modification || (!val.equals(globalAttr_[i].getObjectValueAt(idx_)) && globalAttr_[i].getAttribute() != GISAttributeConstants.ETAT_GEOM);
if (!globalAttr_[i].getObjectValueAt(idx_).equals(val) && globalAttr_[i].getAttribute() != GISAttributeConstants.ETAT_GEOM) {
+ modification = true;
globalAttr_[i].setObject(idx_, val, cmd);
}
}
@@ -470,13 +473,7 @@
*/
@Override
public void apply() {
- //la g\xE9ometrie peut ne pas \xEAtre modifiable par contre les attributs si...
-// if(!isGeomModifiable()){
-// return;
-// }
- if (isGeomModifiable()) {
- modeleSrc_.modificationWillBeDone();
- }
+ modeleSrc_.modificationWillBeDone();
CtuluCommandComposite cmd = new CtuluCommandComposite("Modifications de la g\xE9om\xE9trie");
if (tableRep_ != null) {
tableRep_.apply(cmd);
@@ -487,6 +484,7 @@
}
// D\xE9active le model
modelData_.setSource(null, -1);
+ modeleSrc_.modificationDone();
}
@Override
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2012-11-05 10:44:40 UTC (rev 7856)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleEditable.java 2012-11-05 13:57:48 UTC (rev 7857)
@@ -38,4 +38,6 @@
* @return True si la g\xE9om\xE9trie est valide.
*/
public boolean isDataValid(CoordinateSequence _seq, ZEditionAttributesDataI _data, CtuluAnalyze _ana);
+
+ public void modificationDone();
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-11-05 10:44:40 UTC (rev 7856)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/ZModeleGeometryDefault.java 2012-11-05 13:57:48 UTC (rev 7857)
@@ -53,6 +53,9 @@
public void modificationWillBeDone() {
}
+ public void modificationDone() {
+ }
+
public ZModeleGeometryDefault(GISZoneCollectionGeometry _zone) {
setGeometries(_zone);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2013-01-23 22:57:16
|
Revision: 8251
http://fudaa.svn.sourceforge.net/fudaa/?rev=8251&view=rev
Author: deniger
Date: 2013-01-23 22:57:04 +0000 (Wed, 23 Jan 2013)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectTableModel.java
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2013-01-23 22:47:43 UTC (rev 8250)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectEditorPanel.java 2013-01-23 22:57:04 UTC (rev 8251)
@@ -56,7 +56,7 @@
* @version $Id: EbliSingleObjectEditorPanel.java,v 1.10.6.2 2008-04-01 07:28:15 bmarchan Exp $
*/
public class EbliSingleObjectEditorPanel extends CtuluDialogPanel {
-
+
protected boolean isGeomModifiable() {
return this.modeleSrc_.getGeomData().isGeomModifiable();
}
@@ -144,7 +144,7 @@
public void modeleAdapterError(String _message) {
setErrorText(_message);
}
-
+
@Override
public void modeleAdpaterNoError() {
setErrorText("");
@@ -161,11 +161,11 @@
final BuButton btUp_ = new BuButton(BuResource.BU.getIcon("monter"));
btUp_.setToolTipText(EbliLib.getS("D\xE9cr\xE9menter l'index"));
btUp_.setEnabled(false);
-
+
final BuButton btDown_ = new BuButton(BuResource.BU.getIcon("descendre"));
btDown_.setToolTipText(EbliLib.getS("Incr\xE9menter l'index"));
btDown_.setEnabled(false);
-
+
btUp_.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -200,11 +200,11 @@
final BuButton btAdd_ = new BuButton(BuResource.BU.getIcon("ajouter"), EbliLib.getS("Ajouter"));
btAdd_.setToolTipText(EbliLib.getS("Ajouter un sommet avant la s\xE9lection (ou en dernier si aucune s\xE9lection)"));
btAdd_.setEnabled(isGeomModifiable());
-
+
final BuButton btDel_ = new BuButton(BuResource.BU.getIcon("enlever"), EbliLib.getS("Supprimer"));
btDel_.setToolTipText(EbliLib.getS("Supprimer un sommet"));
btDel_.setEnabled(false);
-
+
btAdd_.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -222,7 +222,7 @@
});
pnAdd.add(btAdd_);
pnAdd.add(btDel_);
-
+
table_.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
@@ -230,7 +230,7 @@
return;
}
final boolean geomModifiable = isGeomModifiable();
-
+
btUp_.setEnabled(geomModifiable && table_.getSelectedRowCount() > 0);
btDown_.setEnabled(geomModifiable && table_.getSelectedRowCount() > 0);
btAdd_.setEnabled(geomModifiable && table_.getSelectedRowCount() <= 1);
@@ -255,7 +255,7 @@
}
}
});
-
+
pnStructure.add(pnAdd, BuBorderLayout.WEST);
pnStructure.add(pnOrder, BuBorderLayout.CENTER);
pnStructure.add(modeChangement_, BuBorderLayout.EAST);
@@ -418,11 +418,12 @@
tableRep_ = new TableRepresentation(_editAttribut, _editVertexAttribut, _defs);
add(tableRep_, BuBorderLayout.CENTER);
}
-
+
public void setDeferredModifications(boolean _active) {
modelData_.setDeferredModifications(_active);
+ this.tableRep_.modeChangement_.setSelected(_active);
}
-
+
public EbliSingleObjectTableModel getTableModel() {
return modelData_;
}
@@ -436,7 +437,7 @@
public void addNewTab(String _title, BuPanel _pn) {
if (tabbedPane_ == null) {
tabbedPane_ = new JTabbedPane();
-
+
remove(tableRep_);
tabbedPane_.add(EbliLib.getS("Table"), tableRep_);
add(tabbedPane_, BuBorderLayout.CENTER);
@@ -490,7 +491,7 @@
modelData_.setSource(null, -1);
modeleSrc_.modificationDone();
}
-
+
@Override
public boolean cancel() {
// D\xE9active le model
@@ -500,11 +501,11 @@
}
return super.cancel();
}
-
+
public final CtuluCommandContainer getCmd() {
return cmd_;
}
-
+
public final void setCmd(final CtuluCommandContainer _cmd) {
cmd_ = _cmd;
}
Modified: trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectTableModel.java
===================================================================
--- trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectTableModel.java 2013-01-23 22:47:43 UTC (rev 8250)
+++ trunk/framework/ebli-2d/src/main/java/org/fudaa/ebli/calque/edition/EbliSingleObjectTableModel.java 2013-01-23 22:57:04 UTC (rev 8251)
@@ -47,15 +47,14 @@
import org.fudaa.ebli.commun.EbliLib;
/**
- * Cette classe permet d'adapter l'interface d'un ZModeleGeometry sur une g\xE9om\xE9trie sp\xE9cifique. C'est \xE0 dire que l'adapter se
- * greffe sur le mod\xE8le et selectionne une des g\xE9om\xE9tries. Toutes les m\xE9thodes propos\xE9es par cette interface seront r\xE9alis\xE9es sur
- * cette g\xE9om\xE9trie.
+ * Cette classe permet d'adapter l'interface d'un ZModeleGeometry sur une g\xE9om\xE9trie sp\xE9cifique. C'est \xE0 dire que l'adapter se greffe sur le mod\xE8le et
+ * selectionne une des g\xE9om\xE9tries. Toutes les m\xE9thodes propos\xE9es par cette interface seront r\xE9alis\xE9es sur cette g\xE9om\xE9trie.
*
- * Ce model contient : en premi\xE8re colonne : index en seconde colonne : x en troisi\xE8me colonne : y en quatri\xE8me colonne : z (si il
- * existe et qu'il est atomique) les autres attributs atomiques dans l'ordre de la GISZoneCollection etc...
+ * Ce model contient : en premi\xE8re colonne : index en seconde colonne : x en troisi\xE8me colonne : y en quatri\xE8me colonne : z (si il existe et qu'il est
+ * atomique) les autres attributs atomiques dans l'ordre de la GISZoneCollection etc...
*
- * Deux modes d'application des modifications sont pr\xE9sents : - un mode imm\xE9diate : les modifications sont imm\xE9diatements
- * appliqu\xE9s \xE0 la gis. - un mode diff\xE9r\xE9 : les modifications sont mises en cache et aplliqu\xE9 quand flushData() est appel\xE9.
+ * Deux modes d'application des modifications sont pr\xE9sents : - un mode imm\xE9diate : les modifications sont imm\xE9diatements appliqu\xE9s \xE0 la gis. - un
+ * mode diff\xE9r\xE9 : les modifications sont mises en cache et aplliqu\xE9 quand flushData() est appel\xE9.
*
* Le model se charge de mettre la g\xE9o\xE9mtrie \xE0 'Modifi\xE9' lorsque celle-ci l'est.
*
@@ -65,8 +64,8 @@
public class EbliSingleObjectTableModel implements TableModel {
/**
- * Classe interface permettant de faire le lien entre la classe m\xE8re et les classes g\xE9rant les \xE9tats sp\xE9cifiques. Utilisation du
- * design pattern Stat.
+ * Classe interface permettant de faire le lien entre la classe m\xE8re et les classes g\xE9rant les \xE9tats sp\xE9cifiques. Utilisation du design pattern
+ * Stat.
*
* @author Emmanuel MARTIN
* @version $Id$
@@ -86,6 +85,7 @@
/**
* Supprime les sommets d'indice donn\xE9es.
+ *
* @param _idx Les indices, dans l'ordre croissant.
* @param _cmd Le container de commandes.
*/
@@ -93,6 +93,7 @@
/**
* Ajoute un sommet \xE0 la g\xE9om\xE9trie
+ *
* @param _idxBefore L'indice apr\xE8s lequel le sommet sera ins\xE9r\xE9. Si -1, le sommet est ins\xE9r\xE9 en 0.
* @param _x La coordonn\xE9e X du sommet.
* @param _y La coordonn\xE9e Y du sommet
@@ -144,6 +145,7 @@
@Override
public void setValueAt(Object value, int rowIndex, int columnIndex) {
CtuluCommandComposite cmd = new CtuluCommandComposite(EbliLib.getS("Modification d'une g\xE9om\xE9trie"));
+ modele_.modificationWillBeDone();
if (columnIndex == 1 || columnIndex == 2) {
putGeomModified(cmd);
clearError();
@@ -176,6 +178,7 @@
@Override
public void switchPoints(int _idx1, int _idx2, CtuluCommandContainer _cmd) {
+ modele_.modificationWillBeDone();
putGeomModified(_cmd);
CoordinateSequence newseq = new GISCoordinateSequenceFactory().create(coordSeq_);
@@ -218,7 +221,7 @@
if (!(zone_ instanceof GISZoneCollectionGeometry)) {
return;
}
-
+ modele_.modificationWillBeDone();
GISZoneCollectionGeometry zone = (GISZoneCollectionGeometry) zone_;
CtuluListSelection sel = new CtuluListSelection(_idx);
zone.removeAtomics(idxSelected_, sel, null, _cmd);
@@ -233,7 +236,7 @@
if (!(zone_ instanceof GISZoneCollectionGeometry)) {
return -1;
}
-
+ modele_.modificationWillBeDone();
GISZoneCollectionGeometry zone = (GISZoneCollectionGeometry) zone_;
int inew = zone.addAtomic(idxSelected_, _idxBefore, _x, _y, _cmd);
// La sequence a \xE9t\xE9 modifi\xE9e
@@ -288,7 +291,7 @@
coordSeq_.setOrdinate(coordSeq_.size() - 1, _idxCol - 1, (Double) _value);
}
} else if (_idxCol > 2) {
- modificationDone_=true;
+ modificationDone_ = true;
lattmdls.get(_idxCol - 3).setObject(_idxRow, _value, null);
}
@@ -436,8 +439,8 @@
for (int i = 0; i < lattmdls.size(); i++) {
final GISAttributeModel m = getModel(i);
final GISReprojectInterpolateurI interpolateur =
- GISZoneAttributeFactory.create1DInterpolateur(lattmdls.get(i).getAttribute(), coordSeq_,
- seq, m);
+ GISZoneAttributeFactory.create1DInterpolateur(lattmdls.get(i).getAttribute(), coordSeq_,
+ seq, m);
lattmdls.set(i, m.deriveNewModel(seq.size(), interpolateur));
}
@@ -450,6 +453,7 @@
/**
* Une classe d'adaptation du modele pour les attributs
+ *
* @author Bertrand Marchand (mar...@de...)
*/
public class AttributesDataModelAdapter implements ZEditionAttributesDataI {
@@ -591,6 +595,7 @@
/**
* Desactive temporairement le listener pour eviter des evenements en boucle.
+ *
* @param _b
*/
public void setInactive(boolean _b) {
@@ -607,7 +612,7 @@
* @exception IllegalArgumentException si _idxSelected n'appartient pas \xE0 _zone.
*/
public EbliSingleObjectTableModel(ZModeleEditable _modele, int _idxSelected, EbliCoordinateDefinition[] _defs,
- CtuluCommandContainer _cmd, boolean _showAttributes) {
+ CtuluCommandContainer _cmd, boolean _showAttributes) {
if ((_modele == null && _idxSelected != -1) || (_modele != null && _idxSelected != -1 && (_idxSelected < 0 || _idxSelected >= _modele.getNombre()))) {
throw new IllegalArgumentException("L'index de g\xE9om\xE9trie n'appartient pas \xE0 la zone.");
}
@@ -864,13 +869,14 @@
if (modele_ == null || idxSelected_ == -1) {
throw new IllegalArgumentException("Aucun modele ou aucune g\xE9om\xE9trie selectionn\xE9e.");
}
- if (value != null && !value.equals(getValueAt(rowIndex, columnIndex)) ) {
+ if (value != null && !value.equals(getValueAt(rowIndex, columnIndex))) {
stat_.setValueAt(value, rowIndex, columnIndex);
}
}
/**
* Incr\xE9mente de n les index donn\xE9s. Pour d\xE9cr\xE9menter donner un indice n\xE9gatif. _idx est modifi\xE9 dans l'op\xE9ration
+ *
* @return le tableau des nouveaux index.
*/
public int[] movePoints(int[] _idx, int n) {
@@ -919,6 +925,7 @@
/**
* Ajoute un point avant l'indice pass\xE9 en argument.
+ *
* @param _idxAfter L'indice. Peut \xEAtre -1, pour ajouter un point en fin de tableau.
*/
public int addPoint(int _idxAfter) {
@@ -1063,7 +1070,7 @@
analyzer_.clear();
if (modele_.isCoordinateValid(coordSeq_, analyzer_)
- && modele_.isDataValid(coordSeq_, getAttributDataModelAdapter(), analyzer_)) {
+ && modele_.isDataValid(coordSeq_, getAttributDataModelAdapter(), analyzer_)) {
return null;
} else {
return analyzer_.getFatalError();
@@ -1103,6 +1110,7 @@
/**
* Retourne vrai si _value est dans _table
+ *
* @param _value
* @param _table
* @return
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|