Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
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,153 +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);
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 = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
+ fastCB.setToolTipText("Fast mode");
461609 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ oneStepButton.setToolTipText("Animate one step forward");
613
+ oneStepButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
503617 trackCB.addItemListener(this);
504618
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
507621 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
622
+
509623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510624 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515625
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- 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 = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight selection");
522635 flashSelectionButton.addActionListener(this);
523636
524
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525638
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
532641 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534643 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
536647 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
538650 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
540653 sevenButton.addActionListener(this);
541654 //
542655
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
544658 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
547662 closeButton.addActionListener(this);
548663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549664 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551665
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
554668 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558669
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
560672 uneditButton.addActionListener(this);
561673
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- 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");
574676 allParamsButton.addActionListener(this);
575677
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- 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");
581684 unselectButton.addActionListener(this);
582685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
583691 // oe.aConstraints.gridx += 1;
584692 // oe.aConstraints.weighty = 0;
585693 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +699,37 @@
591699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592700 // gcButton.addActionListener(this);
593701
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
605705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- 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);
607707 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
612711
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- 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");
617716 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620720 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623724 textureCB.addItemListener(this);
624725
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
627729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
628733 //jList.addListSelectionListener(this);
629734 oe.jTree.addTreeSelectionListener(this);
630735 //jTree.setRootVisible(false);
....@@ -646,10 +751,102 @@
646751 radio.layout = sevenButton;
647752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648753 }
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
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
+ autosaveCB.setToolTipText("Auto-save on structure change");
820
+ autosaveCB.addItemListener(this);
821
+
822
+ if (Globals.ADVANCED)
823
+ {
824
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
825
+ lookAtCB.setToolTipText("Look-at target");
826
+ lookAtCB.addItemListener(this);
827
+ }
828
+
829
+ }
830
+
831
+ cGridBag fill = new cGridBag();
832
+
833
+ fill.preferredHeight = 200;
834
+
835
+ panel.add(fill);
836
+
837
+ }
649838
650839 void EditObject(Object3D obj)
651840 {
652841 cRadio radioButton = new cRadio(obj.name);
842
+
843
+ // Patch to avoid bug with transparency.
844
+ radioButton.hadMaterial = obj.material != null;
845
+ if (!radioButton.hadMaterial)
846
+ {
847
+ obj.material = new cMaterial();
848
+ }
849
+
653850 radioButton.SetObject(obj);
654851 radioButton.layout = sevenButton;
655852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -658,8 +855,11 @@
658855 buttonGroup.add(radioButton);
659856 radioButton.doClick();
660857 }
858
+
661859 void SetupViews(ObjEditor oe)
662860 {
861
+ theFrame = this;
862
+
663863 oe.SetupViews();
664864
665865 System.out.println("SetupViews");
....@@ -668,22 +868,26 @@
668868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
669869 }
670870
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- JCheckBox smoothfocusCB;
871
+ cCheckBox liveCB;
872
+ cCheckBox supportCB;
873
+ cCheckBox localCB;
874
+ cCheckBox crowdCB;
875
+ cCheckBox smoothCB;
876
+ cCheckBox fastCB;
877
+ cCheckBox slowCB;
878
+ cCheckBox boxCB;
879
+ cCheckBox zoomBoxCB;
880
+ cCheckBox trackCB;
881
+ cCheckBox smoothfocusCB;
681882 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
687891
688892 // static int COLOR = 1;
689893 // static int MATERIAL = 2;
....@@ -691,9 +895,9 @@
691895
692896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
693897
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
697901
698902 public void itemStateChanged(ItemEvent e)
699903 {
....@@ -721,6 +925,7 @@
721925 } else if(e.getSource() == liveCB)
722926 {
723927 cameraView.ToggleLive();
928
+ refreshContents(false);
724929 }
725930 else if(e.getSource() == supportCB)
726931 {
....@@ -756,6 +961,10 @@
756961 cameraView.repaint();
757962 // refreshContents();
758963 }
964
+ else if(e.getSource() == zoomBoxCB)
965
+ {
966
+ cameraView.ToggleZoomBoxMode();
967
+ }
759968 else if(e.getSource() == smoothfocusCB)
760969 {
761970 cameraView.ToggleSmoothFocus();
....@@ -780,6 +989,14 @@
780989 else if(e.getSource() == oeilCB)
781990 {
782991 cameraView.ToggleOeil();
992
+ }
993
+ else if(e.getSource() == shadowCB)
994
+ {
995
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
996
+ }
997
+ else if(e.getSource() == autosaveCB)
998
+ {
999
+ Globals.SAVEONMAKE ^= true;
7831000 }
7841001 else if(e.getSource() == lookAtCB)
7851002 {
....@@ -869,7 +1086,9 @@
8691086 // objEditor.DropFile((java.io.File[]) object, true);
8701087 // return;
8711088 // }
872
- if (string.charAt(0) == '/')
1089
+
1090
+ // File path for Mac and Windows
1091
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731092 {
8741093 // file(s)
8751094 String[] names = string.split("\n");
....@@ -896,7 +1115,7 @@
8961115
8971116 flashIt = false;
8981117 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1118
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001119 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011120
9021121 if (group.selection.size() == 1)
....@@ -923,11 +1142,11 @@
9231142 {
9241143 loadClipboard(true);
9251144 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1145
+ pasteInto(false, false);
9271146 } else {
9281147 loadClipboard(false);
9291148 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1149
+ pasteInto(false, false); // true); // ???
9311150 }
9321151 }
9331152 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1268,33 @@
10491268 kleinItem.addActionListener(this);
10501269 particleItem = menu.add(new MenuItem("Particle system"));
10511270 particleItem.addActionListener(this);
1271
+ if (Globals.ADVANCED)
1272
+ {
10521273 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531274 ragdollItem.addActionListener(this);
10541275 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551276 ragdoll2Item.addActionListener(this);
1277
+ }
10561278 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1279
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581280 meshItem.addActionListener(this);
10591281 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601282 // meshGroupItem.addActionListener(this);
1283
+ if (Globals.ADVANCED)
1284
+ {
10611285 springItem = menu.add(new MenuItem("Spring"));
10621286 springItem.addActionListener(this);
10631287 flagItem = menu.add(new MenuItem("Flag"));
10641288 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691289 blobItem = menu.add(new MenuItem("Blob"));
10701290 blobItem.addActionListener(this);
10711291 latheItem = menu.add(new MenuItem("Lathe"));
10721292 latheItem.addActionListener(this);
1293
+ }
1294
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1295
+ bezierItem.addActionListener(this);
1296
+ overlayItem = menu.add(new MenuItem("Overlay"));
1297
+ overlayItem.addActionListener(this);
10731298 lightItem = menu.add(new MenuItem("Light"));
10741299 lightItem.addActionListener(this);
10751300 menu.add("-");
....@@ -1079,39 +1304,44 @@
10791304 loopItem.addActionListener(this);
10801305 doubleItem = menu.add(new MenuItem("Fork"));
10811306 doubleItem.addActionListener(this);
1307
+ if (Globals.ADVANCED)
1308
+ {
10821309 tripleItem = menu.add(new MenuItem("Trident"));
10831310 tripleItem.addActionListener(this);
1311
+ }
10841312 }
10851313
10861314 void buildToolsMenu(Menu menu)
10871315 {
10881316 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891317 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1318
+ animationItem.setState(Globals.ANIMATION);
10911319
10921320 menu.add("-");
10931321 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941322 parseverticesItem.addActionListener(this);
10951323 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961324 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1325
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981326 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011327 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021328 reduceMorphItem.addActionListener(this);
11031329 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041330 reduce34MorphItem.addActionListener(this);
1105
-
1331
+ menu.add("-");
11061332 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071333 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091334
1335
+ if (Globals.ADVANCED)
1336
+ {
1337
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1338
+ mirrorItem.addActionListener(this);
1339
+ menu.add("-");
11101340 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111341 memoryItem.addActionListener(this);
11121342 menu.add(analyzeItem = new MenuItem("Analyze"));
11131343 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
11151345 dumpItem.addActionListener(this);
11161346 // menu.add(pathItem = new MenuItem("From-to path"));
11171347 // pathItem.addActionListener(this);
....@@ -1129,6 +1359,7 @@
11291359 menu.add("-");
11301360 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311361 editScriptItem.addActionListener(this);
1362
+ }
11321363 }
11331364
11341365 void ScreenFit()
....@@ -1251,6 +1482,7 @@
12511482 shadow.material = new cMaterial(obj.material);
12521483 shadow.material.diffuse = 0.0001f;
12531484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
12541486
12551487 makeSomething(shadow);
12561488 }
....@@ -1457,9 +1689,9 @@
14571689
14581690 void Overwrite(int mask)
14591691 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1692
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611693 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1694
+ Object3D content = Grafreed.clipboard.get(0);
14631695
14641696 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651697 content = ((cGroup)content).get(0);
....@@ -1482,6 +1714,7 @@
14821714 //
14831715 public void actionPerformed(ActionEvent event) // , Object arg)
14841716 {
1717
+ Object source = event.getSource();
14851718 /*
14861719 if (event.getSource() == nameField)
14871720 {
....@@ -1493,11 +1726,11 @@
14931726 }
14941727 else
14951728 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1729
+ if (source == lookAtItem || source == lookFromItem)
14971730 {
14981731 ScreenFit();
14991732 } else
1500
- if (event.getSource() == switchItem)
1733
+ if (source == switchItem)
15011734 {
15021735 cVector v1 = new cVector();
15031736 cVector v2 = new cVector();
....@@ -1506,11 +1739,11 @@
15061739 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071740 objEditor.cameraView.repaint();
15081741 } else
1509
- if (event.getSource() == rectoidItem)
1742
+ if (source == rectoidItem)
15101743 {
15111744 makeSomething(new Box());
15121745 } else
1513
- if (event.getSource() == particleItem)
1746
+ if (source == particleItem)
15141747 {
15151748 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161749 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1764,9 @@
15311764 applyExample(particleGeom, "SMOKE");
15321765 makeSomething(particleGeom);
15331766 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1767
+ if (source == ragdollItem || source == ragdoll2Item)
15351768 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1769
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371770
15381771 ragdoll.toParent = LA.newMatrix();
15391772 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1784,7 @@
15511784 } else
15521785 /*
15531786 */
1554
- if (event.getSource() == heightFieldItem)
1787
+ if (source == heightFieldItem)
15551788 {
15561789 Object3D obj = new Object3D();
15571790
....@@ -1589,31 +1822,31 @@
15891822
15901823 makeSomething(obj);
15911824 } else
1592
- if (event.getSource() == gridItem)
1825
+ if (source == gridItem)
15931826 {
15941827 makeSomething(new Grid());
15951828 } else
1596
- if (event.getSource() == ellipsoidItem)
1829
+ if (source == ellipsoidItem)
15971830 {
15981831 makeSomething(new Sphere());
15991832 } else
1600
- if (event.getSource() == coneItem)
1833
+ if (source == coneItem)
16011834 {
16021835 makeSomething(new Cone());
16031836 } else
1604
- if (event.getSource() == torusItem)
1837
+ if (source == torusItem)
16051838 {
16061839 makeSomething(new Torus());
16071840 } else
1608
- if (event.getSource() == superItem)
1841
+ if (source == superItem)
16091842 {
16101843 makeSomething(new Superellipsoid());
16111844 } else
1612
- if (event.getSource() == kleinItem)
1845
+ if (source == kleinItem)
16131846 {
16141847 makeSomething(new Klein());
16151848 } else
1616
- if (event.getSource() == blobItem)
1849
+ if (source == blobItem)
16171850 {
16181851 Blob blob = new Blob();
16191852 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1854,15 @@
16211854 //blob.retile();
16221855 makeSomething(blob);
16231856 } else
1624
- if (event.getSource() == latheItem)
1857
+ if (source == latheItem)
16251858 {
16261859 makeSomething(new Lathe());
16271860 } else
1628
- if (event.getSource() == bezierItem)
1861
+ if (source == bezierItem)
16291862 {
16301863 makeSomething(new BezierSurface());
16311864 } else
1632
- if (event.getSource() == checkerItem)
1865
+ if (source == overlayItem)
16331866 {
16341867 /*
16351868 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1877,7 @@
16441877 */
16451878 makeSomething(new Checker());
16461879 } else
1647
- if (event.getSource() == meshItem)
1880
+ if (source == meshItem)
16481881 {
16491882 Object3D itemtomake = new Object3D();
16501883 Object3D child;
....@@ -1665,35 +1898,35 @@
16651898 makeSomething(child);
16661899 }
16671900 } else
1668
- if (event.getSource() == springItem)
1901
+ if (source == springItem)
16691902 {
16701903 cSpring s = new cSpring();
16711904 s.setup();
16721905 makeSomething(s);
16731906 } else
1674
- if (event.getSource() == flagItem)
1907
+ if (source == flagItem)
16751908 {
16761909 cSpring s = new cFlag();
16771910 s.setup();
16781911 makeSomething(s);
16791912 } else
1680
- if (event.getSource() == lightItem)
1913
+ if (source == lightItem)
16811914 {
16821915 makeSomething(new Light());
16831916 } else
1684
- if (event.getSource() == csgItem)
1917
+ if (source == csgItem)
16851918 {
16861919 group(new CSG());
16871920 } else
1688
- if (event.getSource() == templateItem)
1921
+ if (source == templateItem)
16891922 {
16901923 group(new cTemplate());
16911924 } else
1692
- if (event.getSource() == attributeItem)
1925
+ if (source == attributeItem)
16931926 {
16941927 makeSomething(new Attribute());
16951928 } else
1696
- if (event.getSource() == pointflowItem)
1929
+ if (source == pointflowItem)
16971930 {
16981931 makeSomething(new PointFlow());
16991932 } else
....@@ -1705,7 +1938,7 @@
17051938 } else
17061939 */
17071940
1708
- if (event.getSource() == superLoopItem)
1941
+ if (source == superLoopItem)
17091942 {
17101943 Composite g = new cGroup();
17111944 for (int i=0; i<15; i++)
....@@ -1727,7 +1960,7 @@
17271960
17281961 group(g);
17291962 } else
1730
- if (event.getSource() == loopItem)
1963
+ if (source == loopItem)
17311964 {
17321965 Composite csg = new GroupLeaf();
17331966 csg.count = 5;
....@@ -1736,7 +1969,7 @@
17361969 csg.addChild(child);
17371970 child.addChild(csg);
17381971 } else
1739
- if (event.getSource() == doubleItem)
1972
+ if (source == doubleItem)
17401973 {
17411974 Composite csg = new GroupLeaf();
17421975 csg.count = 5;
....@@ -1748,7 +1981,7 @@
17481981 csg.addChild(child);
17491982 child.addChild(csg);
17501983 } else
1751
- if (event.getSource() == tripleItem)
1984
+ if (source == tripleItem)
17521985 {
17531986 Composite csg = new GroupLeaf();
17541987 csg.count = 4;
....@@ -1763,71 +1996,83 @@
17631996 csg.addChild(child);
17641997 child.addChild(csg);
17651998 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
1999
+ if (source == computeAOItem)
17842000 {
17852001 Globals.drawMode = CameraPane.OCCLUSION;
17862002 Globals.theRenderer.repaint();
17872003 } else
1788
- if (event.getSource() == recompileItem)
2004
+ if (source == recompileItem)
17892005 {
17902006 Recompile();
17912007 refreshContents();
17922008 } else
1793
- if (event.getSource() == editScriptItem)
2009
+ if (source == editScriptItem)
17942010 {
17952011 OpenDialog();
17962012 refreshContents();
17972013 } else
1798
- if (event.getSource() == invariantsItem)
2014
+ if (source == invariantsItem)
17992015 {
18002016 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
2017
+ Grafreed.grafreeD.universe.invariants();
18022018 } else
1803
- if (event.getSource() == memoryItem)
2019
+ if (source == memoryItem)
18042020 {
18052021 //System.out.println("Invariants:");
18062022 PrintMemory();
18072023 } else
1808
- if (event.getSource() == pathItem)
2024
+ if (source == pathItem)
18092025 {
18102026 PrintPath();
18112027 } else
1812
- if (event.getSource() == analyzeItem)
2028
+ if (source == analyzeItem)
18132029 {
18142030 AnalyzeObject();
18152031 } else
1816
- if (event.getSource() == dumpItem)
2032
+ if (source == dumpItem)
18172033 {
18182034 DumpObject();
18192035 } else
1820
- if (event.getSource() == screenfitButton)
2036
+ if (source == minButton)
2037
+ {
2038
+ Minimize();
2039
+ } else
2040
+ if (source == maxButton)
2041
+ {
2042
+ Maximize();
2043
+ } else
2044
+ if (source == fullButton)
2045
+ {
2046
+ ToggleFullScreen();
2047
+ } else
2048
+ if (source == undoButton)
2049
+ {
2050
+ Undo();
2051
+ } else
2052
+ if (source == redoButton)
2053
+ {
2054
+ Redo();
2055
+ } else
2056
+ if (source == saveButton)
2057
+ {
2058
+ Save();
2059
+ } else
2060
+ if (source == oneStepButton)
2061
+ {
2062
+ Globals.ONESTEP = true;
2063
+ cameraView.repaint();
2064
+ } else
2065
+ if (source == screenfitButton)
18212066 {
18222067 //Reload(lastConverter, lastFilename, true);
18232068 ScreenFit();
18242069 } else
1825
- if (event.getSource() == screenfitpointButton)
2070
+ if (source == screenfitpointButton)
18262071 {
18272072 //Reload(lastConverter, lastFilename, true);
18282073 ScreenFitPoint();
18292074 } else
1830
- if (event.getSource() == snapobjectButton)
2075
+ if (source == snapobjectButton)
18312076 {
18322077 //Reload(lastConverter, lastFilename, true);
18332078 SnapObject();
....@@ -1838,13 +2083,13 @@
18382083 // Recompile();
18392084 // refreshContents();
18402085 // } else
1841
- if (event.getSource() == gcButton)
2086
+ if (source == gcButton)
18422087 {
18432088 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442089 System.gc();
18452090 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462091 } else
1847
- if (event.getSource() == editLeafItem)
2092
+ if (source == editLeafItem)
18482093 {
18492094 Object3D obj;
18502095 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2103,74 @@
18582103 }
18592104 refreshContents(true);
18602105 } else
1861
- if (event.getSource() == openWindowItem)
2106
+ if (source == openWindowItem)
18622107 {
18632108 EditSelection(true);
18642109 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2110
+ if (source == cutItem || source == clearButton)
18662111 {
18672112 loadClipboard(true);
18682113 } else
1869
- if (event.getSource() == duplicateItem)
2114
+ if (source == undoItem)
18702115 {
1871
- Object3D keep = GrafreeD.clipboard;
2116
+ Undo();
2117
+ } else
2118
+ if (source == redoItem)
2119
+ {
2120
+ Redo();
2121
+ } else
2122
+ if (source == duplicateItem)
2123
+ {
2124
+ Object3D keep = Grafreed.clipboard;
18722125 loadClipboard(false);
18732126 paste(false);
1874
- GrafreeD.clipboard = keep;
2127
+ Grafreed.clipboard = keep;
18752128 } else
1876
- if (event.getSource() == cloneItem)
2129
+ if (source == cloneItem)
18772130 {
18782131 CloneSelection(false);
18792132 } else
1880
- if (event.getSource() == cloneSupportItem)
2133
+ if (source == cloneSupportItem)
18812134 {
18822135 CloneSelection(true);
18832136 } else
1884
- if (event.getSource() == copyItem)
2137
+ if (source == copyItem)
18852138 {
18862139 loadClipboard(false);
18872140 } else
1888
- if (event.getSource() == pasteItem)
2141
+ if (source == pasteItem)
18892142 {
18902143 paste(false);
18912144 } else
1892
- if (event.getSource() == pasteLinkItem)
2145
+ if (source == pasteIntoItem)
18932146 {
1894
- pasteInto(false);
2147
+ pasteInto(true, false);
18952148 } else
1896
- if (event.getSource() == pasteCloneItem)
2149
+ if (source == pasteLinkItem)
18972150 {
1898
- pasteInto(true);
2151
+ pasteInto(false, false);
18992152 } else
1900
- if (event.getSource() == pasteExpandItem)
2153
+ if (source == pasteCloneItem)
2154
+ {
2155
+ pasteInto(true, true);
2156
+ } else
2157
+ if (source == pasteExpandItem)
19012158 {
19022159 paste(true);
19032160 } else
1904
- if (event.getSource() == synchronizeItem)
2161
+ if (source == synchronizeItem)
19052162 {
19062163 Overwrite(Object3D.TRANSFORM);
19072164 } else
1908
- if (event.getSource() == overwriteNameItem)
2165
+ if (source == overwriteNameItem)
19092166 {
19102167 Overwrite(Object3D.NAME);
19112168 } else
1912
- if (event.getSource() == overwriteUVItem)
2169
+ if (source == overwriteUVItem)
19132170 {
19142171 Overwrite(Object3D.UV);
19152172 } else
1916
- if (event.getSource() == overwriteMatItem)
2173
+ if (source == overwriteMatItem)
19172174 {
19182175 /* july 2015
19192176 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2190,7 @@
19332190
19342191 Overwrite(dropAttributes);
19352192 }
1936
- if (event.getSource() == overwriteGeoItem)
2193
+ if (source == overwriteGeoItem)
19372194 {
19382195 Overwrite(Object3D.GEOMETRY);
19392196 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2207,7 @@
19502207 // refreshContents();
19512208 // }
19522209 } else
1953
- if (event.getSource() == generateMeshItem)
2210
+ if (source == generateMeshItem)
19542211 {
19552212 //if (group.selection.size() == 1)
19562213 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2218,7 @@
19612218 ResetModel();
19622219 refreshContents();
19632220 } else
1964
- if (event.getSource() == extractGeometriesItem)
2221
+ if (source == extractGeometriesItem)
19652222 {
19662223 boolean one = false;
19672224
....@@ -1988,7 +2245,7 @@
19882245 ResetModel();
19892246 refreshContents();
19902247 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2248
+ if (source == cloneGeometriesItem)
19922249 {
19932250 boolean one = false;
19942251
....@@ -2014,7 +2271,7 @@
20142271 ResetModel();
20152272 refreshContents();
20162273 } else
2017
- if (event.getSource() == shareGeometriesItem)
2274
+ if (source == shareGeometriesItem)
20182275 {
20192276 boolean one = false;
20202277
....@@ -2044,7 +2301,7 @@
20442301 refreshContents();
20452302 }
20462303 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2304
+ if (source == mergeGeometriesItem)
20482305 {
20492306 boolean one = false;
20502307
....@@ -2074,7 +2331,7 @@
20742331 ResetModel();
20752332 refreshContents();
20762333 } else
2077
- if (event.getSource() == linkverticesItem)
2334
+ if (source == linkverticesItem)
20782335 {
20792336 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802337 // {
....@@ -2087,9 +2344,9 @@
20872344 // group.selection.get(0).setMasterThis(content); // should be identity
20882345 // refreshContents();
20892346 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2347
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912348 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
20932350
20942351 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952352 content = ((cGroup)content).get(0);
....@@ -2097,38 +2354,38 @@
20972354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982355 for (int i=0; i<group.selection.size(); i++)
20992356 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2357
+ boolean random = CameraPane.SWITCH;
2358
+ CameraPane.SWITCH = false; // parse all random nodes
21022359 group.selection.get(i).linkVerticesThis(content);
21032360 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2361
+ CameraPane.SWITCH = random;
21052362 }
21062363 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072364 refreshContents();
21082365 }
21092366 } else
2110
- if (event.getSource() == resetsupportItem)
2367
+ if (source == resetsupportItem)
21112368 {
21122369 for (int i=0; i<group.selection.size(); i++)
21132370 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2371
+ boolean random = CameraPane.SWITCH;
2372
+ CameraPane.SWITCH = false; // parse all random nodes
21162373 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2374
+ CameraPane.SWITCH = random;
21182375 }
21192376
21202377 refreshContents();
21212378 } else
2122
- if (event.getSource() == relinkverticesItem)
2379
+ if (source == relinkverticesItem)
21232380 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2381
+ boolean random = CameraPane.SWITCH;
2382
+ CameraPane.SWITCH = false; // parse all random nodes
21262383 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2384
+ CameraPane.SWITCH = random;
21282385
21292386 refreshContents();
21302387 } else
2131
- if (event.getSource() == resetreferencesItem)
2388
+ if (source == resetreferencesItem)
21322389 {
21332390 for (int i=0; i<group.selection.size(); i++)
21342391 {
....@@ -2137,11 +2394,11 @@
21372394
21382395 refreshContents();
21392396 } else
2140
- if (event.getSource() == setMasterItem)
2397
+ if (source == setMasterItem)
21412398 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2399
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432400 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2401
+ Object3D content = Grafreed.clipboard.get(0);
21452402
21462403 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472404 content = ((cGroup)content).get(0);
....@@ -2150,13 +2407,13 @@
21502407 refreshContents();
21512408 }
21522409 } else
2153
- if (event.getSource() == poseMeshItem)
2410
+ if (source == poseMeshItem)
21542411 {
21552412 if (group.selection.size() == 1)
21562413 {
2157
- if (GrafreeD.clipboard.size() == 1)
2414
+ if (Grafreed.clipboard.size() == 1)
21582415 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2416
+ Object3D content = Grafreed.clipboard.get(0);
21602417
21612418 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622419 content = ((cGroup)content).get(0);
....@@ -2169,19 +2426,19 @@
21692426 }
21702427
21712428 } else
2172
- if (event.getSource() == revertMeshItem)
2429
+ if (source == revertMeshItem)
21732430 {
21742431 RevertMeshes();
21752432 } else
2176
- if (event.getSource() == resetMeshItem)
2433
+ if (source == resetAllItem)
21772434 {
21782435 ResetAll();
21792436 } else
2180
- if (event.getSource() == stepAllItem)
2437
+ if (source == stepAllItem)
21812438 {
21822439 StepAll();
21832440 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2441
+ if (source == clearItem) // || event.getSource() == clearButton)
21852442 {
21862443 //int indices[] = jList.getSelectedIndices();
21872444 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2446,46 @@
21892446
21902447 ClearSelection(false);
21912448 } else
2192
- if (event.getSource() == clearAllItem)
2449
+ if (source == clearAllItem)
21932450 {
21942451 ClearSelection(true);
21952452 } else
2196
- if (event.getSource() == grabItem)
2453
+ if (source == grabItem)
21972454 {
21982455 group(new cGroup(), true);
21992456 } else
2200
- if (event.getSource() == hideItem)
2457
+ if (source == hideItem)
22012458 {
22022459 group(new HiddenObject());
22032460 } else
2204
- if (event.getSource() == frontItem)
2461
+ if (source == frontItem)
22052462 {
22062463 front();
22072464 } else
2208
- if (event.getSource() == backItem)
2465
+ if (source == backItem)
22092466 {
22102467 back();
22112468 } else
2212
- if (event.getSource() == cameraItem)
2469
+ if (source == cameraItem)
22132470 {
22142471 makeSomething(new Camera());
22152472 } else
2216
- if (event.getSource() == compositeItem)
2473
+ if (source == compositeItem)
22172474 {
22182475 group(new Composite());
22192476 } else
2220
- if (event.getSource() == randomItem)
2477
+ if (source == randomItem)
22212478 {
22222479 RandomNode random = new RandomNode();
22232480 group(random);
22242481 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2482
+ random.name = random.get(0).name + "Switch";
22262483 } else
2227
- if (event.getSource() == physicsItem)
2484
+ if (source == physicsItem)
22282485 {
22292486 group(new PhysicsNode());
22302487 } else
2231
- if (event.getSource() == frameselectorItem)
2488
+ if (source == frameselectorItem)
22322489 {
22332490 for (int i=0; i<group.selection.size(); i++)
22342491 {
....@@ -2240,7 +2497,7 @@
22402497 ResetModel();
22412498 refreshContents();
22422499 } else
2243
- if (event.getSource() == switchGeoItem)
2500
+ if (source == switchGeoItem)
22442501 {
22452502 for (int i=0; i<group.selection.size(); i++)
22462503 {
....@@ -2252,7 +2509,7 @@
22522509 ResetModel();
22532510 refreshContents();
22542511 } else
2255
- if (event.getSource() == switchTransfoItem)
2512
+ if (source == switchTransfoItem)
22562513 {
22572514 for (int i=0; i<group.selection.size(); i++)
22582515 {
....@@ -2264,7 +2521,7 @@
22642521 ResetModel();
22652522 refreshContents();
22662523 } else
2267
- if (event.getSource() == morphItem)
2524
+ if (source == morphItem)
22682525 {
22692526 for (int i=0; i<group.selection.size(); i++)
22702527 {
....@@ -2276,7 +2533,7 @@
22762533 ResetModel();
22772534 refreshContents();
22782535 } else
2279
- if (event.getSource() == scriptNodeItem)
2536
+ if (source == scriptNodeItem)
22802537 {
22812538 boolean atleastone = false;
22822539
....@@ -2315,31 +2572,31 @@
23152572 }
23162573 }
23172574 } else
2318
- if (event.getSource() == linkerItem)
2575
+ if (source == linkerItem)
23192576 {
23202577 group(new cLinker());
23212578 } else
2322
- if (event.getSource() == textureItem)
2579
+ if (source == textureItem)
23232580 {
23242581 group(new TextureNode());
23252582 } else
2326
- if (event.getSource() == billboardItem)
2583
+ if (source == billboardItem)
23272584 {
23282585 group(new BillboardNode());
23292586 } else
2330
- if (event.getSource() == shadowXItem)
2587
+ if (source == shadowXItem)
23312588 {
23322589 CastShadow(0);
23332590 } else
2334
- if (event.getSource() == shadowYItem)
2591
+ if (source == shadowYItem)
23352592 {
23362593 CastShadow(1);
23372594 } else
2338
- if (event.getSource() == shadowZItem)
2595
+ if (source == shadowZItem)
23392596 {
23402597 CastShadow(2);
23412598 } else
2342
- if (event.getSource() == ungroupItem)
2599
+ if (source == ungroupItem)
23432600 {
23442601 //ungroup();
23452602 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2608,203 @@
23512608
23522609 refreshContents();
23532610 } else
2354
- if (event.getSource() == genUVItem)
2611
+ if (source == genUVItem)
23552612 {
23562613 GenUV();
23572614 } else
2358
- if (event.getSource() == genNormalsCADItem)
2615
+ if (source == genNormalsCADItem)
23592616 {
23602617 GenNormals(true);
23612618 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2619
+ if (source == genNormalsMESHItem)
23632620 {
2364
- GenNormals(true); // TODO
2621
+ GenNormalsMESH();
23652622 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2623
+ if (source == genNormalsORGANItem)
23672624 {
23682625 GenNormals(false);
23692626 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2627
+ if (source == genNormalsMINEItem)
23712628 {
23722629 GenNormalsMINE();
23732630 } else
2374
- if (event.getSource() == stripifyItem)
2631
+ if (source == stripifyItem)
23752632 {
23762633 Stripify();
23772634 } else
2378
- if (event.getSource() == unstripifyItem)
2635
+ if (source == unstripifyItem)
23792636 {
23802637 Unstripify();
23812638 } else
2382
- if (event.getSource() == trimItem)
2639
+ if (source == trimItem)
23832640 {
23842641 Trim();
23852642 } else
2386
- if (event.getSource() == untrimItem)
2643
+ if (source == untrimItem)
23872644 {
23882645 Untrim();
23892646 } else
2390
- if (event.getSource() == clearColorsItem)
2647
+ if (source == clearColorsItem)
23912648 {
23922649 ClearColors();
23932650 } else
2394
- if (event.getSource() == clearMaterialsItem)
2651
+ if (source == clearMaterialsItem)
23952652 {
23962653 ClearMaterials();
23972654 } else
2398
- if (event.getSource() == liveleavesItem)
2655
+ if (source == liveleavesItem)
23992656 {
24002657 LiveLeaves(true);
24012658 } else
2402
- if (event.getSource() == unliveleavesItem)
2659
+ if (source == unliveleavesItem)
24032660 {
24042661 LiveLeaves(false);
24052662 } else
2406
- if (event.getSource() == supportleavesItem)
2663
+ if (source == supportleavesItem)
24072664 {
24082665 SupportLeaves(true);
24092666 } else
2410
- if (event.getSource() == unsupportleavesItem)
2667
+ if (source == unsupportleavesItem)
24112668 {
24122669 SupportLeaves(false);
24132670 } else
2414
- if (event.getSource() == hideleavesItem)
2671
+ if (source == hideleavesItem)
24152672 {
24162673 HideLeaves(true);
24172674 } else
2418
- if (event.getSource() == showleavesItem)
2675
+ if (source == showleavesItem)
24192676 {
24202677 HideLeaves(false);
24212678 } else
2422
- if (event.getSource() == markleavesItem)
2679
+ if (source == markleavesItem)
24232680 {
24242681 MarkLeaves(true);
24252682 } else
2426
- if (event.getSource() == unmarkleavesItem)
2683
+ if (source == unmarkleavesItem)
24272684 {
24282685 MarkLeaves(false);
24292686 } else
2430
- if (event.getSource() == flipVItem)
2687
+ if (source == rewindleavesItem)
2688
+ {
2689
+ RewindLeaves(true);
2690
+ } else
2691
+ if (source == unrewindleavesItem)
2692
+ {
2693
+ RewindLeaves(false);
2694
+ } else
2695
+ if (source == randomleavesItem)
2696
+ {
2697
+ RandomLeaves(true);
2698
+ } else
2699
+ if (source == unrandomleavesItem)
2700
+ {
2701
+ RandomLeaves(false);
2702
+ } else
2703
+ if (source == flipVItem)
24312704 {
24322705 FlipV(true);
24332706 } else
2434
- if (event.getSource() == unflipVItem)
2707
+ if (source == unflipVItem)
24352708 {
24362709 FlipV(false);
24372710 } else
2438
- if (event.getSource() == lowTexturesItem)
2711
+ if (source == lowTexturesItem)
24392712 {
24402713 SetTexRes(0);
24412714 } else
2442
- if (event.getSource() == normalTexturesItem)
2715
+ if (source == normalTexturesItem)
24432716 {
24442717 SetTexRes(1);
24452718 } else
2446
- if (event.getSource() == highTexturesItem)
2719
+ if (source == highTexturesItem)
24472720 {
24482721 SetTexRes(2);
24492722 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2723
+ if (source == veryhighTexturesItem)
24512724 {
24522725 SetTexRes(3);
24532726 } else
2454
- if (event.getSource() == maxTexturesItem)
2727
+ if (source == maxTexturesItem)
24552728 {
24562729 SetTexRes(4);
24572730 } else
2458
- if (event.getSource() == panoTexturesItem)
2731
+ if (source == panoTexturesItem)
24592732 {
24602733 SetTexRes(5);
24612734 } else
2462
- if (event.getSource() == reverseNormalsItem)
2735
+ if (source == reverseNormalsItem)
24632736 {
24642737 ReverseNormals();
24652738 } else
2466
- if (event.getSource() == parseverticesItem)
2739
+ if (source == parseverticesItem)
24672740 {
24682741 ParseVertices();
24692742 } else
2470
- if (event.getSource() == textureFieldItem)
2743
+ if (source == textureFieldItem)
24712744 {
24722745 TextureVertices();
24732746 } else
2474
- if (event.getSource() == alignItem)
2747
+ if (source == alignItem)
24752748 {
24762749 Align();
24772750 } else
2478
- if (event.getSource() == mirrorItem)
2751
+ if (source == mirrorItem)
24792752 {
24802753 MirrorPoses();
24812754 } else
2482
- if (event.getSource() == reduceMorphItem)
2755
+ if (source == reduceMorphItem)
24832756 {
24842757 MeshReduction(false);
24852758 } else
2486
- if (event.getSource() == reduce34MorphItem)
2759
+ if (source == reduce34MorphItem)
24872760 {
24882761 MeshReduction(true);
24892762 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2763
+ if (source == reverseTrianglesItem)
24912764 {
24922765 ReverseTriangles();
24932766 } else
2494
- if (event.getSource() == reduceMeshItem)
2767
+ if (source == reduceMeshItem)
24952768 {
24962769 ReduceMesh(false);
24972770 } else
2498
- if (event.getSource() == reduce34MeshItem)
2771
+ if (source == reduce34MeshItem)
24992772 {
25002773 ReduceMesh(true);
25012774 } else
2502
- if (event.getSource() == increaseMeshItem)
2775
+ if (source == increaseMeshItem)
25032776 {
25042777 IncreaseMesh();
25052778 } else
2506
- if (event.getSource() == clipMeshItem)
2779
+ if (source == clipMeshItem)
25072780 {
25082781 ClipMesh();
25092782 } else
2510
- if (event.getSource() == smoothMeshItem)
2783
+ if (source == smoothMeshItem)
25112784 {
25122785 SmoothMesh();
25132786 } else
2514
- if (event.getSource() == transformgeometryItem)
2787
+ if (source == transformGeometryItem)
25152788 {
25162789 TransformGeometry();
25172790 } else
2518
- if (event.getSource() == resetTransformItem)
2791
+ if (source == transformChildrenItem)
2792
+ {
2793
+ TransformChildren();
2794
+ } else
2795
+ if (source == resetTransformItem)
25192796 {
25202797 ResetTransform();
25212798 } else
2522
- if (event.getSource() == resetCentroidItem)
2799
+ if (source == resetCentroidItem)
25232800 {
2524
- ResetCentroid();
2801
+ ResetCentroid(true);
25252802 } else
2526
- if (event.getSource() == resetParentItem)
2803
+ if (source == resetCentroidXZItem)
2804
+ {
2805
+ ResetCentroid(false);
2806
+ } else
2807
+ if (source == resetParentItem)
25272808 {
25282809 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292810 {
....@@ -2533,7 +2814,7 @@
25332814
25342815 refreshContents();
25352816 } else
2536
- if (event.getSource() == repairParentItem)
2817
+ if (source == repairParentItem)
25372818 {
25382819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392820 {
....@@ -2547,7 +2828,7 @@
25472828
25482829 refreshContents();
25492830 } else
2550
- if (event.getSource() == repairShadowItem)
2831
+ if (source == repairShadowItem)
25512832 {
25522833 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532834 {
....@@ -2561,7 +2842,7 @@
25612842
25622843 refreshContents();
25632844 } else
2564
- if (event.getSource() == sortbysizeItem)
2845
+ if (source == sortbysizeItem)
25652846 {
25662847 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672848 {
....@@ -2573,7 +2854,7 @@
25732854 ResetModel();
25742855 refreshContents();
25752856 } else
2576
- if (event.getSource() == sortbynameItem)
2857
+ if (source == sortbynameItem)
25772858 {
25782859 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792860 {
....@@ -2585,7 +2866,7 @@
25852866 ResetModel();
25862867 refreshContents();
25872868 } else
2588
- if (event.getSource() == attachPigmentItem)
2869
+ if (source == attachPigmentItem)
25892870 {
25902871 String texture = GetFile("Attach pigment");
25912872 Object3D obj;
....@@ -2597,7 +2878,7 @@
25972878
25982879 refreshContents();
25992880 } else
2600
- if (event.getSource() == detachPigmentItem)
2881
+ if (source == detachPigmentItem)
26012882 {
26022883 Object3D obj;
26032884 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2889,7 @@
26082889
26092890 refreshContents();
26102891 } else
2611
- if (event.getSource() == attachBumpItem)
2892
+ if (source == attachBumpItem)
26122893 {
26132894 String texture = GetFile("Attach bump");
26142895 Object3D obj;
....@@ -2620,7 +2901,7 @@
26202901
26212902 refreshContents();
26222903 } else
2623
- if (event.getSource() == detachBumpItem)
2904
+ if (source == detachBumpItem)
26242905 {
26252906 Object3D obj;
26262907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2912,7 @@
26312912
26322913 refreshContents();
26332914 } else
2634
- if (event.getSource() == pigmentBumpItem)
2915
+ if (source == pigmentBumpItem)
26352916 {
26362917 Object3D obj;
26372918 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2923,221 @@
26422923
26432924 refreshContents();
26442925 } else
2645
- if (event.getSource() == flashSelectionButton)
2926
+ if (source == flashSelectionButton)
26462927 {
26472928 CameraPane.flash = true;
26482929 refreshContents();
26492930 } else
2650
- if (event.getSource() == oneButton)
2931
+ if (source == oneButton)
26512932 {
26522933 } else
2653
- if (event.getSource() == twoButton)
2934
+ if (source == twoButton)
26542935 {
26552936 radio.layout = twoButton;
26562937 // bug
26572938 //gridPanel.setDividerLocation(1.0);
26582939 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
2940
+// bigThree.remove(scenePanel);
2941
+// bigThree.remove(centralPanel);
2942
+// bigThree.remove(XYZPanel);
2943
+// aWindowConstraints.gridx = 0;
2944
+// aWindowConstraints.gridy = 0;
2945
+// aWindowConstraints.gridwidth = 1;
2946
+// // aConstraints.gridheight = 3;
2947
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.weighty = 1;
2950
+// //bigThree.add(jtp, aWindowConstraints);
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.gridwidth = 3;
2953
+// // aConstraints.gridheight = 3;
2954
+// aWindowConstraints.gridx = 1;
2955
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2956
+// bigThree.add(centralPanel, aWindowConstraints);
2957
+// aWindowConstraints.weightx = 0;
2958
+// aWindowConstraints.gridx = 4;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// //bigThree.add(XYZPanel, aWindowConstraints);
2963
+// scenePanel.setVisible(false);
2964
+// centralPanel.setVisible(true);
2965
+// XYZPanel.setVisible(false);
2966
+ bigThree.ClearUI();
2967
+ bigThree.add(centralPanel);
2968
+ bigThree.FlushUI();
2969
+
2970
+ cameraView.requestFocusInWindow();
2971
+
2972
+// refreshContents(true);
2973
+//
2974
+// try
2975
+// {
2976
+// java.awt.Robot bot = new java.awt.Robot();
2977
+// int mask = InputEvent.BUTTON1_MASK;
2978
+// bot.mouseMove(100, 100);
2979
+// bot.mousePress(mask);
2980
+// bot.mouseRelease(mask);
2981
+// }
2982
+// catch (Exception e)
2983
+// {
2984
+//
2985
+// }
2986
+
26832987 } else
2684
- if (event.getSource() == threeButton)
2988
+ if (source == threeButton)
26852989 {
26862990 radio.layout = threeButton;
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
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2991
+
2992
+// bigThree.remove(scenePanel);
2993
+// bigThree.remove(centralPanel);
2994
+// bigThree.remove(XYZPanel);
2995
+// aWindowConstraints.gridx = 0;
2996
+// aWindowConstraints.gridy = 0;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.weighty = 1;
3002
+// //bigThree.add(jtp, aWindowConstraints);
3003
+// aWindowConstraints.weightx = 1;
3004
+// aWindowConstraints.gridwidth = 3;
3005
+// // aConstraints.gridheight = 3;
3006
+// aWindowConstraints.gridx = 1;
3007
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3008
+// bigThree.add(centralPanel, aWindowConstraints);
3009
+// aWindowConstraints.weightx = 0;
3010
+// aWindowConstraints.gridx = 4;
3011
+// aWindowConstraints.gridwidth = 1;
3012
+// // aConstraints.gridheight = 3;
3013
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3014
+// bigThree.add(XYZPanel, aWindowConstraints);
3015
+// bigThree.validate();
3016
+// scenePanel.setVisible(false);
3017
+// centralPanel.setVisible(true);
3018
+// XYZPanel.setVisible(true);
3019
+ bigThree.ClearUI();
3020
+ bigThree.add(centralPanel);
3021
+ bigThree.add(XYZPanel);
3022
+ bigThree.FlushUI();
3023
+
3024
+ cameraView.requestFocusInWindow();
27113025 } else
2712
- if (event.getSource() == fourButton)
3026
+ if (source == fourButton)
27133027 {
27143028 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, 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(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
3029
+
3030
+// bigThree.remove(scenePanel);
3031
+// bigThree.remove(centralPanel);
3032
+// bigThree.remove(XYZPanel);
3033
+// aWindowConstraints.gridx = 0;
3034
+// aWindowConstraints.gridy = 0;
3035
+// aWindowConstraints.gridwidth = 1;
3036
+// // aWindowConstraints.gridheight = 3;
3037
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3038
+// aWindowConstraints.weightx = 1;
3039
+// aWindowConstraints.weighty = 1;
3040
+// bigThree.add(scenePanel, aWindowConstraints);
3041
+// aWindowConstraints.weightx = 1;
3042
+// aWindowConstraints.gridwidth = 3;
3043
+// // aConstraints.gridheight = 3;
3044
+// aWindowConstraints.gridx = 1;
3045
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3046
+// //bigThree.add(cameraPanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 0;
3048
+// aWindowConstraints.gridx = 4;
3049
+// aWindowConstraints.gridwidth = 1;
3050
+// // aWindowConstraints.gridheight = 3;
3051
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3052
+// //bigThree.add(XYZPanel, aWindowConstraints);
3053
+// bigThree.validate();
3054
+// scenePanel.setVisible(true);
3055
+// centralPanel.setVisible(false);
3056
+// XYZPanel.setVisible(false);
3057
+ bigThree.ClearUI();
3058
+ bigThree.add(scenePanel);
3059
+ bigThree.FlushUI();
3060
+
3061
+ cameraView.requestFocusInWindow();
27393062 } else
2740
- if (event.getSource() == sixButton)
3063
+ if (source == sixButton)
27413064 {
27423065 radio.layout = sixButton;
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
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, 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, aConstraints);
2766
- bigThree.revalidate();
3066
+
3067
+// bigThree.remove(scenePanel);
3068
+// bigThree.remove(centralPanel);
3069
+// bigThree.remove(XYZPanel);
3070
+// aWindowConstraints.gridx = 0;
3071
+// aWindowConstraints.gridy = 0;
3072
+// aWindowConstraints.gridwidth = 1;
3073
+// // aConstraints.gridheight = 3;
3074
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.weighty = 1;
3077
+// bigThree.add(scenePanel, aWindowConstraints);
3078
+// aWindowConstraints.weightx = 1;
3079
+// aWindowConstraints.gridwidth = 3;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.gridx = 1;
3082
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3083
+// bigThree.add(centralPanel, aWindowConstraints);
3084
+// aWindowConstraints.weightx = 0;
3085
+// aWindowConstraints.gridx = 4;
3086
+// aWindowConstraints.gridwidth = 1;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3089
+// //bigThree.add(XYZPanel, aConstraints);
3090
+// bigThree.validate();
3091
+// scenePanel.setVisible(true);
3092
+// centralPanel.setVisible(true);
3093
+// XYZPanel.setVisible(false);
3094
+ bigThree.ClearUI();
3095
+ bigThree.add(scenePanel);
3096
+ bigThree.add(centralPanel);
3097
+ bigThree.FlushUI();
3098
+
3099
+ cameraView.requestFocusInWindow();
27673100 } else
2768
- if (event.getSource() == sevenButton)
3101
+ if (source == sevenButton)
27693102 {
27703103 radio.layout = sevenButton;
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
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
3104
+
3105
+// bigThree.remove(scenePanel);
3106
+// bigThree.remove(centralPanel);
3107
+// bigThree.remove(XYZPanel);
3108
+// aWindowConstraints.gridx = 0;
3109
+// aWindowConstraints.gridy = 0;
3110
+// aWindowConstraints.gridwidth = 1;
3111
+// // aWindowConstraints.gridheight = 3;
3112
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.weighty = 1;
3115
+// bigThree.add(scenePanel, aWindowConstraints);
3116
+// aWindowConstraints.weightx = 1;
3117
+// aWindowConstraints.gridwidth = 3;
3118
+// // aWindowConstraints.gridheight = 3;
3119
+// aWindowConstraints.gridx = 1;
3120
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3121
+// bigThree.add(centralPanel, aWindowConstraints);
3122
+// aWindowConstraints.weightx = 0;
3123
+// aWindowConstraints.gridx = 4;
3124
+// aWindowConstraints.gridwidth = 1;
3125
+// // aConstraints.gridheight = 3;
3126
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3127
+// bigThree.add(XYZPanel, aWindowConstraints);
3128
+// bigThree.validate();
3129
+// scenePanel.setVisible(true);
3130
+// centralPanel.setVisible(true);
3131
+// XYZPanel.setVisible(true);
3132
+ bigThree.ClearUI();
3133
+ bigThree.add(scenePanel);
3134
+ bigThree.add(centralPanel);
3135
+ bigThree.add(XYZPanel);
3136
+ bigThree.FlushUI();
3137
+
3138
+ cameraView.requestFocusInWindow();
27953139 } else
2796
- if (event.getSource() == rootButton)
3140
+ if (source == rootButton)
27973141 {
27983142 Object3D obj;
27993143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2803,34 +3147,44 @@
28033147 EditObject(obj);
28043148 }
28053149
3150
+ cameraView.requestFocusInWindow();
28063151 refreshContents(true);
28073152 } else
2808
- if (event.getSource() == closeButton)
3153
+ if (source == closeButton)
28093154 {
28103155 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113156 cRadio ab;
28123157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28133158 {
28143159 ab = (cRadio)e.nextElement();
2815
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28163161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
28173168 buttonGroup.remove(ab);
28183169 radioPanel.remove(ab);
28193170
2820
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
28213173 // ab.GetObject().objectUI = null; // ?????????
28223174
28233175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28243176 break;
28253177 }
28263178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
28273181 refreshContents(true);
28283182 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3183
+ if (source == editItem || source == editButton)
28303184 {
28313185 EditSelection(false);
28323186 } else
2833
- if (event.getSource() == uneditButton)
3187
+ if (source == uneditButton)
28343188 {
28353189 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363190 {
....@@ -2840,14 +3194,14 @@
28403194 child.CloseUI();
28413195 listUI.remove(child);
28423196
2843
- child.editWindow = null; // ???????????
3197
+ //child.editWindow = null; // ???????????
28443198 }
2845
- objEditor.ctrlPanel.revalidate();
3199
+ objEditor.ctrlPanel.FlushUI();
28463200 //objEditor.jTree.clearSelection();
28473201 //objEditor.ResetSliders();
28483202 refreshContents(true);
28493203 } else
2850
- if (event.getSource() == clearPanelButton)
3204
+ if (source == clearPanelButton)
28513205 {
28523206 assert(copy == group);
28533207 //copy.ClearUI();
....@@ -2858,7 +3212,7 @@
28583212 listUI.clear();
28593213 refreshContents(true);
28603214 } else
2861
- if (event.getSource() == allParamsButton)
3215
+ if (source == allParamsButton)
28623216 {
28633217 assert(copy == group);
28643218
....@@ -2879,19 +3233,19 @@
28793233
28803234 refreshContents(true);
28813235 } else
2882
- if (event.getSource() == unselectButton)
3236
+ if (source == unselectButton)
28833237 {
28843238 objEditor.jTree.clearSelection();
28853239 // ?? oct 2012 GrafreeD.clipboard.clear();
28863240 objEditor.ResetSliders();
28873241 refreshContents(true);
28883242 } else
2889
- if(event.getSource() instanceof cRadio)
3243
+ if(source instanceof cRadio)
28903244 {
28913245 group.parent = keepparent;
28923246 group.attributes = 0;
28933247 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3248
+ /*cRadio*/ radio = (cRadio)source;
28953249 Object3D obj = radio.GetObject();
28963250 System.out.println("Edit " + obj);
28973251 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2926,7 +3280,11 @@
29263280 frontView.object = group;
29273281 sideView.object = group;
29283282 }
2929
- group.editWindow = this;
3283
+
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
3287
+
29303288 /*
29313289 currentLayout = radio.layout;
29323290 if (currentLayout == null)
....@@ -2938,8 +3296,23 @@
29383296 //group.parent = null; // ROOT
29393297 //group.attributes = -1;
29403298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
29413301 refreshContents(true);
2942
- }
3302
+ } else if (event.getSource() == editCameraItem)
3303
+ {
3304
+ cameraView.ProtectCamera();
3305
+ cameraView.repaint();
3306
+ return;
3307
+ } else if (event.getSource() == revertCameraItem)
3308
+ {
3309
+ cameraView.RevertCamera();
3310
+ cameraView.repaint();
3311
+ return;
3312
+ // } else if (event.getSource() == textureButton)
3313
+ // {
3314
+ // return; // true;
3315
+ }
29433316 else
29443317 {
29453318 //return super.action(event, arg);
....@@ -2948,7 +3321,6 @@
29483321 }
29493322
29503323 boolean useclient = false;
2951
- cRadio radio;
29523324
29533325 void ToggleRoot()
29543326 {
....@@ -3000,6 +3372,28 @@
30003372 refreshContents();
30013373 }
30023374
3375
+ void TransformChildren()
3376
+ {
3377
+ Object3D obj;
3378
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3379
+ {
3380
+ obj = (Object3D)e.nextElement();
3381
+ obj.KeepTextureMatrices();
3382
+ obj.TransformChildren();
3383
+ obj.RestoreTextureMatrices();
3384
+
3385
+// if (obj.parent == null)
3386
+// {
3387
+// System.out.println("NULL PARENT!");
3388
+// new Exception().printStackTrace();
3389
+// }
3390
+// else
3391
+// TouchTransform(obj);
3392
+// //obj.parent.Touch();
3393
+ }
3394
+
3395
+ refreshContents();
3396
+ }
30033397
30043398 void ResetTransform()
30053399 {
....@@ -3112,7 +3506,7 @@
31123506 refreshContents();
31133507 }
31143508
3115
- void ResetCentroid()
3509
+ void ResetCentroid(boolean full)
31163510 {
31173511 Object3D obj;
31183512 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +3521,16 @@
31273521 LA.matIdentity(Object3D.mat);
31283522 obj.getBounds(minima, maxima, false);
31293523 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3524
+ if (full)
3525
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31313526 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31323527 obj.TransformMesh(Object3D.mat);
3528
+
31333529 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3530
+ if (full)
3531
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31353532 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3533
+
31363534 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31373535 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31383536 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +3559,8 @@
31613559
31623560 int size = obj.MemorySize();
31633561
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
3562
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3563
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31653564 }
31663565 }
31673566 catch (Exception e)
....@@ -3198,9 +3597,9 @@
31983597 obj = (Object3D)e.nextElement();
31993598
32003599 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
3600
+ Grafreed.AnalyzeObject(obj);
32023601 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
3602
+ Grafreed.AnalyzeObject(obj.bRep);
32043603
32053604 // System.err.println((size/1024) + " KB is the size of " + obj);
32063605 }
....@@ -3242,6 +3641,13 @@
32423641 void GenNormals(boolean crease)
32433642 {
32443643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
32453651
32463652 refreshContents();
32473653 }
....@@ -3414,8 +3820,8 @@
34143820
34153821 void ParseVertices()
34163822 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
3823
+ boolean epsequal = Grafreed.epsequal;
3824
+ Grafreed.epsequal = true;
34193825
34203826 for (int i=0; i<group.selection.size(); i++)
34213827 {
....@@ -3440,7 +3846,7 @@
34403846 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34413847 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34423848
3443
- g.add(GrafreeD.clipboard);
3849
+ g.add(Grafreed.clipboard);
34443850
34453851 buffer.add(g);
34463852 }
....@@ -3455,7 +3861,7 @@
34553861 makeSomething(buffer, i==group.selection.size()-1);
34563862 }
34573863
3458
- GrafreeD.epsequal = epsequal;
3864
+ Grafreed.epsequal = epsequal;
34593865
34603866 refreshContents();
34613867 }
....@@ -3473,7 +3879,16 @@
34733879 String pigment = Object3D.GetPigment(tex);
34743880 //String bump = Object3D.GetBump(tex);
34753881
3476
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3882
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3883
+
3884
+ try
3885
+ {
3886
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3887
+ }
3888
+ catch (Exception e)
3889
+ {
3890
+ System.err.println("FAIL: " + node);
3891
+ }
34773892
34783893 double s = v.s;
34793894
....@@ -3561,11 +3976,11 @@
35613976
35623977 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633978
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3979
+ boolean random = CameraPane.SWITCH;
3980
+ CameraPane.SWITCH = false; // parse all random nodes
35663981 lowres.linkVerticesThis(null);
35673982 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3983
+ CameraPane.SWITCH = random;
35693984
35703985 System.err.flush();
35713986
....@@ -3605,7 +4020,7 @@
36054020 return;
36064021
36074022 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
4023
+ Object3D ref = Grafreed.clipboard.get(0);
36094024
36104025 Object3D newgroup = new Object3D("Po:" + poses.name);
36114026
....@@ -3799,9 +4214,9 @@
37994214
38004215 void ClipMesh()
38014216 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4217
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034218 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4219
+ Object3D content = Grafreed.clipboard.get(0);
38054220
38064221 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074222 content = ((cGroup)content).get(0);
....@@ -3810,7 +4225,7 @@
38104225 // {
38114226 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124227 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4228
+ group.selection.ClipMesh(Grafreed.clipboard);
38144229 }
38154230 // group.selection.ClipMesh(GrafreeD.clipboard);
38164231 System.out.println("DONE.");
....@@ -3857,6 +4272,18 @@
38574272 void MarkLeaves(boolean hide)
38584273 {
38594274 group.selection.MarkLeaves(hide);
4275
+ refreshContents();
4276
+ }
4277
+
4278
+ void RewindLeaves(boolean hide)
4279
+ {
4280
+ group.selection.RewindLeaves(hide);
4281
+ refreshContents();
4282
+ }
4283
+
4284
+ void RandomLeaves(boolean hide)
4285
+ {
4286
+ group.selection.RandomLeaves(hide);
38604287 refreshContents();
38614288 }
38624289
....@@ -3945,7 +4372,7 @@
39454372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464373
39474374 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4375
+ if(elem != group || !newWindow)
39494376 {
39504377 // if (!(elem instanceof Composite))
39514378 // newWindow = false;
....@@ -4035,7 +4462,6 @@
40354462 //case 702: // Event.LIST_DESELECT
40364463 group.deselectAll();
40374464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40394465 if (tps != null)
40404466 {
40414467 for (int i=0; i < tps.length; i++)
....@@ -4044,29 +4470,28 @@
40444470
40454471 //if (child.parent != null)
40464472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
40474474 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40514475 }
40524476 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4477
+// else
4478
+// {
4479
+// objEditor.SetMaterial(group); // .GetMaterial());
4480
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4481
+// System.err.println("info : " + group.GetPath());
4482
+// }
40594483
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4484
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40634485 CameraPane.flash = true;
40644486
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4487
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40664488 // a camera
40674489 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4490
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4491
+ {
4492
+ CameraPane.camerachangeframe = 0; // don't refuse it
4493
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4494
+ }
40704495 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40714496 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724497 }
....@@ -4079,6 +4504,26 @@
40794504
40804505 freezemodel = false;
40814506 }
4507
+
4508
+ void refreshContents(boolean cp)
4509
+ {
4510
+ if (!Globals.MOUSEDRAGGED)
4511
+ {
4512
+ objEditor.ClearInfo(); // .GetMaterial());
4513
+
4514
+ for (int i=0; i < group.selection.Size(); i++)
4515
+ {
4516
+ Object3D child = (Object3D) group.selection.get(i);
4517
+
4518
+ objEditor.AddInfo(child, this, true);
4519
+ System.err.println("info : " + child.GetPath());
4520
+ }
4521
+
4522
+ objEditor.SetText(); // jan 2014
4523
+ }
4524
+
4525
+ super.refreshContents(cp);
4526
+ }
40824527
40834528 void linkSomething(Object3D thing)
40844529 {
....@@ -4150,16 +4595,19 @@
41504595 {
41514596 if (group.selection.isEmpty())
41524597 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
4598
+
4599
+ Grafreed.clipboardIsTempGroup = false;
41544600 Composite tGroup = null;
41554601 if (group.selection.size() > 0) // 1)
41564602 {
41574603 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
4604
+ Grafreed.clipboardIsTempGroup = true;
41594605 }
41604606
41614607 if (cut)
41624608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
41634611 //int indices[] = jList.getSelectedIndices();
41644612 //for (int i = indices.length - 1; i >= 0; i--)
41654613 //jList.remove(indices[i]);
....@@ -4195,16 +4643,16 @@
41954643 //System.out.println("cut " + child);
41964644 //System.out.println("parent = " + child.parent);
41974645 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
4646
+ if (Grafreed.clipboardIsTempGroup)
41994647 tGroup.add/*Child*/(tmp);
42004648 else
4201
- GrafreeD.clipboard = tmp;
4649
+ Grafreed.clipboard = tmp;
42024650 }
42034651 else
4204
- if (GrafreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
42054653 tGroup.add/*Child*/(child);
42064654 else
4207
- GrafreeD.clipboard = child;
4655
+ Grafreed.clipboard = child;
42084656 }
42094657
42104658 //ResetModel();
....@@ -4236,21 +4684,23 @@
42364684 //System.out.println("cut " + elem);
42374685 //System.out.println("parent = " + elem.parent);
42384686 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
4687
+ if (Grafreed.clipboardIsTempGroup)
42404688 tGroup.add/*Child*/(tmp);
42414689 else
4242
- GrafreeD.clipboard = tmp;
4690
+ Grafreed.clipboard = tmp;
42434691 }
42444692 else
4245
- if (GrafreeD.clipboardIsTempGroup)
4693
+ if (Grafreed.clipboardIsTempGroup)
42464694 tGroup.add/*Child*/(child);
42474695 else
4248
- GrafreeD.clipboard = child;
4696
+ Grafreed.clipboard = child;
42494697 }
42504698
42514699 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
4700
+
4701
+ if (Grafreed.clipboardIsTempGroup)
4702
+ Grafreed.clipboard = tGroup;
4703
+
42544704 if (cut)
42554705 {
42564706 ResetModel();
....@@ -4264,7 +4714,7 @@
42644714 // return;
42654715 boolean first = true;
42664716
4267
- if (GrafreeD.clipboardIsTempGroup)
4717
+ if (Grafreed.clipboardIsTempGroup)
42684718 {
42694719 Composite temp;
42704720
....@@ -4275,7 +4725,7 @@
42754725 temp = (Composite)Applet3D.clipboard.deepCopy();
42764726 */
42774727 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4728
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42794729 {
42804730 Object3D child = (Object3D)e.nextElement();
42814731
....@@ -4309,21 +4759,21 @@
43094759 //Object3D cb = Applet3D.clipboard;
43104760 //temp.addChild(cb);
43114761 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4762
+ assert(Grafreed.clipboard.parent == null);
4763
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4764
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4765
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4766
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43174767 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
4768
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4769
+ Grafreed.clipboard.get(0).parent = keepparent;
43204770 }
43214771
43224772 ResetModel();
43234773 refreshContents();
43244774 }
43254775
4326
- void pasteInto(boolean copyit)
4776
+ void pasteInto(boolean copyit, boolean clone)
43274777 {
43284778 // if (GrafreeD.clipboard == null)
43294779 // return;
....@@ -4352,15 +4802,22 @@
43524802 if (copyit)
43534803 {
43544804 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4805
+ if (clone)
4806
+ {
4807
+ CloneClipboard(false); // sept 2014
4808
+ }
4809
+ else
4810
+ {
4811
+ paste(false);
4812
+ }
43564813 }
43574814 else
43584815 {
43594816 boolean first = true;
43604817
4361
- if (GrafreeD.clipboardIsTempGroup)
4818
+ if (Grafreed.clipboardIsTempGroup)
43624819 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
4820
+ Composite temp = (Composite)Grafreed.clipboard;
43644821 Object3D copy;
43654822 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43664823 {
....@@ -4370,7 +4827,7 @@
43704827 }
43714828 } else
43724829 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
4830
+ linkSomething(Grafreed.clipboard); //.get(0));
43744831 }
43754832 }
43764833 }
....@@ -4775,21 +5232,6 @@
47755232 }
47765233 */
47775234
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935235 /*
47945236 public void Callback(Object obj)
47955237 {
....@@ -4813,26 +5255,9 @@
48135255 }
48145256 */
48155257
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335258 String GetFile(String dialogName)
48345259 {
4835
- if (GrafreeD.standAlone)
5260
+ if (Grafreed.standAlone)
48365261 {
48375262 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385263 browser.show();
....@@ -4896,10 +5321,18 @@
48965321 cButton flashSelectionButton;
48975322 cButton editButton;
48985323 cButton uneditButton;
5324
+ JCheckBox allParamsButton;
48995325 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015326 cButton unselectButton;
49025327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
5334
+ cButton oneStepButton;
5335
+
49035336 cButton screenfitButton;
49045337 cButton screenfitpointButton;
49055338 cButton snapobjectButton;
....@@ -4910,14 +5343,6 @@
49105343 cButton closeButton;
49115344
49125345 cButton setsupportButton;
4913
-
4914
- cButton twoButton;
4915
- cButton sixButton;
4916
- cButton threeButton;
4917
- cButton sevenButton;
4918
- cButton fourButton; // full panel
4919
- cButton oneButton; // full XYZ
4920
- //cButton currentLayout;
49215346
49225347 //
49235348 //Composite
....@@ -4930,6 +5355,8 @@
49305355 private MenuItem lookFromItem;
49315356 private MenuItem switchItem;
49325357 private MenuItem cutItem;
5358
+ private MenuItem undoItem;
5359
+ private MenuItem redoItem;
49335360 private MenuItem duplicateItem;
49345361 private MenuItem cloneItem;
49355362 private MenuItem cloneSupportItem;
....@@ -4943,7 +5370,7 @@
49435370 private MenuItem linkverticesItem;
49445371 private MenuItem relinkverticesItem;
49455372 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5373
+ private MenuItem resetAllItem;
49475374 private MenuItem stepAllItem;
49485375 private MenuItem revertMeshItem;
49495376 private MenuItem poseMeshItem;
....@@ -4954,6 +5381,7 @@
49545381 private MenuItem mergeGeometriesItem;
49555382 private MenuItem copyItem;
49565383 private MenuItem pasteItem;
5384
+ private MenuItem pasteIntoItem;
49575385 private MenuItem pasteLinkItem;
49585386 private MenuItem pasteCloneItem;
49595387 private MenuItem pasteExpandItem;
....@@ -4992,6 +5420,10 @@
49925420 private MenuItem showleavesItem;
49935421 private MenuItem markleavesItem;
49945422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
49955427
49965428 private MenuItem flipVItem;
49975429 private MenuItem unflipVItem;
....@@ -5003,8 +5435,10 @@
50035435 private MenuItem panoTexturesItem;
50045436
50055437 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
5438
+ private MenuItem resetCentroidXZItem;
50075439 private MenuItem resetTransformItem;
5440
+ private MenuItem transformGeometryItem;
5441
+ private MenuItem transformChildrenItem;
50085442 private MenuItem hideItem;
50095443 private MenuItem grabItem;
50105444 private MenuItem backItem;
....@@ -5051,7 +5485,7 @@
50515485 private MenuItem blobItem;
50525486 private MenuItem latheItem;
50535487 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5488
+ private MenuItem overlayItem;
50555489 private MenuItem meshItem;
50565490 // private MenuItem meshGroupItem;
50575491 private MenuItem springItem;
....@@ -5073,11 +5507,6 @@
50735507 private MenuItem doubleItem;
50745508 private MenuItem tripleItem;
50755509
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50815510 private MenuItem computeAOItem;
50825511 private MenuItem recompileItem;
50835512 private MenuItem editScriptItem;
....@@ -5087,4 +5516,8 @@
50875516 private MenuItem analyzeItem;
50885517 private MenuItem dumpItem;
50895518 //boolean freezemodel = false;
5519
+
5520
+ Menu cameraMenu;
5521
+ MenuItem editCameraItem;
5522
+ MenuItem revertCameraItem;
50905523 }