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,110 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
-
438577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
442582
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
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");
445605 liveCB.addItemListener(this);
446606
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
613
+ fastCB.addItemListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
449616 trackCB.setToolTipText("Enable tracking");
450617 trackCB.addItemListener(this);
451618
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454620 screenfitButton.setToolTipText("Screen fit");
455621 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
622
+
457623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458624 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464625
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- 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);
471634 flashSelectionButton.setToolTipText("Show selection");
472635 flashSelectionButton.addActionListener(this);
473636
474
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475638
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482640 twoButton.setToolTipText("Show center view only");
483641 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485643 fourButton.addActionListener(this);
486644 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488646 sixButton.setToolTipText("2-column layout left");
489647 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491649 threeButton.setToolTipText("2-column layout right");
492650 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494652 sevenButton.setToolTipText("3-column layout");
495653 sevenButton.addActionListener(this);
496654 //
497655
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- 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");
500658 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503661 closeButton.setToolTipText("Close tab");
504662 closeButton.addActionListener(this);
505663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506664 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508665
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
511668 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515669
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
517672 uneditButton.addActionListener(this);
518673
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- 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");
531676 allParamsButton.addActionListener(this);
532677
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- 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");
538684 unselectButton.addActionListener(this);
539685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
540691 // oe.aConstraints.gridx += 1;
541692 // oe.aConstraints.weighty = 0;
542693 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +699,37 @@
548699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549700 // gcButton.addActionListener(this);
550701
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
562705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- 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);
564707 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
569711
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- 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");
574716 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- 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");
577720 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- 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");
580724 textureCB.addItemListener(this);
581725
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
584729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
585733 //jList.addListSelectionListener(this);
586734 oe.jTree.addTreeSelectionListener(this);
587735 //jTree.setRootVisible(false);
....@@ -604,45 +752,37 @@
604752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605753 }
606754
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608756 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639758 boxCB.setToolTipText("Display bounding boxes");
640759 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643762 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644763 zoomBoxCB.addItemListener(this);
645764
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
+
646786 // constraints.gridy += 1;
647787 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648788 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +790,16 @@
650790 if (false)
651791 {
652792 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655795 speakerCameraCB.addItemListener(this);
656796
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659799 speakerFocusCB.addItemListener(this);
660800
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663803 smoothfocusCB.addItemListener(this);
664804 }
665805
....@@ -667,14 +807,20 @@
667807 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668808 // debugCB.addItemListener(this);
669809
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672811 oeilCB.addItemListener(this);
673812
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
813
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676814 lookAtCB.setToolTipText("Look-at target");
677815 lookAtCB.addItemListener(this);
816
+
817
+ }
818
+
819
+ cGridBag fill = new cGridBag();
820
+
821
+ fill.preferredHeight = 200;
822
+
823
+ panel.add(fill);
678824
679825 }
680826
....@@ -689,8 +835,11 @@
689835 buttonGroup.add(radioButton);
690836 radioButton.doClick();
691837 }
838
+
692839 void SetupViews(ObjEditor oe)
693840 {
841
+ theFrame = this;
842
+
694843 oe.SetupViews();
695844
696845 System.out.println("SetupViews");
....@@ -753,6 +902,7 @@
753902 } else if(e.getSource() == liveCB)
754903 {
755904 cameraView.ToggleLive();
905
+ refreshContents(false);
756906 }
757907 else if(e.getSource() == supportCB)
758908 {
....@@ -905,7 +1055,9 @@
9051055 // objEditor.DropFile((java.io.File[]) object, true);
9061056 // return;
9071057 // }
908
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091061 {
9101062 // file(s)
9111063 String[] names = string.split("\n");
....@@ -932,7 +1084,7 @@
9321084
9331085 flashIt = false;
9341086 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371089
9381090 if (group.selection.size() == 1)
....@@ -959,11 +1111,11 @@
9591111 {
9601112 loadClipboard(true);
9611113 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1114
+ pasteInto(false, false);
9631115 } else {
9641116 loadClipboard(false);
9651117 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9671119 }
9681120 }
9691121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1237,33 @@
10851237 kleinItem.addActionListener(this);
10861238 particleItem = menu.add(new MenuItem("Particle system"));
10871239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10881242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891243 ragdollItem.addActionListener(this);
10901244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911245 ragdoll2Item.addActionListener(this);
1246
+ }
10921247 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941249 meshItem.addActionListener(this);
10951250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10971254 springItem = menu.add(new MenuItem("Spring"));
10981255 springItem.addActionListener(this);
10991256 flagItem = menu.add(new MenuItem("Flag"));
11001257 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051258 blobItem = menu.add(new MenuItem("Blob"));
11061259 blobItem.addActionListener(this);
11071260 latheItem = menu.add(new MenuItem("Lathe"));
11081261 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);
11091267 lightItem = menu.add(new MenuItem("Light"));
11101268 lightItem.addActionListener(this);
11111269 menu.add("-");
....@@ -1115,39 +1273,44 @@
11151273 loopItem.addActionListener(this);
11161274 doubleItem = menu.add(new MenuItem("Fork"));
11171275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
11181278 tripleItem = menu.add(new MenuItem("Trident"));
11191279 tripleItem.addActionListener(this);
1280
+ }
11201281 }
11211282
11221283 void buildToolsMenu(Menu menu)
11231284 {
11241285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251286 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
11271288
11281289 menu.add("-");
11291290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301291 parseverticesItem.addActionListener(this);
11311292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321293 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341295 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381297 reduceMorphItem.addActionListener(this);
11391298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401299 reduce34MorphItem.addActionListener(this);
1141
-
1300
+ menu.add("-");
11421301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431302 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11461309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471310 memoryItem.addActionListener(this);
11481311 menu.add(analyzeItem = new MenuItem("Analyze"));
11491312 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11511314 dumpItem.addActionListener(this);
11521315 // menu.add(pathItem = new MenuItem("From-to path"));
11531316 // pathItem.addActionListener(this);
....@@ -1165,6 +1328,7 @@
11651328 menu.add("-");
11661329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671330 editScriptItem.addActionListener(this);
1331
+ }
11681332 }
11691333
11701334 void ScreenFit()
....@@ -1287,6 +1451,7 @@
12871451 shadow.material = new cMaterial(obj.material);
12881452 shadow.material.diffuse = 0.0001f;
12891453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12901455
12911456 makeSomething(shadow);
12921457 }
....@@ -1493,9 +1658,9 @@
14931658
14941659 void Overwrite(int mask)
14951660 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971662 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14991664
15001665 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011666 content = ((cGroup)content).get(0);
....@@ -1518,6 +1683,7 @@
15181683 //
15191684 public void actionPerformed(ActionEvent event) // , Object arg)
15201685 {
1686
+ Object source = event.getSource();
15211687 /*
15221688 if (event.getSource() == nameField)
15231689 {
....@@ -1529,11 +1695,11 @@
15291695 }
15301696 else
15311697 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
15331699 {
15341700 ScreenFit();
15351701 } else
1536
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
15371703 {
15381704 cVector v1 = new cVector();
15391705 cVector v2 = new cVector();
....@@ -1542,11 +1708,11 @@
15421708 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431709 objEditor.cameraView.repaint();
15441710 } else
1545
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
15461712 {
15471713 makeSomething(new Box());
15481714 } else
1549
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
15501716 {
15511717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1733,9 @@
15671733 applyExample(particleGeom, "SMOKE");
15681734 makeSomething(particleGeom);
15691735 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15711737 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731739
15741740 ragdoll.toParent = LA.newMatrix();
15751741 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1753,7 @@
15871753 } else
15881754 /*
15891755 */
1590
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15911757 {
15921758 Object3D obj = new Object3D();
15931759
....@@ -1625,31 +1791,31 @@
16251791
16261792 makeSomething(obj);
16271793 } else
1628
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
16291795 {
16301796 makeSomething(new Grid());
16311797 } else
1632
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
16331799 {
16341800 makeSomething(new Sphere());
16351801 } else
1636
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
16371803 {
16381804 makeSomething(new Cone());
16391805 } else
1640
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
16411807 {
16421808 makeSomething(new Torus());
16431809 } else
1644
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
16451811 {
16461812 makeSomething(new Superellipsoid());
16471813 } else
1648
- if (event.getSource() == kleinItem)
1814
+ if (source == kleinItem)
16491815 {
16501816 makeSomething(new Klein());
16511817 } else
1652
- if (event.getSource() == blobItem)
1818
+ if (source == blobItem)
16531819 {
16541820 Blob blob = new Blob();
16551821 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1823,15 @@
16571823 //blob.retile();
16581824 makeSomething(blob);
16591825 } else
1660
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16611827 {
16621828 makeSomething(new Lathe());
16631829 } else
1664
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16651831 {
16661832 makeSomething(new BezierSurface());
16671833 } else
1668
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16691835 {
16701836 /*
16711837 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1846,7 @@
16801846 */
16811847 makeSomething(new Checker());
16821848 } else
1683
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16841850 {
16851851 Object3D itemtomake = new Object3D();
16861852 Object3D child;
....@@ -1701,35 +1867,35 @@
17011867 makeSomething(child);
17021868 }
17031869 } else
1704
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
17051871 {
17061872 cSpring s = new cSpring();
17071873 s.setup();
17081874 makeSomething(s);
17091875 } else
1710
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
17111877 {
17121878 cSpring s = new cFlag();
17131879 s.setup();
17141880 makeSomething(s);
17151881 } else
1716
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
17171883 {
17181884 makeSomething(new Light());
17191885 } else
1720
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
17211887 {
17221888 group(new CSG());
17231889 } else
1724
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
17251891 {
17261892 group(new cTemplate());
17271893 } else
1728
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
17291895 {
17301896 makeSomething(new Attribute());
17311897 } else
1732
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
17331899 {
17341900 makeSomething(new PointFlow());
17351901 } else
....@@ -1741,7 +1907,7 @@
17411907 } else
17421908 */
17431909
1744
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
17451911 {
17461912 Composite g = new cGroup();
17471913 for (int i=0; i<15; i++)
....@@ -1763,7 +1929,7 @@
17631929
17641930 group(g);
17651931 } else
1766
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17671933 {
17681934 Composite csg = new GroupLeaf();
17691935 csg.count = 5;
....@@ -1772,7 +1938,7 @@
17721938 csg.addChild(child);
17731939 child.addChild(csg);
17741940 } else
1775
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17761942 {
17771943 Composite csg = new GroupLeaf();
17781944 csg.count = 5;
....@@ -1784,7 +1950,7 @@
17841950 csg.addChild(child);
17851951 child.addChild(csg);
17861952 } else
1787
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17881954 {
17891955 Composite csg = new GroupLeaf();
17901956 csg.count = 4;
....@@ -1799,71 +1965,83 @@
17991965 csg.addChild(child);
18001966 child.addChild(csg);
18011967 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
1968
+ if (source == computeAOItem)
18201969 {
18211970 Globals.drawMode = CameraPane.OCCLUSION;
18221971 Globals.theRenderer.repaint();
18231972 } else
1824
- if (event.getSource() == recompileItem)
1973
+ if (source == recompileItem)
18251974 {
18261975 Recompile();
18271976 refreshContents();
18281977 } else
1829
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
18301979 {
18311980 OpenDialog();
18321981 refreshContents();
18331982 } else
1834
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
18351984 {
18361985 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18381987 } else
1839
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
18401989 {
18411990 //System.out.println("Invariants:");
18421991 PrintMemory();
18431992 } else
1844
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
18451994 {
18461995 PrintPath();
18471996 } else
1848
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
18491998 {
18501999 AnalyzeObject();
18512000 } else
1852
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
18532002 {
18542003 DumpObject();
18552004 } else
1856
- 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)
18572035 {
18582036 //Reload(lastConverter, lastFilename, true);
18592037 ScreenFit();
18602038 } else
1861
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18622040 {
18632041 //Reload(lastConverter, lastFilename, true);
18642042 ScreenFitPoint();
18652043 } else
1866
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18672045 {
18682046 //Reload(lastConverter, lastFilename, true);
18692047 SnapObject();
....@@ -1874,13 +2052,13 @@
18742052 // Recompile();
18752053 // refreshContents();
18762054 // } else
1877
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18782056 {
18792057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802058 System.gc();
18812059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822060 } else
1883
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18842062 {
18852063 Object3D obj;
18862064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2072,74 @@
18942072 }
18952073 refreshContents(true);
18962074 } else
1897
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18982076 {
18992077 EditSelection(true);
19002078 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
19022080 {
19032081 loadClipboard(true);
19042082 } else
1905
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
19062084 {
1907
- 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;
19082094 loadClipboard(false);
19092095 paste(false);
1910
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
19112097 } else
1912
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
19132099 {
19142100 CloneSelection(false);
19152101 } else
1916
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
19172103 {
19182104 CloneSelection(true);
19192105 } else
1920
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
19212107 {
19222108 loadClipboard(false);
19232109 } else
1924
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
19252111 {
19262112 paste(false);
19272113 } else
1928
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
19292115 {
1930
- pasteInto(false);
2116
+ pasteInto(true, false);
19312117 } else
1932
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
19332119 {
1934
- pasteInto(true);
2120
+ pasteInto(false, false);
19352121 } else
1936
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
19372127 {
19382128 paste(true);
19392129 } else
1940
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
19412131 {
19422132 Overwrite(Object3D.TRANSFORM);
19432133 } else
1944
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
19452135 {
19462136 Overwrite(Object3D.NAME);
19472137 } else
1948
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
19492139 {
19502140 Overwrite(Object3D.UV);
19512141 } else
1952
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
19532143 {
19542144 /* july 2015
19552145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2159,7 @@
19692159
19702160 Overwrite(dropAttributes);
19712161 }
1972
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19732163 {
19742164 Overwrite(Object3D.GEOMETRY);
19752165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2176,7 @@
19862176 // refreshContents();
19872177 // }
19882178 } else
1989
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19902180 {
19912181 //if (group.selection.size() == 1)
19922182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2187,7 @@
19972187 ResetModel();
19982188 refreshContents();
19992189 } else
2000
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
20012191 {
20022192 boolean one = false;
20032193
....@@ -2024,7 +2214,7 @@
20242214 ResetModel();
20252215 refreshContents();
20262216 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
20282218 {
20292219 boolean one = false;
20302220
....@@ -2050,7 +2240,7 @@
20502240 ResetModel();
20512241 refreshContents();
20522242 } else
2053
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
20542244 {
20552245 boolean one = false;
20562246
....@@ -2080,7 +2270,7 @@
20802270 refreshContents();
20812271 }
20822272 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20842274 {
20852275 boolean one = false;
20862276
....@@ -2110,7 +2300,7 @@
21102300 ResetModel();
21112301 refreshContents();
21122302 } else
2113
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
21142304 {
21152305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162306 // {
....@@ -2123,9 +2313,9 @@
21232313 // group.selection.get(0).setMasterThis(content); // should be identity
21242314 // refreshContents();
21252315 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272317 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
21292319
21302320 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312321 content = ((cGroup)content).get(0);
....@@ -2133,38 +2323,38 @@
21332323 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342324 for (int i=0; i<group.selection.size(); i++)
21352325 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
21382328 group.selection.get(i).linkVerticesThis(content);
21392329 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21412331 }
21422332 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432333 refreshContents();
21442334 }
21452335 } else
2146
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
21472337 {
21482338 for (int i=0; i<group.selection.size(); i++)
21492339 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21522342 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21542344 }
21552345
21562346 refreshContents();
21572347 } else
2158
- if (event.getSource() == relinkverticesItem)
2348
+ if (source == relinkverticesItem)
21592349 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21622352 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21642354
21652355 refreshContents();
21662356 } else
2167
- if (event.getSource() == resetreferencesItem)
2357
+ if (source == resetreferencesItem)
21682358 {
21692359 for (int i=0; i<group.selection.size(); i++)
21702360 {
....@@ -2173,11 +2363,11 @@
21732363
21742364 refreshContents();
21752365 } else
2176
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21772367 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792369 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21812371
21822372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832373 content = ((cGroup)content).get(0);
....@@ -2186,13 +2376,13 @@
21862376 refreshContents();
21872377 }
21882378 } else
2189
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21902380 {
21912381 if (group.selection.size() == 1)
21922382 {
2193
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21942384 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21962386
21972387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982388 content = ((cGroup)content).get(0);
....@@ -2205,19 +2395,19 @@
22052395 }
22062396
22072397 } else
2208
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
22092399 {
22102400 RevertMeshes();
22112401 } else
2212
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
22132403 {
22142404 ResetAll();
22152405 } else
2216
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
22172407 {
22182408 StepAll();
22192409 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
22212411 {
22222412 //int indices[] = jList.getSelectedIndices();
22232413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2415,46 @@
22252415
22262416 ClearSelection(false);
22272417 } else
2228
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
22292419 {
22302420 ClearSelection(true);
22312421 } else
2232
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
22332423 {
22342424 group(new cGroup(), true);
22352425 } else
2236
- if (event.getSource() == hideItem)
2426
+ if (source == hideItem)
22372427 {
22382428 group(new HiddenObject());
22392429 } else
2240
- if (event.getSource() == frontItem)
2430
+ if (source == frontItem)
22412431 {
22422432 front();
22432433 } else
2244
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
22452435 {
22462436 back();
22472437 } else
2248
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
22492439 {
22502440 makeSomething(new Camera());
22512441 } else
2252
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
22532443 {
22542444 group(new Composite());
22552445 } else
2256
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
22572447 {
22582448 RandomNode random = new RandomNode();
22592449 group(random);
22602450 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22622452 } else
2263
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
22642454 {
22652455 group(new PhysicsNode());
22662456 } else
2267
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
22682458 {
22692459 for (int i=0; i<group.selection.size(); i++)
22702460 {
....@@ -2276,7 +2466,7 @@
22762466 ResetModel();
22772467 refreshContents();
22782468 } else
2279
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22802470 {
22812471 for (int i=0; i<group.selection.size(); i++)
22822472 {
....@@ -2288,7 +2478,7 @@
22882478 ResetModel();
22892479 refreshContents();
22902480 } else
2291
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22922482 {
22932483 for (int i=0; i<group.selection.size(); i++)
22942484 {
....@@ -2300,7 +2490,7 @@
23002490 ResetModel();
23012491 refreshContents();
23022492 } else
2303
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
23042494 {
23052495 for (int i=0; i<group.selection.size(); i++)
23062496 {
....@@ -2312,7 +2502,7 @@
23122502 ResetModel();
23132503 refreshContents();
23142504 } else
2315
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
23162506 {
23172507 boolean atleastone = false;
23182508
....@@ -2351,31 +2541,31 @@
23512541 }
23522542 }
23532543 } else
2354
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
23552545 {
23562546 group(new cLinker());
23572547 } else
2358
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
23592549 {
23602550 group(new TextureNode());
23612551 } else
2362
- if (event.getSource() == billboardItem)
2552
+ if (source == billboardItem)
23632553 {
23642554 group(new BillboardNode());
23652555 } else
2366
- if (event.getSource() == shadowXItem)
2556
+ if (source == shadowXItem)
23672557 {
23682558 CastShadow(0);
23692559 } else
2370
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
23712561 {
23722562 CastShadow(1);
23732563 } else
2374
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
23752565 {
23762566 CastShadow(2);
23772567 } else
2378
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23792569 {
23802570 //ungroup();
23812571 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2577,203 @@
23872577
23882578 refreshContents();
23892579 } else
2390
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23912581 {
23922582 GenUV();
23932583 } else
2394
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23952585 {
23962586 GenNormals(true);
23972587 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2588
+ if (source == genNormalsMESHItem)
23992589 {
2400
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
24012591 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2592
+ if (source == genNormalsORGANItem)
24032593 {
24042594 GenNormals(false);
24052595 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2596
+ if (source == genNormalsMINEItem)
24072597 {
24082598 GenNormalsMINE();
24092599 } else
2410
- if (event.getSource() == stripifyItem)
2600
+ if (source == stripifyItem)
24112601 {
24122602 Stripify();
24132603 } else
2414
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
24152605 {
24162606 Unstripify();
24172607 } else
2418
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
24192609 {
24202610 Trim();
24212611 } else
2422
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
24232613 {
24242614 Untrim();
24252615 } else
2426
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
24272617 {
24282618 ClearColors();
24292619 } else
2430
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
24312621 {
24322622 ClearMaterials();
24332623 } else
2434
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
24352625 {
24362626 LiveLeaves(true);
24372627 } else
2438
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
24392629 {
24402630 LiveLeaves(false);
24412631 } else
2442
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
24432633 {
24442634 SupportLeaves(true);
24452635 } else
2446
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
24472637 {
24482638 SupportLeaves(false);
24492639 } else
2450
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
24512641 {
24522642 HideLeaves(true);
24532643 } else
2454
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
24552645 {
24562646 HideLeaves(false);
24572647 } else
2458
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
24592649 {
24602650 MarkLeaves(true);
24612651 } else
2462
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
24632653 {
24642654 MarkLeaves(false);
24652655 } else
2466
- 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)
24672673 {
24682674 FlipV(true);
24692675 } else
2470
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
24712677 {
24722678 FlipV(false);
24732679 } else
2474
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
24752681 {
24762682 SetTexRes(0);
24772683 } else
2478
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
24792685 {
24802686 SetTexRes(1);
24812687 } else
2482
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
24832689 {
24842690 SetTexRes(2);
24852691 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
24872693 {
24882694 SetTexRes(3);
24892695 } else
2490
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
24912697 {
24922698 SetTexRes(4);
24932699 } else
2494
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24952701 {
24962702 SetTexRes(5);
24972703 } else
2498
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24992705 {
25002706 ReverseNormals();
25012707 } else
2502
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
25032709 {
25042710 ParseVertices();
25052711 } else
2506
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
25072713 {
25082714 TextureVertices();
25092715 } else
2510
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
25112717 {
25122718 Align();
25132719 } else
2514
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
25152721 {
25162722 MirrorPoses();
25172723 } else
2518
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
25192725 {
25202726 MeshReduction(false);
25212727 } else
2522
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
25232729 {
25242730 MeshReduction(true);
25252731 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
25272733 {
25282734 ReverseTriangles();
25292735 } else
2530
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
25312737 {
25322738 ReduceMesh(false);
25332739 } else
2534
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
25352741 {
25362742 ReduceMesh(true);
25372743 } else
2538
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
25392745 {
25402746 IncreaseMesh();
25412747 } else
2542
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
25432749 {
25442750 ClipMesh();
25452751 } else
2546
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
25472753 {
25482754 SmoothMesh();
25492755 } else
2550
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25512757 {
25522758 TransformGeometry();
25532759 } else
2554
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
25552765 {
25562766 ResetTransform();
25572767 } else
2558
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
25592769 {
2560
- ResetCentroid();
2770
+ ResetCentroid(true);
25612771 } else
2562
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
25632777 {
25642778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652779 {
....@@ -2569,7 +2783,7 @@
25692783
25702784 refreshContents();
25712785 } else
2572
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
25732787 {
25742788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752789 {
....@@ -2583,7 +2797,7 @@
25832797
25842798 refreshContents();
25852799 } else
2586
- if (event.getSource() == repairShadowItem)
2800
+ if (source == repairShadowItem)
25872801 {
25882802 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892803 {
....@@ -2597,7 +2811,7 @@
25972811
25982812 refreshContents();
25992813 } else
2600
- if (event.getSource() == sortbysizeItem)
2814
+ if (source == sortbysizeItem)
26012815 {
26022816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032817 {
....@@ -2609,7 +2823,7 @@
26092823 ResetModel();
26102824 refreshContents();
26112825 } else
2612
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
26132827 {
26142828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152829 {
....@@ -2621,7 +2835,7 @@
26212835 ResetModel();
26222836 refreshContents();
26232837 } else
2624
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
26252839 {
26262840 String texture = GetFile("Attach pigment");
26272841 Object3D obj;
....@@ -2633,7 +2847,7 @@
26332847
26342848 refreshContents();
26352849 } else
2636
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
26372851 {
26382852 Object3D obj;
26392853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2858,7 @@
26442858
26452859 refreshContents();
26462860 } else
2647
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
26482862 {
26492863 String texture = GetFile("Attach bump");
26502864 Object3D obj;
....@@ -2656,7 +2870,7 @@
26562870
26572871 refreshContents();
26582872 } else
2659
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
26602874 {
26612875 Object3D obj;
26622876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2881,7 @@
26672881
26682882 refreshContents();
26692883 } else
2670
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
26712885 {
26722886 Object3D obj;
26732887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2892,221 @@
26782892
26792893 refreshContents();
26802894 } else
2681
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
26822896 {
26832897 CameraPane.flash = true;
26842898 refreshContents();
26852899 } else
2686
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
26872901 {
26882902 } else
2689
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
26902904 {
26912905 radio.layout = twoButton;
26922906 // bug
26932907 //gridPanel.setDividerLocation(1.0);
26942908 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- 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
+
27192956 } else
2720
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
27212958 {
27222959 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- 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();
27472994 } else
2748
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
27492996 {
27502997 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- 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();
27753031 } else
2776
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
27773033 {
27783034 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- 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();
28033069 } else
2804
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
28053071 {
28063072 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- 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();
28313108 } else
2832
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
28333110 {
28343111 Object3D obj;
28353112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,9 +3116,10 @@
28393116 EditObject(obj);
28403117 }
28413118
3119
+ cameraView.requestFocusInWindow();
28423120 refreshContents(true);
28433121 } else
2844
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
28453123 {
28463124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473125 cRadio ab;
....@@ -2860,13 +3138,15 @@
28603138 break;
28613139 }
28623140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28633143 refreshContents(true);
28643144 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
28663146 {
28673147 EditSelection(false);
28683148 } else
2869
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
28703150 {
28713151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723152 {
....@@ -2876,14 +3156,14 @@
28763156 child.CloseUI();
28773157 listUI.remove(child);
28783158
2879
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28803160 }
2881
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
28823162 //objEditor.jTree.clearSelection();
28833163 //objEditor.ResetSliders();
28843164 refreshContents(true);
28853165 } else
2886
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
28873167 {
28883168 assert(copy == group);
28893169 //copy.ClearUI();
....@@ -2894,7 +3174,7 @@
28943174 listUI.clear();
28953175 refreshContents(true);
28963176 } else
2897
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
28983178 {
28993179 assert(copy == group);
29003180
....@@ -2915,19 +3195,19 @@
29153195
29163196 refreshContents(true);
29173197 } else
2918
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
29193199 {
29203200 objEditor.jTree.clearSelection();
29213201 // ?? oct 2012 GrafreeD.clipboard.clear();
29223202 objEditor.ResetSliders();
29233203 refreshContents(true);
29243204 } else
2925
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
29263206 {
29273207 group.parent = keepparent;
29283208 group.attributes = 0;
29293209 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
29313211 Object3D obj = radio.GetObject();
29323212 System.out.println("Edit " + obj);
29333213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3242,10 @@
29623242 frontView.object = group;
29633243 sideView.object = group;
29643244 }
2965
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29663249 /*
29673250 currentLayout = radio.layout;
29683251 if (currentLayout == null)
....@@ -2974,8 +3257,23 @@
29743257 //group.parent = null; // ROOT
29753258 //group.attributes = -1;
29763259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29773262 refreshContents(true);
2978
- }
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
+ }
29793277 else
29803278 {
29813279 //return super.action(event, arg);
....@@ -2984,7 +3282,6 @@
29843282 }
29853283
29863284 boolean useclient = false;
2987
- cRadio radio;
29883285
29893286 void ToggleRoot()
29903287 {
....@@ -3036,6 +3333,28 @@
30363333 refreshContents();
30373334 }
30383335
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
+ }
30393358
30403359 void ResetTransform()
30413360 {
....@@ -3148,7 +3467,7 @@
31483467 refreshContents();
31493468 }
31503469
3151
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
31523471 {
31533472 Object3D obj;
31543473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3482,16 @@
31633482 LA.matIdentity(Object3D.mat);
31643483 obj.getBounds(minima, maxima, false);
31653484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683488 obj.TransformMesh(Object3D.mat);
3489
+
31693490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31723495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3520,8 @@
31973520
31983521 int size = obj.MemorySize();
31993522
3200
- 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)");
32013525 }
32023526 }
32033527 catch (Exception e)
....@@ -3234,9 +3558,9 @@
32343558 obj = (Object3D)e.nextElement();
32353559
32363560 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
32383562 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
32403564
32413565 // System.err.println((size/1024) + " KB is the size of " + obj);
32423566 }
....@@ -3278,6 +3602,13 @@
32783602 void GenNormals(boolean crease)
32793603 {
32803604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32813612
32823613 refreshContents();
32833614 }
....@@ -3450,8 +3781,8 @@
34503781
34513782 void ParseVertices()
34523783 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34553786
34563787 for (int i=0; i<group.selection.size(); i++)
34573788 {
....@@ -3476,7 +3807,7 @@
34763807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783809
3479
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34803811
34813812 buffer.add(g);
34823813 }
....@@ -3491,7 +3822,7 @@
34913822 makeSomething(buffer, i==group.selection.size()-1);
34923823 }
34933824
3494
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
34953826
34963827 refreshContents();
34973828 }
....@@ -3509,7 +3840,16 @@
35093840 String pigment = Object3D.GetPigment(tex);
35103841 //String bump = Object3D.GetBump(tex);
35113842
3512
- 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
+ }
35133853
35143854 double s = v.s;
35153855
....@@ -3597,11 +3937,11 @@
35973937
35983938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993939
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
36023942 lowres.linkVerticesThis(null);
36033943 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
36053945
36063946 System.err.flush();
36073947
....@@ -3641,7 +3981,7 @@
36413981 return;
36423982
36433983 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
36453985
36463986 Object3D newgroup = new Object3D("Po:" + poses.name);
36473987
....@@ -3835,9 +4175,9 @@
38354175
38364176 void ClipMesh()
38374177 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394179 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
38414181
38424182 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434183 content = ((cGroup)content).get(0);
....@@ -3846,7 +4186,7 @@
38464186 // {
38474187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484188 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
38504190 }
38514191 // group.selection.ClipMesh(GrafreeD.clipboard);
38524192 System.out.println("DONE.");
....@@ -3893,6 +4233,18 @@
38934233 void MarkLeaves(boolean hide)
38944234 {
38954235 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);
38964248 refreshContents();
38974249 }
38984250
....@@ -3981,7 +4333,7 @@
39814333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824334
39834335 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4336
+ if(elem != group || !newWindow)
39854337 {
39864338 // if (!(elem instanceof Composite))
39874339 // newWindow = false;
....@@ -4071,7 +4423,6 @@
40714423 //case 702: // Event.LIST_DESELECT
40724424 group.deselectAll();
40734425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754426 if (tps != null)
40764427 {
40774428 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4431,28 @@
40804431
40814432 //if (child.parent != null)
40824433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
40834435 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874436 }
40884437 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
40954444
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- 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))
40994446 CameraPane.flash = true;
41004447
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024449 // a camera
41034450 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- 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
+ }
41064456 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074457 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084458 }
....@@ -4115,6 +4465,26 @@
41154465
41164466 freezemodel = false;
41174467 }
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
+ }
41184488
41194489 void linkSomething(Object3D thing)
41204490 {
....@@ -4186,16 +4556,18 @@
41864556 {
41874557 if (group.selection.isEmpty())
41884558 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
41904561 Composite tGroup = null;
41914562 if (group.selection.size() > 0) // 1)
41924563 {
41934564 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
41954566 }
41964567
41974568 if (cut)
41984569 {
4570
+ Save();
41994571 //int indices[] = jList.getSelectedIndices();
42004572 //for (int i = indices.length - 1; i >= 0; i--)
42014573 //jList.remove(indices[i]);
....@@ -4231,16 +4603,16 @@
42314603 //System.out.println("cut " + child);
42324604 //System.out.println("parent = " + child.parent);
42334605 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42354607 tGroup.add/*Child*/(tmp);
42364608 else
4237
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
42384610 }
42394611 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
42414613 tGroup.add/*Child*/(child);
42424614 else
4243
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
42444616 }
42454617
42464618 //ResetModel();
....@@ -4272,21 +4644,23 @@
42724644 //System.out.println("cut " + elem);
42734645 //System.out.println("parent = " + elem.parent);
42744646 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42764648 tGroup.add/*Child*/(tmp);
42774649 else
4278
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42794651 }
42804652 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42824654 tGroup.add/*Child*/(child);
42834655 else
4284
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
42854657 }
42864658
42874659 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
42904664 if (cut)
42914665 {
42924666 ResetModel();
....@@ -4300,7 +4674,7 @@
43004674 // return;
43014675 boolean first = true;
43024676
4303
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
43044678 {
43054679 Composite temp;
43064680
....@@ -4311,7 +4685,7 @@
43114685 temp = (Composite)Applet3D.clipboard.deepCopy();
43124686 */
43134687 Object3D elem;
4314
- 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))
43154689 {
43164690 Object3D child = (Object3D)e.nextElement();
43174691
....@@ -4345,21 +4719,21 @@
43454719 //Object3D cb = Applet3D.clipboard;
43464720 //temp.addChild(cb);
43474721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- 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());
43534727 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43564730 }
43574731
43584732 ResetModel();
43594733 refreshContents();
43604734 }
43614735
4362
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43634737 {
43644738 // if (GrafreeD.clipboard == null)
43654739 // return;
....@@ -4388,15 +4762,22 @@
43884762 if (copyit)
43894763 {
43904764 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
43924773 }
43934774 else
43944775 {
43954776 boolean first = true;
43964777
4397
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
43984779 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
44004781 Object3D copy;
44014782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024783 {
....@@ -4406,7 +4787,7 @@
44064787 }
44074788 } else
44084789 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
44104791 }
44114792 }
44124793 }
....@@ -4811,21 +5192,6 @@
48115192 }
48125193 */
48135194
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48295195 /*
48305196 public void Callback(Object obj)
48315197 {
....@@ -4849,26 +5215,9 @@
48495215 }
48505216 */
48515217
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48695218 String GetFile(String dialogName)
48705219 {
4871
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48725221 {
48735222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745223 browser.show();
....@@ -4932,10 +5281,18 @@
49325281 cButton flashSelectionButton;
49335282 cButton editButton;
49345283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
49355285 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375286 cButton unselectButton;
49385287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
49395296 cButton screenfitButton;
49405297 cButton screenfitpointButton;
49415298 cButton snapobjectButton;
....@@ -4946,14 +5303,6 @@
49465303 cButton closeButton;
49475304
49485305 cButton setsupportButton;
4949
-
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
49575306
49585307 //
49595308 //Composite
....@@ -4966,6 +5315,8 @@
49665315 private MenuItem lookFromItem;
49675316 private MenuItem switchItem;
49685317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49695320 private MenuItem duplicateItem;
49705321 private MenuItem cloneItem;
49715322 private MenuItem cloneSupportItem;
....@@ -4979,7 +5330,7 @@
49795330 private MenuItem linkverticesItem;
49805331 private MenuItem relinkverticesItem;
49815332 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
49835334 private MenuItem stepAllItem;
49845335 private MenuItem revertMeshItem;
49855336 private MenuItem poseMeshItem;
....@@ -4990,6 +5341,7 @@
49905341 private MenuItem mergeGeometriesItem;
49915342 private MenuItem copyItem;
49925343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
49935345 private MenuItem pasteLinkItem;
49945346 private MenuItem pasteCloneItem;
49955347 private MenuItem pasteExpandItem;
....@@ -5028,6 +5380,10 @@
50285380 private MenuItem showleavesItem;
50295381 private MenuItem markleavesItem;
50305382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
50315387
50325388 private MenuItem flipVItem;
50335389 private MenuItem unflipVItem;
....@@ -5039,8 +5395,10 @@
50395395 private MenuItem panoTexturesItem;
50405396
50415397 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
50435399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
50445402 private MenuItem hideItem;
50455403 private MenuItem grabItem;
50465404 private MenuItem backItem;
....@@ -5087,7 +5445,7 @@
50875445 private MenuItem blobItem;
50885446 private MenuItem latheItem;
50895447 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
50915449 private MenuItem meshItem;
50925450 // private MenuItem meshGroupItem;
50935451 private MenuItem springItem;
....@@ -5109,11 +5467,6 @@
51095467 private MenuItem doubleItem;
51105468 private MenuItem tripleItem;
51115469
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175470 private MenuItem computeAOItem;
51185471 private MenuItem recompileItem;
51195472 private MenuItem editScriptItem;
....@@ -5123,4 +5476,8 @@
51235476 private MenuItem analyzeItem;
51245477 private MenuItem dumpItem;
51255478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
51265483 }