Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +368,35 @@
262368 billboardItem.addActionListener(this);
263369 csgItem = menu.add(new MenuItem("CSG"));
264370 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266372 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268374 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +469,14 @@
341469 markleavesItem.addActionListener(this);
342470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
344480 menu.add("-");
345481 flipVItem = menu.add(new MenuItem("Flip V"));
346482 flipVItem.addActionListener(this);
....@@ -376,35 +512,40 @@
376512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377513 sortbynameItem.addActionListener(this);
378514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
379522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380523 extractGeometriesItem.addActionListener(this);
381524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382525 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
526
+ }
387527
388528 oe.menuBar.add(menu = new Menu("Insert"));
389529 buildCreateMenu(menu);
390530
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402531 oe.menuBar.add(menu = new Menu("Tools"));
403532 buildToolsMenu(menu);
404533 }
405534
406535 void SetupUI2(ObjEditor oe)
407536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
408549 //new Exception().printStackTrace();
409550
410551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
461613 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
503617 trackCB.addItemListener(this);
504618
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
507621 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
622
+
509623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510624 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515625
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
522635 flashSelectionButton.addActionListener(this);
523636
524
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525638
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
532641 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534643 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
536647 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
538650 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
540653 sevenButton.addActionListener(this);
541654 //
542655
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
544658 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
547662 closeButton.addActionListener(this);
548663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549664 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551665
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
554668 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558669
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
560672 uneditButton.addActionListener(this);
561673
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
574676 allParamsButton.addActionListener(this);
575677
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
581684 unselectButton.addActionListener(this);
582685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
583691 // oe.aConstraints.gridx += 1;
584692 // oe.aConstraints.weighty = 0;
585693 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +699,37 @@
591699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592700 // gcButton.addActionListener(this);
593701
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
605705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607707 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
612711
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
617716 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
620720 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
623724 textureCB.addItemListener(this);
624725
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
627729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
628733 //jList.addListSelectionListener(this);
629734 oe.jTree.addTreeSelectionListener(this);
630735 //jTree.setRootVisible(false);
....@@ -646,6 +751,78 @@
646751 radio.layout = sevenButton;
647752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.addItemListener(this);
812
+
813
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814
+ lookAtCB.setToolTipText("Look-at target");
815
+ lookAtCB.addItemListener(this);
816
+
817
+ }
818
+
819
+ cGridBag fill = new cGridBag();
820
+
821
+ fill.preferredHeight = 200;
822
+
823
+ panel.add(fill);
824
+
825
+ }
649826
650827 void EditObject(Object3D obj)
651828 {
....@@ -658,8 +835,11 @@
658835 buttonGroup.add(radioButton);
659836 radioButton.doClick();
660837 }
838
+
661839 void SetupViews(ObjEditor oe)
662840 {
841
+ theFrame = this;
842
+
663843 oe.SetupViews();
664844
665845 System.out.println("SetupViews");
....@@ -676,6 +856,7 @@
676856 JCheckBox fastCB;
677857 JCheckBox slowCB;
678858 JCheckBox boxCB;
859
+ JCheckBox zoomBoxCB;
679860 JCheckBox trackCB;
680861 JCheckBox smoothfocusCB;
681862 // JCheckBox speakerMocapCB;
....@@ -721,6 +902,7 @@
721902 } else if(e.getSource() == liveCB)
722903 {
723904 cameraView.ToggleLive();
905
+ refreshContents(false);
724906 }
725907 else if(e.getSource() == supportCB)
726908 {
....@@ -755,6 +937,10 @@
755937 Recompile();
756938 cameraView.repaint();
757939 // refreshContents();
940
+ }
941
+ else if(e.getSource() == zoomBoxCB)
942
+ {
943
+ cameraView.ToggleZoomBoxMode();
758944 }
759945 else if(e.getSource() == smoothfocusCB)
760946 {
....@@ -869,7 +1055,9 @@
8691055 // objEditor.DropFile((java.io.File[]) object, true);
8701056 // return;
8711057 // }
872
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731061 {
8741062 // file(s)
8751063 String[] names = string.split("\n");
....@@ -896,7 +1084,7 @@
8961084
8971085 flashIt = false;
8981086 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011089
9021090 if (group.selection.size() == 1)
....@@ -923,11 +1111,11 @@
9231111 {
9241112 loadClipboard(true);
9251113 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1114
+ pasteInto(false, false);
9271115 } else {
9281116 loadClipboard(false);
9291117 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9311119 }
9321120 }
9331121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1237,33 @@
10491237 kleinItem.addActionListener(this);
10501238 particleItem = menu.add(new MenuItem("Particle system"));
10511239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10521242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531243 ragdollItem.addActionListener(this);
10541244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551245 ragdoll2Item.addActionListener(this);
1246
+ }
10561247 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581249 meshItem.addActionListener(this);
10591250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10611254 springItem = menu.add(new MenuItem("Spring"));
10621255 springItem.addActionListener(this);
10631256 flagItem = menu.add(new MenuItem("Flag"));
10641257 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691258 blobItem = menu.add(new MenuItem("Blob"));
10701259 blobItem.addActionListener(this);
10711260 latheItem = menu.add(new MenuItem("Lathe"));
10721261 latheItem.addActionListener(this);
1262
+ }
1263
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1264
+ bezierItem.addActionListener(this);
1265
+ overlayItem = menu.add(new MenuItem("Overlay"));
1266
+ overlayItem.addActionListener(this);
10731267 lightItem = menu.add(new MenuItem("Light"));
10741268 lightItem.addActionListener(this);
10751269 menu.add("-");
....@@ -1079,39 +1273,44 @@
10791273 loopItem.addActionListener(this);
10801274 doubleItem = menu.add(new MenuItem("Fork"));
10811275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10821278 tripleItem = menu.add(new MenuItem("Trident"));
10831279 tripleItem.addActionListener(this);
1280
+ }
10841281 }
10851282
10861283 void buildToolsMenu(Menu menu)
10871284 {
10881285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891286 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
10911288
10921289 menu.add("-");
10931290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941291 parseverticesItem.addActionListener(this);
10951292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961293 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981295 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021297 reduceMorphItem.addActionListener(this);
11031298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041299 reduce34MorphItem.addActionListener(this);
1105
-
1300
+ menu.add("-");
11061301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071302 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11101309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111310 memoryItem.addActionListener(this);
11121311 menu.add(analyzeItem = new MenuItem("Analyze"));
11131312 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11151314 dumpItem.addActionListener(this);
11161315 // menu.add(pathItem = new MenuItem("From-to path"));
11171316 // pathItem.addActionListener(this);
....@@ -1129,6 +1328,7 @@
11291328 menu.add("-");
11301329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311330 editScriptItem.addActionListener(this);
1331
+ }
11321332 }
11331333
11341334 void ScreenFit()
....@@ -1251,6 +1451,7 @@
12511451 shadow.material = new cMaterial(obj.material);
12521452 shadow.material.diffuse = 0.0001f;
12531453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12541455
12551456 makeSomething(shadow);
12561457 }
....@@ -1457,9 +1658,9 @@
14571658
14581659 void Overwrite(int mask)
14591660 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611662 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14631664
14641665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651666 content = ((cGroup)content).get(0);
....@@ -1482,6 +1683,7 @@
14821683 //
14831684 public void actionPerformed(ActionEvent event) // , Object arg)
14841685 {
1686
+ Object source = event.getSource();
14851687 /*
14861688 if (event.getSource() == nameField)
14871689 {
....@@ -1493,11 +1695,11 @@
14931695 }
14941696 else
14951697 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
14971699 {
14981700 ScreenFit();
14991701 } else
1500
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
15011703 {
15021704 cVector v1 = new cVector();
15031705 cVector v2 = new cVector();
....@@ -1506,11 +1708,11 @@
15061708 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071709 objEditor.cameraView.repaint();
15081710 } else
1509
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
15101712 {
15111713 makeSomething(new Box());
15121714 } else
1513
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
15141716 {
15151717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1733,9 @@
15311733 applyExample(particleGeom, "SMOKE");
15321734 makeSomething(particleGeom);
15331735 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15351737 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371739
15381740 ragdoll.toParent = LA.newMatrix();
15391741 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1753,7 @@
15511753 } else
15521754 /*
15531755 */
1554
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15551757 {
15561758 Object3D obj = new Object3D();
15571759
....@@ -1589,31 +1791,31 @@
15891791
15901792 makeSomething(obj);
15911793 } else
1592
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
15931795 {
15941796 makeSomething(new Grid());
15951797 } else
1596
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
15971799 {
15981800 makeSomething(new Sphere());
15991801 } else
1600
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
16011803 {
16021804 makeSomething(new Cone());
16031805 } else
1604
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
16051807 {
16061808 makeSomething(new Torus());
16071809 } else
1608
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
16091811 {
16101812 makeSomething(new Superellipsoid());
16111813 } else
1612
- if (event.getSource() == kleinItem)
1814
+ if (source == kleinItem)
16131815 {
16141816 makeSomething(new Klein());
16151817 } else
1616
- if (event.getSource() == blobItem)
1818
+ if (source == blobItem)
16171819 {
16181820 Blob blob = new Blob();
16191821 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1823,15 @@
16211823 //blob.retile();
16221824 makeSomething(blob);
16231825 } else
1624
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16251827 {
16261828 makeSomething(new Lathe());
16271829 } else
1628
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16291831 {
16301832 makeSomething(new BezierSurface());
16311833 } else
1632
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16331835 {
16341836 /*
16351837 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1846,7 @@
16441846 */
16451847 makeSomething(new Checker());
16461848 } else
1647
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16481850 {
16491851 Object3D itemtomake = new Object3D();
16501852 Object3D child;
....@@ -1665,35 +1867,35 @@
16651867 makeSomething(child);
16661868 }
16671869 } else
1668
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
16691871 {
16701872 cSpring s = new cSpring();
16711873 s.setup();
16721874 makeSomething(s);
16731875 } else
1674
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
16751877 {
16761878 cSpring s = new cFlag();
16771879 s.setup();
16781880 makeSomething(s);
16791881 } else
1680
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
16811883 {
16821884 makeSomething(new Light());
16831885 } else
1684
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
16851887 {
16861888 group(new CSG());
16871889 } else
1688
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
16891891 {
16901892 group(new cTemplate());
16911893 } else
1692
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
16931895 {
16941896 makeSomething(new Attribute());
16951897 } else
1696
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
16971899 {
16981900 makeSomething(new PointFlow());
16991901 } else
....@@ -1705,7 +1907,7 @@
17051907 } else
17061908 */
17071909
1708
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
17091911 {
17101912 Composite g = new cGroup();
17111913 for (int i=0; i<15; i++)
....@@ -1727,7 +1929,7 @@
17271929
17281930 group(g);
17291931 } else
1730
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17311933 {
17321934 Composite csg = new GroupLeaf();
17331935 csg.count = 5;
....@@ -1736,7 +1938,7 @@
17361938 csg.addChild(child);
17371939 child.addChild(csg);
17381940 } else
1739
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17401942 {
17411943 Composite csg = new GroupLeaf();
17421944 csg.count = 5;
....@@ -1748,7 +1950,7 @@
17481950 csg.addChild(child);
17491951 child.addChild(csg);
17501952 } else
1751
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17521954 {
17531955 Composite csg = new GroupLeaf();
17541956 csg.count = 4;
....@@ -1763,71 +1965,83 @@
17631965 csg.addChild(child);
17641966 child.addChild(csg);
17651967 } else
1766
-
1767
- if (event.getSource() == importGFDItem)
1768
- {
1769
- ImportGFD();
1770
- } else
1771
- if (event.getSource() == importVRMLX3DItem)
1772
- {
1773
- ImportVRMLX3D();
1774
- } else
1775
- if (event.getSource() == import3DSItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1778
- } else
1779
- if (event.getSource() == importOBJItem)
1780
- {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1782
- } else
1783
- if (event.getSource() == computeAOItem)
1968
+ if (source == computeAOItem)
17841969 {
17851970 Globals.drawMode = CameraPane.OCCLUSION;
17861971 Globals.theRenderer.repaint();
17871972 } else
1788
- if (event.getSource() == recompileItem)
1973
+ if (source == recompileItem)
17891974 {
17901975 Recompile();
17911976 refreshContents();
17921977 } else
1793
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
17941979 {
17951980 OpenDialog();
17961981 refreshContents();
17971982 } else
1798
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
17991984 {
18001985 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18021987 } else
1803
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
18041989 {
18051990 //System.out.println("Invariants:");
18061991 PrintMemory();
18071992 } else
1808
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
18091994 {
18101995 PrintPath();
18111996 } else
1812
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
18131998 {
18141999 AnalyzeObject();
18152000 } else
1816
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
18172002 {
18182003 DumpObject();
18192004 } else
1820
- if (event.getSource() == screenfitButton)
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
2028
+ } else
2029
+ if (source == oneStepButton)
2030
+ {
2031
+ Globals.ONESTEP = true;
2032
+ cameraView.repaint();
2033
+ } else
2034
+ if (source == screenfitButton)
18212035 {
18222036 //Reload(lastConverter, lastFilename, true);
18232037 ScreenFit();
18242038 } else
1825
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18262040 {
18272041 //Reload(lastConverter, lastFilename, true);
18282042 ScreenFitPoint();
18292043 } else
1830
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18312045 {
18322046 //Reload(lastConverter, lastFilename, true);
18332047 SnapObject();
....@@ -1838,13 +2052,13 @@
18382052 // Recompile();
18392053 // refreshContents();
18402054 // } else
1841
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18422056 {
18432057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442058 System.gc();
18452059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18462060 } else
1847
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18482062 {
18492063 Object3D obj;
18502064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +2072,74 @@
18582072 }
18592073 refreshContents(true);
18602074 } else
1861
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18622076 {
18632077 EditSelection(true);
18642078 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
18662080 {
18672081 loadClipboard(true);
18682082 } else
1869
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
18702084 {
1871
- Object3D keep = GrafreeD.clipboard;
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
2091
+ if (source == duplicateItem)
2092
+ {
2093
+ Object3D keep = Grafreed.clipboard;
18722094 loadClipboard(false);
18732095 paste(false);
1874
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18752097 } else
1876
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
18772099 {
18782100 CloneSelection(false);
18792101 } else
1880
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
18812103 {
18822104 CloneSelection(true);
18832105 } else
1884
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
18852107 {
18862108 loadClipboard(false);
18872109 } else
1888
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
18892111 {
18902112 paste(false);
18912113 } else
1892
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
18932115 {
1894
- pasteInto(false);
2116
+ pasteInto(true, false);
18952117 } else
1896
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
18972119 {
1898
- pasteInto(true);
2120
+ pasteInto(false, false);
18992121 } else
1900
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
19012127 {
19022128 paste(true);
19032129 } else
1904
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
19052131 {
19062132 Overwrite(Object3D.TRANSFORM);
19072133 } else
1908
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
19092135 {
19102136 Overwrite(Object3D.NAME);
19112137 } else
1912
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
19132139 {
19142140 Overwrite(Object3D.UV);
19152141 } else
1916
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
19172143 {
19182144 /* july 2015
19192145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2159,7 @@
19332159
19342160 Overwrite(dropAttributes);
19352161 }
1936
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19372163 {
19382164 Overwrite(Object3D.GEOMETRY);
19392165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2176,7 @@
19502176 // refreshContents();
19512177 // }
19522178 } else
1953
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19542180 {
19552181 //if (group.selection.size() == 1)
19562182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2187,7 @@
19612187 ResetModel();
19622188 refreshContents();
19632189 } else
1964
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
19652191 {
19662192 boolean one = false;
19672193
....@@ -1988,7 +2214,7 @@
19882214 ResetModel();
19892215 refreshContents();
19902216 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
19922218 {
19932219 boolean one = false;
19942220
....@@ -2014,7 +2240,7 @@
20142240 ResetModel();
20152241 refreshContents();
20162242 } else
2017
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
20182244 {
20192245 boolean one = false;
20202246
....@@ -2044,7 +2270,7 @@
20442270 refreshContents();
20452271 }
20462272 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20482274 {
20492275 boolean one = false;
20502276
....@@ -2074,7 +2300,7 @@
20742300 ResetModel();
20752301 refreshContents();
20762302 } else
2077
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
20782304 {
20792305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802306 // {
....@@ -2087,9 +2313,9 @@
20872313 // group.selection.get(0).setMasterThis(content); // should be identity
20882314 // refreshContents();
20892315 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912317 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
20932319
20942320 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952321 content = ((cGroup)content).get(0);
....@@ -2097,38 +2323,38 @@
20972323 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982324 for (int i=0; i<group.selection.size(); i++)
20992325 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
21022328 group.selection.get(i).linkVerticesThis(content);
21032329 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21052331 }
21062332 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072333 refreshContents();
21082334 }
21092335 } else
2110
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
21112337 {
21122338 for (int i=0; i<group.selection.size(); i++)
21132339 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21162342 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21182344 }
21192345
21202346 refreshContents();
21212347 } else
2122
- if (event.getSource() == relinkverticesItem)
2348
+ if (source == relinkverticesItem)
21232349 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21262352 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21282354
21292355 refreshContents();
21302356 } else
2131
- if (event.getSource() == resetreferencesItem)
2357
+ if (source == resetreferencesItem)
21322358 {
21332359 for (int i=0; i<group.selection.size(); i++)
21342360 {
....@@ -2137,11 +2363,11 @@
21372363
21382364 refreshContents();
21392365 } else
2140
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21412367 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432369 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21452371
21462372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472373 content = ((cGroup)content).get(0);
....@@ -2150,13 +2376,13 @@
21502376 refreshContents();
21512377 }
21522378 } else
2153
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21542380 {
21552381 if (group.selection.size() == 1)
21562382 {
2157
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21582384 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21602386
21612387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622388 content = ((cGroup)content).get(0);
....@@ -2169,19 +2395,19 @@
21692395 }
21702396
21712397 } else
2172
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
21732399 {
21742400 RevertMeshes();
21752401 } else
2176
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
21772403 {
21782404 ResetAll();
21792405 } else
2180
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
21812407 {
21822408 StepAll();
21832409 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
21852411 {
21862412 //int indices[] = jList.getSelectedIndices();
21872413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2415,46 @@
21892415
21902416 ClearSelection(false);
21912417 } else
2192
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
21932419 {
21942420 ClearSelection(true);
21952421 } else
2196
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
21972423 {
21982424 group(new cGroup(), true);
21992425 } else
2200
- if (event.getSource() == hideItem)
2426
+ if (source == hideItem)
22012427 {
22022428 group(new HiddenObject());
22032429 } else
2204
- if (event.getSource() == frontItem)
2430
+ if (source == frontItem)
22052431 {
22062432 front();
22072433 } else
2208
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
22092435 {
22102436 back();
22112437 } else
2212
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
22132439 {
22142440 makeSomething(new Camera());
22152441 } else
2216
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
22172443 {
22182444 group(new Composite());
22192445 } else
2220
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
22212447 {
22222448 RandomNode random = new RandomNode();
22232449 group(random);
22242450 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22262452 } else
2227
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
22282454 {
22292455 group(new PhysicsNode());
22302456 } else
2231
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
22322458 {
22332459 for (int i=0; i<group.selection.size(); i++)
22342460 {
....@@ -2240,7 +2466,7 @@
22402466 ResetModel();
22412467 refreshContents();
22422468 } else
2243
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22442470 {
22452471 for (int i=0; i<group.selection.size(); i++)
22462472 {
....@@ -2252,7 +2478,7 @@
22522478 ResetModel();
22532479 refreshContents();
22542480 } else
2255
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22562482 {
22572483 for (int i=0; i<group.selection.size(); i++)
22582484 {
....@@ -2264,7 +2490,7 @@
22642490 ResetModel();
22652491 refreshContents();
22662492 } else
2267
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
22682494 {
22692495 for (int i=0; i<group.selection.size(); i++)
22702496 {
....@@ -2276,7 +2502,7 @@
22762502 ResetModel();
22772503 refreshContents();
22782504 } else
2279
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
22802506 {
22812507 boolean atleastone = false;
22822508
....@@ -2315,31 +2541,31 @@
23152541 }
23162542 }
23172543 } else
2318
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
23192545 {
23202546 group(new cLinker());
23212547 } else
2322
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
23232549 {
23242550 group(new TextureNode());
23252551 } else
2326
- if (event.getSource() == billboardItem)
2552
+ if (source == billboardItem)
23272553 {
23282554 group(new BillboardNode());
23292555 } else
2330
- if (event.getSource() == shadowXItem)
2556
+ if (source == shadowXItem)
23312557 {
23322558 CastShadow(0);
23332559 } else
2334
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
23352561 {
23362562 CastShadow(1);
23372563 } else
2338
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
23392565 {
23402566 CastShadow(2);
23412567 } else
2342
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23432569 {
23442570 //ungroup();
23452571 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2577,203 @@
23512577
23522578 refreshContents();
23532579 } else
2354
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23552581 {
23562582 GenUV();
23572583 } else
2358
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23592585 {
23602586 GenNormals(true);
23612587 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2588
+ if (source == genNormalsMESHItem)
23632589 {
2364
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
23652591 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2592
+ if (source == genNormalsORGANItem)
23672593 {
23682594 GenNormals(false);
23692595 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2596
+ if (source == genNormalsMINEItem)
23712597 {
23722598 GenNormalsMINE();
23732599 } else
2374
- if (event.getSource() == stripifyItem)
2600
+ if (source == stripifyItem)
23752601 {
23762602 Stripify();
23772603 } else
2378
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
23792605 {
23802606 Unstripify();
23812607 } else
2382
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
23832609 {
23842610 Trim();
23852611 } else
2386
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
23872613 {
23882614 Untrim();
23892615 } else
2390
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
23912617 {
23922618 ClearColors();
23932619 } else
2394
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
23952621 {
23962622 ClearMaterials();
23972623 } else
2398
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
23992625 {
24002626 LiveLeaves(true);
24012627 } else
2402
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
24032629 {
24042630 LiveLeaves(false);
24052631 } else
2406
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
24072633 {
24082634 SupportLeaves(true);
24092635 } else
2410
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
24112637 {
24122638 SupportLeaves(false);
24132639 } else
2414
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
24152641 {
24162642 HideLeaves(true);
24172643 } else
2418
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
24192645 {
24202646 HideLeaves(false);
24212647 } else
2422
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
24232649 {
24242650 MarkLeaves(true);
24252651 } else
2426
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
24272653 {
24282654 MarkLeaves(false);
24292655 } else
2430
- if (event.getSource() == flipVItem)
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
2671
+ } else
2672
+ if (source == flipVItem)
24312673 {
24322674 FlipV(true);
24332675 } else
2434
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
24352677 {
24362678 FlipV(false);
24372679 } else
2438
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
24392681 {
24402682 SetTexRes(0);
24412683 } else
2442
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
24432685 {
24442686 SetTexRes(1);
24452687 } else
2446
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
24472689 {
24482690 SetTexRes(2);
24492691 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
24512693 {
24522694 SetTexRes(3);
24532695 } else
2454
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
24552697 {
24562698 SetTexRes(4);
24572699 } else
2458
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24592701 {
24602702 SetTexRes(5);
24612703 } else
2462
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24632705 {
24642706 ReverseNormals();
24652707 } else
2466
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
24672709 {
24682710 ParseVertices();
24692711 } else
2470
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
24712713 {
24722714 TextureVertices();
24732715 } else
2474
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
24752717 {
24762718 Align();
24772719 } else
2478
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
24792721 {
24802722 MirrorPoses();
24812723 } else
2482
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
24832725 {
24842726 MeshReduction(false);
24852727 } else
2486
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
24872729 {
24882730 MeshReduction(true);
24892731 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
24912733 {
24922734 ReverseTriangles();
24932735 } else
2494
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
24952737 {
24962738 ReduceMesh(false);
24972739 } else
2498
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
24992741 {
25002742 ReduceMesh(true);
25012743 } else
2502
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
25032745 {
25042746 IncreaseMesh();
25052747 } else
2506
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
25072749 {
25082750 ClipMesh();
25092751 } else
2510
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
25112753 {
25122754 SmoothMesh();
25132755 } else
2514
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25152757 {
25162758 TransformGeometry();
25172759 } else
2518
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
25192765 {
25202766 ResetTransform();
25212767 } else
2522
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
25232769 {
2524
- ResetCentroid();
2770
+ ResetCentroid(true);
25252771 } else
2526
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
25272777 {
25282778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292779 {
....@@ -2533,7 +2783,7 @@
25332783
25342784 refreshContents();
25352785 } else
2536
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
25372787 {
25382788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392789 {
....@@ -2547,7 +2797,7 @@
25472797
25482798 refreshContents();
25492799 } else
2550
- if (event.getSource() == repairShadowItem)
2800
+ if (source == repairShadowItem)
25512801 {
25522802 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532803 {
....@@ -2561,7 +2811,7 @@
25612811
25622812 refreshContents();
25632813 } else
2564
- if (event.getSource() == sortbysizeItem)
2814
+ if (source == sortbysizeItem)
25652815 {
25662816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672817 {
....@@ -2573,7 +2823,7 @@
25732823 ResetModel();
25742824 refreshContents();
25752825 } else
2576
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
25772827 {
25782828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792829 {
....@@ -2585,7 +2835,7 @@
25852835 ResetModel();
25862836 refreshContents();
25872837 } else
2588
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
25892839 {
25902840 String texture = GetFile("Attach pigment");
25912841 Object3D obj;
....@@ -2597,7 +2847,7 @@
25972847
25982848 refreshContents();
25992849 } else
2600
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
26012851 {
26022852 Object3D obj;
26032853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2858,7 @@
26082858
26092859 refreshContents();
26102860 } else
2611
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
26122862 {
26132863 String texture = GetFile("Attach bump");
26142864 Object3D obj;
....@@ -2620,7 +2870,7 @@
26202870
26212871 refreshContents();
26222872 } else
2623
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
26242874 {
26252875 Object3D obj;
26262876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2881,7 @@
26312881
26322882 refreshContents();
26332883 } else
2634
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
26352885 {
26362886 Object3D obj;
26372887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2892,221 @@
26422892
26432893 refreshContents();
26442894 } else
2645
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
26462896 {
26472897 CameraPane.flash = true;
26482898 refreshContents();
26492899 } else
2650
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
26512901 {
26522902 } else
2653
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
26542904 {
26552905 radio.layout = twoButton;
26562906 // bug
26572907 //gridPanel.setDividerLocation(1.0);
26582908 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
2909
+// bigThree.remove(scenePanel);
2910
+// bigThree.remove(centralPanel);
2911
+// bigThree.remove(XYZPanel);
2912
+// aWindowConstraints.gridx = 0;
2913
+// aWindowConstraints.gridy = 0;
2914
+// aWindowConstraints.gridwidth = 1;
2915
+// // aConstraints.gridheight = 3;
2916
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2917
+// aWindowConstraints.weightx = 0;
2918
+// aWindowConstraints.weighty = 1;
2919
+// //bigThree.add(jtp, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 1;
2921
+// aWindowConstraints.gridwidth = 3;
2922
+// // aConstraints.gridheight = 3;
2923
+// aWindowConstraints.gridx = 1;
2924
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2925
+// bigThree.add(centralPanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 0;
2927
+// aWindowConstraints.gridx = 4;
2928
+// aWindowConstraints.gridwidth = 1;
2929
+// // aConstraints.gridheight = 3;
2930
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2931
+// //bigThree.add(XYZPanel, aWindowConstraints);
2932
+// scenePanel.setVisible(false);
2933
+// centralPanel.setVisible(true);
2934
+// XYZPanel.setVisible(false);
2935
+ bigThree.ClearUI();
2936
+ bigThree.add(centralPanel);
2937
+ bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
26832956 } else
2684
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
26852958 {
26862959 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2960
+
2961
+// bigThree.remove(scenePanel);
2962
+// bigThree.remove(centralPanel);
2963
+// bigThree.remove(XYZPanel);
2964
+// aWindowConstraints.gridx = 0;
2965
+// aWindowConstraints.gridy = 0;
2966
+// aWindowConstraints.gridwidth = 1;
2967
+// // aConstraints.gridheight = 3;
2968
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2969
+// aWindowConstraints.weightx = 0;
2970
+// aWindowConstraints.weighty = 1;
2971
+// //bigThree.add(jtp, aWindowConstraints);
2972
+// aWindowConstraints.weightx = 1;
2973
+// aWindowConstraints.gridwidth = 3;
2974
+// // aConstraints.gridheight = 3;
2975
+// aWindowConstraints.gridx = 1;
2976
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2977
+// bigThree.add(centralPanel, aWindowConstraints);
2978
+// aWindowConstraints.weightx = 0;
2979
+// aWindowConstraints.gridx = 4;
2980
+// aWindowConstraints.gridwidth = 1;
2981
+// // aConstraints.gridheight = 3;
2982
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2983
+// bigThree.add(XYZPanel, aWindowConstraints);
2984
+// bigThree.validate();
2985
+// scenePanel.setVisible(false);
2986
+// centralPanel.setVisible(true);
2987
+// XYZPanel.setVisible(true);
2988
+ bigThree.ClearUI();
2989
+ bigThree.add(centralPanel);
2990
+ bigThree.add(XYZPanel);
2991
+ bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
27112994 } else
2712
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
27132996 {
27142997 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2998
+
2999
+// bigThree.remove(scenePanel);
3000
+// bigThree.remove(centralPanel);
3001
+// bigThree.remove(XYZPanel);
3002
+// aWindowConstraints.gridx = 0;
3003
+// aWindowConstraints.gridy = 0;
3004
+// aWindowConstraints.gridwidth = 1;
3005
+// // aWindowConstraints.gridheight = 3;
3006
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3007
+// aWindowConstraints.weightx = 1;
3008
+// aWindowConstraints.weighty = 1;
3009
+// bigThree.add(scenePanel, aWindowConstraints);
3010
+// aWindowConstraints.weightx = 1;
3011
+// aWindowConstraints.gridwidth = 3;
3012
+// // aConstraints.gridheight = 3;
3013
+// aWindowConstraints.gridx = 1;
3014
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3015
+// //bigThree.add(cameraPanel, aWindowConstraints);
3016
+// aWindowConstraints.weightx = 0;
3017
+// aWindowConstraints.gridx = 4;
3018
+// aWindowConstraints.gridwidth = 1;
3019
+// // aWindowConstraints.gridheight = 3;
3020
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3021
+// //bigThree.add(XYZPanel, aWindowConstraints);
3022
+// bigThree.validate();
3023
+// scenePanel.setVisible(true);
3024
+// centralPanel.setVisible(false);
3025
+// XYZPanel.setVisible(false);
3026
+ bigThree.ClearUI();
3027
+ bigThree.add(scenePanel);
3028
+ bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
27393031 } else
2740
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
27413033 {
27423034 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- bigThree.revalidate();
3035
+
3036
+// bigThree.remove(scenePanel);
3037
+// bigThree.remove(centralPanel);
3038
+// bigThree.remove(XYZPanel);
3039
+// aWindowConstraints.gridx = 0;
3040
+// aWindowConstraints.gridy = 0;
3041
+// aWindowConstraints.gridwidth = 1;
3042
+// // aConstraints.gridheight = 3;
3043
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3044
+// aWindowConstraints.weightx = 0;
3045
+// aWindowConstraints.weighty = 1;
3046
+// bigThree.add(scenePanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 1;
3048
+// aWindowConstraints.gridwidth = 3;
3049
+// // aWindowConstraints.gridheight = 3;
3050
+// aWindowConstraints.gridx = 1;
3051
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3052
+// bigThree.add(centralPanel, aWindowConstraints);
3053
+// aWindowConstraints.weightx = 0;
3054
+// aWindowConstraints.gridx = 4;
3055
+// aWindowConstraints.gridwidth = 1;
3056
+// // aWindowConstraints.gridheight = 3;
3057
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3058
+// //bigThree.add(XYZPanel, aConstraints);
3059
+// bigThree.validate();
3060
+// scenePanel.setVisible(true);
3061
+// centralPanel.setVisible(true);
3062
+// XYZPanel.setVisible(false);
3063
+ bigThree.ClearUI();
3064
+ bigThree.add(scenePanel);
3065
+ bigThree.add(centralPanel);
3066
+ bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
27673069 } else
2768
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
27693071 {
27703072 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
3073
+
3074
+// bigThree.remove(scenePanel);
3075
+// bigThree.remove(centralPanel);
3076
+// bigThree.remove(XYZPanel);
3077
+// aWindowConstraints.gridx = 0;
3078
+// aWindowConstraints.gridy = 0;
3079
+// aWindowConstraints.gridwidth = 1;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3082
+// aWindowConstraints.weightx = 0;
3083
+// aWindowConstraints.weighty = 1;
3084
+// bigThree.add(scenePanel, aWindowConstraints);
3085
+// aWindowConstraints.weightx = 1;
3086
+// aWindowConstraints.gridwidth = 3;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.gridx = 1;
3089
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3090
+// bigThree.add(centralPanel, aWindowConstraints);
3091
+// aWindowConstraints.weightx = 0;
3092
+// aWindowConstraints.gridx = 4;
3093
+// aWindowConstraints.gridwidth = 1;
3094
+// // aConstraints.gridheight = 3;
3095
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3096
+// bigThree.add(XYZPanel, aWindowConstraints);
3097
+// bigThree.validate();
3098
+// scenePanel.setVisible(true);
3099
+// centralPanel.setVisible(true);
3100
+// XYZPanel.setVisible(true);
3101
+ bigThree.ClearUI();
3102
+ bigThree.add(scenePanel);
3103
+ bigThree.add(centralPanel);
3104
+ bigThree.add(XYZPanel);
3105
+ bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
27953108 } else
2796
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
27973110 {
27983111 Object3D obj;
27993112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2803,9 +3116,10 @@
28033116 EditObject(obj);
28043117 }
28053118
3119
+ cameraView.requestFocusInWindow();
28063120 refreshContents(true);
28073121 } else
2808
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
28093123 {
28103124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28113125 cRadio ab;
....@@ -2824,13 +3138,15 @@
28243138 break;
28253139 }
28263140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28273143 refreshContents(true);
28283144 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
28303146 {
28313147 EditSelection(false);
28323148 } else
2833
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
28343150 {
28353151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28363152 {
....@@ -2840,14 +3156,14 @@
28403156 child.CloseUI();
28413157 listUI.remove(child);
28423158
2843
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28443160 }
2845
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
28463162 //objEditor.jTree.clearSelection();
28473163 //objEditor.ResetSliders();
28483164 refreshContents(true);
28493165 } else
2850
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
28513167 {
28523168 assert(copy == group);
28533169 //copy.ClearUI();
....@@ -2858,7 +3174,7 @@
28583174 listUI.clear();
28593175 refreshContents(true);
28603176 } else
2861
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
28623178 {
28633179 assert(copy == group);
28643180
....@@ -2879,19 +3195,19 @@
28793195
28803196 refreshContents(true);
28813197 } else
2882
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
28833199 {
28843200 objEditor.jTree.clearSelection();
28853201 // ?? oct 2012 GrafreeD.clipboard.clear();
28863202 objEditor.ResetSliders();
28873203 refreshContents(true);
28883204 } else
2889
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
28903206 {
28913207 group.parent = keepparent;
28923208 group.attributes = 0;
28933209 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
28953211 Object3D obj = radio.GetObject();
28963212 System.out.println("Edit " + obj);
28973213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2926,7 +3242,10 @@
29263242 frontView.object = group;
29273243 sideView.object = group;
29283244 }
2929
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29303249 /*
29313250 currentLayout = radio.layout;
29323251 if (currentLayout == null)
....@@ -2938,8 +3257,23 @@
29383257 //group.parent = null; // ROOT
29393258 //group.attributes = -1;
29403259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29413262 refreshContents(true);
2942
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
29433277 else
29443278 {
29453279 //return super.action(event, arg);
....@@ -2948,7 +3282,6 @@
29483282 }
29493283
29503284 boolean useclient = false;
2951
- cRadio radio;
29523285
29533286 void ToggleRoot()
29543287 {
....@@ -3000,6 +3333,28 @@
30003333 refreshContents();
30013334 }
30023335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
30033358
30043359 void ResetTransform()
30053360 {
....@@ -3112,7 +3467,7 @@
31123467 refreshContents();
31133468 }
31143469
3115
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
31163471 {
31173472 Object3D obj;
31183473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3127,12 +3482,16 @@
31273482 LA.matIdentity(Object3D.mat);
31283483 obj.getBounds(minima, maxima, false);
31293484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3130
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31313487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31323488 obj.TransformMesh(Object3D.mat);
3489
+
31333490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3134
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31353493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31363495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31373496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31383497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3161,7 +3520,8 @@
31613520
31623521 int size = obj.MemorySize();
31633522
3164
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31653525 }
31663526 }
31673527 catch (Exception e)
....@@ -3198,9 +3558,9 @@
31983558 obj = (Object3D)e.nextElement();
31993559
32003560 System.out.println("Object is: " + obj);
3201
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
32023562 System.out.println("Boundary rep: " + obj.bRep);
3203
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
32043564
32053565 // System.err.println((size/1024) + " KB is the size of " + obj);
32063566 }
....@@ -3242,6 +3602,13 @@
32423602 void GenNormals(boolean crease)
32433603 {
32443604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32453612
32463613 refreshContents();
32473614 }
....@@ -3414,8 +3781,8 @@
34143781
34153782 void ParseVertices()
34163783 {
3417
- boolean epsequal = GrafreeD.epsequal;
3418
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34193786
34203787 for (int i=0; i<group.selection.size(); i++)
34213788 {
....@@ -3440,7 +3807,7 @@
34403807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34413808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34423809
3443
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34443811
34453812 buffer.add(g);
34463813 }
....@@ -3455,7 +3822,7 @@
34553822 makeSomething(buffer, i==group.selection.size()-1);
34563823 }
34573824
3458
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
34593826
34603827 refreshContents();
34613828 }
....@@ -3473,7 +3840,16 @@
34733840 String pigment = Object3D.GetPigment(tex);
34743841 //String bump = Object3D.GetBump(tex);
34753842
3476
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
34773853
34783854 double s = v.s;
34793855
....@@ -3561,11 +3937,11 @@
35613937
35623938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633939
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
35663942 lowres.linkVerticesThis(null);
35673943 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
35693945
35703946 System.err.flush();
35713947
....@@ -3605,7 +3981,7 @@
36053981 return;
36063982
36073983 Object3D poses = group.selection.get(0);
3608
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
36093985
36103986 Object3D newgroup = new Object3D("Po:" + poses.name);
36113987
....@@ -3799,9 +4175,9 @@
37994175
38004176 void ClipMesh()
38014177 {
3802
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38034179 {
3804
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
38054181
38064182 if (content instanceof cGroup && ((cGroup)content).transientlink )
38074183 content = ((cGroup)content).get(0);
....@@ -3810,7 +4186,7 @@
38104186 // {
38114187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38124188 // }
3813
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
38144190 }
38154191 // group.selection.ClipMesh(GrafreeD.clipboard);
38164192 System.out.println("DONE.");
....@@ -3857,6 +4233,18 @@
38574233 void MarkLeaves(boolean hide)
38584234 {
38594235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
38604248 refreshContents();
38614249 }
38624250
....@@ -3945,7 +4333,7 @@
39454333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39464334
39474335 Object3D elem = (Object3D)group.selection.elementAt(i);
3948
- if(elem != group)
4336
+ if(elem != group || !newWindow)
39494337 {
39504338 // if (!(elem instanceof Composite))
39514339 // newWindow = false;
....@@ -4035,7 +4423,6 @@
40354423 //case 702: // Event.LIST_DESELECT
40364424 group.deselectAll();
40374425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4038
- objEditor.ClearInfo(); // .GetMaterial());
40394426 if (tps != null)
40404427 {
40414428 for (int i=0; i < tps.length; i++)
....@@ -4044,29 +4431,28 @@
40444431
40454432 //if (child.parent != null)
40464433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
40474435 group.addSelectee(child);
4048
- objEditor.SetMaterial(child); // .GetMaterial());
4049
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4050
- System.err.println("info : " + child.GetPath());
40514436 }
40524437 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
40594444
4060
- objEditor.SetText(); // jan 2014
4061
-
4062
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40634446 CameraPane.flash = true;
40644447
4065
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40664449 // a camera
40674450 {
4068
- CameraPane.camerachangeframe = 0; // don't refuse it
4069
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
40704456 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40714457 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724458 }
....@@ -4079,6 +4465,26 @@
40794465
40804466 freezemodel = false;
40814467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
40824488
40834489 void linkSomething(Object3D thing)
40844490 {
....@@ -4150,16 +4556,18 @@
41504556 {
41514557 if (group.selection.isEmpty())
41524558 return;
4153
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
41544561 Composite tGroup = null;
41554562 if (group.selection.size() > 0) // 1)
41564563 {
41574564 tGroup = new cGroup();
4158
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
41594566 }
41604567
41614568 if (cut)
41624569 {
4570
+ Save();
41634571 //int indices[] = jList.getSelectedIndices();
41644572 //for (int i = indices.length - 1; i >= 0; i--)
41654573 //jList.remove(indices[i]);
....@@ -4195,16 +4603,16 @@
41954603 //System.out.println("cut " + child);
41964604 //System.out.println("parent = " + child.parent);
41974605 // tmp.addChild(child);
4198
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
41994607 tGroup.add/*Child*/(tmp);
42004608 else
4201
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
42024610 }
42034611 else
4204
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
42054613 tGroup.add/*Child*/(child);
42064614 else
4207
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
42084616 }
42094617
42104618 //ResetModel();
....@@ -4236,21 +4644,23 @@
42364644 //System.out.println("cut " + elem);
42374645 //System.out.println("parent = " + elem.parent);
42384646 // tmp.addChild(elem);
4239
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42404648 tGroup.add/*Child*/(tmp);
42414649 else
4242
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42434651 }
42444652 else
4245
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42464654 tGroup.add/*Child*/(child);
42474655 else
4248
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
42494657 }
42504658
42514659 }
4252
- if (GrafreeD.clipboardIsTempGroup)
4253
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
42544664 if (cut)
42554665 {
42564666 ResetModel();
....@@ -4264,7 +4674,7 @@
42644674 // return;
42654675 boolean first = true;
42664676
4267
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
42684678 {
42694679 Composite temp;
42704680
....@@ -4275,7 +4685,7 @@
42754685 temp = (Composite)Applet3D.clipboard.deepCopy();
42764686 */
42774687 Object3D elem;
4278
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42794689 {
42804690 Object3D child = (Object3D)e.nextElement();
42814691
....@@ -4309,21 +4719,21 @@
43094719 //Object3D cb = Applet3D.clipboard;
43104720 //temp.addChild(cb);
43114721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4312
- assert(GrafreeD.clipboard.parent == null);
4313
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4314
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4315
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4316
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43174727 else
4318
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4319
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43204730 }
43214731
43224732 ResetModel();
43234733 refreshContents();
43244734 }
43254735
4326
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43274737 {
43284738 // if (GrafreeD.clipboard == null)
43294739 // return;
....@@ -4352,15 +4762,22 @@
43524762 if (copyit)
43534763 {
43544764 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
43564773 }
43574774 else
43584775 {
43594776 boolean first = true;
43604777
4361
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
43624779 {
4363
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
43644781 Object3D copy;
43654782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43664783 {
....@@ -4370,7 +4787,7 @@
43704787 }
43714788 } else
43724789 {
4373
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
43744791 }
43754792 }
43764793 }
....@@ -4775,21 +5192,6 @@
47755192 }
47765193 */
47775194
4778
- void ImportGFD()
4779
- {
4780
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4781
- browser.show();
4782
- String filename = browser.getFile();
4783
- if (filename != null && filename.length() > 0)
4784
- {
4785
- String fullname = browser.getDirectory() + filename;
4786
-
4787
- //Object3D readobj =
4788
- objEditor.ReadGFD(fullname, objEditor);
4789
- //makeSomething(readobj);
4790
- }
4791
- }
4792
-
47935195 /*
47945196 public void Callback(Object obj)
47955197 {
....@@ -4813,26 +5215,9 @@
48135215 }
48145216 */
48155217
4816
- void ImportVRMLX3D()
4817
- {
4818
- if (GrafreeD.standAlone)
4819
- {
4820
- /**/
4821
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4822
- browser.show();
4823
- String filename = browser.getFile();
4824
- if (filename != null && filename.length() > 0)
4825
- {
4826
- String fullname = browser.getDirectory() + filename;
4827
- LoadVRMLX3D(fullname);
4828
- }
4829
- /**/
4830
- }
4831
- }
4832
-
48335218 String GetFile(String dialogName)
48345219 {
4835
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48365221 {
48375222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48385223 browser.show();
....@@ -4896,10 +5281,18 @@
48965281 cButton flashSelectionButton;
48975282 cButton editButton;
48985283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
48995285 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015286 cButton unselectButton;
49025287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
49035296 cButton screenfitButton;
49045297 cButton screenfitpointButton;
49055298 cButton snapobjectButton;
....@@ -4910,14 +5303,6 @@
49105303 cButton closeButton;
49115304
49125305 cButton setsupportButton;
4913
-
4914
- cButton twoButton;
4915
- cButton sixButton;
4916
- cButton threeButton;
4917
- cButton sevenButton;
4918
- cButton fourButton; // full panel
4919
- cButton oneButton; // full XYZ
4920
- //cButton currentLayout;
49215306
49225307 //
49235308 //Composite
....@@ -4930,6 +5315,8 @@
49305315 private MenuItem lookFromItem;
49315316 private MenuItem switchItem;
49325317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49335320 private MenuItem duplicateItem;
49345321 private MenuItem cloneItem;
49355322 private MenuItem cloneSupportItem;
....@@ -4943,7 +5330,7 @@
49435330 private MenuItem linkverticesItem;
49445331 private MenuItem relinkverticesItem;
49455332 private MenuItem setMasterItem;
4946
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
49475334 private MenuItem stepAllItem;
49485335 private MenuItem revertMeshItem;
49495336 private MenuItem poseMeshItem;
....@@ -4954,6 +5341,7 @@
49545341 private MenuItem mergeGeometriesItem;
49555342 private MenuItem copyItem;
49565343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
49575345 private MenuItem pasteLinkItem;
49585346 private MenuItem pasteCloneItem;
49595347 private MenuItem pasteExpandItem;
....@@ -4992,6 +5380,10 @@
49925380 private MenuItem showleavesItem;
49935381 private MenuItem markleavesItem;
49945382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
49955387
49965388 private MenuItem flipVItem;
49975389 private MenuItem unflipVItem;
....@@ -5003,8 +5395,10 @@
50035395 private MenuItem panoTexturesItem;
50045396
50055397 private MenuItem resetCentroidItem;
5006
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
50075399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
50085402 private MenuItem hideItem;
50095403 private MenuItem grabItem;
50105404 private MenuItem backItem;
....@@ -5051,7 +5445,7 @@
50515445 private MenuItem blobItem;
50525446 private MenuItem latheItem;
50535447 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
50555449 private MenuItem meshItem;
50565450 // private MenuItem meshGroupItem;
50575451 private MenuItem springItem;
....@@ -5073,11 +5467,6 @@
50735467 private MenuItem doubleItem;
50745468 private MenuItem tripleItem;
50755469
5076
- private MenuItem importGFDItem;
5077
- private MenuItem importVRMLX3DItem;
5078
- private MenuItem import3DSItem;
5079
- private MenuItem importOBJItem;
5080
-
50815470 private MenuItem computeAOItem;
50825471 private MenuItem recompileItem;
50835472 private MenuItem editScriptItem;
....@@ -5087,4 +5476,8 @@
50875476 private MenuItem analyzeItem;
50885477 private MenuItem dumpItem;
50895478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
50905483 }