[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Project.java, 1.211, 1.212
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2013-05-16 08:26:17
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13879/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.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** Project.java 15 May 2013 06:44:11 -0000 1.211 --- Project.java 16 May 2013 08:26:15 -0000 1.212 *************** *** 44,136 **** */ public class Project implements Parametric { ! /** The logger */ private static Logger log = Logger.getLogger(Project.class); ! /** The instance */ ! private static Project instance; ! private Tesselator tesselator; - private Shell shell; - - /** The observers */ - private List<Observer> observers; - - /** Static observers */ private List staticObservers; ! /** The scheduled observers */ ! private List scheduledObservers; ! ! /** The toplevel space */ ! private Space world; ! ! /** The classification */ ! private static Classification constructionClas = null; ! ! /** The classification */ private static Classification functionalClas = null; - private static Collection<ClassificationType> classificationTypes; private static Collection<Component> library; private static boolean doDisplayGeometry; private static boolean useDisplayLists = false; - private static boolean doExport; ! private HashMap cameras = new HashMap(); ! private long nextCameraID; - /** The globals */ - private ParameterBlock globals; ! /** Has changes been made */ ! private boolean dirty; ! private boolean isExporting; ! /** The path to the current project */ ! private String savePath; ! /** The last used path for for loading and saving */ ! private String defaultPath; ! /** The current project camera */ ! private Camera currentCamera; ! /** The active space */ private Space activeSpace; - - /** The undo stack */ - private Stack undoStack; - - /** The redo stack */ - private Stack redoStack; - - /** The current state */ - private Bmodel currentState; - - /** The activeCoordinateSystem */ private CoordinateSystem activeCoordinateSystem; ! /** The name of the project */ ! private String name; ! /** The script of the Project */ private Description script; - private String exportPath; - /** Flag set when updating */ private boolean updating = false; private Map<Long, Material> materials; - private long nextMaterialId; private List<Component> catalog; private Space findIn(Item item, String name) { if (item instanceof Space) { --- 44,112 ---- */ public class Project implements Parametric { ! /** The Logger */ private static Logger log = Logger.getLogger(Project.class); ! /** ! * Global application state ! */ + private static Project instance; private Tesselator tesselator; private Shell shell; private List staticObservers; ! private static Classification constructionClas = null; private static Classification functionalClas = null; private static Collection<ClassificationType> classificationTypes; + private static Collection<Component> library; private static boolean doDisplayGeometry; private static boolean useDisplayLists = false; ! private String defaultPath; ! /** ! * Non persistent per-project state ! */ ! private List<Observer> observers; ! private Stack undoStack; ! private Stack redoStack; ! private Bmodel currentState; ! private boolean dirty; ! private String savePath; ! /** ! * Persistent project state ! */ ! private Space world; private Space activeSpace; private CoordinateSystem activeCoordinateSystem; ! private HashMap cameras = new HashMap(); ! private long nextCameraID; ! private Camera currentCamera; ! private ParameterBlock globals; ! ! private String name; private Description script; /** Flag set when updating */ private boolean updating = false; private Map<Long, Material> materials; private long nextMaterialId; private List<Component> catalog; + + private Space findIn(Item item, String name) { if (item instanceof Space) { *************** *** 272,280 **** public void initialize() { name = "New Project"; - exportPath = "b-export"; script = new Description(""); observers = new LinkedList(); - scheduledObservers = new LinkedList(); catalog = new LinkedList(); --- 248,254 ---- *************** *** 410,434 **** /** - * Schedule adding an observer. Will be added at a safe time. - * @param observer The observer - */ - public void scheduleObserver(Observer observer) { - scheduledObservers.add(observer); - if (!updating) { - addSchedule(); - } - } - - /** - * Adds observers scheduled. - */ - private void addSchedule() { - Iterator it = scheduledObservers.iterator(); - while (it.hasNext()) { - addObserver((Observer)it.next()); - } - } - - /** * Remove observer * @param observer The observer --- 384,387 ---- *************** *** 472,482 **** allObservers.addAll(staticObservers); Iterator iter = allObservers.iterator(); - updating = true; while (iter.hasNext()) { Observer current = (Observer) iter.next(); current.update(entity); } - updating = false; - addSchedule(); makeDirty(); } --- 425,432 ---- *************** *** 662,678 **** public void makeDirty() { dirty = true; - if (doExport) { - if (!isExporting) { - isExporting = true; - SwingUtilities.invokeLater( - new Runnable() { - public void run() { - export(); - isExporting = false; - } - } - ); - } - } } --- 612,615 ---- *************** *** 983,990 **** } else if (a.getName().equals("Use display lists")) { useDisplayLists = ((Boolean) a.getValue()).booleanValue(); - } else if (a.getName().equals("Export")) { - doExport = ((Boolean) a.getValue()).booleanValue(); - } else if (a.getName().equals("Export Path")) { - setExportPath((String)a.getValue()); } } --- 920,923 ---- *************** *** 1027,1046 **** /** - * - * @return Export Path - */ - public String getExportPath() { - return exportPath; - } - - /** - * Set export path - * @param value new export path - */ - public void setExportPath(String value) { - exportPath = value; - } - - /** * String representation of the object * @return The string --- 960,963 ---- *************** *** 1470,1483 **** } - /** - * - */ - public void export() { - try { - export(getExportPath()); - } catch (Exception e) { - // empty - } - } /** --- 1387,1390 ---- |