.. | .. |
---|
1935 | 1935 | e2.printStackTrace(); |
---|
1936 | 1936 | } |
---|
1937 | 1937 | } |
---|
| 1938 | + |
---|
1938 | 1939 | LoadJMEThread loadThread; |
---|
1939 | 1940 | |
---|
1940 | 1941 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
1992 | 1993 | //LoadFile0(filename, converter); |
---|
1993 | 1994 | } |
---|
1994 | 1995 | } |
---|
| 1996 | + |
---|
1995 | 1997 | LoadOBJThread loadObjThread; |
---|
1996 | 1998 | |
---|
1997 | 1999 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
3212 | 3214 | objEditor.refreshContents(); |
---|
3213 | 3215 | } |
---|
3214 | 3216 | |
---|
3215 | | - Object3D graphs[] = new Object3D[10000]; |
---|
3216 | | - int undoindex = 0; |
---|
3217 | | - |
---|
3218 | 3217 | static public Object clone(Object o) |
---|
3219 | 3218 | { |
---|
3220 | 3219 | try |
---|
.. | .. |
---|
3237 | 3236 | } |
---|
3238 | 3237 | } |
---|
3239 | 3238 | |
---|
| 3239 | + cRadio GetCurrentTab() |
---|
| 3240 | + { |
---|
| 3241 | + cRadio ab; |
---|
| 3242 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3243 | + { |
---|
| 3244 | + ab = (cRadio)e.nextElement(); |
---|
| 3245 | + if(ab.GetObject() == client) |
---|
| 3246 | + { |
---|
| 3247 | + return ab; |
---|
| 3248 | + } |
---|
| 3249 | + } |
---|
| 3250 | + |
---|
| 3251 | + return null; |
---|
| 3252 | + } |
---|
| 3253 | + |
---|
3240 | 3254 | public void Save() |
---|
3241 | 3255 | { |
---|
3242 | | - if (true) return; |
---|
| 3256 | + cRadio tab = GetCurrentTab(); |
---|
3243 | 3257 | |
---|
3244 | 3258 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3245 | | - graphs[undoindex++] = (Object3D)clone(copy); |
---|
| 3259 | + tab.graphs[tab.undoindex++] = (Object3D)clone(copy); |
---|
3246 | 3260 | |
---|
3247 | | - for (int i = undoindex; i < graphs.length; i++) |
---|
| 3261 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
3248 | 3262 | { |
---|
3249 | | - graphs[i] = null; |
---|
| 3263 | + tab.graphs[i] = null; |
---|
3250 | 3264 | } |
---|
3251 | 3265 | |
---|
3252 | 3266 | // test save |
---|
.. | .. |
---|
3254 | 3268 | { |
---|
3255 | 3269 | try |
---|
3256 | 3270 | { |
---|
3257 | | - FileOutputStream ostream = new FileOutputStream("save" + undoindex); |
---|
| 3271 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
3258 | 3272 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3259 | 3273 | |
---|
3260 | 3274 | p.writeObject(copy); |
---|
.. | .. |
---|
3269 | 3283 | } |
---|
3270 | 3284 | } |
---|
3271 | 3285 | |
---|
| 3286 | + void CopyChanged(Object3D obj) |
---|
| 3287 | + { |
---|
| 3288 | + copy.clear(); |
---|
| 3289 | + |
---|
| 3290 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3291 | + { |
---|
| 3292 | + copy.add(obj.get(i)); |
---|
| 3293 | + } |
---|
| 3294 | + |
---|
| 3295 | + copy.Touch(); |
---|
| 3296 | + |
---|
| 3297 | + ResetModel(); |
---|
| 3298 | + copy.HardTouch(); // recompile? |
---|
| 3299 | + |
---|
| 3300 | + cRadio ab; |
---|
| 3301 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3302 | + { |
---|
| 3303 | + ab = (cRadio)e.nextElement(); |
---|
| 3304 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3305 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3306 | + if (test != null) |
---|
| 3307 | + { |
---|
| 3308 | + test.editWindow = ab.object.editWindow; |
---|
| 3309 | + ab.object = test; |
---|
| 3310 | + } |
---|
| 3311 | + } |
---|
| 3312 | + |
---|
| 3313 | + refreshContents(); |
---|
| 3314 | + } |
---|
| 3315 | + |
---|
3272 | 3316 | public void Undo() |
---|
3273 | 3317 | { |
---|
3274 | | - if (undoindex == 0) |
---|
| 3318 | + cRadio tab = GetCurrentTab(); |
---|
| 3319 | + |
---|
| 3320 | + if (tab.undoindex == 0) |
---|
3275 | 3321 | { |
---|
3276 | 3322 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3277 | 3323 | return; |
---|
3278 | 3324 | } |
---|
3279 | 3325 | |
---|
3280 | | - if (graphs[undoindex] == null) |
---|
| 3326 | + if (tab.graphs[tab.undoindex] == null) |
---|
3281 | 3327 | { |
---|
3282 | 3328 | Save(); |
---|
3283 | | - undoindex -= 1; |
---|
| 3329 | + tab.undoindex -= 1; |
---|
3284 | 3330 | } |
---|
3285 | 3331 | |
---|
3286 | | - undoindex -= 1; |
---|
| 3332 | + tab.undoindex -= 1; |
---|
3287 | 3333 | |
---|
3288 | | - copy = graphs[undoindex]; |
---|
3289 | | - |
---|
3290 | | - cameraView.object = copy; |
---|
3291 | | - copy.Touch(); |
---|
3292 | | - |
---|
3293 | | - ResetModel(); |
---|
3294 | | - refreshContents(); |
---|
| 3334 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
3295 | 3335 | } |
---|
3296 | 3336 | |
---|
3297 | 3337 | public void Redo() |
---|
3298 | 3338 | { |
---|
3299 | | - if (graphs[undoindex + 1] == null) |
---|
| 3339 | + cRadio tab = GetCurrentTab(); |
---|
| 3340 | + |
---|
| 3341 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
3300 | 3342 | { |
---|
3301 | 3343 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3302 | 3344 | return; |
---|
3303 | 3345 | } |
---|
3304 | 3346 | |
---|
3305 | | - undoindex += 1; |
---|
| 3347 | + tab.undoindex += 1; |
---|
3306 | 3348 | |
---|
3307 | | - copy = graphs[undoindex]; |
---|
3308 | | - |
---|
3309 | | - cameraView.object = copy; |
---|
3310 | | - copy.Touch(); |
---|
3311 | | - |
---|
3312 | | - ResetModel(); |
---|
3313 | | - refreshContents(); |
---|
| 3349 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
3314 | 3350 | } |
---|
3315 | 3351 | |
---|
3316 | 3352 | void ImportGFD() |
---|