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,176 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
442605 liveCB.addItemListener(this);
443606
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446612 fastCB.setToolTipText("Fast mode");
447613 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
515616 trackCB.setToolTipText("Enable tracking");
516617 trackCB.addItemListener(this);
517618
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520620 screenfitButton.setToolTipText("Screen fit");
521621 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
622
+
523623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524624 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530625
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
537634 flashSelectionButton.setToolTipText("Show selection");
538635 flashSelectionButton.addActionListener(this);
539636
540
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541638
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548640 twoButton.setToolTipText("Show center view only");
549641 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551643 fourButton.addActionListener(this);
552644 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554646 sixButton.setToolTipText("2-column layout left");
555647 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557649 threeButton.setToolTipText("2-column layout right");
558650 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560652 sevenButton.setToolTipText("3-column layout");
561653 sevenButton.addActionListener(this);
562654 //
563655
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
566658 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569661 closeButton.setToolTipText("Close tab");
570662 closeButton.addActionListener(this);
571663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572664 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574665
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
577668 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581669
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
583672 uneditButton.addActionListener(this);
584673
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
597676 allParamsButton.addActionListener(this);
598677
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
604684 unselectButton.addActionListener(this);
605685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
606691 // oe.aConstraints.gridx += 1;
607692 // oe.aConstraints.weighty = 0;
608693 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +699,37 @@
614699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615700 // gcButton.addActionListener(this);
616701
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
628705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630707 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
635711
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
640716 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
643720 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
646724 textureCB.addItemListener(this);
647725
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
650729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
651733 //jList.addListSelectionListener(this);
652734 oe.jTree.addTreeSelectionListener(this);
653735 //jTree.setRootVisible(false);
....@@ -669,6 +751,78 @@
669751 radio.layout = sevenButton;
670752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.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
+ }
672826
673827 void EditObject(Object3D obj)
674828 {
....@@ -681,8 +835,11 @@
681835 buttonGroup.add(radioButton);
682836 radioButton.doClick();
683837 }
838
+
684839 void SetupViews(ObjEditor oe)
685840 {
841
+ theFrame = this;
842
+
686843 oe.SetupViews();
687844
688845 System.out.println("SetupViews");
....@@ -745,6 +902,7 @@
745902 } else if(e.getSource() == liveCB)
746903 {
747904 cameraView.ToggleLive();
905
+ refreshContents(false);
748906 }
749907 else if(e.getSource() == supportCB)
750908 {
....@@ -897,7 +1055,9 @@
8971055 // objEditor.DropFile((java.io.File[]) object, true);
8981056 // return;
8991057 // }
900
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011061 {
9021062 // file(s)
9031063 String[] names = string.split("\n");
....@@ -924,7 +1084,7 @@
9241084
9251085 flashIt = false;
9261086 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291089
9301090 if (group.selection.size() == 1)
....@@ -951,11 +1111,11 @@
9511111 {
9521112 loadClipboard(true);
9531113 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
1114
+ pasteInto(false, false);
9551115 } else {
9561116 loadClipboard(false);
9571117 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9591119 }
9601120 }
9611121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1237,33 @@
10771237 kleinItem.addActionListener(this);
10781238 particleItem = menu.add(new MenuItem("Particle system"));
10791239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10801242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811243 ragdollItem.addActionListener(this);
10821244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831245 ragdoll2Item.addActionListener(this);
1246
+ }
10841247 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861249 meshItem.addActionListener(this);
10871250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10891254 springItem = menu.add(new MenuItem("Spring"));
10901255 springItem.addActionListener(this);
10911256 flagItem = menu.add(new MenuItem("Flag"));
10921257 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971258 blobItem = menu.add(new MenuItem("Blob"));
10981259 blobItem.addActionListener(this);
10991260 latheItem = menu.add(new MenuItem("Lathe"));
11001261 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);
11011267 lightItem = menu.add(new MenuItem("Light"));
11021268 lightItem.addActionListener(this);
11031269 menu.add("-");
....@@ -1107,39 +1273,44 @@
11071273 loopItem.addActionListener(this);
11081274 doubleItem = menu.add(new MenuItem("Fork"));
11091275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
11101278 tripleItem = menu.add(new MenuItem("Trident"));
11111279 tripleItem.addActionListener(this);
1280
+ }
11121281 }
11131282
11141283 void buildToolsMenu(Menu menu)
11151284 {
11161285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171286 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
11191288
11201289 menu.add("-");
11211290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221291 parseverticesItem.addActionListener(this);
11231292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241293 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261295 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301297 reduceMorphItem.addActionListener(this);
11311298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321299 reduce34MorphItem.addActionListener(this);
1133
-
1300
+ menu.add("-");
11341301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351302 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11381309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391310 memoryItem.addActionListener(this);
11401311 menu.add(analyzeItem = new MenuItem("Analyze"));
11411312 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11431314 dumpItem.addActionListener(this);
11441315 // menu.add(pathItem = new MenuItem("From-to path"));
11451316 // pathItem.addActionListener(this);
....@@ -1157,6 +1328,7 @@
11571328 menu.add("-");
11581329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591330 editScriptItem.addActionListener(this);
1331
+ }
11601332 }
11611333
11621334 void ScreenFit()
....@@ -1279,6 +1451,7 @@
12791451 shadow.material = new cMaterial(obj.material);
12801452 shadow.material.diffuse = 0.0001f;
12811453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12821455
12831456 makeSomething(shadow);
12841457 }
....@@ -1485,9 +1658,9 @@
14851658
14861659 void Overwrite(int mask)
14871660 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891662 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14911664
14921665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931666 content = ((cGroup)content).get(0);
....@@ -1510,6 +1683,7 @@
15101683 //
15111684 public void actionPerformed(ActionEvent event) // , Object arg)
15121685 {
1686
+ Object source = event.getSource();
15131687 /*
15141688 if (event.getSource() == nameField)
15151689 {
....@@ -1521,11 +1695,11 @@
15211695 }
15221696 else
15231697 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
15251699 {
15261700 ScreenFit();
15271701 } else
1528
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
15291703 {
15301704 cVector v1 = new cVector();
15311705 cVector v2 = new cVector();
....@@ -1534,11 +1708,11 @@
15341708 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351709 objEditor.cameraView.repaint();
15361710 } else
1537
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
15381712 {
15391713 makeSomething(new Box());
15401714 } else
1541
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
15421716 {
15431717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1733,9 @@
15591733 applyExample(particleGeom, "SMOKE");
15601734 makeSomething(particleGeom);
15611735 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15631737 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651739
15661740 ragdoll.toParent = LA.newMatrix();
15671741 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1753,7 @@
15791753 } else
15801754 /*
15811755 */
1582
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15831757 {
15841758 Object3D obj = new Object3D();
15851759
....@@ -1617,31 +1791,31 @@
16171791
16181792 makeSomething(obj);
16191793 } else
1620
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
16211795 {
16221796 makeSomething(new Grid());
16231797 } else
1624
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
16251799 {
16261800 makeSomething(new Sphere());
16271801 } else
1628
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
16291803 {
16301804 makeSomething(new Cone());
16311805 } else
1632
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
16331807 {
16341808 makeSomething(new Torus());
16351809 } else
1636
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
16371811 {
16381812 makeSomething(new Superellipsoid());
16391813 } else
1640
- if (event.getSource() == kleinItem)
1814
+ if (source == kleinItem)
16411815 {
16421816 makeSomething(new Klein());
16431817 } else
1644
- if (event.getSource() == blobItem)
1818
+ if (source == blobItem)
16451819 {
16461820 Blob blob = new Blob();
16471821 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1823,15 @@
16491823 //blob.retile();
16501824 makeSomething(blob);
16511825 } else
1652
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16531827 {
16541828 makeSomething(new Lathe());
16551829 } else
1656
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16571831 {
16581832 makeSomething(new BezierSurface());
16591833 } else
1660
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16611835 {
16621836 /*
16631837 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1846,7 @@
16721846 */
16731847 makeSomething(new Checker());
16741848 } else
1675
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16761850 {
16771851 Object3D itemtomake = new Object3D();
16781852 Object3D child;
....@@ -1693,35 +1867,35 @@
16931867 makeSomething(child);
16941868 }
16951869 } else
1696
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
16971871 {
16981872 cSpring s = new cSpring();
16991873 s.setup();
17001874 makeSomething(s);
17011875 } else
1702
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
17031877 {
17041878 cSpring s = new cFlag();
17051879 s.setup();
17061880 makeSomething(s);
17071881 } else
1708
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
17091883 {
17101884 makeSomething(new Light());
17111885 } else
1712
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
17131887 {
17141888 group(new CSG());
17151889 } else
1716
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
17171891 {
17181892 group(new cTemplate());
17191893 } else
1720
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
17211895 {
17221896 makeSomething(new Attribute());
17231897 } else
1724
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
17251899 {
17261900 makeSomething(new PointFlow());
17271901 } else
....@@ -1733,7 +1907,7 @@
17331907 } else
17341908 */
17351909
1736
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
17371911 {
17381912 Composite g = new cGroup();
17391913 for (int i=0; i<15; i++)
....@@ -1755,7 +1929,7 @@
17551929
17561930 group(g);
17571931 } else
1758
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17591933 {
17601934 Composite csg = new GroupLeaf();
17611935 csg.count = 5;
....@@ -1764,7 +1938,7 @@
17641938 csg.addChild(child);
17651939 child.addChild(csg);
17661940 } else
1767
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17681942 {
17691943 Composite csg = new GroupLeaf();
17701944 csg.count = 5;
....@@ -1776,7 +1950,7 @@
17761950 csg.addChild(child);
17771951 child.addChild(csg);
17781952 } else
1779
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17801954 {
17811955 Composite csg = new GroupLeaf();
17821956 csg.count = 4;
....@@ -1791,71 +1965,83 @@
17911965 csg.addChild(child);
17921966 child.addChild(csg);
17931967 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
1968
+ if (source == computeAOItem)
18121969 {
18131970 Globals.drawMode = CameraPane.OCCLUSION;
18141971 Globals.theRenderer.repaint();
18151972 } else
1816
- if (event.getSource() == recompileItem)
1973
+ if (source == recompileItem)
18171974 {
18181975 Recompile();
18191976 refreshContents();
18201977 } else
1821
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
18221979 {
18231980 OpenDialog();
18241981 refreshContents();
18251982 } else
1826
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
18271984 {
18281985 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18301987 } else
1831
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
18321989 {
18331990 //System.out.println("Invariants:");
18341991 PrintMemory();
18351992 } else
1836
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
18371994 {
18381995 PrintPath();
18391996 } else
1840
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
18411998 {
18421999 AnalyzeObject();
18432000 } else
1844
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
18452002 {
18462003 DumpObject();
18472004 } else
1848
- 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)
18492035 {
18502036 //Reload(lastConverter, lastFilename, true);
18512037 ScreenFit();
18522038 } else
1853
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18542040 {
18552041 //Reload(lastConverter, lastFilename, true);
18562042 ScreenFitPoint();
18572043 } else
1858
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18592045 {
18602046 //Reload(lastConverter, lastFilename, true);
18612047 SnapObject();
....@@ -1866,13 +2052,13 @@
18662052 // Recompile();
18672053 // refreshContents();
18682054 // } else
1869
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18702056 {
18712057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722058 System.gc();
18732059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742060 } else
1875
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18762062 {
18772063 Object3D obj;
18782064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2072,74 @@
18862072 }
18872073 refreshContents(true);
18882074 } else
1889
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18902076 {
18912077 EditSelection(true);
18922078 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
18942080 {
18952081 loadClipboard(true);
18962082 } else
1897
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
18982084 {
1899
- 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;
19002094 loadClipboard(false);
19012095 paste(false);
1902
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
19032097 } else
1904
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
19052099 {
19062100 CloneSelection(false);
19072101 } else
1908
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
19092103 {
19102104 CloneSelection(true);
19112105 } else
1912
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
19132107 {
19142108 loadClipboard(false);
19152109 } else
1916
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
19172111 {
19182112 paste(false);
19192113 } else
1920
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
19212115 {
1922
- pasteInto(false);
2116
+ pasteInto(true, false);
19232117 } else
1924
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
19252119 {
1926
- pasteInto(true);
2120
+ pasteInto(false, false);
19272121 } else
1928
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
19292127 {
19302128 paste(true);
19312129 } else
1932
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
19332131 {
19342132 Overwrite(Object3D.TRANSFORM);
19352133 } else
1936
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
19372135 {
19382136 Overwrite(Object3D.NAME);
19392137 } else
1940
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
19412139 {
19422140 Overwrite(Object3D.UV);
19432141 } else
1944
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
19452143 {
19462144 /* july 2015
19472145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2159,7 @@
19612159
19622160 Overwrite(dropAttributes);
19632161 }
1964
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19652163 {
19662164 Overwrite(Object3D.GEOMETRY);
19672165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2176,7 @@
19782176 // refreshContents();
19792177 // }
19802178 } else
1981
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19822180 {
19832181 //if (group.selection.size() == 1)
19842182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2187,7 @@
19892187 ResetModel();
19902188 refreshContents();
19912189 } else
1992
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
19932191 {
19942192 boolean one = false;
19952193
....@@ -2016,7 +2214,7 @@
20162214 ResetModel();
20172215 refreshContents();
20182216 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
20202218 {
20212219 boolean one = false;
20222220
....@@ -2042,7 +2240,7 @@
20422240 ResetModel();
20432241 refreshContents();
20442242 } else
2045
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
20462244 {
20472245 boolean one = false;
20482246
....@@ -2072,7 +2270,7 @@
20722270 refreshContents();
20732271 }
20742272 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20762274 {
20772275 boolean one = false;
20782276
....@@ -2102,7 +2300,7 @@
21022300 ResetModel();
21032301 refreshContents();
21042302 } else
2105
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
21062304 {
21072305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082306 // {
....@@ -2115,9 +2313,9 @@
21152313 // group.selection.get(0).setMasterThis(content); // should be identity
21162314 // refreshContents();
21172315 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192317 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
21212319
21222320 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232321 content = ((cGroup)content).get(0);
....@@ -2125,38 +2323,38 @@
21252323 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262324 for (int i=0; i<group.selection.size(); i++)
21272325 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
21302328 group.selection.get(i).linkVerticesThis(content);
21312329 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21332331 }
21342332 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352333 refreshContents();
21362334 }
21372335 } else
2138
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
21392337 {
21402338 for (int i=0; i<group.selection.size(); i++)
21412339 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21442342 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21462344 }
21472345
21482346 refreshContents();
21492347 } else
2150
- if (event.getSource() == relinkverticesItem)
2348
+ if (source == relinkverticesItem)
21512349 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21542352 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21562354
21572355 refreshContents();
21582356 } else
2159
- if (event.getSource() == resetreferencesItem)
2357
+ if (source == resetreferencesItem)
21602358 {
21612359 for (int i=0; i<group.selection.size(); i++)
21622360 {
....@@ -2165,11 +2363,11 @@
21652363
21662364 refreshContents();
21672365 } else
2168
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21692367 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712369 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21732371
21742372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752373 content = ((cGroup)content).get(0);
....@@ -2178,13 +2376,13 @@
21782376 refreshContents();
21792377 }
21802378 } else
2181
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21822380 {
21832381 if (group.selection.size() == 1)
21842382 {
2185
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21862384 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21882386
21892387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902388 content = ((cGroup)content).get(0);
....@@ -2197,19 +2395,19 @@
21972395 }
21982396
21992397 } else
2200
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
22012399 {
22022400 RevertMeshes();
22032401 } else
2204
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
22052403 {
22062404 ResetAll();
22072405 } else
2208
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
22092407 {
22102408 StepAll();
22112409 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
22132411 {
22142412 //int indices[] = jList.getSelectedIndices();
22152413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2415,46 @@
22172415
22182416 ClearSelection(false);
22192417 } else
2220
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
22212419 {
22222420 ClearSelection(true);
22232421 } else
2224
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
22252423 {
22262424 group(new cGroup(), true);
22272425 } else
2228
- if (event.getSource() == hideItem)
2426
+ if (source == hideItem)
22292427 {
22302428 group(new HiddenObject());
22312429 } else
2232
- if (event.getSource() == frontItem)
2430
+ if (source == frontItem)
22332431 {
22342432 front();
22352433 } else
2236
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
22372435 {
22382436 back();
22392437 } else
2240
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
22412439 {
22422440 makeSomething(new Camera());
22432441 } else
2244
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
22452443 {
22462444 group(new Composite());
22472445 } else
2248
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
22492447 {
22502448 RandomNode random = new RandomNode();
22512449 group(random);
22522450 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22542452 } else
2255
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
22562454 {
22572455 group(new PhysicsNode());
22582456 } else
2259
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
22602458 {
22612459 for (int i=0; i<group.selection.size(); i++)
22622460 {
....@@ -2268,7 +2466,7 @@
22682466 ResetModel();
22692467 refreshContents();
22702468 } else
2271
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22722470 {
22732471 for (int i=0; i<group.selection.size(); i++)
22742472 {
....@@ -2280,7 +2478,7 @@
22802478 ResetModel();
22812479 refreshContents();
22822480 } else
2283
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22842482 {
22852483 for (int i=0; i<group.selection.size(); i++)
22862484 {
....@@ -2292,7 +2490,7 @@
22922490 ResetModel();
22932491 refreshContents();
22942492 } else
2295
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
22962494 {
22972495 for (int i=0; i<group.selection.size(); i++)
22982496 {
....@@ -2304,7 +2502,7 @@
23042502 ResetModel();
23052503 refreshContents();
23062504 } else
2307
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
23082506 {
23092507 boolean atleastone = false;
23102508
....@@ -2343,31 +2541,31 @@
23432541 }
23442542 }
23452543 } else
2346
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
23472545 {
23482546 group(new cLinker());
23492547 } else
2350
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
23512549 {
23522550 group(new TextureNode());
23532551 } else
2354
- if (event.getSource() == billboardItem)
2552
+ if (source == billboardItem)
23552553 {
23562554 group(new BillboardNode());
23572555 } else
2358
- if (event.getSource() == shadowXItem)
2556
+ if (source == shadowXItem)
23592557 {
23602558 CastShadow(0);
23612559 } else
2362
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
23632561 {
23642562 CastShadow(1);
23652563 } else
2366
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
23672565 {
23682566 CastShadow(2);
23692567 } else
2370
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23712569 {
23722570 //ungroup();
23732571 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2577,203 @@
23792577
23802578 refreshContents();
23812579 } else
2382
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23832581 {
23842582 GenUV();
23852583 } else
2386
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23872585 {
23882586 GenNormals(true);
23892587 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2588
+ if (source == genNormalsMESHItem)
23912589 {
2392
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
23932591 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2592
+ if (source == genNormalsORGANItem)
23952593 {
23962594 GenNormals(false);
23972595 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2596
+ if (source == genNormalsMINEItem)
23992597 {
24002598 GenNormalsMINE();
24012599 } else
2402
- if (event.getSource() == stripifyItem)
2600
+ if (source == stripifyItem)
24032601 {
24042602 Stripify();
24052603 } else
2406
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
24072605 {
24082606 Unstripify();
24092607 } else
2410
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
24112609 {
24122610 Trim();
24132611 } else
2414
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
24152613 {
24162614 Untrim();
24172615 } else
2418
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
24192617 {
24202618 ClearColors();
24212619 } else
2422
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
24232621 {
24242622 ClearMaterials();
24252623 } else
2426
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
24272625 {
24282626 LiveLeaves(true);
24292627 } else
2430
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
24312629 {
24322630 LiveLeaves(false);
24332631 } else
2434
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
24352633 {
24362634 SupportLeaves(true);
24372635 } else
2438
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
24392637 {
24402638 SupportLeaves(false);
24412639 } else
2442
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
24432641 {
24442642 HideLeaves(true);
24452643 } else
2446
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
24472645 {
24482646 HideLeaves(false);
24492647 } else
2450
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
24512649 {
24522650 MarkLeaves(true);
24532651 } else
2454
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
24552653 {
24562654 MarkLeaves(false);
24572655 } else
2458
- 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)
24592673 {
24602674 FlipV(true);
24612675 } else
2462
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
24632677 {
24642678 FlipV(false);
24652679 } else
2466
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
24672681 {
24682682 SetTexRes(0);
24692683 } else
2470
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
24712685 {
24722686 SetTexRes(1);
24732687 } else
2474
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
24752689 {
24762690 SetTexRes(2);
24772691 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
24792693 {
24802694 SetTexRes(3);
24812695 } else
2482
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
24832697 {
24842698 SetTexRes(4);
24852699 } else
2486
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24872701 {
24882702 SetTexRes(5);
24892703 } else
2490
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24912705 {
24922706 ReverseNormals();
24932707 } else
2494
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
24952709 {
24962710 ParseVertices();
24972711 } else
2498
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
24992713 {
25002714 TextureVertices();
25012715 } else
2502
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
25032717 {
25042718 Align();
25052719 } else
2506
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
25072721 {
25082722 MirrorPoses();
25092723 } else
2510
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
25112725 {
25122726 MeshReduction(false);
25132727 } else
2514
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
25152729 {
25162730 MeshReduction(true);
25172731 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
25192733 {
25202734 ReverseTriangles();
25212735 } else
2522
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
25232737 {
25242738 ReduceMesh(false);
25252739 } else
2526
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
25272741 {
25282742 ReduceMesh(true);
25292743 } else
2530
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
25312745 {
25322746 IncreaseMesh();
25332747 } else
2534
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
25352749 {
25362750 ClipMesh();
25372751 } else
2538
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
25392753 {
25402754 SmoothMesh();
25412755 } else
2542
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25432757 {
25442758 TransformGeometry();
25452759 } else
2546
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
25472765 {
25482766 ResetTransform();
25492767 } else
2550
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
25512769 {
2552
- ResetCentroid();
2770
+ ResetCentroid(true);
25532771 } else
2554
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
25552777 {
25562778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572779 {
....@@ -2561,7 +2783,7 @@
25612783
25622784 refreshContents();
25632785 } else
2564
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
25652787 {
25662788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672789 {
....@@ -2575,7 +2797,7 @@
25752797
25762798 refreshContents();
25772799 } else
2578
- if (event.getSource() == repairShadowItem)
2800
+ if (source == repairShadowItem)
25792801 {
25802802 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812803 {
....@@ -2589,7 +2811,7 @@
25892811
25902812 refreshContents();
25912813 } else
2592
- if (event.getSource() == sortbysizeItem)
2814
+ if (source == sortbysizeItem)
25932815 {
25942816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952817 {
....@@ -2601,7 +2823,7 @@
26012823 ResetModel();
26022824 refreshContents();
26032825 } else
2604
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
26052827 {
26062828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072829 {
....@@ -2613,7 +2835,7 @@
26132835 ResetModel();
26142836 refreshContents();
26152837 } else
2616
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
26172839 {
26182840 String texture = GetFile("Attach pigment");
26192841 Object3D obj;
....@@ -2625,7 +2847,7 @@
26252847
26262848 refreshContents();
26272849 } else
2628
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
26292851 {
26302852 Object3D obj;
26312853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2858,7 @@
26362858
26372859 refreshContents();
26382860 } else
2639
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
26402862 {
26412863 String texture = GetFile("Attach bump");
26422864 Object3D obj;
....@@ -2648,7 +2870,7 @@
26482870
26492871 refreshContents();
26502872 } else
2651
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
26522874 {
26532875 Object3D obj;
26542876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2881,7 @@
26592881
26602882 refreshContents();
26612883 } else
2662
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
26632885 {
26642886 Object3D obj;
26652887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2892,221 @@
26702892
26712893 refreshContents();
26722894 } else
2673
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
26742896 {
26752897 CameraPane.flash = true;
26762898 refreshContents();
26772899 } else
2678
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
26792901 {
26802902 } else
2681
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
26822904 {
26832905 radio.layout = twoButton;
26842906 // bug
26852907 //gridPanel.setDividerLocation(1.0);
26862908 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
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
+
27112956 } else
2712
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
27132958 {
27142959 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
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();
27392994 } else
2740
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
27412996 {
27422997 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
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();
27673031 } else
2768
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
27693033 {
27703034 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
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();
27953069 } else
2796
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
27973071 {
27983072 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
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();
28233108 } else
2824
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
28253110 {
28263111 Object3D obj;
28273112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2831,9 +3116,10 @@
28313116 EditObject(obj);
28323117 }
28333118
3119
+ cameraView.requestFocusInWindow();
28343120 refreshContents(true);
28353121 } else
2836
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
28373123 {
28383124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393125 cRadio ab;
....@@ -2852,13 +3138,15 @@
28523138 break;
28533139 }
28543140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28553143 refreshContents(true);
28563144 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
28583146 {
28593147 EditSelection(false);
28603148 } else
2861
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
28623150 {
28633151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643152 {
....@@ -2868,14 +3156,14 @@
28683156 child.CloseUI();
28693157 listUI.remove(child);
28703158
2871
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28723160 }
2873
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
28743162 //objEditor.jTree.clearSelection();
28753163 //objEditor.ResetSliders();
28763164 refreshContents(true);
28773165 } else
2878
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
28793167 {
28803168 assert(copy == group);
28813169 //copy.ClearUI();
....@@ -2886,7 +3174,7 @@
28863174 listUI.clear();
28873175 refreshContents(true);
28883176 } else
2889
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
28903178 {
28913179 assert(copy == group);
28923180
....@@ -2907,19 +3195,19 @@
29073195
29083196 refreshContents(true);
29093197 } else
2910
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
29113199 {
29123200 objEditor.jTree.clearSelection();
29133201 // ?? oct 2012 GrafreeD.clipboard.clear();
29143202 objEditor.ResetSliders();
29153203 refreshContents(true);
29163204 } else
2917
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
29183206 {
29193207 group.parent = keepparent;
29203208 group.attributes = 0;
29213209 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
29233211 Object3D obj = radio.GetObject();
29243212 System.out.println("Edit " + obj);
29253213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2954,7 +3242,10 @@
29543242 frontView.object = group;
29553243 sideView.object = group;
29563244 }
2957
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29583249 /*
29593250 currentLayout = radio.layout;
29603251 if (currentLayout == null)
....@@ -2966,8 +3257,23 @@
29663257 //group.parent = null; // ROOT
29673258 //group.attributes = -1;
29683259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29693262 refreshContents(true);
2970
- }
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
+ }
29713277 else
29723278 {
29733279 //return super.action(event, arg);
....@@ -2976,7 +3282,6 @@
29763282 }
29773283
29783284 boolean useclient = false;
2979
- cRadio radio;
29803285
29813286 void ToggleRoot()
29823287 {
....@@ -3028,6 +3333,28 @@
30283333 refreshContents();
30293334 }
30303335
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
+ }
30313358
30323359 void ResetTransform()
30333360 {
....@@ -3140,7 +3467,7 @@
31403467 refreshContents();
31413468 }
31423469
3143
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
31443471 {
31453472 Object3D obj;
31463473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3482,16 @@
31553482 LA.matIdentity(Object3D.mat);
31563483 obj.getBounds(minima, maxima, false);
31573484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603488 obj.TransformMesh(Object3D.mat);
3489
+
31613490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31643495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3520,8 @@
31893520
31903521 int size = obj.MemorySize();
31913522
3192
- 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)");
31933525 }
31943526 }
31953527 catch (Exception e)
....@@ -3226,9 +3558,9 @@
32263558 obj = (Object3D)e.nextElement();
32273559
32283560 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
32303562 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
32323564
32333565 // System.err.println((size/1024) + " KB is the size of " + obj);
32343566 }
....@@ -3270,6 +3602,13 @@
32703602 void GenNormals(boolean crease)
32713603 {
32723604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32733612
32743613 refreshContents();
32753614 }
....@@ -3442,8 +3781,8 @@
34423781
34433782 void ParseVertices()
34443783 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34473786
34483787 for (int i=0; i<group.selection.size(); i++)
34493788 {
....@@ -3468,7 +3807,7 @@
34683807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34693808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34703809
3471
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34723811
34733812 buffer.add(g);
34743813 }
....@@ -3483,7 +3822,7 @@
34833822 makeSomething(buffer, i==group.selection.size()-1);
34843823 }
34853824
3486
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
34873826
34883827 refreshContents();
34893828 }
....@@ -3501,7 +3840,16 @@
35013840 String pigment = Object3D.GetPigment(tex);
35023841 //String bump = Object3D.GetBump(tex);
35033842
3504
- 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
+ }
35053853
35063854 double s = v.s;
35073855
....@@ -3589,11 +3937,11 @@
35893937
35903938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913939
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
35943942 lowres.linkVerticesThis(null);
35953943 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
35973945
35983946 System.err.flush();
35993947
....@@ -3633,7 +3981,7 @@
36333981 return;
36343982
36353983 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
36373985
36383986 Object3D newgroup = new Object3D("Po:" + poses.name);
36393987
....@@ -3827,9 +4175,9 @@
38274175
38284176 void ClipMesh()
38294177 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314179 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
38334181
38344182 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354183 content = ((cGroup)content).get(0);
....@@ -3838,7 +4186,7 @@
38384186 // {
38394187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404188 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
38424190 }
38434191 // group.selection.ClipMesh(GrafreeD.clipboard);
38444192 System.out.println("DONE.");
....@@ -3885,6 +4233,18 @@
38854233 void MarkLeaves(boolean hide)
38864234 {
38874235 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);
38884248 refreshContents();
38894249 }
38904250
....@@ -3973,7 +4333,7 @@
39734333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744334
39754335 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4336
+ if(elem != group || !newWindow)
39774337 {
39784338 // if (!(elem instanceof Composite))
39794339 // newWindow = false;
....@@ -4063,7 +4423,6 @@
40634423 //case 702: // Event.LIST_DESELECT
40644424 group.deselectAll();
40654425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674426 if (tps != null)
40684427 {
40694428 for (int i=0; i < tps.length; i++)
....@@ -4072,29 +4431,28 @@
40724431
40734432 //if (child.parent != null)
40744433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
40754435 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794436 }
40804437 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
40874444
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- 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))
40914446 CameraPane.flash = true;
40924447
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944449 // a camera
40954450 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- 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
+ }
40984456 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994457 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004458 }
....@@ -4107,6 +4465,26 @@
41074465
41084466 freezemodel = false;
41094467 }
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
+ }
41104488
41114489 void linkSomething(Object3D thing)
41124490 {
....@@ -4178,16 +4556,18 @@
41784556 {
41794557 if (group.selection.isEmpty())
41804558 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
41824561 Composite tGroup = null;
41834562 if (group.selection.size() > 0) // 1)
41844563 {
41854564 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
41874566 }
41884567
41894568 if (cut)
41904569 {
4570
+ Save();
41914571 //int indices[] = jList.getSelectedIndices();
41924572 //for (int i = indices.length - 1; i >= 0; i--)
41934573 //jList.remove(indices[i]);
....@@ -4223,16 +4603,16 @@
42234603 //System.out.println("cut " + child);
42244604 //System.out.println("parent = " + child.parent);
42254605 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42274607 tGroup.add/*Child*/(tmp);
42284608 else
4229
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
42304610 }
42314611 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
42334613 tGroup.add/*Child*/(child);
42344614 else
4235
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
42364616 }
42374617
42384618 //ResetModel();
....@@ -4264,21 +4644,23 @@
42644644 //System.out.println("cut " + elem);
42654645 //System.out.println("parent = " + elem.parent);
42664646 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42684648 tGroup.add/*Child*/(tmp);
42694649 else
4270
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42714651 }
42724652 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42744654 tGroup.add/*Child*/(child);
42754655 else
4276
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
42774657 }
42784658
42794659 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
42824664 if (cut)
42834665 {
42844666 ResetModel();
....@@ -4292,7 +4674,7 @@
42924674 // return;
42934675 boolean first = true;
42944676
4295
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
42964678 {
42974679 Composite temp;
42984680
....@@ -4303,7 +4685,7 @@
43034685 temp = (Composite)Applet3D.clipboard.deepCopy();
43044686 */
43054687 Object3D elem;
4306
- 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))
43074689 {
43084690 Object3D child = (Object3D)e.nextElement();
43094691
....@@ -4337,21 +4719,21 @@
43374719 //Object3D cb = Applet3D.clipboard;
43384720 //temp.addChild(cb);
43394721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
43454727 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43484730 }
43494731
43504732 ResetModel();
43514733 refreshContents();
43524734 }
43534735
4354
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43554737 {
43564738 // if (GrafreeD.clipboard == null)
43574739 // return;
....@@ -4380,15 +4762,22 @@
43804762 if (copyit)
43814763 {
43824764 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
43844773 }
43854774 else
43864775 {
43874776 boolean first = true;
43884777
4389
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
43904779 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
43924781 Object3D copy;
43934782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43944783 {
....@@ -4398,7 +4787,7 @@
43984787 }
43994788 } else
44004789 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
44024791 }
44034792 }
44044793 }
....@@ -4803,21 +5192,6 @@
48035192 }
48045193 */
48055194
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215195 /*
48225196 public void Callback(Object obj)
48235197 {
....@@ -4841,26 +5215,9 @@
48415215 }
48425216 */
48435217
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615218 String GetFile(String dialogName)
48625219 {
4863
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48645221 {
48655222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665223 browser.show();
....@@ -4924,10 +5281,18 @@
49245281 cButton flashSelectionButton;
49255282 cButton editButton;
49265283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
49275285 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295286 cButton unselectButton;
49305287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
49315296 cButton screenfitButton;
49325297 cButton screenfitpointButton;
49335298 cButton snapobjectButton;
....@@ -4938,14 +5303,6 @@
49385303 cButton closeButton;
49395304
49405305 cButton setsupportButton;
4941
-
4942
- cButton twoButton;
4943
- cButton sixButton;
4944
- cButton threeButton;
4945
- cButton sevenButton;
4946
- cButton fourButton; // full panel
4947
- cButton oneButton; // full XYZ
4948
- //cButton currentLayout;
49495306
49505307 //
49515308 //Composite
....@@ -4958,6 +5315,8 @@
49585315 private MenuItem lookFromItem;
49595316 private MenuItem switchItem;
49605317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49615320 private MenuItem duplicateItem;
49625321 private MenuItem cloneItem;
49635322 private MenuItem cloneSupportItem;
....@@ -4971,7 +5330,7 @@
49715330 private MenuItem linkverticesItem;
49725331 private MenuItem relinkverticesItem;
49735332 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
49755334 private MenuItem stepAllItem;
49765335 private MenuItem revertMeshItem;
49775336 private MenuItem poseMeshItem;
....@@ -4982,6 +5341,7 @@
49825341 private MenuItem mergeGeometriesItem;
49835342 private MenuItem copyItem;
49845343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
49855345 private MenuItem pasteLinkItem;
49865346 private MenuItem pasteCloneItem;
49875347 private MenuItem pasteExpandItem;
....@@ -5020,6 +5380,10 @@
50205380 private MenuItem showleavesItem;
50215381 private MenuItem markleavesItem;
50225382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
50235387
50245388 private MenuItem flipVItem;
50255389 private MenuItem unflipVItem;
....@@ -5031,8 +5395,10 @@
50315395 private MenuItem panoTexturesItem;
50325396
50335397 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
50355399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
50365402 private MenuItem hideItem;
50375403 private MenuItem grabItem;
50385404 private MenuItem backItem;
....@@ -5079,7 +5445,7 @@
50795445 private MenuItem blobItem;
50805446 private MenuItem latheItem;
50815447 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
50835449 private MenuItem meshItem;
50845450 // private MenuItem meshGroupItem;
50855451 private MenuItem springItem;
....@@ -5101,11 +5467,6 @@
51015467 private MenuItem doubleItem;
51025468 private MenuItem tripleItem;
51035469
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095470 private MenuItem computeAOItem;
51105471 private MenuItem recompileItem;
51115472 private MenuItem editScriptItem;
....@@ -5115,4 +5476,8 @@
51155476 private MenuItem analyzeItem;
51165477 private MenuItem dumpItem;
51175478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
51185483 }