Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24424/src/net/sourceforge/bprocessor/gui/actions
Modified Files:
FileImportActionListener.java ImportFileReader.java
Log Message:
Made z-x plane and 1:100 default import param, and added spaces as normal geometry and not protected
Index: FileImportActionListener.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FileImportActionListener.java 22 Oct 2007 10:00:17 -0000 1.9
--- FileImportActionListener.java 29 Oct 2007 09:05:18 -0000 1.10
***************
*** 97,103 ****
if (lfile.getName().endsWith(".csv")) {
try {
! ImportFileReader.importCsvFile(lfile, Project.getInstance().world(),
info.getSelectedFloor());
! Project.getInstance().changed(Project.getInstance());
} catch (Exception ex) {
log.error("Could not open file: " + lfile, ex);
--- 97,104 ----
if (lfile.getName().endsWith(".csv")) {
try {
! ImportFileReader.importCsvFile(lfile, Project.getInstance().getActiveSpace(),
info.getSelectedFloor());
! Project.getInstance().changed(Project.getInstance().getActiveSpace());
! Project.getInstance().checkpoint();
} catch (Exception ex) {
log.error("Could not open file: " + lfile, ex);
***************
*** 105,112 ****
} else if (lfile.getName().endsWith(".obj")) {
try {
! Space s = Project.getInstance().world().createUnion(lfile.getName());
ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(),
info.objPanel.getDirection());
! Project.getInstance().world().add(s);
} catch (Exception ex) {
log.error("Could not open file: " + lfile, ex);
--- 106,116 ----
} else if (lfile.getName().endsWith(".obj")) {
try {
! Space into = Project.getInstance().getActiveSpace();
! Space s = into.createUnion(lfile.getName());
! into.add(s);
ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(),
info.objPanel.getDirection());
! Project.getInstance().changed(s);
! Project.getInstance().checkpoint();
} catch (Exception ex) {
log.error("Could not open file: " + lfile, ex);
***************
*** 126,132 ****
this.add(new JLabel("Baseplane"));
basis = new JComboBox(new String[]{"X-Y", "Z-X", "Y-Z"});
this.add(basis);
this.add(new JLabel("Scale"));
! scale = new JTextField("1:1", 5);
scale.addActionListener(this);
this.add(scale);
--- 130,137 ----
this.add(new JLabel("Baseplane"));
basis = new JComboBox(new String[]{"X-Y", "Z-X", "Y-Z"});
+ basis.setSelectedIndex(1);
this.add(basis);
this.add(new JLabel("Scale"));
! scale = new JTextField("1:100", 5);
scale.addActionListener(this);
this.add(scale);
Index: ImportFileReader.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ImportFileReader.java 24 Oct 2007 06:48:28 -0000 1.8
--- ImportFileReader.java 29 Oct 2007 09:05:18 -0000 1.9
***************
*** 187,194 ****
}
loadMaterials(new File(f.getParent() + "\\" + name), materialMap);
}
}
for (Space s : groups) {
! into.addProtected(s);
}
for (Material m : materialMap.values()) {
--- 187,198 ----
}
loadMaterials(new File(f.getParent() + "\\" + name), materialMap);
+ } else {
+ log.warn("Did not understand line " + lineNum + " : " + line);
}
}
for (Space s : groups) {
! if (!s.getVertices().isEmpty()) {
! into.add(s);
! }
}
for (Material m : materialMap.values()) {
***************
*** 205,208 ****
--- 209,215 ----
}
into.changed();
+ stream.close();
+ br.close();
+ reader.close();
}
}
***************
*** 412,415 ****
--- 419,425 ----
throw new IOException("Problems in format at line " + line);
}
+ bf.close();
+ isr.close();
+ fis.close();
}
//check if there is something left to read
|