[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Item.java, 1.5, 1.6 Component.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2010-03-09 13:02:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7535/src/net/sourceforge/bprocessor/model Modified Files: Item.java Component.java Project.java Persistence.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Item.java 12 Feb 2010 14:36:40 -0000 1.5 --- Item.java 9 Mar 2010 13:02:00 -0000 1.6 *************** *** 622,632 **** res.add(new Attribute("Modellor", getModellor())); } - if (getOwner() != null && getOwner().getModellor() != null) { - Parametric parameters = getOwner().getModellor().get((Space) this); - if (parameters != null) { - res.add(new Attribute(parameters.title(), parameters)); - } - } - return res; } --- 622,625 ---- Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Persistence.java 12 Feb 2010 13:04:18 -0000 1.87 --- Persistence.java 9 Mar 2010 13:02:00 -0000 1.88 *************** *** 1888,1893 **** private static Component internalizeLibraryObj(LibObjType lot, Map map, Collection xmls) { Component lo = new Component(); - lo.setAuthor(lot.getAuthor()); - lo.setVersion(lot.getVersion()); lo.setName(lot.getName()); lo.setLocked(lot.isLocked()); --- 1888,1891 ---- *************** *** 1940,1948 **** libobj.setId(counter++); libobj.setLocked(libo.isLocked()); ! libobj.setAuthor(libo.getAuthor()); libobj.setName(libo.getName()); libobj.setSpace(externalizeSpace(libo.getSpace(), map)); ! libobj.setUseableLevels(libo.getUseLevel()); ! libobj.setVersion(libo.getVersion()); return libobj; } --- 1938,1946 ---- libobj.setId(counter++); libobj.setLocked(libo.isLocked()); ! libobj.setAuthor("bprocessor"); libobj.setName(libo.getName()); libobj.setSpace(externalizeSpace(libo.getSpace(), map)); ! libobj.setUseableLevels((byte) 0); ! libobj.setVersion("0"); return libobj; } Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Component.java 12 Feb 2010 11:44:28 -0000 1.10 --- Component.java 9 Mar 2010 13:02:00 -0000 1.11 *************** *** 18,36 **** private File file; private Space space = null; - private byte useableLevels = 0; private boolean isLocked = false; private String name; - private String author; - private String version; /** * The default constructor - * @param usableLvls the levels where obj can be used incoded into a byte * @param f the file that represents this library object * @param s the space (union) this lib obj encapsulate */ ! public Component(byte usableLvls, File f, Space s) { file = f; - useableLevels = usableLvls; space = s; name = s.getName(); --- 18,31 ---- private File file; private Space space = null; private boolean isLocked = false; private String name; /** * The default constructor * @param f the file that represents this library object * @param s the space (union) this lib obj encapsulate */ ! public Component(File f, Space s) { file = f; space = s; name = s.getName(); *************** *** 69,80 **** /** - * Return a byte with the usable levelnumber bit set - * @return a byte with some set bits - */ - public byte getUseLevel() { - return useableLevels; - } - - /** * A getter for the space (union) this lib obj points to * @return The Space --- 64,67 ---- *************** *** 143,150 **** List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); - att.add(new Attribute("Project", worksAtLevel(Space.PROJECT_LEVEL))); - att.add(new Attribute("Space", worksAtLevel(Space.SPACE_LEVEL))); - att.add(new Attribute("Element", worksAtLevel(Space.ELEMENT_LEVEL))); - att.add(new Attribute("Part", worksAtLevel(Space.PART_LEVEL))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); --- 130,133 ---- *************** *** 154,171 **** } att.add(new Attribute("File", fileStr)); - att.add(new Attribute("Author", getAuthor())); - att.add(new Attribute("Version", getVersion())); att.add(new Attribute("Preview", this)); return att; } - private boolean worksAtLevel(int spaceLevel) { - int lvl = 1 >> (spaceLevel - Space.PROJECT_LEVEL); - if ((getUseLevel() & lvl) == lvl) { - return true; - } - return false; - } - /** * {@inheritDoc} --- 137,144 ---- *************** *** 186,223 **** return name; } - - /** - * @return the author - */ - public String getAuthor() { - if (author == null) { - author = "n/a"; - } - return author; - } - - /** - * @param author the author to set - */ - public void setAuthor(String author) { - this.author = author; - } - - /** - * @return the version - */ - public String getVersion() { - if (version == null) { - version = "n/a"; - } - return version; - } - - /** - * @param version the version to set - */ - public void setVersion(String version) { - this.version = version; - } /** --- 159,162 ---- Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.186 retrieving revision 1.187 diff -C2 -d -r1.186 -r1.187 *** Project.java 25 Feb 2010 14:43:48 -0000 1.186 --- Project.java 9 Mar 2010 13:02:00 -0000 1.187 *************** *** 112,116 **** private static boolean doDisplayGeometry; ! private static boolean doDebugGeometry; private static boolean doExport; --- 112,116 ---- private static boolean doDisplayGeometry; ! private static boolean useDisplayLists; private static boolean doExport; *************** *** 423,428 **** * @return boolean */ ! public static boolean doDebugGeometry() { ! return Project.doDebugGeometry; } --- 423,428 ---- * @return boolean */ ! public static boolean useDisplayLists() { ! return Project.useDisplayLists; } *************** *** 459,463 **** public Project() { super(); - System.out.println("-- construct --"); staticObservers = new LinkedList(); reset(); --- 459,462 ---- *************** *** 932,946 **** */ public void checkpoint() { - Bmodel state = Persistence.externalize(); - if (state != null) { redoStack.clear(); if (currentState != null) { undoStack.push(currentState); } currentState = state; } - log.debug("--------CheckPoint--------"); } --- 931,945 ---- */ public void checkpoint() { Bmodel state = Persistence.externalize(); if (state != null) { redoStack.clear(); if (currentState != null) { undoStack.push(currentState); + if (undoStack.size() > 5) { + undoStack.remove(0); + } } currentState = state; } } *************** *** 1147,1152 **** } else if (a.getName().equals("Display Geometry")) { doDisplayGeometry = ((Boolean) a.getValue()).booleanValue(); ! } else if (a.getName().equals("Debug Geometry")) { ! doDebugGeometry = ((Boolean) a.getValue()).booleanValue(); } else if (a.getName().equals("Export")) { doExport = ((Boolean) a.getValue()).booleanValue(); --- 1146,1151 ---- } else if (a.getName().equals("Display Geometry")) { doDisplayGeometry = ((Boolean) a.getValue()).booleanValue(); ! } else if (a.getName().equals("Use display lists")) { ! useDisplayLists = ((Boolean) a.getValue()).booleanValue(); } else if (a.getName().equals("Export")) { doExport = ((Boolean) a.getValue()).booleanValue(); *************** *** 1169,1173 **** res.add(new Attribute("Heated area", new Double(EnergyCalc.heatedArea()), false)); res.add(new Attribute("Display Geometry", Boolean.valueOf(doDisplayGeometry))); ! res.add(new Attribute("Debug Geometry", Boolean.valueOf(doDebugGeometry))); res.add(new Attribute("Export", Boolean.valueOf(doExport))); res.add(new Attribute("Export Path", getExportPath())); --- 1168,1172 ---- res.add(new Attribute("Heated area", new Double(EnergyCalc.heatedArea()), false)); res.add(new Attribute("Display Geometry", Boolean.valueOf(doDisplayGeometry))); ! res.add(new Attribute("Use display lists", Boolean.valueOf(useDisplayLists))); res.add(new Attribute("Export", Boolean.valueOf(doExport))); res.add(new Attribute("Export Path", getExportPath())); |