Normand Briere
2019-10-05 8768a855af9ccc482a9520ce708ef32e0e6e0e7d
FileObject.java
....@@ -17,6 +17,41 @@
1717 filecontent = null;
1818 }
1919
20
+ boolean HasBigData()
21
+ {
22
+ return filecontent != null;
23
+ }
24
+
25
+ void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
26
+ {
27
+ Object3D o;
28
+
29
+ if (hashtable.containsKey(GetUUID()))
30
+ {
31
+ o = hashtable.get(GetUUID());
32
+
33
+ //Grafreed.Assert(this.filecontent == ((FileObject)o).filecontent);
34
+ }
35
+ else
36
+ {
37
+ o = new Object3D("copy of " + this.name);
38
+
39
+ hashtable.put(GetUUID(), o);
40
+ }
41
+
42
+ ExtractBigData(o);
43
+ }
44
+
45
+ void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
46
+ {
47
+ if (!hashtable.containsKey(GetUUID()))
48
+ return;
49
+
50
+ Object3D o = hashtable.get(GetUUID());
51
+
52
+ RestoreBigData(o);
53
+ }
54
+
2055 boolean IsStatic()
2156 {
2257 return false; // ???? false;
....@@ -81,6 +116,23 @@
81116 this.objfile = objfile;
82117 }
83118
119
+ void ExtractBigData(Object3D o)
120
+ {
121
+ super.ExtractBigData(o);
122
+
123
+ o.savefilecontent = this.filecontent;
124
+
125
+ // filecontent is transient
126
+ this.filecontent = null;
127
+ }
128
+
129
+ void RestoreBigData(Object3D o)
130
+ {
131
+ super.RestoreBigData(o);
132
+
133
+ this.filecontent = o.savefilecontent;
134
+ }
135
+
84136 Object3D deepCopy()
85137 {
86138 FileObject e = new FileObject(name, objfile);
....@@ -88,9 +140,9 @@
88140 return e;
89141 }
90142
91
- protected void deepCopySelf(Object3D other)
143
+ protected void deepCopyNode(Object3D other)
92144 {
93
- super.deepCopySelf(other);
145
+ super.deepCopyNode(other);
94146 }
95147
96148 // void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected)