protected void treatOneTrack(int tkNthFrom, int tkNthTo) { HoloTrack tmpTrack = gp.copyTrack.dupliquer(); // on remplace temporairement HoloPoint hpi; gp.Copy(tkNthFrom); // --- parametres fournis par l'utilisateur : double scaler = Math.abs((Double) results[3] / 100.); if (!gp.copyTrack.isEmpty()) { for (int i = 0; i < gp.copyTrack.size(); i++) { hpi = gp.copyTrack.elementAt(i); hpi.date = (int) (hpi.date * scaler); inc(); } } gp.ReplaceWithoutStore(tkNthTo); int endStretch = gp.copyTrack.getLastDate() + dateBegin; gp.update(tkNthTo, dateEnd >= endStretch ? dateEnd : endStretch); gp.copyTrack = tmpTrack.dupliquer(); }
public void run() { try { Ut.print("___________________________________________"); Ut.print(" o Writing file : " + filename + " in progress..."); Ut.print("..."); pb.setValue(0); BufferedWriter out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(new File(filename)), "UTF-8")); out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"); HoloTrack tk = gp.tracks.get(tkNum); HoloTraj ht = tk.getHoloTraj(tjNum).dupliquer(); ht.shiftDates(-ht.getFirstDate()); out.write(ht.toICSTFile()); pb.inc(gp.tracks.get(tkNum).getHoloTraj(tjNum).size()); out.close(); pb.dispose(); Ut.print(" v File was successfully written"); Ut.print("___________________________________________"); } catch (IOException ioe) { ioe.printStackTrace(); } }