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,176 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = 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");
442605 liveCB.addItemListener(this);
443606
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
446608 fastCB.setToolTipText("Fast mode");
447609 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
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);
515616 trackCB.setToolTipText("Enable tracking");
516617 trackCB.addItemListener(this);
517618
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520620 screenfitButton.setToolTipText("Screen fit");
521621 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
622
+
523623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524624 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530625
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
- flashSelectionButton.setToolTipText("Show selection");
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");
538635 flashSelectionButton.addActionListener(this);
539636
540
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541638
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548640 twoButton.setToolTipText("Show center view only");
549641 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551643 fourButton.addActionListener(this);
552644 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554646 sixButton.setToolTipText("2-column layout left");
555647 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557649 threeButton.setToolTipText("2-column layout right");
558650 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560652 sevenButton.setToolTipText("3-column layout");
561653 sevenButton.addActionListener(this);
562654 //
563655
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
566658 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569661 closeButton.setToolTipText("Close tab");
570662 closeButton.addActionListener(this);
571663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572664 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574665
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
577668 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581669
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
583672 uneditButton.addActionListener(this);
584673
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
597676 allParamsButton.addActionListener(this);
598677
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
604684 unselectButton.addActionListener(this);
605685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
606691 // oe.aConstraints.gridx += 1;
607692 // oe.aConstraints.weighty = 0;
608693 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +699,37 @@
614699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615700 // gcButton.addActionListener(this);
616701
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
628705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630707 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
635711
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
640716 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
643720 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
646724 textureCB.addItemListener(this);
647725
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
650729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
651733 //jList.addListSelectionListener(this);
652734 oe.jTree.addTreeSelectionListener(this);
653735 //jTree.setRootVisible(false);
....@@ -669,10 +751,102 @@
669751 radio.layout = sevenButton;
670752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
812
+ oeilCB.addItemListener(this);
813
+
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ 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
+ }
672838
673839 void EditObject(Object3D obj)
674840 {
675841 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
+
676850 radioButton.SetObject(obj);
677851 radioButton.layout = sevenButton;
678852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -681,8 +855,11 @@
681855 buttonGroup.add(radioButton);
682856 radioButton.doClick();
683857 }
858
+
684859 void SetupViews(ObjEditor oe)
685860 {
861
+ theFrame = this;
862
+
686863 oe.SetupViews();
687864
688865 System.out.println("SetupViews");
....@@ -691,23 +868,26 @@
691868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
692869 }
693870
694
- JCheckBox liveCB;
695
- JCheckBox supportCB;
696
- JCheckBox localCB;
697
- JCheckBox crowdCB;
698
- JCheckBox smoothCB;
699
- JCheckBox fastCB;
700
- JCheckBox slowCB;
701
- JCheckBox boxCB;
702
- JCheckBox zoomBoxCB;
703
- JCheckBox trackCB;
704
- 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;
705882 // JCheckBox speakerMocapCB;
706
- JCheckBox speakerCameraCB;
707
- JCheckBox speakerFocusCB;
708
- JCheckBox debugCB;
709
- JCheckBox oeilCB;
710
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
711891
712892 // static int COLOR = 1;
713893 // static int MATERIAL = 2;
....@@ -715,9 +895,9 @@
715895
716896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
717897
718
- JCheckBox colorCB;
719
- JCheckBox materialCB;
720
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
721901
722902 public void itemStateChanged(ItemEvent e)
723903 {
....@@ -745,6 +925,7 @@
745925 } else if(e.getSource() == liveCB)
746926 {
747927 cameraView.ToggleLive();
928
+ refreshContents(false);
748929 }
749930 else if(e.getSource() == supportCB)
750931 {
....@@ -808,6 +989,14 @@
808989 else if(e.getSource() == oeilCB)
809990 {
810991 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;
8111000 }
8121001 else if(e.getSource() == lookAtCB)
8131002 {
....@@ -897,7 +1086,9 @@
8971086 // objEditor.DropFile((java.io.File[]) object, true);
8981087 // return;
8991088 // }
900
- if (string.charAt(0) == '/')
1089
+
1090
+ // File path for Mac and Windows
1091
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011092 {
9021093 // file(s)
9031094 String[] names = string.split("\n");
....@@ -924,7 +1115,7 @@
9241115
9251116 flashIt = false;
9261117 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1118
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281119 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291120
9301121 if (group.selection.size() == 1)
....@@ -951,11 +1142,11 @@
9511142 {
9521143 loadClipboard(true);
9531144 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1145
+ pasteInto(false, false);
9551146 } else {
9561147 loadClipboard(false);
9571148 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1149
+ pasteInto(false, false); // true); // ???
9591150 }
9601151 }
9611152 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1268,33 @@
10771268 kleinItem.addActionListener(this);
10781269 particleItem = menu.add(new MenuItem("Particle system"));
10791270 particleItem.addActionListener(this);
1271
+ if (Globals.ADVANCED)
1272
+ {
10801273 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811274 ragdollItem.addActionListener(this);
10821275 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831276 ragdoll2Item.addActionListener(this);
1277
+ }
10841278 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1279
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861280 meshItem.addActionListener(this);
10871281 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881282 // meshGroupItem.addActionListener(this);
1283
+ if (Globals.ADVANCED)
1284
+ {
10891285 springItem = menu.add(new MenuItem("Spring"));
10901286 springItem.addActionListener(this);
10911287 flagItem = menu.add(new MenuItem("Flag"));
10921288 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971289 blobItem = menu.add(new MenuItem("Blob"));
10981290 blobItem.addActionListener(this);
10991291 latheItem = menu.add(new MenuItem("Lathe"));
11001292 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);
11011298 lightItem = menu.add(new MenuItem("Light"));
11021299 lightItem.addActionListener(this);
11031300 menu.add("-");
....@@ -1107,39 +1304,44 @@
11071304 loopItem.addActionListener(this);
11081305 doubleItem = menu.add(new MenuItem("Fork"));
11091306 doubleItem.addActionListener(this);
1307
+ if (Globals.ADVANCED)
1308
+ {
11101309 tripleItem = menu.add(new MenuItem("Trident"));
11111310 tripleItem.addActionListener(this);
1311
+ }
11121312 }
11131313
11141314 void buildToolsMenu(Menu menu)
11151315 {
11161316 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171317 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1318
+ animationItem.setState(Globals.ANIMATION);
11191319
11201320 menu.add("-");
11211321 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221322 parseverticesItem.addActionListener(this);
11231323 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241324 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1325
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261326 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291327 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301328 reduceMorphItem.addActionListener(this);
11311329 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321330 reduce34MorphItem.addActionListener(this);
1133
-
1331
+ menu.add("-");
11341332 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351333 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371334
1335
+ if (Globals.ADVANCED)
1336
+ {
1337
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1338
+ mirrorItem.addActionListener(this);
1339
+ menu.add("-");
11381340 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391341 memoryItem.addActionListener(this);
11401342 menu.add(analyzeItem = new MenuItem("Analyze"));
11411343 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
11431345 dumpItem.addActionListener(this);
11441346 // menu.add(pathItem = new MenuItem("From-to path"));
11451347 // pathItem.addActionListener(this);
....@@ -1157,6 +1359,7 @@
11571359 menu.add("-");
11581360 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591361 editScriptItem.addActionListener(this);
1362
+ }
11601363 }
11611364
11621365 void ScreenFit()
....@@ -1279,6 +1482,7 @@
12791482 shadow.material = new cMaterial(obj.material);
12801483 shadow.material.diffuse = 0.0001f;
12811484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
12821486
12831487 makeSomething(shadow);
12841488 }
....@@ -1485,9 +1689,9 @@
14851689
14861690 void Overwrite(int mask)
14871691 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1692
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891693 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1694
+ Object3D content = Grafreed.clipboard.get(0);
14911695
14921696 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931697 content = ((cGroup)content).get(0);
....@@ -1510,6 +1714,7 @@
15101714 //
15111715 public void actionPerformed(ActionEvent event) // , Object arg)
15121716 {
1717
+ Object source = event.getSource();
15131718 /*
15141719 if (event.getSource() == nameField)
15151720 {
....@@ -1521,11 +1726,11 @@
15211726 }
15221727 else
15231728 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1729
+ if (source == lookAtItem || source == lookFromItem)
15251730 {
15261731 ScreenFit();
15271732 } else
1528
- if (event.getSource() == switchItem)
1733
+ if (source == switchItem)
15291734 {
15301735 cVector v1 = new cVector();
15311736 cVector v2 = new cVector();
....@@ -1534,11 +1739,11 @@
15341739 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351740 objEditor.cameraView.repaint();
15361741 } else
1537
- if (event.getSource() == rectoidItem)
1742
+ if (source == rectoidItem)
15381743 {
15391744 makeSomething(new Box());
15401745 } else
1541
- if (event.getSource() == particleItem)
1746
+ if (source == particleItem)
15421747 {
15431748 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441749 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1764,9 @@
15591764 applyExample(particleGeom, "SMOKE");
15601765 makeSomething(particleGeom);
15611766 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1767
+ if (source == ragdollItem || source == ragdoll2Item)
15631768 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1769
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651770
15661771 ragdoll.toParent = LA.newMatrix();
15671772 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1784,7 @@
15791784 } else
15801785 /*
15811786 */
1582
- if (event.getSource() == heightFieldItem)
1787
+ if (source == heightFieldItem)
15831788 {
15841789 Object3D obj = new Object3D();
15851790
....@@ -1617,31 +1822,31 @@
16171822
16181823 makeSomething(obj);
16191824 } else
1620
- if (event.getSource() == gridItem)
1825
+ if (source == gridItem)
16211826 {
16221827 makeSomething(new Grid());
16231828 } else
1624
- if (event.getSource() == ellipsoidItem)
1829
+ if (source == ellipsoidItem)
16251830 {
16261831 makeSomething(new Sphere());
16271832 } else
1628
- if (event.getSource() == coneItem)
1833
+ if (source == coneItem)
16291834 {
16301835 makeSomething(new Cone());
16311836 } else
1632
- if (event.getSource() == torusItem)
1837
+ if (source == torusItem)
16331838 {
16341839 makeSomething(new Torus());
16351840 } else
1636
- if (event.getSource() == superItem)
1841
+ if (source == superItem)
16371842 {
16381843 makeSomething(new Superellipsoid());
16391844 } else
1640
- if (event.getSource() == kleinItem)
1845
+ if (source == kleinItem)
16411846 {
16421847 makeSomething(new Klein());
16431848 } else
1644
- if (event.getSource() == blobItem)
1849
+ if (source == blobItem)
16451850 {
16461851 Blob blob = new Blob();
16471852 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1854,15 @@
16491854 //blob.retile();
16501855 makeSomething(blob);
16511856 } else
1652
- if (event.getSource() == latheItem)
1857
+ if (source == latheItem)
16531858 {
16541859 makeSomething(new Lathe());
16551860 } else
1656
- if (event.getSource() == bezierItem)
1861
+ if (source == bezierItem)
16571862 {
16581863 makeSomething(new BezierSurface());
16591864 } else
1660
- if (event.getSource() == checkerItem)
1865
+ if (source == overlayItem)
16611866 {
16621867 /*
16631868 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1877,7 @@
16721877 */
16731878 makeSomething(new Checker());
16741879 } else
1675
- if (event.getSource() == meshItem)
1880
+ if (source == meshItem)
16761881 {
16771882 Object3D itemtomake = new Object3D();
16781883 Object3D child;
....@@ -1693,35 +1898,35 @@
16931898 makeSomething(child);
16941899 }
16951900 } else
1696
- if (event.getSource() == springItem)
1901
+ if (source == springItem)
16971902 {
16981903 cSpring s = new cSpring();
16991904 s.setup();
17001905 makeSomething(s);
17011906 } else
1702
- if (event.getSource() == flagItem)
1907
+ if (source == flagItem)
17031908 {
17041909 cSpring s = new cFlag();
17051910 s.setup();
17061911 makeSomething(s);
17071912 } else
1708
- if (event.getSource() == lightItem)
1913
+ if (source == lightItem)
17091914 {
17101915 makeSomething(new Light());
17111916 } else
1712
- if (event.getSource() == csgItem)
1917
+ if (source == csgItem)
17131918 {
17141919 group(new CSG());
17151920 } else
1716
- if (event.getSource() == templateItem)
1921
+ if (source == templateItem)
17171922 {
17181923 group(new cTemplate());
17191924 } else
1720
- if (event.getSource() == attributeItem)
1925
+ if (source == attributeItem)
17211926 {
17221927 makeSomething(new Attribute());
17231928 } else
1724
- if (event.getSource() == pointflowItem)
1929
+ if (source == pointflowItem)
17251930 {
17261931 makeSomething(new PointFlow());
17271932 } else
....@@ -1733,7 +1938,7 @@
17331938 } else
17341939 */
17351940
1736
- if (event.getSource() == superLoopItem)
1941
+ if (source == superLoopItem)
17371942 {
17381943 Composite g = new cGroup();
17391944 for (int i=0; i<15; i++)
....@@ -1755,7 +1960,7 @@
17551960
17561961 group(g);
17571962 } else
1758
- if (event.getSource() == loopItem)
1963
+ if (source == loopItem)
17591964 {
17601965 Composite csg = new GroupLeaf();
17611966 csg.count = 5;
....@@ -1764,7 +1969,7 @@
17641969 csg.addChild(child);
17651970 child.addChild(csg);
17661971 } else
1767
- if (event.getSource() == doubleItem)
1972
+ if (source == doubleItem)
17681973 {
17691974 Composite csg = new GroupLeaf();
17701975 csg.count = 5;
....@@ -1776,7 +1981,7 @@
17761981 csg.addChild(child);
17771982 child.addChild(csg);
17781983 } else
1779
- if (event.getSource() == tripleItem)
1984
+ if (source == tripleItem)
17801985 {
17811986 Composite csg = new GroupLeaf();
17821987 csg.count = 4;
....@@ -1791,71 +1996,83 @@
17911996 csg.addChild(child);
17921997 child.addChild(csg);
17931998 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
1999
+ if (source == computeAOItem)
18122000 {
18132001 Globals.drawMode = CameraPane.OCCLUSION;
18142002 Globals.theRenderer.repaint();
18152003 } else
1816
- if (event.getSource() == recompileItem)
2004
+ if (source == recompileItem)
18172005 {
18182006 Recompile();
18192007 refreshContents();
18202008 } else
1821
- if (event.getSource() == editScriptItem)
2009
+ if (source == editScriptItem)
18222010 {
18232011 OpenDialog();
18242012 refreshContents();
18252013 } else
1826
- if (event.getSource() == invariantsItem)
2014
+ if (source == invariantsItem)
18272015 {
18282016 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
2017
+ Grafreed.grafreeD.universe.invariants();
18302018 } else
1831
- if (event.getSource() == memoryItem)
2019
+ if (source == memoryItem)
18322020 {
18332021 //System.out.println("Invariants:");
18342022 PrintMemory();
18352023 } else
1836
- if (event.getSource() == pathItem)
2024
+ if (source == pathItem)
18372025 {
18382026 PrintPath();
18392027 } else
1840
- if (event.getSource() == analyzeItem)
2028
+ if (source == analyzeItem)
18412029 {
18422030 AnalyzeObject();
18432031 } else
1844
- if (event.getSource() == dumpItem)
2032
+ if (source == dumpItem)
18452033 {
18462034 DumpObject();
18472035 } else
1848
- 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)
18492066 {
18502067 //Reload(lastConverter, lastFilename, true);
18512068 ScreenFit();
18522069 } else
1853
- if (event.getSource() == screenfitpointButton)
2070
+ if (source == screenfitpointButton)
18542071 {
18552072 //Reload(lastConverter, lastFilename, true);
18562073 ScreenFitPoint();
18572074 } else
1858
- if (event.getSource() == snapobjectButton)
2075
+ if (source == snapobjectButton)
18592076 {
18602077 //Reload(lastConverter, lastFilename, true);
18612078 SnapObject();
....@@ -1866,13 +2083,13 @@
18662083 // Recompile();
18672084 // refreshContents();
18682085 // } else
1869
- if (event.getSource() == gcButton)
2086
+ if (source == gcButton)
18702087 {
18712088 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722089 System.gc();
18732090 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742091 } else
1875
- if (event.getSource() == editLeafItem)
2092
+ if (source == editLeafItem)
18762093 {
18772094 Object3D obj;
18782095 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2103,74 @@
18862103 }
18872104 refreshContents(true);
18882105 } else
1889
- if (event.getSource() == openWindowItem)
2106
+ if (source == openWindowItem)
18902107 {
18912108 EditSelection(true);
18922109 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2110
+ if (source == cutItem || source == clearButton)
18942111 {
18952112 loadClipboard(true);
18962113 } else
1897
- if (event.getSource() == duplicateItem)
2114
+ if (source == undoItem)
18982115 {
1899
- 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;
19002125 loadClipboard(false);
19012126 paste(false);
1902
- GrafreeD.clipboard = keep;
2127
+ Grafreed.clipboard = keep;
19032128 } else
1904
- if (event.getSource() == cloneItem)
2129
+ if (source == cloneItem)
19052130 {
19062131 CloneSelection(false);
19072132 } else
1908
- if (event.getSource() == cloneSupportItem)
2133
+ if (source == cloneSupportItem)
19092134 {
19102135 CloneSelection(true);
19112136 } else
1912
- if (event.getSource() == copyItem)
2137
+ if (source == copyItem)
19132138 {
19142139 loadClipboard(false);
19152140 } else
1916
- if (event.getSource() == pasteItem)
2141
+ if (source == pasteItem)
19172142 {
19182143 paste(false);
19192144 } else
1920
- if (event.getSource() == pasteLinkItem)
2145
+ if (source == pasteIntoItem)
19212146 {
1922
- pasteInto(false);
2147
+ pasteInto(true, false);
19232148 } else
1924
- if (event.getSource() == pasteCloneItem)
2149
+ if (source == pasteLinkItem)
19252150 {
1926
- pasteInto(true);
2151
+ pasteInto(false, false);
19272152 } else
1928
- if (event.getSource() == pasteExpandItem)
2153
+ if (source == pasteCloneItem)
2154
+ {
2155
+ pasteInto(true, true);
2156
+ } else
2157
+ if (source == pasteExpandItem)
19292158 {
19302159 paste(true);
19312160 } else
1932
- if (event.getSource() == synchronizeItem)
2161
+ if (source == synchronizeItem)
19332162 {
19342163 Overwrite(Object3D.TRANSFORM);
19352164 } else
1936
- if (event.getSource() == overwriteNameItem)
2165
+ if (source == overwriteNameItem)
19372166 {
19382167 Overwrite(Object3D.NAME);
19392168 } else
1940
- if (event.getSource() == overwriteUVItem)
2169
+ if (source == overwriteUVItem)
19412170 {
19422171 Overwrite(Object3D.UV);
19432172 } else
1944
- if (event.getSource() == overwriteMatItem)
2173
+ if (source == overwriteMatItem)
19452174 {
19462175 /* july 2015
19472176 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2190,7 @@
19612190
19622191 Overwrite(dropAttributes);
19632192 }
1964
- if (event.getSource() == overwriteGeoItem)
2193
+ if (source == overwriteGeoItem)
19652194 {
19662195 Overwrite(Object3D.GEOMETRY);
19672196 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2207,7 @@
19782207 // refreshContents();
19792208 // }
19802209 } else
1981
- if (event.getSource() == generateMeshItem)
2210
+ if (source == generateMeshItem)
19822211 {
19832212 //if (group.selection.size() == 1)
19842213 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2218,7 @@
19892218 ResetModel();
19902219 refreshContents();
19912220 } else
1992
- if (event.getSource() == extractGeometriesItem)
2221
+ if (source == extractGeometriesItem)
19932222 {
19942223 boolean one = false;
19952224
....@@ -2016,7 +2245,7 @@
20162245 ResetModel();
20172246 refreshContents();
20182247 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2248
+ if (source == cloneGeometriesItem)
20202249 {
20212250 boolean one = false;
20222251
....@@ -2042,7 +2271,7 @@
20422271 ResetModel();
20432272 refreshContents();
20442273 } else
2045
- if (event.getSource() == shareGeometriesItem)
2274
+ if (source == shareGeometriesItem)
20462275 {
20472276 boolean one = false;
20482277
....@@ -2072,7 +2301,7 @@
20722301 refreshContents();
20732302 }
20742303 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2304
+ if (source == mergeGeometriesItem)
20762305 {
20772306 boolean one = false;
20782307
....@@ -2102,7 +2331,7 @@
21022331 ResetModel();
21032332 refreshContents();
21042333 } else
2105
- if (event.getSource() == linkverticesItem)
2334
+ if (source == linkverticesItem)
21062335 {
21072336 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082337 // {
....@@ -2115,9 +2344,9 @@
21152344 // group.selection.get(0).setMasterThis(content); // should be identity
21162345 // refreshContents();
21172346 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2347
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192348 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21212350
21222351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232352 content = ((cGroup)content).get(0);
....@@ -2125,38 +2354,38 @@
21252354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262355 for (int i=0; i<group.selection.size(); i++)
21272356 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2357
+ boolean random = CameraPane.SWITCH;
2358
+ CameraPane.SWITCH = false; // parse all random nodes
21302359 group.selection.get(i).linkVerticesThis(content);
21312360 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2361
+ CameraPane.SWITCH = random;
21332362 }
21342363 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352364 refreshContents();
21362365 }
21372366 } else
2138
- if (event.getSource() == resetsupportItem)
2367
+ if (source == resetsupportItem)
21392368 {
21402369 for (int i=0; i<group.selection.size(); i++)
21412370 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2371
+ boolean random = CameraPane.SWITCH;
2372
+ CameraPane.SWITCH = false; // parse all random nodes
21442373 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2374
+ CameraPane.SWITCH = random;
21462375 }
21472376
21482377 refreshContents();
21492378 } else
2150
- if (event.getSource() == relinkverticesItem)
2379
+ if (source == relinkverticesItem)
21512380 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2381
+ boolean random = CameraPane.SWITCH;
2382
+ CameraPane.SWITCH = false; // parse all random nodes
21542383 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2384
+ CameraPane.SWITCH = random;
21562385
21572386 refreshContents();
21582387 } else
2159
- if (event.getSource() == resetreferencesItem)
2388
+ if (source == resetreferencesItem)
21602389 {
21612390 for (int i=0; i<group.selection.size(); i++)
21622391 {
....@@ -2165,11 +2394,11 @@
21652394
21662395 refreshContents();
21672396 } else
2168
- if (event.getSource() == setMasterItem)
2397
+ if (source == setMasterItem)
21692398 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2399
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712400 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2401
+ Object3D content = Grafreed.clipboard.get(0);
21732402
21742403 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752404 content = ((cGroup)content).get(0);
....@@ -2178,13 +2407,13 @@
21782407 refreshContents();
21792408 }
21802409 } else
2181
- if (event.getSource() == poseMeshItem)
2410
+ if (source == poseMeshItem)
21822411 {
21832412 if (group.selection.size() == 1)
21842413 {
2185
- if (GrafreeD.clipboard.size() == 1)
2414
+ if (Grafreed.clipboard.size() == 1)
21862415 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2416
+ Object3D content = Grafreed.clipboard.get(0);
21882417
21892418 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902419 content = ((cGroup)content).get(0);
....@@ -2197,19 +2426,19 @@
21972426 }
21982427
21992428 } else
2200
- if (event.getSource() == revertMeshItem)
2429
+ if (source == revertMeshItem)
22012430 {
22022431 RevertMeshes();
22032432 } else
2204
- if (event.getSource() == resetMeshItem)
2433
+ if (source == resetAllItem)
22052434 {
22062435 ResetAll();
22072436 } else
2208
- if (event.getSource() == stepAllItem)
2437
+ if (source == stepAllItem)
22092438 {
22102439 StepAll();
22112440 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2441
+ if (source == clearItem) // || event.getSource() == clearButton)
22132442 {
22142443 //int indices[] = jList.getSelectedIndices();
22152444 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2446,46 @@
22172446
22182447 ClearSelection(false);
22192448 } else
2220
- if (event.getSource() == clearAllItem)
2449
+ if (source == clearAllItem)
22212450 {
22222451 ClearSelection(true);
22232452 } else
2224
- if (event.getSource() == grabItem)
2453
+ if (source == grabItem)
22252454 {
22262455 group(new cGroup(), true);
22272456 } else
2228
- if (event.getSource() == hideItem)
2457
+ if (source == hideItem)
22292458 {
22302459 group(new HiddenObject());
22312460 } else
2232
- if (event.getSource() == frontItem)
2461
+ if (source == frontItem)
22332462 {
22342463 front();
22352464 } else
2236
- if (event.getSource() == backItem)
2465
+ if (source == backItem)
22372466 {
22382467 back();
22392468 } else
2240
- if (event.getSource() == cameraItem)
2469
+ if (source == cameraItem)
22412470 {
22422471 makeSomething(new Camera());
22432472 } else
2244
- if (event.getSource() == compositeItem)
2473
+ if (source == compositeItem)
22452474 {
22462475 group(new Composite());
22472476 } else
2248
- if (event.getSource() == randomItem)
2477
+ if (source == randomItem)
22492478 {
22502479 RandomNode random = new RandomNode();
22512480 group(random);
22522481 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2482
+ random.name = random.get(0).name + "Switch";
22542483 } else
2255
- if (event.getSource() == physicsItem)
2484
+ if (source == physicsItem)
22562485 {
22572486 group(new PhysicsNode());
22582487 } else
2259
- if (event.getSource() == frameselectorItem)
2488
+ if (source == frameselectorItem)
22602489 {
22612490 for (int i=0; i<group.selection.size(); i++)
22622491 {
....@@ -2268,7 +2497,7 @@
22682497 ResetModel();
22692498 refreshContents();
22702499 } else
2271
- if (event.getSource() == switchGeoItem)
2500
+ if (source == switchGeoItem)
22722501 {
22732502 for (int i=0; i<group.selection.size(); i++)
22742503 {
....@@ -2280,7 +2509,7 @@
22802509 ResetModel();
22812510 refreshContents();
22822511 } else
2283
- if (event.getSource() == switchTransfoItem)
2512
+ if (source == switchTransfoItem)
22842513 {
22852514 for (int i=0; i<group.selection.size(); i++)
22862515 {
....@@ -2292,7 +2521,7 @@
22922521 ResetModel();
22932522 refreshContents();
22942523 } else
2295
- if (event.getSource() == morphItem)
2524
+ if (source == morphItem)
22962525 {
22972526 for (int i=0; i<group.selection.size(); i++)
22982527 {
....@@ -2304,7 +2533,7 @@
23042533 ResetModel();
23052534 refreshContents();
23062535 } else
2307
- if (event.getSource() == scriptNodeItem)
2536
+ if (source == scriptNodeItem)
23082537 {
23092538 boolean atleastone = false;
23102539
....@@ -2343,31 +2572,31 @@
23432572 }
23442573 }
23452574 } else
2346
- if (event.getSource() == linkerItem)
2575
+ if (source == linkerItem)
23472576 {
23482577 group(new cLinker());
23492578 } else
2350
- if (event.getSource() == textureItem)
2579
+ if (source == textureItem)
23512580 {
23522581 group(new TextureNode());
23532582 } else
2354
- if (event.getSource() == billboardItem)
2583
+ if (source == billboardItem)
23552584 {
23562585 group(new BillboardNode());
23572586 } else
2358
- if (event.getSource() == shadowXItem)
2587
+ if (source == shadowXItem)
23592588 {
23602589 CastShadow(0);
23612590 } else
2362
- if (event.getSource() == shadowYItem)
2591
+ if (source == shadowYItem)
23632592 {
23642593 CastShadow(1);
23652594 } else
2366
- if (event.getSource() == shadowZItem)
2595
+ if (source == shadowZItem)
23672596 {
23682597 CastShadow(2);
23692598 } else
2370
- if (event.getSource() == ungroupItem)
2599
+ if (source == ungroupItem)
23712600 {
23722601 //ungroup();
23732602 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2608,203 @@
23792608
23802609 refreshContents();
23812610 } else
2382
- if (event.getSource() == genUVItem)
2611
+ if (source == genUVItem)
23832612 {
23842613 GenUV();
23852614 } else
2386
- if (event.getSource() == genNormalsCADItem)
2615
+ if (source == genNormalsCADItem)
23872616 {
23882617 GenNormals(true);
23892618 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2619
+ if (source == genNormalsMESHItem)
23912620 {
2392
- GenNormals(true); // TODO
2621
+ GenNormalsMESH();
23932622 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2623
+ if (source == genNormalsORGANItem)
23952624 {
23962625 GenNormals(false);
23972626 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2627
+ if (source == genNormalsMINEItem)
23992628 {
24002629 GenNormalsMINE();
24012630 } else
2402
- if (event.getSource() == stripifyItem)
2631
+ if (source == stripifyItem)
24032632 {
24042633 Stripify();
24052634 } else
2406
- if (event.getSource() == unstripifyItem)
2635
+ if (source == unstripifyItem)
24072636 {
24082637 Unstripify();
24092638 } else
2410
- if (event.getSource() == trimItem)
2639
+ if (source == trimItem)
24112640 {
24122641 Trim();
24132642 } else
2414
- if (event.getSource() == untrimItem)
2643
+ if (source == untrimItem)
24152644 {
24162645 Untrim();
24172646 } else
2418
- if (event.getSource() == clearColorsItem)
2647
+ if (source == clearColorsItem)
24192648 {
24202649 ClearColors();
24212650 } else
2422
- if (event.getSource() == clearMaterialsItem)
2651
+ if (source == clearMaterialsItem)
24232652 {
24242653 ClearMaterials();
24252654 } else
2426
- if (event.getSource() == liveleavesItem)
2655
+ if (source == liveleavesItem)
24272656 {
24282657 LiveLeaves(true);
24292658 } else
2430
- if (event.getSource() == unliveleavesItem)
2659
+ if (source == unliveleavesItem)
24312660 {
24322661 LiveLeaves(false);
24332662 } else
2434
- if (event.getSource() == supportleavesItem)
2663
+ if (source == supportleavesItem)
24352664 {
24362665 SupportLeaves(true);
24372666 } else
2438
- if (event.getSource() == unsupportleavesItem)
2667
+ if (source == unsupportleavesItem)
24392668 {
24402669 SupportLeaves(false);
24412670 } else
2442
- if (event.getSource() == hideleavesItem)
2671
+ if (source == hideleavesItem)
24432672 {
24442673 HideLeaves(true);
24452674 } else
2446
- if (event.getSource() == showleavesItem)
2675
+ if (source == showleavesItem)
24472676 {
24482677 HideLeaves(false);
24492678 } else
2450
- if (event.getSource() == markleavesItem)
2679
+ if (source == markleavesItem)
24512680 {
24522681 MarkLeaves(true);
24532682 } else
2454
- if (event.getSource() == unmarkleavesItem)
2683
+ if (source == unmarkleavesItem)
24552684 {
24562685 MarkLeaves(false);
24572686 } else
2458
- 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)
24592704 {
24602705 FlipV(true);
24612706 } else
2462
- if (event.getSource() == unflipVItem)
2707
+ if (source == unflipVItem)
24632708 {
24642709 FlipV(false);
24652710 } else
2466
- if (event.getSource() == lowTexturesItem)
2711
+ if (source == lowTexturesItem)
24672712 {
24682713 SetTexRes(0);
24692714 } else
2470
- if (event.getSource() == normalTexturesItem)
2715
+ if (source == normalTexturesItem)
24712716 {
24722717 SetTexRes(1);
24732718 } else
2474
- if (event.getSource() == highTexturesItem)
2719
+ if (source == highTexturesItem)
24752720 {
24762721 SetTexRes(2);
24772722 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2723
+ if (source == veryhighTexturesItem)
24792724 {
24802725 SetTexRes(3);
24812726 } else
2482
- if (event.getSource() == maxTexturesItem)
2727
+ if (source == maxTexturesItem)
24832728 {
24842729 SetTexRes(4);
24852730 } else
2486
- if (event.getSource() == panoTexturesItem)
2731
+ if (source == panoTexturesItem)
24872732 {
24882733 SetTexRes(5);
24892734 } else
2490
- if (event.getSource() == reverseNormalsItem)
2735
+ if (source == reverseNormalsItem)
24912736 {
24922737 ReverseNormals();
24932738 } else
2494
- if (event.getSource() == parseverticesItem)
2739
+ if (source == parseverticesItem)
24952740 {
24962741 ParseVertices();
24972742 } else
2498
- if (event.getSource() == textureFieldItem)
2743
+ if (source == textureFieldItem)
24992744 {
25002745 TextureVertices();
25012746 } else
2502
- if (event.getSource() == alignItem)
2747
+ if (source == alignItem)
25032748 {
25042749 Align();
25052750 } else
2506
- if (event.getSource() == mirrorItem)
2751
+ if (source == mirrorItem)
25072752 {
25082753 MirrorPoses();
25092754 } else
2510
- if (event.getSource() == reduceMorphItem)
2755
+ if (source == reduceMorphItem)
25112756 {
25122757 MeshReduction(false);
25132758 } else
2514
- if (event.getSource() == reduce34MorphItem)
2759
+ if (source == reduce34MorphItem)
25152760 {
25162761 MeshReduction(true);
25172762 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2763
+ if (source == reverseTrianglesItem)
25192764 {
25202765 ReverseTriangles();
25212766 } else
2522
- if (event.getSource() == reduceMeshItem)
2767
+ if (source == reduceMeshItem)
25232768 {
25242769 ReduceMesh(false);
25252770 } else
2526
- if (event.getSource() == reduce34MeshItem)
2771
+ if (source == reduce34MeshItem)
25272772 {
25282773 ReduceMesh(true);
25292774 } else
2530
- if (event.getSource() == increaseMeshItem)
2775
+ if (source == increaseMeshItem)
25312776 {
25322777 IncreaseMesh();
25332778 } else
2534
- if (event.getSource() == clipMeshItem)
2779
+ if (source == clipMeshItem)
25352780 {
25362781 ClipMesh();
25372782 } else
2538
- if (event.getSource() == smoothMeshItem)
2783
+ if (source == smoothMeshItem)
25392784 {
25402785 SmoothMesh();
25412786 } else
2542
- if (event.getSource() == transformgeometryItem)
2787
+ if (source == transformGeometryItem)
25432788 {
25442789 TransformGeometry();
25452790 } else
2546
- if (event.getSource() == resetTransformItem)
2791
+ if (source == transformChildrenItem)
2792
+ {
2793
+ TransformChildren();
2794
+ } else
2795
+ if (source == resetTransformItem)
25472796 {
25482797 ResetTransform();
25492798 } else
2550
- if (event.getSource() == resetCentroidItem)
2799
+ if (source == resetCentroidItem)
25512800 {
2552
- ResetCentroid();
2801
+ ResetCentroid(true);
25532802 } else
2554
- if (event.getSource() == resetParentItem)
2803
+ if (source == resetCentroidXZItem)
2804
+ {
2805
+ ResetCentroid(false);
2806
+ } else
2807
+ if (source == resetParentItem)
25552808 {
25562809 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572810 {
....@@ -2561,7 +2814,7 @@
25612814
25622815 refreshContents();
25632816 } else
2564
- if (event.getSource() == repairParentItem)
2817
+ if (source == repairParentItem)
25652818 {
25662819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672820 {
....@@ -2575,7 +2828,7 @@
25752828
25762829 refreshContents();
25772830 } else
2578
- if (event.getSource() == repairShadowItem)
2831
+ if (source == repairShadowItem)
25792832 {
25802833 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812834 {
....@@ -2589,7 +2842,7 @@
25892842
25902843 refreshContents();
25912844 } else
2592
- if (event.getSource() == sortbysizeItem)
2845
+ if (source == sortbysizeItem)
25932846 {
25942847 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952848 {
....@@ -2601,7 +2854,7 @@
26012854 ResetModel();
26022855 refreshContents();
26032856 } else
2604
- if (event.getSource() == sortbynameItem)
2857
+ if (source == sortbynameItem)
26052858 {
26062859 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072860 {
....@@ -2613,7 +2866,7 @@
26132866 ResetModel();
26142867 refreshContents();
26152868 } else
2616
- if (event.getSource() == attachPigmentItem)
2869
+ if (source == attachPigmentItem)
26172870 {
26182871 String texture = GetFile("Attach pigment");
26192872 Object3D obj;
....@@ -2625,7 +2878,7 @@
26252878
26262879 refreshContents();
26272880 } else
2628
- if (event.getSource() == detachPigmentItem)
2881
+ if (source == detachPigmentItem)
26292882 {
26302883 Object3D obj;
26312884 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2889,7 @@
26362889
26372890 refreshContents();
26382891 } else
2639
- if (event.getSource() == attachBumpItem)
2892
+ if (source == attachBumpItem)
26402893 {
26412894 String texture = GetFile("Attach bump");
26422895 Object3D obj;
....@@ -2648,7 +2901,7 @@
26482901
26492902 refreshContents();
26502903 } else
2651
- if (event.getSource() == detachBumpItem)
2904
+ if (source == detachBumpItem)
26522905 {
26532906 Object3D obj;
26542907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2912,7 @@
26592912
26602913 refreshContents();
26612914 } else
2662
- if (event.getSource() == pigmentBumpItem)
2915
+ if (source == pigmentBumpItem)
26632916 {
26642917 Object3D obj;
26652918 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2923,221 @@
26702923
26712924 refreshContents();
26722925 } else
2673
- if (event.getSource() == flashSelectionButton)
2926
+ if (source == flashSelectionButton)
26742927 {
26752928 CameraPane.flash = true;
26762929 refreshContents();
26772930 } else
2678
- if (event.getSource() == oneButton)
2931
+ if (source == oneButton)
26792932 {
26802933 } else
2681
- if (event.getSource() == twoButton)
2934
+ if (source == twoButton)
26822935 {
26832936 radio.layout = twoButton;
26842937 // bug
26852938 //gridPanel.setDividerLocation(1.0);
26862939 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
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
+
27112987 } else
2712
- if (event.getSource() == threeButton)
2988
+ if (source == threeButton)
27132989 {
27142990 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
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();
27393025 } else
2740
- if (event.getSource() == fourButton)
3026
+ if (source == fourButton)
27413027 {
27423028 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
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();
27673062 } else
2768
- if (event.getSource() == sixButton)
3063
+ if (source == sixButton)
27693064 {
27703065 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
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();
27953100 } else
2796
- if (event.getSource() == sevenButton)
3101
+ if (source == sevenButton)
27973102 {
27983103 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
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();
28233139 } else
2824
- if (event.getSource() == rootButton)
3140
+ if (source == rootButton)
28253141 {
28263142 Object3D obj;
28273143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2831,34 +3147,44 @@
28313147 EditObject(obj);
28323148 }
28333149
3150
+ cameraView.requestFocusInWindow();
28343151 refreshContents(true);
28353152 } else
2836
- if (event.getSource() == closeButton)
3153
+ if (source == closeButton)
28373154 {
28383155 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393156 cRadio ab;
28403157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28413158 {
28423159 ab = (cRadio)e.nextElement();
2843
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28443161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
28453168 buttonGroup.remove(ab);
28463169 radioPanel.remove(ab);
28473170
2848
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
28493173 // ab.GetObject().objectUI = null; // ?????????
28503174
28513175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28523176 break;
28533177 }
28543178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
28553181 refreshContents(true);
28563182 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3183
+ if (source == editItem || source == editButton)
28583184 {
28593185 EditSelection(false);
28603186 } else
2861
- if (event.getSource() == uneditButton)
3187
+ if (source == uneditButton)
28623188 {
28633189 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643190 {
....@@ -2868,14 +3194,14 @@
28683194 child.CloseUI();
28693195 listUI.remove(child);
28703196
2871
- child.editWindow = null; // ???????????
3197
+ //child.editWindow = null; // ???????????
28723198 }
2873
- objEditor.ctrlPanel.revalidate();
3199
+ objEditor.ctrlPanel.FlushUI();
28743200 //objEditor.jTree.clearSelection();
28753201 //objEditor.ResetSliders();
28763202 refreshContents(true);
28773203 } else
2878
- if (event.getSource() == clearPanelButton)
3204
+ if (source == clearPanelButton)
28793205 {
28803206 assert(copy == group);
28813207 //copy.ClearUI();
....@@ -2886,7 +3212,7 @@
28863212 listUI.clear();
28873213 refreshContents(true);
28883214 } else
2889
- if (event.getSource() == allParamsButton)
3215
+ if (source == allParamsButton)
28903216 {
28913217 assert(copy == group);
28923218
....@@ -2907,19 +3233,19 @@
29073233
29083234 refreshContents(true);
29093235 } else
2910
- if (event.getSource() == unselectButton)
3236
+ if (source == unselectButton)
29113237 {
29123238 objEditor.jTree.clearSelection();
29133239 // ?? oct 2012 GrafreeD.clipboard.clear();
29143240 objEditor.ResetSliders();
29153241 refreshContents(true);
29163242 } else
2917
- if(event.getSource() instanceof cRadio)
3243
+ if(source instanceof cRadio)
29183244 {
29193245 group.parent = keepparent;
29203246 group.attributes = 0;
29213247 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3248
+ /*cRadio*/ radio = (cRadio)source;
29233249 Object3D obj = radio.GetObject();
29243250 System.out.println("Edit " + obj);
29253251 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3280,11 @@
29543280 frontView.object = group;
29553281 sideView.object = group;
29563282 }
2957
- group.editWindow = this;
3283
+
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
3287
+
29583288 /*
29593289 currentLayout = radio.layout;
29603290 if (currentLayout == null)
....@@ -2966,8 +3296,23 @@
29663296 //group.parent = null; // ROOT
29673297 //group.attributes = -1;
29683298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
29693301 refreshContents(true);
2970
- }
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
+ }
29713316 else
29723317 {
29733318 //return super.action(event, arg);
....@@ -2976,7 +3321,6 @@
29763321 }
29773322
29783323 boolean useclient = false;
2979
- cRadio radio;
29803324
29813325 void ToggleRoot()
29823326 {
....@@ -3028,6 +3372,28 @@
30283372 refreshContents();
30293373 }
30303374
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
+ }
30313397
30323398 void ResetTransform()
30333399 {
....@@ -3140,7 +3506,7 @@
31403506 refreshContents();
31413507 }
31423508
3143
- void ResetCentroid()
3509
+ void ResetCentroid(boolean full)
31443510 {
31453511 Object3D obj;
31463512 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3521,16 @@
31553521 LA.matIdentity(Object3D.mat);
31563522 obj.getBounds(minima, maxima, false);
31573523 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3524
+ if (full)
3525
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593526 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603527 obj.TransformMesh(Object3D.mat);
3528
+
31613529 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3530
+ if (full)
3531
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633532 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3533
+
31643534 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653535 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663536 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3559,8 @@
31893559
31903560 int size = obj.MemorySize();
31913561
3192
- 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)");
31933564 }
31943565 }
31953566 catch (Exception e)
....@@ -3226,9 +3597,9 @@
32263597 obj = (Object3D)e.nextElement();
32273598
32283599 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3600
+ Grafreed.AnalyzeObject(obj);
32303601 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3602
+ Grafreed.AnalyzeObject(obj.bRep);
32323603
32333604 // System.err.println((size/1024) + " KB is the size of " + obj);
32343605 }
....@@ -3270,6 +3641,13 @@
32703641 void GenNormals(boolean crease)
32713642 {
32723643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
32733651
32743652 refreshContents();
32753653 }
....@@ -3442,8 +3820,8 @@
34423820
34433821 void ParseVertices()
34443822 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3823
+ boolean epsequal = Grafreed.epsequal;
3824
+ Grafreed.epsequal = true;
34473825
34483826 for (int i=0; i<group.selection.size(); i++)
34493827 {
....@@ -3468,7 +3846,7 @@
34683846 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693847 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703848
3471
- g.add(GrafreeD.clipboard);
3849
+ g.add(Grafreed.clipboard);
34723850
34733851 buffer.add(g);
34743852 }
....@@ -3483,7 +3861,7 @@
34833861 makeSomething(buffer, i==group.selection.size()-1);
34843862 }
34853863
3486
- GrafreeD.epsequal = epsequal;
3864
+ Grafreed.epsequal = epsequal;
34873865
34883866 refreshContents();
34893867 }
....@@ -3501,7 +3879,16 @@
35013879 String pigment = Object3D.GetPigment(tex);
35023880 //String bump = Object3D.GetBump(tex);
35033881
3504
- 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
+ }
35053892
35063893 double s = v.s;
35073894
....@@ -3589,11 +3976,11 @@
35893976
35903977 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913978
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3979
+ boolean random = CameraPane.SWITCH;
3980
+ CameraPane.SWITCH = false; // parse all random nodes
35943981 lowres.linkVerticesThis(null);
35953982 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3983
+ CameraPane.SWITCH = random;
35973984
35983985 System.err.flush();
35993986
....@@ -3633,7 +4020,7 @@
36334020 return;
36344021
36354022 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
4023
+ Object3D ref = Grafreed.clipboard.get(0);
36374024
36384025 Object3D newgroup = new Object3D("Po:" + poses.name);
36394026
....@@ -3827,9 +4214,9 @@
38274214
38284215 void ClipMesh()
38294216 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4217
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314218 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4219
+ Object3D content = Grafreed.clipboard.get(0);
38334220
38344221 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354222 content = ((cGroup)content).get(0);
....@@ -3838,7 +4225,7 @@
38384225 // {
38394226 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404227 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4228
+ group.selection.ClipMesh(Grafreed.clipboard);
38424229 }
38434230 // group.selection.ClipMesh(GrafreeD.clipboard);
38444231 System.out.println("DONE.");
....@@ -3885,6 +4272,18 @@
38854272 void MarkLeaves(boolean hide)
38864273 {
38874274 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);
38884287 refreshContents();
38894288 }
38904289
....@@ -3973,7 +4372,7 @@
39734372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744373
39754374 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4375
+ if(elem != group || !newWindow)
39774376 {
39784377 // if (!(elem instanceof Composite))
39794378 // newWindow = false;
....@@ -4063,7 +4462,6 @@
40634462 //case 702: // Event.LIST_DESELECT
40644463 group.deselectAll();
40654464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674465 if (tps != null)
40684466 {
40694467 for (int i=0; i < tps.length; i++)
....@@ -4072,29 +4470,28 @@
40724470
40734471 //if (child.parent != null)
40744472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
40754474 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794475 }
40804476 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4477
+// else
4478
+// {
4479
+// objEditor.SetMaterial(group); // .GetMaterial());
4480
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4481
+// System.err.println("info : " + group.GetPath());
4482
+// }
40874483
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- 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))
40914485 CameraPane.flash = true;
40924486
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4487
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944488 // a camera
40954489 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- 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
+ }
40984495 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994496 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004497 }
....@@ -4107,6 +4504,26 @@
41074504
41084505 freezemodel = false;
41094506 }
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
+ }
41104527
41114528 void linkSomething(Object3D thing)
41124529 {
....@@ -4178,16 +4595,19 @@
41784595 {
41794596 if (group.selection.isEmpty())
41804597 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4598
+
4599
+ Grafreed.clipboardIsTempGroup = false;
41824600 Composite tGroup = null;
41834601 if (group.selection.size() > 0) // 1)
41844602 {
41854603 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4604
+ Grafreed.clipboardIsTempGroup = true;
41874605 }
41884606
41894607 if (cut)
41904608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
41914611 //int indices[] = jList.getSelectedIndices();
41924612 //for (int i = indices.length - 1; i >= 0; i--)
41934613 //jList.remove(indices[i]);
....@@ -4223,16 +4643,16 @@
42234643 //System.out.println("cut " + child);
42244644 //System.out.println("parent = " + child.parent);
42254645 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4646
+ if (Grafreed.clipboardIsTempGroup)
42274647 tGroup.add/*Child*/(tmp);
42284648 else
4229
- GrafreeD.clipboard = tmp;
4649
+ Grafreed.clipboard = tmp;
42304650 }
42314651 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
42334653 tGroup.add/*Child*/(child);
42344654 else
4235
- GrafreeD.clipboard = child;
4655
+ Grafreed.clipboard = child;
42364656 }
42374657
42384658 //ResetModel();
....@@ -4264,21 +4684,23 @@
42644684 //System.out.println("cut " + elem);
42654685 //System.out.println("parent = " + elem.parent);
42664686 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4687
+ if (Grafreed.clipboardIsTempGroup)
42684688 tGroup.add/*Child*/(tmp);
42694689 else
4270
- GrafreeD.clipboard = tmp;
4690
+ Grafreed.clipboard = tmp;
42714691 }
42724692 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4693
+ if (Grafreed.clipboardIsTempGroup)
42744694 tGroup.add/*Child*/(child);
42754695 else
4276
- GrafreeD.clipboard = child;
4696
+ Grafreed.clipboard = child;
42774697 }
42784698
42794699 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4700
+
4701
+ if (Grafreed.clipboardIsTempGroup)
4702
+ Grafreed.clipboard = tGroup;
4703
+
42824704 if (cut)
42834705 {
42844706 ResetModel();
....@@ -4292,7 +4714,7 @@
42924714 // return;
42934715 boolean first = true;
42944716
4295
- if (GrafreeD.clipboardIsTempGroup)
4717
+ if (Grafreed.clipboardIsTempGroup)
42964718 {
42974719 Composite temp;
42984720
....@@ -4303,7 +4725,7 @@
43034725 temp = (Composite)Applet3D.clipboard.deepCopy();
43044726 */
43054727 Object3D elem;
4306
- 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))
43074729 {
43084730 Object3D child = (Object3D)e.nextElement();
43094731
....@@ -4337,21 +4759,21 @@
43374759 //Object3D cb = Applet3D.clipboard;
43384760 //temp.addChild(cb);
43394761 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
43454767 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4768
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4769
+ Grafreed.clipboard.get(0).parent = keepparent;
43484770 }
43494771
43504772 ResetModel();
43514773 refreshContents();
43524774 }
43534775
4354
- void pasteInto(boolean copyit)
4776
+ void pasteInto(boolean copyit, boolean clone)
43554777 {
43564778 // if (GrafreeD.clipboard == null)
43574779 // return;
....@@ -4380,15 +4802,22 @@
43804802 if (copyit)
43814803 {
43824804 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4805
+ if (clone)
4806
+ {
4807
+ CloneClipboard(false); // sept 2014
4808
+ }
4809
+ else
4810
+ {
4811
+ paste(false);
4812
+ }
43844813 }
43854814 else
43864815 {
43874816 boolean first = true;
43884817
4389
- if (GrafreeD.clipboardIsTempGroup)
4818
+ if (Grafreed.clipboardIsTempGroup)
43904819 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4820
+ Composite temp = (Composite)Grafreed.clipboard;
43924821 Object3D copy;
43934822 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944823 {
....@@ -4398,7 +4827,7 @@
43984827 }
43994828 } else
44004829 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4830
+ linkSomething(Grafreed.clipboard); //.get(0));
44024831 }
44034832 }
44044833 }
....@@ -4803,21 +5232,6 @@
48035232 }
48045233 */
48055234
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215235 /*
48225236 public void Callback(Object obj)
48235237 {
....@@ -4841,26 +5255,9 @@
48415255 }
48425256 */
48435257
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615258 String GetFile(String dialogName)
48625259 {
4863
- if (GrafreeD.standAlone)
5260
+ if (Grafreed.standAlone)
48645261 {
48655262 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665263 browser.show();
....@@ -4924,10 +5321,18 @@
49245321 cButton flashSelectionButton;
49255322 cButton editButton;
49265323 cButton uneditButton;
5324
+ JCheckBox allParamsButton;
49275325 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295326 cButton unselectButton;
49305327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
5334
+ cButton oneStepButton;
5335
+
49315336 cButton screenfitButton;
49325337 cButton screenfitpointButton;
49335338 cButton snapobjectButton;
....@@ -4938,14 +5343,6 @@
49385343 cButton closeButton;
49395344
49405345 cButton setsupportButton;
4941
-
4942
- cButton twoButton;
4943
- cButton sixButton;
4944
- cButton threeButton;
4945
- cButton sevenButton;
4946
- cButton fourButton; // full panel
4947
- cButton oneButton; // full XYZ
4948
- //cButton currentLayout;
49495346
49505347 //
49515348 //Composite
....@@ -4958,6 +5355,8 @@
49585355 private MenuItem lookFromItem;
49595356 private MenuItem switchItem;
49605357 private MenuItem cutItem;
5358
+ private MenuItem undoItem;
5359
+ private MenuItem redoItem;
49615360 private MenuItem duplicateItem;
49625361 private MenuItem cloneItem;
49635362 private MenuItem cloneSupportItem;
....@@ -4971,7 +5370,7 @@
49715370 private MenuItem linkverticesItem;
49725371 private MenuItem relinkverticesItem;
49735372 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5373
+ private MenuItem resetAllItem;
49755374 private MenuItem stepAllItem;
49765375 private MenuItem revertMeshItem;
49775376 private MenuItem poseMeshItem;
....@@ -4982,6 +5381,7 @@
49825381 private MenuItem mergeGeometriesItem;
49835382 private MenuItem copyItem;
49845383 private MenuItem pasteItem;
5384
+ private MenuItem pasteIntoItem;
49855385 private MenuItem pasteLinkItem;
49865386 private MenuItem pasteCloneItem;
49875387 private MenuItem pasteExpandItem;
....@@ -5020,6 +5420,10 @@
50205420 private MenuItem showleavesItem;
50215421 private MenuItem markleavesItem;
50225422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
50235427
50245428 private MenuItem flipVItem;
50255429 private MenuItem unflipVItem;
....@@ -5031,8 +5435,10 @@
50315435 private MenuItem panoTexturesItem;
50325436
50335437 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5438
+ private MenuItem resetCentroidXZItem;
50355439 private MenuItem resetTransformItem;
5440
+ private MenuItem transformGeometryItem;
5441
+ private MenuItem transformChildrenItem;
50365442 private MenuItem hideItem;
50375443 private MenuItem grabItem;
50385444 private MenuItem backItem;
....@@ -5079,7 +5485,7 @@
50795485 private MenuItem blobItem;
50805486 private MenuItem latheItem;
50815487 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5488
+ private MenuItem overlayItem;
50835489 private MenuItem meshItem;
50845490 // private MenuItem meshGroupItem;
50855491 private MenuItem springItem;
....@@ -5101,11 +5507,6 @@
51015507 private MenuItem doubleItem;
51025508 private MenuItem tripleItem;
51035509
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095510 private MenuItem computeAOItem;
51105511 private MenuItem recompileItem;
51115512 private MenuItem editScriptItem;
....@@ -5115,4 +5516,8 @@
51155516 private MenuItem analyzeItem;
51165517 private MenuItem dumpItem;
51175518 //boolean freezemodel = false;
5519
+
5520
+ Menu cameraMenu;
5521
+ MenuItem editCameraItem;
5522
+ MenuItem revertCameraItem;
51185523 }