Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
FileObject.java
....@@ -19,15 +19,37 @@
1919
2020 boolean HasBigData()
2121 {
22
- return false;
22
+ return filecontent != null;
2323 }
2424
2525 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
2626 {
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);
2743 }
2844
2945 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
3046 {
47
+ if (!hashtable.containsKey(GetUUID()))
48
+ return;
49
+
50
+ Object3D o = hashtable.get(GetUUID());
51
+
52
+ RestoreBigData(o);
3153 }
3254
3355 boolean IsStatic()
....@@ -94,6 +116,23 @@
94116 this.objfile = objfile;
95117 }
96118
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
+
97136 Object3D deepCopy()
98137 {
99138 FileObject e = new FileObject(name, objfile);
....@@ -101,9 +140,9 @@
101140 return e;
102141 }
103142
104
- protected void deepCopySelf(Object3D other)
143
+ protected void deepCopyNode(Object3D other)
105144 {
106
- super.deepCopySelf(other);
145
+ super.deepCopyNode(other);
107146 }
108147
109148 // void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected)