Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +368,35 @@
262368 billboardItem.addActionListener(this);
263369 csgItem = menu.add(new MenuItem("CSG"));
264370 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266372 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268374 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +469,14 @@
341469 markleavesItem.addActionListener(this);
342470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
344480 menu.add("-");
345481 flipVItem = menu.add(new MenuItem("Flip V"));
346482 flipVItem.addActionListener(this);
....@@ -376,35 +512,40 @@
376512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377513 sortbynameItem.addActionListener(this);
378514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
379522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380523 extractGeometriesItem.addActionListener(this);
381524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382525 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
526
+ }
387527
388528 oe.menuBar.add(menu = new Menu("Insert"));
389529 buildCreateMenu(menu);
390530
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402531 oe.menuBar.add(menu = new Menu("Tools"));
403532 buildToolsMenu(menu);
404533 }
405534
406535 void SetupUI2(ObjEditor oe)
407536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
408549 //new Exception().printStackTrace();
409550
410551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,176 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
442605 liveCB.addItemListener(this);
443606
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446612 fastCB.setToolTipText("Fast mode");
447613 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
515616 trackCB.setToolTipText("Enable tracking");
516617 trackCB.addItemListener(this);
517618
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520620 screenfitButton.setToolTipText("Screen fit");
521621 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
622
+
523623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524624 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530625
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
537634 flashSelectionButton.setToolTipText("Show selection");
538635 flashSelectionButton.addActionListener(this);
539636
540
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541638
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548640 twoButton.setToolTipText("Show center view only");
549641 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551643 fourButton.addActionListener(this);
552644 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554646 sixButton.setToolTipText("2-column layout left");
555647 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557649 threeButton.setToolTipText("2-column layout right");
558650 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560652 sevenButton.setToolTipText("3-column layout");
561653 sevenButton.addActionListener(this);
562654 //
563655
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
566658 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569661 closeButton.setToolTipText("Close tab");
570662 closeButton.addActionListener(this);
571663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572664 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574665
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
577668 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581669
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
583672 uneditButton.addActionListener(this);
584673
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
597676 allParamsButton.addActionListener(this);
598677
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
604684 unselectButton.addActionListener(this);
605685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
606691 // oe.aConstraints.gridx += 1;
607692 // oe.aConstraints.weighty = 0;
608693 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +699,37 @@
614699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615700 // gcButton.addActionListener(this);
616701
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
628705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630707 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
635711
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
640716 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
643720 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
646724 textureCB.addItemListener(this);
647725
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
650729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
651733 //jList.addListSelectionListener(this);
652734 oe.jTree.addTreeSelectionListener(this);
653735 //jTree.setRootVisible(false);
....@@ -669,10 +751,98 @@
669751 radio.layout = sevenButton;
670752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
812
+ oeilCB.addItemListener(this);
813
+
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
820
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
821
+ lookAtCB.setToolTipText("Look-at target");
822
+ lookAtCB.addItemListener(this);
823
+ }
824
+
825
+ }
826
+
827
+ cGridBag fill = new cGridBag();
828
+
829
+ fill.preferredHeight = 200;
830
+
831
+ panel.add(fill);
832
+
833
+ }
672834
673835 void EditObject(Object3D obj)
674836 {
675837 cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
676846 radioButton.SetObject(obj);
677847 radioButton.layout = sevenButton;
678848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -681,8 +851,11 @@
681851 buttonGroup.add(radioButton);
682852 radioButton.doClick();
683853 }
854
+
684855 void SetupViews(ObjEditor oe)
685856 {
857
+ theFrame = this;
858
+
686859 oe.SetupViews();
687860
688861 System.out.println("SetupViews");
....@@ -706,7 +879,9 @@
706879 JCheckBox speakerCameraCB;
707880 JCheckBox speakerFocusCB;
708881 JCheckBox debugCB;
882
+
709883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
710885 JCheckBox lookAtCB;
711886
712887 // static int COLOR = 1;
....@@ -745,6 +920,7 @@
745920 } else if(e.getSource() == liveCB)
746921 {
747922 cameraView.ToggleLive();
923
+ refreshContents(false);
748924 }
749925 else if(e.getSource() == supportCB)
750926 {
....@@ -808,6 +984,10 @@
808984 else if(e.getSource() == oeilCB)
809985 {
810986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
811991 }
812992 else if(e.getSource() == lookAtCB)
813993 {
....@@ -897,7 +1077,9 @@
8971077 // objEditor.DropFile((java.io.File[]) object, true);
8981078 // return;
8991079 // }
900
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011083 {
9021084 // file(s)
9031085 String[] names = string.split("\n");
....@@ -924,7 +1106,7 @@
9241106
9251107 flashIt = false;
9261108 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291111
9301112 if (group.selection.size() == 1)
....@@ -951,11 +1133,11 @@
9511133 {
9521134 loadClipboard(true);
9531135 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1136
+ pasteInto(false, false);
9551137 } else {
9561138 loadClipboard(false);
9571139 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9591141 }
9601142 }
9611143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1259,33 @@
10771259 kleinItem.addActionListener(this);
10781260 particleItem = menu.add(new MenuItem("Particle system"));
10791261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10801264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811265 ragdollItem.addActionListener(this);
10821266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831267 ragdoll2Item.addActionListener(this);
1268
+ }
10841269 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861271 meshItem.addActionListener(this);
10871272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10891276 springItem = menu.add(new MenuItem("Spring"));
10901277 springItem.addActionListener(this);
10911278 flagItem = menu.add(new MenuItem("Flag"));
10921279 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971280 blobItem = menu.add(new MenuItem("Blob"));
10981281 blobItem.addActionListener(this);
10991282 latheItem = menu.add(new MenuItem("Lathe"));
11001283 latheItem.addActionListener(this);
1284
+ }
1285
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1286
+ bezierItem.addActionListener(this);
1287
+ overlayItem = menu.add(new MenuItem("Overlay"));
1288
+ overlayItem.addActionListener(this);
11011289 lightItem = menu.add(new MenuItem("Light"));
11021290 lightItem.addActionListener(this);
11031291 menu.add("-");
....@@ -1107,39 +1295,44 @@
11071295 loopItem.addActionListener(this);
11081296 doubleItem = menu.add(new MenuItem("Fork"));
11091297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
11101300 tripleItem = menu.add(new MenuItem("Trident"));
11111301 tripleItem.addActionListener(this);
1302
+ }
11121303 }
11131304
11141305 void buildToolsMenu(Menu menu)
11151306 {
11161307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171308 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
11191310
11201311 menu.add("-");
11211312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221313 parseverticesItem.addActionListener(this);
11231314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241315 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261317 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301319 reduceMorphItem.addActionListener(this);
11311320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321321 reduce34MorphItem.addActionListener(this);
1133
-
1322
+ menu.add("-");
11341323 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351324 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
11381331 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391332 memoryItem.addActionListener(this);
11401333 menu.add(analyzeItem = new MenuItem("Analyze"));
11411334 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11431336 dumpItem.addActionListener(this);
11441337 // menu.add(pathItem = new MenuItem("From-to path"));
11451338 // pathItem.addActionListener(this);
....@@ -1157,6 +1350,7 @@
11571350 menu.add("-");
11581351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591352 editScriptItem.addActionListener(this);
1353
+ }
11601354 }
11611355
11621356 void ScreenFit()
....@@ -1279,6 +1473,7 @@
12791473 shadow.material = new cMaterial(obj.material);
12801474 shadow.material.diffuse = 0.0001f;
12811475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12821477
12831478 makeSomething(shadow);
12841479 }
....@@ -1485,9 +1680,9 @@
14851680
14861681 void Overwrite(int mask)
14871682 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891684 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14911686
14921687 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931688 content = ((cGroup)content).get(0);
....@@ -1510,6 +1705,7 @@
15101705 //
15111706 public void actionPerformed(ActionEvent event) // , Object arg)
15121707 {
1708
+ Object source = event.getSource();
15131709 /*
15141710 if (event.getSource() == nameField)
15151711 {
....@@ -1521,11 +1717,11 @@
15211717 }
15221718 else
15231719 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1720
+ if (source == lookAtItem || source == lookFromItem)
15251721 {
15261722 ScreenFit();
15271723 } else
1528
- if (event.getSource() == switchItem)
1724
+ if (source == switchItem)
15291725 {
15301726 cVector v1 = new cVector();
15311727 cVector v2 = new cVector();
....@@ -1534,11 +1730,11 @@
15341730 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351731 objEditor.cameraView.repaint();
15361732 } else
1537
- if (event.getSource() == rectoidItem)
1733
+ if (source == rectoidItem)
15381734 {
15391735 makeSomething(new Box());
15401736 } else
1541
- if (event.getSource() == particleItem)
1737
+ if (source == particleItem)
15421738 {
15431739 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441740 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1755,9 @@
15591755 applyExample(particleGeom, "SMOKE");
15601756 makeSomething(particleGeom);
15611757 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1758
+ if (source == ragdollItem || source == ragdoll2Item)
15631759 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1760
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651761
15661762 ragdoll.toParent = LA.newMatrix();
15671763 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1775,7 @@
15791775 } else
15801776 /*
15811777 */
1582
- if (event.getSource() == heightFieldItem)
1778
+ if (source == heightFieldItem)
15831779 {
15841780 Object3D obj = new Object3D();
15851781
....@@ -1617,31 +1813,31 @@
16171813
16181814 makeSomething(obj);
16191815 } else
1620
- if (event.getSource() == gridItem)
1816
+ if (source == gridItem)
16211817 {
16221818 makeSomething(new Grid());
16231819 } else
1624
- if (event.getSource() == ellipsoidItem)
1820
+ if (source == ellipsoidItem)
16251821 {
16261822 makeSomething(new Sphere());
16271823 } else
1628
- if (event.getSource() == coneItem)
1824
+ if (source == coneItem)
16291825 {
16301826 makeSomething(new Cone());
16311827 } else
1632
- if (event.getSource() == torusItem)
1828
+ if (source == torusItem)
16331829 {
16341830 makeSomething(new Torus());
16351831 } else
1636
- if (event.getSource() == superItem)
1832
+ if (source == superItem)
16371833 {
16381834 makeSomething(new Superellipsoid());
16391835 } else
1640
- if (event.getSource() == kleinItem)
1836
+ if (source == kleinItem)
16411837 {
16421838 makeSomething(new Klein());
16431839 } else
1644
- if (event.getSource() == blobItem)
1840
+ if (source == blobItem)
16451841 {
16461842 Blob blob = new Blob();
16471843 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1845,15 @@
16491845 //blob.retile();
16501846 makeSomething(blob);
16511847 } else
1652
- if (event.getSource() == latheItem)
1848
+ if (source == latheItem)
16531849 {
16541850 makeSomething(new Lathe());
16551851 } else
1656
- if (event.getSource() == bezierItem)
1852
+ if (source == bezierItem)
16571853 {
16581854 makeSomething(new BezierSurface());
16591855 } else
1660
- if (event.getSource() == checkerItem)
1856
+ if (source == overlayItem)
16611857 {
16621858 /*
16631859 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1868,7 @@
16721868 */
16731869 makeSomething(new Checker());
16741870 } else
1675
- if (event.getSource() == meshItem)
1871
+ if (source == meshItem)
16761872 {
16771873 Object3D itemtomake = new Object3D();
16781874 Object3D child;
....@@ -1693,35 +1889,35 @@
16931889 makeSomething(child);
16941890 }
16951891 } else
1696
- if (event.getSource() == springItem)
1892
+ if (source == springItem)
16971893 {
16981894 cSpring s = new cSpring();
16991895 s.setup();
17001896 makeSomething(s);
17011897 } else
1702
- if (event.getSource() == flagItem)
1898
+ if (source == flagItem)
17031899 {
17041900 cSpring s = new cFlag();
17051901 s.setup();
17061902 makeSomething(s);
17071903 } else
1708
- if (event.getSource() == lightItem)
1904
+ if (source == lightItem)
17091905 {
17101906 makeSomething(new Light());
17111907 } else
1712
- if (event.getSource() == csgItem)
1908
+ if (source == csgItem)
17131909 {
17141910 group(new CSG());
17151911 } else
1716
- if (event.getSource() == templateItem)
1912
+ if (source == templateItem)
17171913 {
17181914 group(new cTemplate());
17191915 } else
1720
- if (event.getSource() == attributeItem)
1916
+ if (source == attributeItem)
17211917 {
17221918 makeSomething(new Attribute());
17231919 } else
1724
- if (event.getSource() == pointflowItem)
1920
+ if (source == pointflowItem)
17251921 {
17261922 makeSomething(new PointFlow());
17271923 } else
....@@ -1733,7 +1929,7 @@
17331929 } else
17341930 */
17351931
1736
- if (event.getSource() == superLoopItem)
1932
+ if (source == superLoopItem)
17371933 {
17381934 Composite g = new cGroup();
17391935 for (int i=0; i<15; i++)
....@@ -1755,7 +1951,7 @@
17551951
17561952 group(g);
17571953 } else
1758
- if (event.getSource() == loopItem)
1954
+ if (source == loopItem)
17591955 {
17601956 Composite csg = new GroupLeaf();
17611957 csg.count = 5;
....@@ -1764,7 +1960,7 @@
17641960 csg.addChild(child);
17651961 child.addChild(csg);
17661962 } else
1767
- if (event.getSource() == doubleItem)
1963
+ if (source == doubleItem)
17681964 {
17691965 Composite csg = new GroupLeaf();
17701966 csg.count = 5;
....@@ -1776,7 +1972,7 @@
17761972 csg.addChild(child);
17771973 child.addChild(csg);
17781974 } else
1779
- if (event.getSource() == tripleItem)
1975
+ if (source == tripleItem)
17801976 {
17811977 Composite csg = new GroupLeaf();
17821978 csg.count = 4;
....@@ -1791,71 +1987,83 @@
17911987 csg.addChild(child);
17921988 child.addChild(csg);
17931989 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
1990
+ if (source == computeAOItem)
18121991 {
18131992 Globals.drawMode = CameraPane.OCCLUSION;
18141993 Globals.theRenderer.repaint();
18151994 } else
1816
- if (event.getSource() == recompileItem)
1995
+ if (source == recompileItem)
18171996 {
18181997 Recompile();
18191998 refreshContents();
18201999 } else
1821
- if (event.getSource() == editScriptItem)
2000
+ if (source == editScriptItem)
18222001 {
18232002 OpenDialog();
18242003 refreshContents();
18252004 } else
1826
- if (event.getSource() == invariantsItem)
2005
+ if (source == invariantsItem)
18272006 {
18282007 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
18302009 } else
1831
- if (event.getSource() == memoryItem)
2010
+ if (source == memoryItem)
18322011 {
18332012 //System.out.println("Invariants:");
18342013 PrintMemory();
18352014 } else
1836
- if (event.getSource() == pathItem)
2015
+ if (source == pathItem)
18372016 {
18382017 PrintPath();
18392018 } else
1840
- if (event.getSource() == analyzeItem)
2019
+ if (source == analyzeItem)
18412020 {
18422021 AnalyzeObject();
18432022 } else
1844
- if (event.getSource() == dumpItem)
2023
+ if (source == dumpItem)
18452024 {
18462025 DumpObject();
18472026 } else
1848
- if (event.getSource() == screenfitButton)
2027
+ if (source == minButton)
2028
+ {
2029
+ Minimize();
2030
+ } else
2031
+ if (source == maxButton)
2032
+ {
2033
+ Maximize();
2034
+ } else
2035
+ if (source == fullButton)
2036
+ {
2037
+ ToggleFullScreen();
2038
+ } else
2039
+ if (source == undoButton)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoButton)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == saveButton)
2048
+ {
2049
+ Save();
2050
+ } else
2051
+ if (source == oneStepButton)
2052
+ {
2053
+ Globals.ONESTEP = true;
2054
+ cameraView.repaint();
2055
+ } else
2056
+ if (source == screenfitButton)
18492057 {
18502058 //Reload(lastConverter, lastFilename, true);
18512059 ScreenFit();
18522060 } else
1853
- if (event.getSource() == screenfitpointButton)
2061
+ if (source == screenfitpointButton)
18542062 {
18552063 //Reload(lastConverter, lastFilename, true);
18562064 ScreenFitPoint();
18572065 } else
1858
- if (event.getSource() == snapobjectButton)
2066
+ if (source == snapobjectButton)
18592067 {
18602068 //Reload(lastConverter, lastFilename, true);
18612069 SnapObject();
....@@ -1866,13 +2074,13 @@
18662074 // Recompile();
18672075 // refreshContents();
18682076 // } else
1869
- if (event.getSource() == gcButton)
2077
+ if (source == gcButton)
18702078 {
18712079 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722080 System.gc();
18732081 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742082 } else
1875
- if (event.getSource() == editLeafItem)
2083
+ if (source == editLeafItem)
18762084 {
18772085 Object3D obj;
18782086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2094,74 @@
18862094 }
18872095 refreshContents(true);
18882096 } else
1889
- if (event.getSource() == openWindowItem)
2097
+ if (source == openWindowItem)
18902098 {
18912099 EditSelection(true);
18922100 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2101
+ if (source == cutItem || source == clearButton)
18942102 {
18952103 loadClipboard(true);
18962104 } else
1897
- if (event.getSource() == duplicateItem)
2105
+ if (source == undoItem)
18982106 {
1899
- Object3D keep = GrafreeD.clipboard;
2107
+ Undo();
2108
+ } else
2109
+ if (source == redoItem)
2110
+ {
2111
+ Redo();
2112
+ } else
2113
+ if (source == duplicateItem)
2114
+ {
2115
+ Object3D keep = Grafreed.clipboard;
19002116 loadClipboard(false);
19012117 paste(false);
1902
- GrafreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
19032119 } else
1904
- if (event.getSource() == cloneItem)
2120
+ if (source == cloneItem)
19052121 {
19062122 CloneSelection(false);
19072123 } else
1908
- if (event.getSource() == cloneSupportItem)
2124
+ if (source == cloneSupportItem)
19092125 {
19102126 CloneSelection(true);
19112127 } else
1912
- if (event.getSource() == copyItem)
2128
+ if (source == copyItem)
19132129 {
19142130 loadClipboard(false);
19152131 } else
1916
- if (event.getSource() == pasteItem)
2132
+ if (source == pasteItem)
19172133 {
19182134 paste(false);
19192135 } else
1920
- if (event.getSource() == pasteLinkItem)
2136
+ if (source == pasteIntoItem)
19212137 {
1922
- pasteInto(false);
2138
+ pasteInto(true, false);
19232139 } else
1924
- if (event.getSource() == pasteCloneItem)
2140
+ if (source == pasteLinkItem)
19252141 {
1926
- pasteInto(true);
2142
+ pasteInto(false, false);
19272143 } else
1928
- if (event.getSource() == pasteExpandItem)
2144
+ if (source == pasteCloneItem)
2145
+ {
2146
+ pasteInto(true, true);
2147
+ } else
2148
+ if (source == pasteExpandItem)
19292149 {
19302150 paste(true);
19312151 } else
1932
- if (event.getSource() == synchronizeItem)
2152
+ if (source == synchronizeItem)
19332153 {
19342154 Overwrite(Object3D.TRANSFORM);
19352155 } else
1936
- if (event.getSource() == overwriteNameItem)
2156
+ if (source == overwriteNameItem)
19372157 {
19382158 Overwrite(Object3D.NAME);
19392159 } else
1940
- if (event.getSource() == overwriteUVItem)
2160
+ if (source == overwriteUVItem)
19412161 {
19422162 Overwrite(Object3D.UV);
19432163 } else
1944
- if (event.getSource() == overwriteMatItem)
2164
+ if (source == overwriteMatItem)
19452165 {
19462166 /* july 2015
19472167 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2181,7 @@
19612181
19622182 Overwrite(dropAttributes);
19632183 }
1964
- if (event.getSource() == overwriteGeoItem)
2184
+ if (source == overwriteGeoItem)
19652185 {
19662186 Overwrite(Object3D.GEOMETRY);
19672187 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2198,7 @@
19782198 // refreshContents();
19792199 // }
19802200 } else
1981
- if (event.getSource() == generateMeshItem)
2201
+ if (source == generateMeshItem)
19822202 {
19832203 //if (group.selection.size() == 1)
19842204 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2209,7 @@
19892209 ResetModel();
19902210 refreshContents();
19912211 } else
1992
- if (event.getSource() == extractGeometriesItem)
2212
+ if (source == extractGeometriesItem)
19932213 {
19942214 boolean one = false;
19952215
....@@ -2016,7 +2236,7 @@
20162236 ResetModel();
20172237 refreshContents();
20182238 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2239
+ if (source == cloneGeometriesItem)
20202240 {
20212241 boolean one = false;
20222242
....@@ -2042,7 +2262,7 @@
20422262 ResetModel();
20432263 refreshContents();
20442264 } else
2045
- if (event.getSource() == shareGeometriesItem)
2265
+ if (source == shareGeometriesItem)
20462266 {
20472267 boolean one = false;
20482268
....@@ -2072,7 +2292,7 @@
20722292 refreshContents();
20732293 }
20742294 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2295
+ if (source == mergeGeometriesItem)
20762296 {
20772297 boolean one = false;
20782298
....@@ -2102,7 +2322,7 @@
21022322 ResetModel();
21032323 refreshContents();
21042324 } else
2105
- if (event.getSource() == linkverticesItem)
2325
+ if (source == linkverticesItem)
21062326 {
21072327 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082328 // {
....@@ -2115,9 +2335,9 @@
21152335 // group.selection.get(0).setMasterThis(content); // should be identity
21162336 // refreshContents();
21172337 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192339 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21212341
21222342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232343 content = ((cGroup)content).get(0);
....@@ -2125,38 +2345,38 @@
21252345 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262346 for (int i=0; i<group.selection.size(); i++)
21272347 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
21302350 group.selection.get(i).linkVerticesThis(content);
21312351 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
21332353 }
21342354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352355 refreshContents();
21362356 }
21372357 } else
2138
- if (event.getSource() == resetsupportItem)
2358
+ if (source == resetsupportItem)
21392359 {
21402360 for (int i=0; i<group.selection.size(); i++)
21412361 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
21442364 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
21462366 }
21472367
21482368 refreshContents();
21492369 } else
2150
- if (event.getSource() == relinkverticesItem)
2370
+ if (source == relinkverticesItem)
21512371 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
21542374 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2375
+ CameraPane.SWITCH = random;
21562376
21572377 refreshContents();
21582378 } else
2159
- if (event.getSource() == resetreferencesItem)
2379
+ if (source == resetreferencesItem)
21602380 {
21612381 for (int i=0; i<group.selection.size(); i++)
21622382 {
....@@ -2165,11 +2385,11 @@
21652385
21662386 refreshContents();
21672387 } else
2168
- if (event.getSource() == setMasterItem)
2388
+ if (source == setMasterItem)
21692389 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712391 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21732393
21742394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752395 content = ((cGroup)content).get(0);
....@@ -2178,13 +2398,13 @@
21782398 refreshContents();
21792399 }
21802400 } else
2181
- if (event.getSource() == poseMeshItem)
2401
+ if (source == poseMeshItem)
21822402 {
21832403 if (group.selection.size() == 1)
21842404 {
2185
- if (GrafreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21862406 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21882408
21892409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902410 content = ((cGroup)content).get(0);
....@@ -2197,19 +2417,19 @@
21972417 }
21982418
21992419 } else
2200
- if (event.getSource() == revertMeshItem)
2420
+ if (source == revertMeshItem)
22012421 {
22022422 RevertMeshes();
22032423 } else
2204
- if (event.getSource() == resetMeshItem)
2424
+ if (source == resetAllItem)
22052425 {
22062426 ResetAll();
22072427 } else
2208
- if (event.getSource() == stepAllItem)
2428
+ if (source == stepAllItem)
22092429 {
22102430 StepAll();
22112431 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2432
+ if (source == clearItem) // || event.getSource() == clearButton)
22132433 {
22142434 //int indices[] = jList.getSelectedIndices();
22152435 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2437,46 @@
22172437
22182438 ClearSelection(false);
22192439 } else
2220
- if (event.getSource() == clearAllItem)
2440
+ if (source == clearAllItem)
22212441 {
22222442 ClearSelection(true);
22232443 } else
2224
- if (event.getSource() == grabItem)
2444
+ if (source == grabItem)
22252445 {
22262446 group(new cGroup(), true);
22272447 } else
2228
- if (event.getSource() == hideItem)
2448
+ if (source == hideItem)
22292449 {
22302450 group(new HiddenObject());
22312451 } else
2232
- if (event.getSource() == frontItem)
2452
+ if (source == frontItem)
22332453 {
22342454 front();
22352455 } else
2236
- if (event.getSource() == backItem)
2456
+ if (source == backItem)
22372457 {
22382458 back();
22392459 } else
2240
- if (event.getSource() == cameraItem)
2460
+ if (source == cameraItem)
22412461 {
22422462 makeSomething(new Camera());
22432463 } else
2244
- if (event.getSource() == compositeItem)
2464
+ if (source == compositeItem)
22452465 {
22462466 group(new Composite());
22472467 } else
2248
- if (event.getSource() == randomItem)
2468
+ if (source == randomItem)
22492469 {
22502470 RandomNode random = new RandomNode();
22512471 group(random);
22522472 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
22542474 } else
2255
- if (event.getSource() == physicsItem)
2475
+ if (source == physicsItem)
22562476 {
22572477 group(new PhysicsNode());
22582478 } else
2259
- if (event.getSource() == frameselectorItem)
2479
+ if (source == frameselectorItem)
22602480 {
22612481 for (int i=0; i<group.selection.size(); i++)
22622482 {
....@@ -2268,7 +2488,7 @@
22682488 ResetModel();
22692489 refreshContents();
22702490 } else
2271
- if (event.getSource() == switchGeoItem)
2491
+ if (source == switchGeoItem)
22722492 {
22732493 for (int i=0; i<group.selection.size(); i++)
22742494 {
....@@ -2280,7 +2500,7 @@
22802500 ResetModel();
22812501 refreshContents();
22822502 } else
2283
- if (event.getSource() == switchTransfoItem)
2503
+ if (source == switchTransfoItem)
22842504 {
22852505 for (int i=0; i<group.selection.size(); i++)
22862506 {
....@@ -2292,7 +2512,7 @@
22922512 ResetModel();
22932513 refreshContents();
22942514 } else
2295
- if (event.getSource() == morphItem)
2515
+ if (source == morphItem)
22962516 {
22972517 for (int i=0; i<group.selection.size(); i++)
22982518 {
....@@ -2304,7 +2524,7 @@
23042524 ResetModel();
23052525 refreshContents();
23062526 } else
2307
- if (event.getSource() == scriptNodeItem)
2527
+ if (source == scriptNodeItem)
23082528 {
23092529 boolean atleastone = false;
23102530
....@@ -2343,31 +2563,31 @@
23432563 }
23442564 }
23452565 } else
2346
- if (event.getSource() == linkerItem)
2566
+ if (source == linkerItem)
23472567 {
23482568 group(new cLinker());
23492569 } else
2350
- if (event.getSource() == textureItem)
2570
+ if (source == textureItem)
23512571 {
23522572 group(new TextureNode());
23532573 } else
2354
- if (event.getSource() == billboardItem)
2574
+ if (source == billboardItem)
23552575 {
23562576 group(new BillboardNode());
23572577 } else
2358
- if (event.getSource() == shadowXItem)
2578
+ if (source == shadowXItem)
23592579 {
23602580 CastShadow(0);
23612581 } else
2362
- if (event.getSource() == shadowYItem)
2582
+ if (source == shadowYItem)
23632583 {
23642584 CastShadow(1);
23652585 } else
2366
- if (event.getSource() == shadowZItem)
2586
+ if (source == shadowZItem)
23672587 {
23682588 CastShadow(2);
23692589 } else
2370
- if (event.getSource() == ungroupItem)
2590
+ if (source == ungroupItem)
23712591 {
23722592 //ungroup();
23732593 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2599,203 @@
23792599
23802600 refreshContents();
23812601 } else
2382
- if (event.getSource() == genUVItem)
2602
+ if (source == genUVItem)
23832603 {
23842604 GenUV();
23852605 } else
2386
- if (event.getSource() == genNormalsCADItem)
2606
+ if (source == genNormalsCADItem)
23872607 {
23882608 GenNormals(true);
23892609 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2610
+ if (source == genNormalsMESHItem)
23912611 {
2392
- GenNormals(true); // TODO
2612
+ GenNormalsMESH();
23932613 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2614
+ if (source == genNormalsORGANItem)
23952615 {
23962616 GenNormals(false);
23972617 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2618
+ if (source == genNormalsMINEItem)
23992619 {
24002620 GenNormalsMINE();
24012621 } else
2402
- if (event.getSource() == stripifyItem)
2622
+ if (source == stripifyItem)
24032623 {
24042624 Stripify();
24052625 } else
2406
- if (event.getSource() == unstripifyItem)
2626
+ if (source == unstripifyItem)
24072627 {
24082628 Unstripify();
24092629 } else
2410
- if (event.getSource() == trimItem)
2630
+ if (source == trimItem)
24112631 {
24122632 Trim();
24132633 } else
2414
- if (event.getSource() == untrimItem)
2634
+ if (source == untrimItem)
24152635 {
24162636 Untrim();
24172637 } else
2418
- if (event.getSource() == clearColorsItem)
2638
+ if (source == clearColorsItem)
24192639 {
24202640 ClearColors();
24212641 } else
2422
- if (event.getSource() == clearMaterialsItem)
2642
+ if (source == clearMaterialsItem)
24232643 {
24242644 ClearMaterials();
24252645 } else
2426
- if (event.getSource() == liveleavesItem)
2646
+ if (source == liveleavesItem)
24272647 {
24282648 LiveLeaves(true);
24292649 } else
2430
- if (event.getSource() == unliveleavesItem)
2650
+ if (source == unliveleavesItem)
24312651 {
24322652 LiveLeaves(false);
24332653 } else
2434
- if (event.getSource() == supportleavesItem)
2654
+ if (source == supportleavesItem)
24352655 {
24362656 SupportLeaves(true);
24372657 } else
2438
- if (event.getSource() == unsupportleavesItem)
2658
+ if (source == unsupportleavesItem)
24392659 {
24402660 SupportLeaves(false);
24412661 } else
2442
- if (event.getSource() == hideleavesItem)
2662
+ if (source == hideleavesItem)
24432663 {
24442664 HideLeaves(true);
24452665 } else
2446
- if (event.getSource() == showleavesItem)
2666
+ if (source == showleavesItem)
24472667 {
24482668 HideLeaves(false);
24492669 } else
2450
- if (event.getSource() == markleavesItem)
2670
+ if (source == markleavesItem)
24512671 {
24522672 MarkLeaves(true);
24532673 } else
2454
- if (event.getSource() == unmarkleavesItem)
2674
+ if (source == unmarkleavesItem)
24552675 {
24562676 MarkLeaves(false);
24572677 } else
2458
- if (event.getSource() == flipVItem)
2678
+ if (source == rewindleavesItem)
2679
+ {
2680
+ RewindLeaves(true);
2681
+ } else
2682
+ if (source == unrewindleavesItem)
2683
+ {
2684
+ RewindLeaves(false);
2685
+ } else
2686
+ if (source == randomleavesItem)
2687
+ {
2688
+ RandomLeaves(true);
2689
+ } else
2690
+ if (source == unrandomleavesItem)
2691
+ {
2692
+ RandomLeaves(false);
2693
+ } else
2694
+ if (source == flipVItem)
24592695 {
24602696 FlipV(true);
24612697 } else
2462
- if (event.getSource() == unflipVItem)
2698
+ if (source == unflipVItem)
24632699 {
24642700 FlipV(false);
24652701 } else
2466
- if (event.getSource() == lowTexturesItem)
2702
+ if (source == lowTexturesItem)
24672703 {
24682704 SetTexRes(0);
24692705 } else
2470
- if (event.getSource() == normalTexturesItem)
2706
+ if (source == normalTexturesItem)
24712707 {
24722708 SetTexRes(1);
24732709 } else
2474
- if (event.getSource() == highTexturesItem)
2710
+ if (source == highTexturesItem)
24752711 {
24762712 SetTexRes(2);
24772713 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2714
+ if (source == veryhighTexturesItem)
24792715 {
24802716 SetTexRes(3);
24812717 } else
2482
- if (event.getSource() == maxTexturesItem)
2718
+ if (source == maxTexturesItem)
24832719 {
24842720 SetTexRes(4);
24852721 } else
2486
- if (event.getSource() == panoTexturesItem)
2722
+ if (source == panoTexturesItem)
24872723 {
24882724 SetTexRes(5);
24892725 } else
2490
- if (event.getSource() == reverseNormalsItem)
2726
+ if (source == reverseNormalsItem)
24912727 {
24922728 ReverseNormals();
24932729 } else
2494
- if (event.getSource() == parseverticesItem)
2730
+ if (source == parseverticesItem)
24952731 {
24962732 ParseVertices();
24972733 } else
2498
- if (event.getSource() == textureFieldItem)
2734
+ if (source == textureFieldItem)
24992735 {
25002736 TextureVertices();
25012737 } else
2502
- if (event.getSource() == alignItem)
2738
+ if (source == alignItem)
25032739 {
25042740 Align();
25052741 } else
2506
- if (event.getSource() == mirrorItem)
2742
+ if (source == mirrorItem)
25072743 {
25082744 MirrorPoses();
25092745 } else
2510
- if (event.getSource() == reduceMorphItem)
2746
+ if (source == reduceMorphItem)
25112747 {
25122748 MeshReduction(false);
25132749 } else
2514
- if (event.getSource() == reduce34MorphItem)
2750
+ if (source == reduce34MorphItem)
25152751 {
25162752 MeshReduction(true);
25172753 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2754
+ if (source == reverseTrianglesItem)
25192755 {
25202756 ReverseTriangles();
25212757 } else
2522
- if (event.getSource() == reduceMeshItem)
2758
+ if (source == reduceMeshItem)
25232759 {
25242760 ReduceMesh(false);
25252761 } else
2526
- if (event.getSource() == reduce34MeshItem)
2762
+ if (source == reduce34MeshItem)
25272763 {
25282764 ReduceMesh(true);
25292765 } else
2530
- if (event.getSource() == increaseMeshItem)
2766
+ if (source == increaseMeshItem)
25312767 {
25322768 IncreaseMesh();
25332769 } else
2534
- if (event.getSource() == clipMeshItem)
2770
+ if (source == clipMeshItem)
25352771 {
25362772 ClipMesh();
25372773 } else
2538
- if (event.getSource() == smoothMeshItem)
2774
+ if (source == smoothMeshItem)
25392775 {
25402776 SmoothMesh();
25412777 } else
2542
- if (event.getSource() == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
25432779 {
25442780 TransformGeometry();
25452781 } else
2546
- if (event.getSource() == resetTransformItem)
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
2785
+ } else
2786
+ if (source == resetTransformItem)
25472787 {
25482788 ResetTransform();
25492789 } else
2550
- if (event.getSource() == resetCentroidItem)
2790
+ if (source == resetCentroidItem)
25512791 {
2552
- ResetCentroid();
2792
+ ResetCentroid(true);
25532793 } else
2554
- if (event.getSource() == resetParentItem)
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
2797
+ } else
2798
+ if (source == resetParentItem)
25552799 {
25562800 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572801 {
....@@ -2561,7 +2805,7 @@
25612805
25622806 refreshContents();
25632807 } else
2564
- if (event.getSource() == repairParentItem)
2808
+ if (source == repairParentItem)
25652809 {
25662810 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672811 {
....@@ -2575,7 +2819,7 @@
25752819
25762820 refreshContents();
25772821 } else
2578
- if (event.getSource() == repairShadowItem)
2822
+ if (source == repairShadowItem)
25792823 {
25802824 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812825 {
....@@ -2589,7 +2833,7 @@
25892833
25902834 refreshContents();
25912835 } else
2592
- if (event.getSource() == sortbysizeItem)
2836
+ if (source == sortbysizeItem)
25932837 {
25942838 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952839 {
....@@ -2601,7 +2845,7 @@
26012845 ResetModel();
26022846 refreshContents();
26032847 } else
2604
- if (event.getSource() == sortbynameItem)
2848
+ if (source == sortbynameItem)
26052849 {
26062850 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072851 {
....@@ -2613,7 +2857,7 @@
26132857 ResetModel();
26142858 refreshContents();
26152859 } else
2616
- if (event.getSource() == attachPigmentItem)
2860
+ if (source == attachPigmentItem)
26172861 {
26182862 String texture = GetFile("Attach pigment");
26192863 Object3D obj;
....@@ -2625,7 +2869,7 @@
26252869
26262870 refreshContents();
26272871 } else
2628
- if (event.getSource() == detachPigmentItem)
2872
+ if (source == detachPigmentItem)
26292873 {
26302874 Object3D obj;
26312875 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2880,7 @@
26362880
26372881 refreshContents();
26382882 } else
2639
- if (event.getSource() == attachBumpItem)
2883
+ if (source == attachBumpItem)
26402884 {
26412885 String texture = GetFile("Attach bump");
26422886 Object3D obj;
....@@ -2648,7 +2892,7 @@
26482892
26492893 refreshContents();
26502894 } else
2651
- if (event.getSource() == detachBumpItem)
2895
+ if (source == detachBumpItem)
26522896 {
26532897 Object3D obj;
26542898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2903,7 @@
26592903
26602904 refreshContents();
26612905 } else
2662
- if (event.getSource() == pigmentBumpItem)
2906
+ if (source == pigmentBumpItem)
26632907 {
26642908 Object3D obj;
26652909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2914,221 @@
26702914
26712915 refreshContents();
26722916 } else
2673
- if (event.getSource() == flashSelectionButton)
2917
+ if (source == flashSelectionButton)
26742918 {
26752919 CameraPane.flash = true;
26762920 refreshContents();
26772921 } else
2678
- if (event.getSource() == oneButton)
2922
+ if (source == oneButton)
26792923 {
26802924 } else
2681
- if (event.getSource() == twoButton)
2925
+ if (source == twoButton)
26822926 {
26832927 radio.layout = twoButton;
26842928 // bug
26852929 //gridPanel.setDividerLocation(1.0);
26862930 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2931
+// bigThree.remove(scenePanel);
2932
+// bigThree.remove(centralPanel);
2933
+// bigThree.remove(XYZPanel);
2934
+// aWindowConstraints.gridx = 0;
2935
+// aWindowConstraints.gridy = 0;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// aWindowConstraints.weightx = 0;
2940
+// aWindowConstraints.weighty = 1;
2941
+// //bigThree.add(jtp, aWindowConstraints);
2942
+// aWindowConstraints.weightx = 1;
2943
+// aWindowConstraints.gridwidth = 3;
2944
+// // aConstraints.gridheight = 3;
2945
+// aWindowConstraints.gridx = 1;
2946
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2947
+// bigThree.add(centralPanel, aWindowConstraints);
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.gridx = 4;
2950
+// aWindowConstraints.gridwidth = 1;
2951
+// // aConstraints.gridheight = 3;
2952
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2953
+// //bigThree.add(XYZPanel, aWindowConstraints);
2954
+// scenePanel.setVisible(false);
2955
+// centralPanel.setVisible(true);
2956
+// XYZPanel.setVisible(false);
2957
+ bigThree.ClearUI();
2958
+ bigThree.add(centralPanel);
2959
+ bigThree.FlushUI();
2960
+
2961
+ cameraView.requestFocusInWindow();
2962
+
2963
+// refreshContents(true);
2964
+//
2965
+// try
2966
+// {
2967
+// java.awt.Robot bot = new java.awt.Robot();
2968
+// int mask = InputEvent.BUTTON1_MASK;
2969
+// bot.mouseMove(100, 100);
2970
+// bot.mousePress(mask);
2971
+// bot.mouseRelease(mask);
2972
+// }
2973
+// catch (Exception e)
2974
+// {
2975
+//
2976
+// }
2977
+
27112978 } else
2712
- if (event.getSource() == threeButton)
2979
+ if (source == threeButton)
27132980 {
27142981 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2982
+
2983
+// bigThree.remove(scenePanel);
2984
+// bigThree.remove(centralPanel);
2985
+// bigThree.remove(XYZPanel);
2986
+// aWindowConstraints.gridx = 0;
2987
+// aWindowConstraints.gridy = 0;
2988
+// aWindowConstraints.gridwidth = 1;
2989
+// // aConstraints.gridheight = 3;
2990
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2991
+// aWindowConstraints.weightx = 0;
2992
+// aWindowConstraints.weighty = 1;
2993
+// //bigThree.add(jtp, aWindowConstraints);
2994
+// aWindowConstraints.weightx = 1;
2995
+// aWindowConstraints.gridwidth = 3;
2996
+// // aConstraints.gridheight = 3;
2997
+// aWindowConstraints.gridx = 1;
2998
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2999
+// bigThree.add(centralPanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.gridx = 4;
3002
+// aWindowConstraints.gridwidth = 1;
3003
+// // aConstraints.gridheight = 3;
3004
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3005
+// bigThree.add(XYZPanel, aWindowConstraints);
3006
+// bigThree.validate();
3007
+// scenePanel.setVisible(false);
3008
+// centralPanel.setVisible(true);
3009
+// XYZPanel.setVisible(true);
3010
+ bigThree.ClearUI();
3011
+ bigThree.add(centralPanel);
3012
+ bigThree.add(XYZPanel);
3013
+ bigThree.FlushUI();
3014
+
3015
+ cameraView.requestFocusInWindow();
27393016 } else
2740
- if (event.getSource() == fourButton)
3017
+ if (source == fourButton)
27413018 {
27423019 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
3020
+
3021
+// bigThree.remove(scenePanel);
3022
+// bigThree.remove(centralPanel);
3023
+// bigThree.remove(XYZPanel);
3024
+// aWindowConstraints.gridx = 0;
3025
+// aWindowConstraints.gridy = 0;
3026
+// aWindowConstraints.gridwidth = 1;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3029
+// aWindowConstraints.weightx = 1;
3030
+// aWindowConstraints.weighty = 1;
3031
+// bigThree.add(scenePanel, aWindowConstraints);
3032
+// aWindowConstraints.weightx = 1;
3033
+// aWindowConstraints.gridwidth = 3;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.gridx = 1;
3036
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3037
+// //bigThree.add(cameraPanel, aWindowConstraints);
3038
+// aWindowConstraints.weightx = 0;
3039
+// aWindowConstraints.gridx = 4;
3040
+// aWindowConstraints.gridwidth = 1;
3041
+// // aWindowConstraints.gridheight = 3;
3042
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3043
+// //bigThree.add(XYZPanel, aWindowConstraints);
3044
+// bigThree.validate();
3045
+// scenePanel.setVisible(true);
3046
+// centralPanel.setVisible(false);
3047
+// XYZPanel.setVisible(false);
3048
+ bigThree.ClearUI();
3049
+ bigThree.add(scenePanel);
3050
+ bigThree.FlushUI();
3051
+
3052
+ cameraView.requestFocusInWindow();
27673053 } else
2768
- if (event.getSource() == sixButton)
3054
+ if (source == sixButton)
27693055 {
27703056 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
3057
+
3058
+// bigThree.remove(scenePanel);
3059
+// bigThree.remove(centralPanel);
3060
+// bigThree.remove(XYZPanel);
3061
+// aWindowConstraints.gridx = 0;
3062
+// aWindowConstraints.gridy = 0;
3063
+// aWindowConstraints.gridwidth = 1;
3064
+// // aConstraints.gridheight = 3;
3065
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3066
+// aWindowConstraints.weightx = 0;
3067
+// aWindowConstraints.weighty = 1;
3068
+// bigThree.add(scenePanel, aWindowConstraints);
3069
+// aWindowConstraints.weightx = 1;
3070
+// aWindowConstraints.gridwidth = 3;
3071
+// // aWindowConstraints.gridheight = 3;
3072
+// aWindowConstraints.gridx = 1;
3073
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3074
+// bigThree.add(centralPanel, aWindowConstraints);
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.gridx = 4;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aWindowConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// //bigThree.add(XYZPanel, aConstraints);
3081
+// bigThree.validate();
3082
+// scenePanel.setVisible(true);
3083
+// centralPanel.setVisible(true);
3084
+// XYZPanel.setVisible(false);
3085
+ bigThree.ClearUI();
3086
+ bigThree.add(scenePanel);
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.FlushUI();
3089
+
3090
+ cameraView.requestFocusInWindow();
27953091 } else
2796
- if (event.getSource() == sevenButton)
3092
+ if (source == sevenButton)
27973093 {
27983094 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
3095
+
3096
+// bigThree.remove(scenePanel);
3097
+// bigThree.remove(centralPanel);
3098
+// bigThree.remove(XYZPanel);
3099
+// aWindowConstraints.gridx = 0;
3100
+// aWindowConstraints.gridy = 0;
3101
+// aWindowConstraints.gridwidth = 1;
3102
+// // aWindowConstraints.gridheight = 3;
3103
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3104
+// aWindowConstraints.weightx = 0;
3105
+// aWindowConstraints.weighty = 1;
3106
+// bigThree.add(scenePanel, aWindowConstraints);
3107
+// aWindowConstraints.weightx = 1;
3108
+// aWindowConstraints.gridwidth = 3;
3109
+// // aWindowConstraints.gridheight = 3;
3110
+// aWindowConstraints.gridx = 1;
3111
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3112
+// bigThree.add(centralPanel, aWindowConstraints);
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.gridx = 4;
3115
+// aWindowConstraints.gridwidth = 1;
3116
+// // aConstraints.gridheight = 3;
3117
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3118
+// bigThree.add(XYZPanel, aWindowConstraints);
3119
+// bigThree.validate();
3120
+// scenePanel.setVisible(true);
3121
+// centralPanel.setVisible(true);
3122
+// XYZPanel.setVisible(true);
3123
+ bigThree.ClearUI();
3124
+ bigThree.add(scenePanel);
3125
+ bigThree.add(centralPanel);
3126
+ bigThree.add(XYZPanel);
3127
+ bigThree.FlushUI();
3128
+
3129
+ cameraView.requestFocusInWindow();
28233130 } else
2824
- if (event.getSource() == rootButton)
3131
+ if (source == rootButton)
28253132 {
28263133 Object3D obj;
28273134 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2831,17 +3138,24 @@
28313138 EditObject(obj);
28323139 }
28333140
3141
+ cameraView.requestFocusInWindow();
28343142 refreshContents(true);
28353143 } else
2836
- if (event.getSource() == closeButton)
3144
+ if (source == closeButton)
28373145 {
28383146 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393147 cRadio ab;
28403148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28413149 {
28423150 ab = (cRadio)e.nextElement();
2843
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28443152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
28453159 buttonGroup.remove(ab);
28463160 radioPanel.remove(ab);
28473161
....@@ -2852,13 +3166,15 @@
28523166 break;
28533167 }
28543168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
28553171 refreshContents(true);
28563172 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3173
+ if (source == editItem || source == editButton)
28583174 {
28593175 EditSelection(false);
28603176 } else
2861
- if (event.getSource() == uneditButton)
3177
+ if (source == uneditButton)
28623178 {
28633179 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643180 {
....@@ -2868,14 +3184,14 @@
28683184 child.CloseUI();
28693185 listUI.remove(child);
28703186
2871
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
28723188 }
2873
- objEditor.ctrlPanel.revalidate();
3189
+ objEditor.ctrlPanel.FlushUI();
28743190 //objEditor.jTree.clearSelection();
28753191 //objEditor.ResetSliders();
28763192 refreshContents(true);
28773193 } else
2878
- if (event.getSource() == clearPanelButton)
3194
+ if (source == clearPanelButton)
28793195 {
28803196 assert(copy == group);
28813197 //copy.ClearUI();
....@@ -2886,7 +3202,7 @@
28863202 listUI.clear();
28873203 refreshContents(true);
28883204 } else
2889
- if (event.getSource() == allParamsButton)
3205
+ if (source == allParamsButton)
28903206 {
28913207 assert(copy == group);
28923208
....@@ -2907,19 +3223,19 @@
29073223
29083224 refreshContents(true);
29093225 } else
2910
- if (event.getSource() == unselectButton)
3226
+ if (source == unselectButton)
29113227 {
29123228 objEditor.jTree.clearSelection();
29133229 // ?? oct 2012 GrafreeD.clipboard.clear();
29143230 objEditor.ResetSliders();
29153231 refreshContents(true);
29163232 } else
2917
- if(event.getSource() instanceof cRadio)
3233
+ if(source instanceof cRadio)
29183234 {
29193235 group.parent = keepparent;
29203236 group.attributes = 0;
29213237 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3238
+ /*cRadio*/ radio = (cRadio)source;
29233239 Object3D obj = radio.GetObject();
29243240 System.out.println("Edit " + obj);
29253241 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3270,10 @@
29543270 frontView.object = group;
29553271 sideView.object = group;
29563272 }
2957
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
29583277 /*
29593278 currentLayout = radio.layout;
29603279 if (currentLayout == null)
....@@ -2966,8 +3285,23 @@
29663285 //group.parent = null; // ROOT
29673286 //group.attributes = -1;
29683287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
29693290 refreshContents(true);
2970
- }
3291
+ } else if (event.getSource() == editCameraItem)
3292
+ {
3293
+ cameraView.ProtectCamera();
3294
+ cameraView.repaint();
3295
+ return;
3296
+ } else if (event.getSource() == revertCameraItem)
3297
+ {
3298
+ cameraView.RevertCamera();
3299
+ cameraView.repaint();
3300
+ return;
3301
+ // } else if (event.getSource() == textureButton)
3302
+ // {
3303
+ // return; // true;
3304
+ }
29713305 else
29723306 {
29733307 //return super.action(event, arg);
....@@ -2976,7 +3310,6 @@
29763310 }
29773311
29783312 boolean useclient = false;
2979
- cRadio radio;
29803313
29813314 void ToggleRoot()
29823315 {
....@@ -3028,6 +3361,28 @@
30283361 refreshContents();
30293362 }
30303363
3364
+ void TransformChildren()
3365
+ {
3366
+ Object3D obj;
3367
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3368
+ {
3369
+ obj = (Object3D)e.nextElement();
3370
+ obj.KeepTextureMatrices();
3371
+ obj.TransformChildren();
3372
+ obj.RestoreTextureMatrices();
3373
+
3374
+// if (obj.parent == null)
3375
+// {
3376
+// System.out.println("NULL PARENT!");
3377
+// new Exception().printStackTrace();
3378
+// }
3379
+// else
3380
+// TouchTransform(obj);
3381
+// //obj.parent.Touch();
3382
+ }
3383
+
3384
+ refreshContents();
3385
+ }
30313386
30323387 void ResetTransform()
30333388 {
....@@ -3140,7 +3495,7 @@
31403495 refreshContents();
31413496 }
31423497
3143
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
31443499 {
31453500 Object3D obj;
31463501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3510,16 @@
31553510 LA.matIdentity(Object3D.mat);
31563511 obj.getBounds(minima, maxima, false);
31573512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603516 obj.TransformMesh(Object3D.mat);
3517
+
31613518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
31643523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3548,8 @@
31893548
31903549 int size = obj.MemorySize();
31913550
3192
- System.err.println((size/1024) + " KB is the size of " + obj);
3551
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3552
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31933553 }
31943554 }
31953555 catch (Exception e)
....@@ -3226,9 +3586,9 @@
32263586 obj = (Object3D)e.nextElement();
32273587
32283588 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
32303590 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
32323592
32333593 // System.err.println((size/1024) + " KB is the size of " + obj);
32343594 }
....@@ -3270,6 +3630,13 @@
32703630 void GenNormals(boolean crease)
32713631 {
32723632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
32733640
32743641 refreshContents();
32753642 }
....@@ -3442,8 +3809,8 @@
34423809
34433810 void ParseVertices()
34443811 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
34473814
34483815 for (int i=0; i<group.selection.size(); i++)
34493816 {
....@@ -3468,7 +3835,7 @@
34683835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703837
3471
- g.add(GrafreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
34723839
34733840 buffer.add(g);
34743841 }
....@@ -3483,7 +3850,7 @@
34833850 makeSomething(buffer, i==group.selection.size()-1);
34843851 }
34853852
3486
- GrafreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
34873854
34883855 refreshContents();
34893856 }
....@@ -3501,7 +3868,16 @@
35013868 String pigment = Object3D.GetPigment(tex);
35023869 //String bump = Object3D.GetBump(tex);
35033870
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3871
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3872
+
3873
+ try
3874
+ {
3875
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3876
+ }
3877
+ catch (Exception e)
3878
+ {
3879
+ System.err.println("FAIL: " + node);
3880
+ }
35053881
35063882 double s = v.s;
35073883
....@@ -3589,11 +3965,11 @@
35893965
35903966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913967
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
35943970 lowres.linkVerticesThis(null);
35953971 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
35973973
35983974 System.err.flush();
35993975
....@@ -3633,7 +4009,7 @@
36334009 return;
36344010
36354011 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
36374013
36384014 Object3D newgroup = new Object3D("Po:" + poses.name);
36394015
....@@ -3827,9 +4203,9 @@
38274203
38284204 void ClipMesh()
38294205 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314207 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
38334209
38344210 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354211 content = ((cGroup)content).get(0);
....@@ -3838,7 +4214,7 @@
38384214 // {
38394215 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404216 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
38424218 }
38434219 // group.selection.ClipMesh(GrafreeD.clipboard);
38444220 System.out.println("DONE.");
....@@ -3885,6 +4261,18 @@
38854261 void MarkLeaves(boolean hide)
38864262 {
38874263 group.selection.MarkLeaves(hide);
4264
+ refreshContents();
4265
+ }
4266
+
4267
+ void RewindLeaves(boolean hide)
4268
+ {
4269
+ group.selection.RewindLeaves(hide);
4270
+ refreshContents();
4271
+ }
4272
+
4273
+ void RandomLeaves(boolean hide)
4274
+ {
4275
+ group.selection.RandomLeaves(hide);
38884276 refreshContents();
38894277 }
38904278
....@@ -3973,7 +4361,7 @@
39734361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744362
39754363 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4364
+ if(elem != group || !newWindow)
39774365 {
39784366 // if (!(elem instanceof Composite))
39794367 // newWindow = false;
....@@ -4063,7 +4451,6 @@
40634451 //case 702: // Event.LIST_DESELECT
40644452 group.deselectAll();
40654453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674454 if (tps != null)
40684455 {
40694456 for (int i=0; i < tps.length; i++)
....@@ -4072,29 +4459,28 @@
40724459
40734460 //if (child.parent != null)
40744461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
40754463 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794464 }
40804465 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4466
+// else
4467
+// {
4468
+// objEditor.SetMaterial(group); // .GetMaterial());
4469
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4470
+// System.err.println("info : " + group.GetPath());
4471
+// }
40874472
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4473
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40914474 CameraPane.flash = true;
40924475
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944477 // a camera
40954478 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4479
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4480
+ {
4481
+ CameraPane.camerachangeframe = 0; // don't refuse it
4482
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4483
+ }
40984484 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994485 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004486 }
....@@ -4107,6 +4493,26 @@
41074493
41084494 freezemodel = false;
41094495 }
4496
+
4497
+ void refreshContents(boolean cp)
4498
+ {
4499
+ if (!Globals.MOUSEDRAGGED)
4500
+ {
4501
+ objEditor.ClearInfo(); // .GetMaterial());
4502
+
4503
+ for (int i=0; i < group.selection.Size(); i++)
4504
+ {
4505
+ Object3D child = (Object3D) group.selection.get(i);
4506
+
4507
+ objEditor.AddInfo(child, this, true);
4508
+ System.err.println("info : " + child.GetPath());
4509
+ }
4510
+
4511
+ objEditor.SetText(); // jan 2014
4512
+ }
4513
+
4514
+ super.refreshContents(cp);
4515
+ }
41104516
41114517 void linkSomething(Object3D thing)
41124518 {
....@@ -4178,16 +4584,18 @@
41784584 {
41794585 if (group.selection.isEmpty())
41804586 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
41824589 Composite tGroup = null;
41834590 if (group.selection.size() > 0) // 1)
41844591 {
41854592 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
41874594 }
41884595
41894596 if (cut)
41904597 {
4598
+ Save();
41914599 //int indices[] = jList.getSelectedIndices();
41924600 //for (int i = indices.length - 1; i >= 0; i--)
41934601 //jList.remove(indices[i]);
....@@ -4223,16 +4631,16 @@
42234631 //System.out.println("cut " + child);
42244632 //System.out.println("parent = " + child.parent);
42254633 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
42274635 tGroup.add/*Child*/(tmp);
42284636 else
4229
- GrafreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
42304638 }
42314639 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
42334641 tGroup.add/*Child*/(child);
42344642 else
4235
- GrafreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
42364644 }
42374645
42384646 //ResetModel();
....@@ -4264,21 +4672,23 @@
42644672 //System.out.println("cut " + elem);
42654673 //System.out.println("parent = " + elem.parent);
42664674 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
42684676 tGroup.add/*Child*/(tmp);
42694677 else
4270
- GrafreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
42714679 }
42724680 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
42744682 tGroup.add/*Child*/(child);
42754683 else
4276
- GrafreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
42774685 }
42784686
42794687 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
42824692 if (cut)
42834693 {
42844694 ResetModel();
....@@ -4292,7 +4702,7 @@
42924702 // return;
42934703 boolean first = true;
42944704
4295
- if (GrafreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
42964706 {
42974707 Composite temp;
42984708
....@@ -4303,7 +4713,7 @@
43034713 temp = (Composite)Applet3D.clipboard.deepCopy();
43044714 */
43054715 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4716
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074717 {
43084718 Object3D child = (Object3D)e.nextElement();
43094719
....@@ -4337,21 +4747,21 @@
43374747 //Object3D cb = Applet3D.clipboard;
43384748 //temp.addChild(cb);
43394749 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4750
+ assert(Grafreed.clipboard.parent == null);
4751
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4752
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4753
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4754
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43454755 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
43484758 }
43494759
43504760 ResetModel();
43514761 refreshContents();
43524762 }
43534763
4354
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
43554765 {
43564766 // if (GrafreeD.clipboard == null)
43574767 // return;
....@@ -4380,15 +4790,22 @@
43804790 if (copyit)
43814791 {
43824792 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
43844801 }
43854802 else
43864803 {
43874804 boolean first = true;
43884805
4389
- if (GrafreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
43904807 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
43924809 Object3D copy;
43934810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944811 {
....@@ -4398,7 +4815,7 @@
43984815 }
43994816 } else
44004817 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
44024819 }
44034820 }
44044821 }
....@@ -4803,21 +5220,6 @@
48035220 }
48045221 */
48055222
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215223 /*
48225224 public void Callback(Object obj)
48235225 {
....@@ -4841,26 +5243,9 @@
48415243 }
48425244 */
48435245
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615246 String GetFile(String dialogName)
48625247 {
4863
- if (GrafreeD.standAlone)
5248
+ if (Grafreed.standAlone)
48645249 {
48655250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665251 browser.show();
....@@ -4924,10 +5309,18 @@
49245309 cButton flashSelectionButton;
49255310 cButton editButton;
49265311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
49275313 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295314 cButton unselectButton;
49305315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
49315324 cButton screenfitButton;
49325325 cButton screenfitpointButton;
49335326 cButton snapobjectButton;
....@@ -4938,14 +5331,6 @@
49385331 cButton closeButton;
49395332
49405333 cButton setsupportButton;
4941
-
4942
- cButton twoButton;
4943
- cButton sixButton;
4944
- cButton threeButton;
4945
- cButton sevenButton;
4946
- cButton fourButton; // full panel
4947
- cButton oneButton; // full XYZ
4948
- //cButton currentLayout;
49495334
49505335 //
49515336 //Composite
....@@ -4958,6 +5343,8 @@
49585343 private MenuItem lookFromItem;
49595344 private MenuItem switchItem;
49605345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
49615348 private MenuItem duplicateItem;
49625349 private MenuItem cloneItem;
49635350 private MenuItem cloneSupportItem;
....@@ -4971,7 +5358,7 @@
49715358 private MenuItem linkverticesItem;
49725359 private MenuItem relinkverticesItem;
49735360 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
49755362 private MenuItem stepAllItem;
49765363 private MenuItem revertMeshItem;
49775364 private MenuItem poseMeshItem;
....@@ -4982,6 +5369,7 @@
49825369 private MenuItem mergeGeometriesItem;
49835370 private MenuItem copyItem;
49845371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
49855373 private MenuItem pasteLinkItem;
49865374 private MenuItem pasteCloneItem;
49875375 private MenuItem pasteExpandItem;
....@@ -5020,6 +5408,10 @@
50205408 private MenuItem showleavesItem;
50215409 private MenuItem markleavesItem;
50225410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
50235415
50245416 private MenuItem flipVItem;
50255417 private MenuItem unflipVItem;
....@@ -5031,8 +5423,10 @@
50315423 private MenuItem panoTexturesItem;
50325424
50335425 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
50355427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
50365430 private MenuItem hideItem;
50375431 private MenuItem grabItem;
50385432 private MenuItem backItem;
....@@ -5079,7 +5473,7 @@
50795473 private MenuItem blobItem;
50805474 private MenuItem latheItem;
50815475 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
50835477 private MenuItem meshItem;
50845478 // private MenuItem meshGroupItem;
50855479 private MenuItem springItem;
....@@ -5101,11 +5495,6 @@
51015495 private MenuItem doubleItem;
51025496 private MenuItem tripleItem;
51035497
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095498 private MenuItem computeAOItem;
51105499 private MenuItem recompileItem;
51115500 private MenuItem editScriptItem;
....@@ -5115,4 +5504,8 @@
51155504 private MenuItem analyzeItem;
51165505 private MenuItem dumpItem;
51175506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
51185511 }