Commit 0c6c4f40 authored by VERNIER HARRISON's avatar VERNIER HARRISON
Browse files

correctif mise à jour JTree data

parent a82f2f70
...@@ -425,7 +425,7 @@ public class MainFrame extends JFrame { ...@@ -425,7 +425,7 @@ public class MainFrame extends JFrame {
} }
} }
this.mDataTreeModel.reload(currentNode); this.mDataTreeModel.reload(currentNode);
//this.mDataProjectTree.repaint();
/*for(int i=0 ; i< listDataSession.size() ; i++) { /*for(int i=0 ; i< listDataSession.size() ; i++) {
DefaultMutableTreeNode newNodeDataSession = new DefaultMutableTreeNode(listDataSession.get(i)); DefaultMutableTreeNode newNodeDataSession = new DefaultMutableTreeNode(listDataSession.get(i));
...@@ -2102,7 +2102,7 @@ public class MainFrame extends JFrame { ...@@ -2102,7 +2102,7 @@ public class MainFrame extends JFrame {
this.desktop.addImageFrame(session); this.desktop.addImageFrame(session);
else else
this.desktop.setSelectedFrame(session.associatedFrame); this.desktop.setSelectedFrame(session.associatedFrame);
session.associatedFrame.addInternalFrameListener(new InternalFrameListener() { session.associatedFrame.addInternalFrameListener(new InternalFrameListener() {
@Override @Override
...@@ -2189,7 +2189,8 @@ public class MainFrame extends JFrame { ...@@ -2189,7 +2189,8 @@ public class MainFrame extends JFrame {
this.mDataTreeModel.insertNodeInto(newNode, this.mDataProjectNode, this.mDataProjectNode.getChildCount()); this.mDataTreeModel.insertNodeInto(newNode, this.mDataProjectNode, this.mDataProjectNode.getChildCount());
final TreePath pates = new TreePath(newNode.getPath()); final TreePath pates = new TreePath(newNode.getPath());
//this.mDataProjectTree.setSelectionPath(pates); if(listDataSession.size() == 1)
this.mDataProjectTree.setSelectionPath(pates);
this.currentDataSession = session; this.currentDataSession = session;
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
actionArffData = true; actionArffData = true;
...@@ -2203,7 +2204,7 @@ public class MainFrame extends JFrame { ...@@ -2203,7 +2204,7 @@ public class MainFrame extends JFrame {
this.desktop.addDataFrame(session); this.desktop.addDataFrame(session);
else else
this.desktop.setSelectedFrame(session.associatedFrame); this.desktop.setSelectedFrame(session.associatedFrame);
UpdateDataProjectTree();
session.associatedFrame.addInternalFrameListener(new InternalFrameListener() { session.associatedFrame.addInternalFrameListener(new InternalFrameListener() {
@Override @Override
...@@ -2268,6 +2269,7 @@ public class MainFrame extends JFrame { ...@@ -2268,6 +2269,7 @@ public class MainFrame extends JFrame {
}); });
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
if (MainFrame.DEBUG_MODE) if (MainFrame.DEBUG_MODE)
System.out.println(Messages.getString("MainFrame.75") + ((endTime - startTime))); //$NON-NLS-1$ System.out.println(Messages.getString("MainFrame.75") + ((endTime - startTime))); //$NON-NLS-1$
......
...@@ -170,6 +170,7 @@ public class DataPanel extends JPanel implements ChangeListener { ...@@ -170,6 +170,7 @@ public class DataPanel extends JPanel implements ChangeListener {
/* Selectionne par defaut le premier attribut */ /* Selectionne par defaut le premier attribut */
this.attrTable.getSelectionModel().setLeadSelectionIndex(0); this.attrTable.getSelectionModel().setLeadSelectionIndex(0);
} }
public DataPanel(Data _data) { public DataPanel(Data _data) {
......
...@@ -244,9 +244,9 @@ public class CSVToKMLDialog extends JPanel implements ToUpdateObject { ...@@ -244,9 +244,9 @@ public class CSVToKMLDialog extends JPanel implements ToUpdateObject {
String filename = Utils.addExtension(fileChooser.getSelectedFile().getAbsolutePath(), "csv"); String filename = Utils.addExtension(fileChooser.getSelectedFile().getAbsolutePath(), "csv");
File file = new File(filename); File file = new File(filename);
try { try {
Writer output = new BufferedWriter(new FileWriter(file)); Writer output = new BufferedWriter(new FileWriter(file));
/*String kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<kml xmlns=\"http://www.opengis.net/kml/2.2\"\n " String kml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<kml xmlns=\"http://www.opengis.net/kml/2.2\"\n "
+ "xmlns:gx=\"http://www.google.com/kml/ext/2.2\">\n" + "<Folder>\n" + "xmlns:gx=\"http://www.google.com/kml/ext/2.2\">\n" + "<Folder>\n"
+ "<name>" + filename + "</name>\n"; + "<name>" + filename + "</name>\n";
for(int i=0 ; i<clusterSee.size(); i++) { for(int i=0 ; i<clusterSee.size(); i++) {
...@@ -287,26 +287,26 @@ Writer output = new BufferedWriter(new FileWriter(file)); ...@@ -287,26 +287,26 @@ Writer output = new BufferedWriter(new FileWriter(file));
} }
} }
kml += "</Folder>\n" + "</kml>\n";*/ kml += "</Folder>\n" + "</kml>\n";
String kml = "ClusterNumber;id;gps1;gps2\n"; // String kml = "ClusterNumber;id;gps1;gps2\n";
//
for(int i=0 ; i<clusterSee.size(); i++) { // for(int i=0 ; i<clusterSee.size(); i++) {
Cluster cluster = classif.getClusteringResult().getCluster(clusterSee.get(i)); // Cluster cluster = classif.getClusteringResult().getCluster(clusterSee.get(i));
//
Data dataTmp = cluster.getData(true); // Data dataTmp = cluster.getData(true);
List<DataObject> obj = dataTmp.getViewDataObjects(); // List<DataObject> obj = dataTmp.getViewDataObjects();
for(int j=0 ; j< obj.size(); j++) { // for(int j=0 ; j< obj.size(); j++) {
for(int z=0 ; z < gpsPos.size(); z++) { // for(int z=0 ; z < gpsPos.size(); z++) {
if(obj.get(j).getId() == ((int)gpsPos.get(z)[0])) { // if(obj.get(j).getId() == ((int)gpsPos.get(z)[0])) {
kml +=""+(i+1)+";"+obj.get(j).getId()+";"+gpsPos.get(z)[1]+";"+gpsPos.get(z)[2]+"\n"; // kml +=""+(i+1)+";"+obj.get(j).getId()+";"+gpsPos.get(z)[1]+";"+gpsPos.get(z)[2]+"\n";
gpsPos.remove(z); // gpsPos.remove(z);
z--; // z--;
} // }
} // }
} // }
//
} // }
output.write(kml); output.write(kml);
output.close(); output.close();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment