Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10538/src/net/sourceforge/bprocessor/model
Modified Files:
Project.java
Log Message:
Index: Project.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v
retrieving revision 1.188
retrieving revision 1.189
diff -C2 -d -r1.188 -r1.189
*** Project.java 22 Apr 2010 08:13:47 -0000 1.188
--- Project.java 26 Apr 2010 09:30:05 -0000 1.189
***************
*** 79,82 ****
--- 79,85 ----
/** */
public static final boolean SENSE = false;
+
+ /** */
+ public static final boolean BRUN = false;
private static final String HOST = "localhost";
private static final int PORT = 8800;
***************
*** 114,118 ****
private static boolean useDisplayLists;
private static boolean doExport;
- private static boolean doExportXml;
private HashMap cameras = new HashMap();
--- 117,120 ----
***************
*** 468,472 ****
public void initialize() {
name = "New Project";
! exportPath = "b-processor-export.obj";
script = new Description("");
--- 470,474 ----
public void initialize() {
name = "New Project";
! exportPath = "b-export";
script = new Description("");
***************
*** 1150,1155 ****
} else if (a.getName().equals("Export")) {
doExport = ((Boolean) a.getValue()).booleanValue();
- } else if (a.getName().equals("Export XML")) {
- doExportXml = ((Boolean) a.getValue()).booleanValue();
} else if (a.getName().equals("Export Path")) {
setExportPath((String)a.getValue());
--- 1152,1155 ----
***************
*** 1173,1178 ****
res.add(new Attribute("Export", Boolean.valueOf(doExport)));
res.add(new Attribute("Export Path", getExportPath()));
! res.add(new Attribute("Export XML", Boolean.valueOf(doExportXml)));
! res.add(new Attribute("Brunata Server", Boolean.valueOf(brunata)));
res.add(new Attribute("Script", script));
return res;
--- 1173,1179 ----
res.add(new Attribute("Export", Boolean.valueOf(doExport)));
res.add(new Attribute("Export Path", getExportPath()));
! if (BRUN) {
! res.add(new Attribute("Brunata Server", Boolean.valueOf(brunata)));
! }
res.add(new Attribute("Script", script));
return res;
***************
*** 1870,1880 ****
int count = 1;
List<String> names = new LinkedList();
for (Space current : constructs) {
- String name = current.getName();
- if (name.length() == 0) {
- name = "construct-" + count++;
- }
if (visible(current)) {
names.add(name);
File objfile = new File(file, name + ".obj");
--- 1871,1886 ----
int count = 1;
List<String> names = new LinkedList();
+ Set<String> mark = new HashSet();
for (Space current : constructs) {
if (visible(current)) {
+ String name = current.getName();
+ if (name.length() == 0) {
+ name = "construct-" + count++;
+ } else if (mark.contains(name)) {
+ name = "construct-" + count++;
+ }
+
+ mark.add(name);
names.add(name);
File objfile = new File(file, name + ".obj");
***************
*** 1957,1965 ****
*/
public void export(String path) throws Exception {
! if (doExportXml) {
! exportXmlAll(path);
! } else {
! exportObjAll(path);
! }
}
--- 1963,1967 ----
*/
public void export(String path) throws Exception {
! exportXmlAll(path);
}
***************
*** 2187,2192 ****
return items;
}
!
!
}
--- 2189,2212 ----
return items;
}
!
! /**
! *
! * @param file File
! * @throws Exception Exception
! */
! public void importLibrary(File file) throws Exception {
! Document document = Persistence.load(file);
! Space union = Space.createUnion("Import");
! document.getWorld().copyInterior(new HashMap(), union);
! Project.getInstance().world().add(union);
! for (Material current : document.getMaterials()) {
! Project.getInstance().add(current);
! }
! for (Component current : document.getComponents()) {
! Project.getInstance().addCalalogObject(current);
! }
!
! Project.getInstance().changed(Project.getInstance());
! }
}
|