Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
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,20 +807,42 @@
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);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
672812 oeilCB.addItemListener(this);
673813
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
820
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676821 lookAtCB.setToolTipText("Look-at target");
677822 lookAtCB.addItemListener(this);
823
+ }
824
+
825
+ }
826
+
827
+ cGridBag fill = new cGridBag();
828
+
829
+ fill.preferredHeight = 200;
830
+
831
+ panel.add(fill);
678832
679833 }
680834
681835 void EditObject(Object3D obj)
682836 {
683837 cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
684846 radioButton.SetObject(obj);
685847 radioButton.layout = sevenButton;
686848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +851,11 @@
689851 buttonGroup.add(radioButton);
690852 radioButton.doClick();
691853 }
854
+
692855 void SetupViews(ObjEditor oe)
693856 {
857
+ theFrame = this;
858
+
694859 oe.SetupViews();
695860
696861 System.out.println("SetupViews");
....@@ -714,7 +879,9 @@
714879 JCheckBox speakerCameraCB;
715880 JCheckBox speakerFocusCB;
716881 JCheckBox debugCB;
882
+
717883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
718885 JCheckBox lookAtCB;
719886
720887 // static int COLOR = 1;
....@@ -753,6 +920,7 @@
753920 } else if(e.getSource() == liveCB)
754921 {
755922 cameraView.ToggleLive();
923
+ refreshContents(false);
756924 }
757925 else if(e.getSource() == supportCB)
758926 {
....@@ -816,6 +984,10 @@
816984 else if(e.getSource() == oeilCB)
817985 {
818986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
819991 }
820992 else if(e.getSource() == lookAtCB)
821993 {
....@@ -905,7 +1077,9 @@
9051077 // objEditor.DropFile((java.io.File[]) object, true);
9061078 // return;
9071079 // }
908
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091083 {
9101084 // file(s)
9111085 String[] names = string.split("\n");
....@@ -932,7 +1106,7 @@
9321106
9331107 flashIt = false;
9341108 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371111
9381112 if (group.selection.size() == 1)
....@@ -959,11 +1133,11 @@
9591133 {
9601134 loadClipboard(true);
9611135 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1136
+ pasteInto(false, false);
9631137 } else {
9641138 loadClipboard(false);
9651139 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9671141 }
9681142 }
9691143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1259,33 @@
10851259 kleinItem.addActionListener(this);
10861260 particleItem = menu.add(new MenuItem("Particle system"));
10871261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10881264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891265 ragdollItem.addActionListener(this);
10901266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911267 ragdoll2Item.addActionListener(this);
1268
+ }
10921269 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941271 meshItem.addActionListener(this);
10951272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10971276 springItem = menu.add(new MenuItem("Spring"));
10981277 springItem.addActionListener(this);
10991278 flagItem = menu.add(new MenuItem("Flag"));
11001279 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);
11051280 blobItem = menu.add(new MenuItem("Blob"));
11061281 blobItem.addActionListener(this);
11071282 latheItem = menu.add(new MenuItem("Lathe"));
11081283 latheItem.addActionListener(this);
1284
+ }
1285
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1286
+ bezierItem.addActionListener(this);
1287
+ overlayItem = menu.add(new MenuItem("Overlay"));
1288
+ overlayItem.addActionListener(this);
11091289 lightItem = menu.add(new MenuItem("Light"));
11101290 lightItem.addActionListener(this);
11111291 menu.add("-");
....@@ -1115,39 +1295,44 @@
11151295 loopItem.addActionListener(this);
11161296 doubleItem = menu.add(new MenuItem("Fork"));
11171297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
11181300 tripleItem = menu.add(new MenuItem("Trident"));
11191301 tripleItem.addActionListener(this);
1302
+ }
11201303 }
11211304
11221305 void buildToolsMenu(Menu menu)
11231306 {
11241307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251308 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
11271310
11281311 menu.add("-");
11291312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301313 parseverticesItem.addActionListener(this);
11311314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321315 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341317 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381319 reduceMorphItem.addActionListener(this);
11391320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401321 reduce34MorphItem.addActionListener(this);
1141
-
1322
+ menu.add("-");
11421323 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431324 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
11461331 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471332 memoryItem.addActionListener(this);
11481333 menu.add(analyzeItem = new MenuItem("Analyze"));
11491334 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11511336 dumpItem.addActionListener(this);
11521337 // menu.add(pathItem = new MenuItem("From-to path"));
11531338 // pathItem.addActionListener(this);
....@@ -1165,6 +1350,7 @@
11651350 menu.add("-");
11661351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671352 editScriptItem.addActionListener(this);
1353
+ }
11681354 }
11691355
11701356 void ScreenFit()
....@@ -1287,6 +1473,7 @@
12871473 shadow.material = new cMaterial(obj.material);
12881474 shadow.material.diffuse = 0.0001f;
12891475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12901477
12911478 makeSomething(shadow);
12921479 }
....@@ -1493,9 +1680,9 @@
14931680
14941681 void Overwrite(int mask)
14951682 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971684 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14991686
15001687 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011688 content = ((cGroup)content).get(0);
....@@ -1518,6 +1705,7 @@
15181705 //
15191706 public void actionPerformed(ActionEvent event) // , Object arg)
15201707 {
1708
+ Object source = event.getSource();
15211709 /*
15221710 if (event.getSource() == nameField)
15231711 {
....@@ -1529,11 +1717,11 @@
15291717 }
15301718 else
15311719 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1720
+ if (source == lookAtItem || source == lookFromItem)
15331721 {
15341722 ScreenFit();
15351723 } else
1536
- if (event.getSource() == switchItem)
1724
+ if (source == switchItem)
15371725 {
15381726 cVector v1 = new cVector();
15391727 cVector v2 = new cVector();
....@@ -1542,11 +1730,11 @@
15421730 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431731 objEditor.cameraView.repaint();
15441732 } else
1545
- if (event.getSource() == rectoidItem)
1733
+ if (source == rectoidItem)
15461734 {
15471735 makeSomething(new Box());
15481736 } else
1549
- if (event.getSource() == particleItem)
1737
+ if (source == particleItem)
15501738 {
15511739 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521740 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1755,9 @@
15671755 applyExample(particleGeom, "SMOKE");
15681756 makeSomething(particleGeom);
15691757 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1758
+ if (source == ragdollItem || source == ragdoll2Item)
15711759 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1760
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731761
15741762 ragdoll.toParent = LA.newMatrix();
15751763 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1775,7 @@
15871775 } else
15881776 /*
15891777 */
1590
- if (event.getSource() == heightFieldItem)
1778
+ if (source == heightFieldItem)
15911779 {
15921780 Object3D obj = new Object3D();
15931781
....@@ -1625,31 +1813,31 @@
16251813
16261814 makeSomething(obj);
16271815 } else
1628
- if (event.getSource() == gridItem)
1816
+ if (source == gridItem)
16291817 {
16301818 makeSomething(new Grid());
16311819 } else
1632
- if (event.getSource() == ellipsoidItem)
1820
+ if (source == ellipsoidItem)
16331821 {
16341822 makeSomething(new Sphere());
16351823 } else
1636
- if (event.getSource() == coneItem)
1824
+ if (source == coneItem)
16371825 {
16381826 makeSomething(new Cone());
16391827 } else
1640
- if (event.getSource() == torusItem)
1828
+ if (source == torusItem)
16411829 {
16421830 makeSomething(new Torus());
16431831 } else
1644
- if (event.getSource() == superItem)
1832
+ if (source == superItem)
16451833 {
16461834 makeSomething(new Superellipsoid());
16471835 } else
1648
- if (event.getSource() == kleinItem)
1836
+ if (source == kleinItem)
16491837 {
16501838 makeSomething(new Klein());
16511839 } else
1652
- if (event.getSource() == blobItem)
1840
+ if (source == blobItem)
16531841 {
16541842 Blob blob = new Blob();
16551843 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1845,15 @@
16571845 //blob.retile();
16581846 makeSomething(blob);
16591847 } else
1660
- if (event.getSource() == latheItem)
1848
+ if (source == latheItem)
16611849 {
16621850 makeSomething(new Lathe());
16631851 } else
1664
- if (event.getSource() == bezierItem)
1852
+ if (source == bezierItem)
16651853 {
16661854 makeSomething(new BezierSurface());
16671855 } else
1668
- if (event.getSource() == checkerItem)
1856
+ if (source == overlayItem)
16691857 {
16701858 /*
16711859 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1868,7 @@
16801868 */
16811869 makeSomething(new Checker());
16821870 } else
1683
- if (event.getSource() == meshItem)
1871
+ if (source == meshItem)
16841872 {
16851873 Object3D itemtomake = new Object3D();
16861874 Object3D child;
....@@ -1701,35 +1889,35 @@
17011889 makeSomething(child);
17021890 }
17031891 } else
1704
- if (event.getSource() == springItem)
1892
+ if (source == springItem)
17051893 {
17061894 cSpring s = new cSpring();
17071895 s.setup();
17081896 makeSomething(s);
17091897 } else
1710
- if (event.getSource() == flagItem)
1898
+ if (source == flagItem)
17111899 {
17121900 cSpring s = new cFlag();
17131901 s.setup();
17141902 makeSomething(s);
17151903 } else
1716
- if (event.getSource() == lightItem)
1904
+ if (source == lightItem)
17171905 {
17181906 makeSomething(new Light());
17191907 } else
1720
- if (event.getSource() == csgItem)
1908
+ if (source == csgItem)
17211909 {
17221910 group(new CSG());
17231911 } else
1724
- if (event.getSource() == templateItem)
1912
+ if (source == templateItem)
17251913 {
17261914 group(new cTemplate());
17271915 } else
1728
- if (event.getSource() == attributeItem)
1916
+ if (source == attributeItem)
17291917 {
17301918 makeSomething(new Attribute());
17311919 } else
1732
- if (event.getSource() == pointflowItem)
1920
+ if (source == pointflowItem)
17331921 {
17341922 makeSomething(new PointFlow());
17351923 } else
....@@ -1741,7 +1929,7 @@
17411929 } else
17421930 */
17431931
1744
- if (event.getSource() == superLoopItem)
1932
+ if (source == superLoopItem)
17451933 {
17461934 Composite g = new cGroup();
17471935 for (int i=0; i<15; i++)
....@@ -1763,7 +1951,7 @@
17631951
17641952 group(g);
17651953 } else
1766
- if (event.getSource() == loopItem)
1954
+ if (source == loopItem)
17671955 {
17681956 Composite csg = new GroupLeaf();
17691957 csg.count = 5;
....@@ -1772,7 +1960,7 @@
17721960 csg.addChild(child);
17731961 child.addChild(csg);
17741962 } else
1775
- if (event.getSource() == doubleItem)
1963
+ if (source == doubleItem)
17761964 {
17771965 Composite csg = new GroupLeaf();
17781966 csg.count = 5;
....@@ -1784,7 +1972,7 @@
17841972 csg.addChild(child);
17851973 child.addChild(csg);
17861974 } else
1787
- if (event.getSource() == tripleItem)
1975
+ if (source == tripleItem)
17881976 {
17891977 Composite csg = new GroupLeaf();
17901978 csg.count = 4;
....@@ -1799,71 +1987,83 @@
17991987 csg.addChild(child);
18001988 child.addChild(csg);
18011989 } 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)
1990
+ if (source == computeAOItem)
18201991 {
18211992 Globals.drawMode = CameraPane.OCCLUSION;
18221993 Globals.theRenderer.repaint();
18231994 } else
1824
- if (event.getSource() == recompileItem)
1995
+ if (source == recompileItem)
18251996 {
18261997 Recompile();
18271998 refreshContents();
18281999 } else
1829
- if (event.getSource() == editScriptItem)
2000
+ if (source == editScriptItem)
18302001 {
18312002 OpenDialog();
18322003 refreshContents();
18332004 } else
1834
- if (event.getSource() == invariantsItem)
2005
+ if (source == invariantsItem)
18352006 {
18362007 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
18382009 } else
1839
- if (event.getSource() == memoryItem)
2010
+ if (source == memoryItem)
18402011 {
18412012 //System.out.println("Invariants:");
18422013 PrintMemory();
18432014 } else
1844
- if (event.getSource() == pathItem)
2015
+ if (source == pathItem)
18452016 {
18462017 PrintPath();
18472018 } else
1848
- if (event.getSource() == analyzeItem)
2019
+ if (source == analyzeItem)
18492020 {
18502021 AnalyzeObject();
18512022 } else
1852
- if (event.getSource() == dumpItem)
2023
+ if (source == dumpItem)
18532024 {
18542025 DumpObject();
18552026 } else
1856
- if (event.getSource() == screenfitButton)
2027
+ if (source == minButton)
2028
+ {
2029
+ Minimize();
2030
+ } else
2031
+ if (source == maxButton)
2032
+ {
2033
+ Maximize();
2034
+ } else
2035
+ if (source == fullButton)
2036
+ {
2037
+ ToggleFullScreen();
2038
+ } else
2039
+ if (source == undoButton)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoButton)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == saveButton)
2048
+ {
2049
+ Save();
2050
+ } else
2051
+ if (source == oneStepButton)
2052
+ {
2053
+ Globals.ONESTEP = true;
2054
+ cameraView.repaint();
2055
+ } else
2056
+ if (source == screenfitButton)
18572057 {
18582058 //Reload(lastConverter, lastFilename, true);
18592059 ScreenFit();
18602060 } else
1861
- if (event.getSource() == screenfitpointButton)
2061
+ if (source == screenfitpointButton)
18622062 {
18632063 //Reload(lastConverter, lastFilename, true);
18642064 ScreenFitPoint();
18652065 } else
1866
- if (event.getSource() == snapobjectButton)
2066
+ if (source == snapobjectButton)
18672067 {
18682068 //Reload(lastConverter, lastFilename, true);
18692069 SnapObject();
....@@ -1874,13 +2074,13 @@
18742074 // Recompile();
18752075 // refreshContents();
18762076 // } else
1877
- if (event.getSource() == gcButton)
2077
+ if (source == gcButton)
18782078 {
18792079 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802080 System.gc();
18812081 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822082 } else
1883
- if (event.getSource() == editLeafItem)
2083
+ if (source == editLeafItem)
18842084 {
18852085 Object3D obj;
18862086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2094,74 @@
18942094 }
18952095 refreshContents(true);
18962096 } else
1897
- if (event.getSource() == openWindowItem)
2097
+ if (source == openWindowItem)
18982098 {
18992099 EditSelection(true);
19002100 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2101
+ if (source == cutItem || source == clearButton)
19022102 {
19032103 loadClipboard(true);
19042104 } else
1905
- if (event.getSource() == duplicateItem)
2105
+ if (source == undoItem)
19062106 {
1907
- Object3D keep = GrafreeD.clipboard;
2107
+ Undo();
2108
+ } else
2109
+ if (source == redoItem)
2110
+ {
2111
+ Redo();
2112
+ } else
2113
+ if (source == duplicateItem)
2114
+ {
2115
+ Object3D keep = Grafreed.clipboard;
19082116 loadClipboard(false);
19092117 paste(false);
1910
- GrafreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
19112119 } else
1912
- if (event.getSource() == cloneItem)
2120
+ if (source == cloneItem)
19132121 {
19142122 CloneSelection(false);
19152123 } else
1916
- if (event.getSource() == cloneSupportItem)
2124
+ if (source == cloneSupportItem)
19172125 {
19182126 CloneSelection(true);
19192127 } else
1920
- if (event.getSource() == copyItem)
2128
+ if (source == copyItem)
19212129 {
19222130 loadClipboard(false);
19232131 } else
1924
- if (event.getSource() == pasteItem)
2132
+ if (source == pasteItem)
19252133 {
19262134 paste(false);
19272135 } else
1928
- if (event.getSource() == pasteLinkItem)
2136
+ if (source == pasteIntoItem)
19292137 {
1930
- pasteInto(false);
2138
+ pasteInto(true, false);
19312139 } else
1932
- if (event.getSource() == pasteCloneItem)
2140
+ if (source == pasteLinkItem)
19332141 {
1934
- pasteInto(true);
2142
+ pasteInto(false, false);
19352143 } else
1936
- if (event.getSource() == pasteExpandItem)
2144
+ if (source == pasteCloneItem)
2145
+ {
2146
+ pasteInto(true, true);
2147
+ } else
2148
+ if (source == pasteExpandItem)
19372149 {
19382150 paste(true);
19392151 } else
1940
- if (event.getSource() == synchronizeItem)
2152
+ if (source == synchronizeItem)
19412153 {
19422154 Overwrite(Object3D.TRANSFORM);
19432155 } else
1944
- if (event.getSource() == overwriteNameItem)
2156
+ if (source == overwriteNameItem)
19452157 {
19462158 Overwrite(Object3D.NAME);
19472159 } else
1948
- if (event.getSource() == overwriteUVItem)
2160
+ if (source == overwriteUVItem)
19492161 {
19502162 Overwrite(Object3D.UV);
19512163 } else
1952
- if (event.getSource() == overwriteMatItem)
2164
+ if (source == overwriteMatItem)
19532165 {
19542166 /* july 2015
19552167 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2181,7 @@
19692181
19702182 Overwrite(dropAttributes);
19712183 }
1972
- if (event.getSource() == overwriteGeoItem)
2184
+ if (source == overwriteGeoItem)
19732185 {
19742186 Overwrite(Object3D.GEOMETRY);
19752187 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2198,7 @@
19862198 // refreshContents();
19872199 // }
19882200 } else
1989
- if (event.getSource() == generateMeshItem)
2201
+ if (source == generateMeshItem)
19902202 {
19912203 //if (group.selection.size() == 1)
19922204 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2209,7 @@
19972209 ResetModel();
19982210 refreshContents();
19992211 } else
2000
- if (event.getSource() == extractGeometriesItem)
2212
+ if (source == extractGeometriesItem)
20012213 {
20022214 boolean one = false;
20032215
....@@ -2024,7 +2236,7 @@
20242236 ResetModel();
20252237 refreshContents();
20262238 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2239
+ if (source == cloneGeometriesItem)
20282240 {
20292241 boolean one = false;
20302242
....@@ -2050,7 +2262,7 @@
20502262 ResetModel();
20512263 refreshContents();
20522264 } else
2053
- if (event.getSource() == shareGeometriesItem)
2265
+ if (source == shareGeometriesItem)
20542266 {
20552267 boolean one = false;
20562268
....@@ -2080,7 +2292,7 @@
20802292 refreshContents();
20812293 }
20822294 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2295
+ if (source == mergeGeometriesItem)
20842296 {
20852297 boolean one = false;
20862298
....@@ -2110,7 +2322,7 @@
21102322 ResetModel();
21112323 refreshContents();
21122324 } else
2113
- if (event.getSource() == linkverticesItem)
2325
+ if (source == linkverticesItem)
21142326 {
21152327 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162328 // {
....@@ -2123,9 +2335,9 @@
21232335 // group.selection.get(0).setMasterThis(content); // should be identity
21242336 // refreshContents();
21252337 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272339 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
21292341
21302342 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312343 content = ((cGroup)content).get(0);
....@@ -2133,38 +2345,38 @@
21332345 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342346 for (int i=0; i<group.selection.size(); i++)
21352347 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
21382350 group.selection.get(i).linkVerticesThis(content);
21392351 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
21412353 }
21422354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432355 refreshContents();
21442356 }
21452357 } else
2146
- if (event.getSource() == resetsupportItem)
2358
+ if (source == resetsupportItem)
21472359 {
21482360 for (int i=0; i<group.selection.size(); i++)
21492361 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
21522364 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
21542366 }
21552367
21562368 refreshContents();
21572369 } else
2158
- if (event.getSource() == relinkverticesItem)
2370
+ if (source == relinkverticesItem)
21592371 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
21622374 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2375
+ CameraPane.SWITCH = random;
21642376
21652377 refreshContents();
21662378 } else
2167
- if (event.getSource() == resetreferencesItem)
2379
+ if (source == resetreferencesItem)
21682380 {
21692381 for (int i=0; i<group.selection.size(); i++)
21702382 {
....@@ -2173,11 +2385,11 @@
21732385
21742386 refreshContents();
21752387 } else
2176
- if (event.getSource() == setMasterItem)
2388
+ if (source == setMasterItem)
21772389 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792391 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21812393
21822394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832395 content = ((cGroup)content).get(0);
....@@ -2186,13 +2398,13 @@
21862398 refreshContents();
21872399 }
21882400 } else
2189
- if (event.getSource() == poseMeshItem)
2401
+ if (source == poseMeshItem)
21902402 {
21912403 if (group.selection.size() == 1)
21922404 {
2193
- if (GrafreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21942406 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21962408
21972409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982410 content = ((cGroup)content).get(0);
....@@ -2205,19 +2417,19 @@
22052417 }
22062418
22072419 } else
2208
- if (event.getSource() == revertMeshItem)
2420
+ if (source == revertMeshItem)
22092421 {
22102422 RevertMeshes();
22112423 } else
2212
- if (event.getSource() == resetMeshItem)
2424
+ if (source == resetAllItem)
22132425 {
22142426 ResetAll();
22152427 } else
2216
- if (event.getSource() == stepAllItem)
2428
+ if (source == stepAllItem)
22172429 {
22182430 StepAll();
22192431 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2432
+ if (source == clearItem) // || event.getSource() == clearButton)
22212433 {
22222434 //int indices[] = jList.getSelectedIndices();
22232435 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2437,46 @@
22252437
22262438 ClearSelection(false);
22272439 } else
2228
- if (event.getSource() == clearAllItem)
2440
+ if (source == clearAllItem)
22292441 {
22302442 ClearSelection(true);
22312443 } else
2232
- if (event.getSource() == grabItem)
2444
+ if (source == grabItem)
22332445 {
22342446 group(new cGroup(), true);
22352447 } else
2236
- if (event.getSource() == hideItem)
2448
+ if (source == hideItem)
22372449 {
22382450 group(new HiddenObject());
22392451 } else
2240
- if (event.getSource() == frontItem)
2452
+ if (source == frontItem)
22412453 {
22422454 front();
22432455 } else
2244
- if (event.getSource() == backItem)
2456
+ if (source == backItem)
22452457 {
22462458 back();
22472459 } else
2248
- if (event.getSource() == cameraItem)
2460
+ if (source == cameraItem)
22492461 {
22502462 makeSomething(new Camera());
22512463 } else
2252
- if (event.getSource() == compositeItem)
2464
+ if (source == compositeItem)
22532465 {
22542466 group(new Composite());
22552467 } else
2256
- if (event.getSource() == randomItem)
2468
+ if (source == randomItem)
22572469 {
22582470 RandomNode random = new RandomNode();
22592471 group(random);
22602472 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
22622474 } else
2263
- if (event.getSource() == physicsItem)
2475
+ if (source == physicsItem)
22642476 {
22652477 group(new PhysicsNode());
22662478 } else
2267
- if (event.getSource() == frameselectorItem)
2479
+ if (source == frameselectorItem)
22682480 {
22692481 for (int i=0; i<group.selection.size(); i++)
22702482 {
....@@ -2276,7 +2488,7 @@
22762488 ResetModel();
22772489 refreshContents();
22782490 } else
2279
- if (event.getSource() == switchGeoItem)
2491
+ if (source == switchGeoItem)
22802492 {
22812493 for (int i=0; i<group.selection.size(); i++)
22822494 {
....@@ -2288,7 +2500,7 @@
22882500 ResetModel();
22892501 refreshContents();
22902502 } else
2291
- if (event.getSource() == switchTransfoItem)
2503
+ if (source == switchTransfoItem)
22922504 {
22932505 for (int i=0; i<group.selection.size(); i++)
22942506 {
....@@ -2300,7 +2512,7 @@
23002512 ResetModel();
23012513 refreshContents();
23022514 } else
2303
- if (event.getSource() == morphItem)
2515
+ if (source == morphItem)
23042516 {
23052517 for (int i=0; i<group.selection.size(); i++)
23062518 {
....@@ -2312,7 +2524,7 @@
23122524 ResetModel();
23132525 refreshContents();
23142526 } else
2315
- if (event.getSource() == scriptNodeItem)
2527
+ if (source == scriptNodeItem)
23162528 {
23172529 boolean atleastone = false;
23182530
....@@ -2351,31 +2563,31 @@
23512563 }
23522564 }
23532565 } else
2354
- if (event.getSource() == linkerItem)
2566
+ if (source == linkerItem)
23552567 {
23562568 group(new cLinker());
23572569 } else
2358
- if (event.getSource() == textureItem)
2570
+ if (source == textureItem)
23592571 {
23602572 group(new TextureNode());
23612573 } else
2362
- if (event.getSource() == billboardItem)
2574
+ if (source == billboardItem)
23632575 {
23642576 group(new BillboardNode());
23652577 } else
2366
- if (event.getSource() == shadowXItem)
2578
+ if (source == shadowXItem)
23672579 {
23682580 CastShadow(0);
23692581 } else
2370
- if (event.getSource() == shadowYItem)
2582
+ if (source == shadowYItem)
23712583 {
23722584 CastShadow(1);
23732585 } else
2374
- if (event.getSource() == shadowZItem)
2586
+ if (source == shadowZItem)
23752587 {
23762588 CastShadow(2);
23772589 } else
2378
- if (event.getSource() == ungroupItem)
2590
+ if (source == ungroupItem)
23792591 {
23802592 //ungroup();
23812593 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2599,203 @@
23872599
23882600 refreshContents();
23892601 } else
2390
- if (event.getSource() == genUVItem)
2602
+ if (source == genUVItem)
23912603 {
23922604 GenUV();
23932605 } else
2394
- if (event.getSource() == genNormalsCADItem)
2606
+ if (source == genNormalsCADItem)
23952607 {
23962608 GenNormals(true);
23972609 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2610
+ if (source == genNormalsMESHItem)
23992611 {
2400
- GenNormals(true); // TODO
2612
+ GenNormalsMESH();
24012613 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2614
+ if (source == genNormalsORGANItem)
24032615 {
24042616 GenNormals(false);
24052617 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2618
+ if (source == genNormalsMINEItem)
24072619 {
24082620 GenNormalsMINE();
24092621 } else
2410
- if (event.getSource() == stripifyItem)
2622
+ if (source == stripifyItem)
24112623 {
24122624 Stripify();
24132625 } else
2414
- if (event.getSource() == unstripifyItem)
2626
+ if (source == unstripifyItem)
24152627 {
24162628 Unstripify();
24172629 } else
2418
- if (event.getSource() == trimItem)
2630
+ if (source == trimItem)
24192631 {
24202632 Trim();
24212633 } else
2422
- if (event.getSource() == untrimItem)
2634
+ if (source == untrimItem)
24232635 {
24242636 Untrim();
24252637 } else
2426
- if (event.getSource() == clearColorsItem)
2638
+ if (source == clearColorsItem)
24272639 {
24282640 ClearColors();
24292641 } else
2430
- if (event.getSource() == clearMaterialsItem)
2642
+ if (source == clearMaterialsItem)
24312643 {
24322644 ClearMaterials();
24332645 } else
2434
- if (event.getSource() == liveleavesItem)
2646
+ if (source == liveleavesItem)
24352647 {
24362648 LiveLeaves(true);
24372649 } else
2438
- if (event.getSource() == unliveleavesItem)
2650
+ if (source == unliveleavesItem)
24392651 {
24402652 LiveLeaves(false);
24412653 } else
2442
- if (event.getSource() == supportleavesItem)
2654
+ if (source == supportleavesItem)
24432655 {
24442656 SupportLeaves(true);
24452657 } else
2446
- if (event.getSource() == unsupportleavesItem)
2658
+ if (source == unsupportleavesItem)
24472659 {
24482660 SupportLeaves(false);
24492661 } else
2450
- if (event.getSource() == hideleavesItem)
2662
+ if (source == hideleavesItem)
24512663 {
24522664 HideLeaves(true);
24532665 } else
2454
- if (event.getSource() == showleavesItem)
2666
+ if (source == showleavesItem)
24552667 {
24562668 HideLeaves(false);
24572669 } else
2458
- if (event.getSource() == markleavesItem)
2670
+ if (source == markleavesItem)
24592671 {
24602672 MarkLeaves(true);
24612673 } else
2462
- if (event.getSource() == unmarkleavesItem)
2674
+ if (source == unmarkleavesItem)
24632675 {
24642676 MarkLeaves(false);
24652677 } else
2466
- if (event.getSource() == flipVItem)
2678
+ if (source == rewindleavesItem)
2679
+ {
2680
+ RewindLeaves(true);
2681
+ } else
2682
+ if (source == unrewindleavesItem)
2683
+ {
2684
+ RewindLeaves(false);
2685
+ } else
2686
+ if (source == randomleavesItem)
2687
+ {
2688
+ RandomLeaves(true);
2689
+ } else
2690
+ if (source == unrandomleavesItem)
2691
+ {
2692
+ RandomLeaves(false);
2693
+ } else
2694
+ if (source == flipVItem)
24672695 {
24682696 FlipV(true);
24692697 } else
2470
- if (event.getSource() == unflipVItem)
2698
+ if (source == unflipVItem)
24712699 {
24722700 FlipV(false);
24732701 } else
2474
- if (event.getSource() == lowTexturesItem)
2702
+ if (source == lowTexturesItem)
24752703 {
24762704 SetTexRes(0);
24772705 } else
2478
- if (event.getSource() == normalTexturesItem)
2706
+ if (source == normalTexturesItem)
24792707 {
24802708 SetTexRes(1);
24812709 } else
2482
- if (event.getSource() == highTexturesItem)
2710
+ if (source == highTexturesItem)
24832711 {
24842712 SetTexRes(2);
24852713 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2714
+ if (source == veryhighTexturesItem)
24872715 {
24882716 SetTexRes(3);
24892717 } else
2490
- if (event.getSource() == maxTexturesItem)
2718
+ if (source == maxTexturesItem)
24912719 {
24922720 SetTexRes(4);
24932721 } else
2494
- if (event.getSource() == panoTexturesItem)
2722
+ if (source == panoTexturesItem)
24952723 {
24962724 SetTexRes(5);
24972725 } else
2498
- if (event.getSource() == reverseNormalsItem)
2726
+ if (source == reverseNormalsItem)
24992727 {
25002728 ReverseNormals();
25012729 } else
2502
- if (event.getSource() == parseverticesItem)
2730
+ if (source == parseverticesItem)
25032731 {
25042732 ParseVertices();
25052733 } else
2506
- if (event.getSource() == textureFieldItem)
2734
+ if (source == textureFieldItem)
25072735 {
25082736 TextureVertices();
25092737 } else
2510
- if (event.getSource() == alignItem)
2738
+ if (source == alignItem)
25112739 {
25122740 Align();
25132741 } else
2514
- if (event.getSource() == mirrorItem)
2742
+ if (source == mirrorItem)
25152743 {
25162744 MirrorPoses();
25172745 } else
2518
- if (event.getSource() == reduceMorphItem)
2746
+ if (source == reduceMorphItem)
25192747 {
25202748 MeshReduction(false);
25212749 } else
2522
- if (event.getSource() == reduce34MorphItem)
2750
+ if (source == reduce34MorphItem)
25232751 {
25242752 MeshReduction(true);
25252753 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2754
+ if (source == reverseTrianglesItem)
25272755 {
25282756 ReverseTriangles();
25292757 } else
2530
- if (event.getSource() == reduceMeshItem)
2758
+ if (source == reduceMeshItem)
25312759 {
25322760 ReduceMesh(false);
25332761 } else
2534
- if (event.getSource() == reduce34MeshItem)
2762
+ if (source == reduce34MeshItem)
25352763 {
25362764 ReduceMesh(true);
25372765 } else
2538
- if (event.getSource() == increaseMeshItem)
2766
+ if (source == increaseMeshItem)
25392767 {
25402768 IncreaseMesh();
25412769 } else
2542
- if (event.getSource() == clipMeshItem)
2770
+ if (source == clipMeshItem)
25432771 {
25442772 ClipMesh();
25452773 } else
2546
- if (event.getSource() == smoothMeshItem)
2774
+ if (source == smoothMeshItem)
25472775 {
25482776 SmoothMesh();
25492777 } else
2550
- if (event.getSource() == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
25512779 {
25522780 TransformGeometry();
25532781 } else
2554
- if (event.getSource() == resetTransformItem)
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
2785
+ } else
2786
+ if (source == resetTransformItem)
25552787 {
25562788 ResetTransform();
25572789 } else
2558
- if (event.getSource() == resetCentroidItem)
2790
+ if (source == resetCentroidItem)
25592791 {
2560
- ResetCentroid();
2792
+ ResetCentroid(true);
25612793 } else
2562
- if (event.getSource() == resetParentItem)
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
2797
+ } else
2798
+ if (source == resetParentItem)
25632799 {
25642800 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652801 {
....@@ -2569,7 +2805,7 @@
25692805
25702806 refreshContents();
25712807 } else
2572
- if (event.getSource() == repairParentItem)
2808
+ if (source == repairParentItem)
25732809 {
25742810 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752811 {
....@@ -2583,7 +2819,7 @@
25832819
25842820 refreshContents();
25852821 } else
2586
- if (event.getSource() == repairShadowItem)
2822
+ if (source == repairShadowItem)
25872823 {
25882824 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892825 {
....@@ -2597,7 +2833,7 @@
25972833
25982834 refreshContents();
25992835 } else
2600
- if (event.getSource() == sortbysizeItem)
2836
+ if (source == sortbysizeItem)
26012837 {
26022838 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032839 {
....@@ -2609,7 +2845,7 @@
26092845 ResetModel();
26102846 refreshContents();
26112847 } else
2612
- if (event.getSource() == sortbynameItem)
2848
+ if (source == sortbynameItem)
26132849 {
26142850 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152851 {
....@@ -2621,7 +2857,7 @@
26212857 ResetModel();
26222858 refreshContents();
26232859 } else
2624
- if (event.getSource() == attachPigmentItem)
2860
+ if (source == attachPigmentItem)
26252861 {
26262862 String texture = GetFile("Attach pigment");
26272863 Object3D obj;
....@@ -2633,7 +2869,7 @@
26332869
26342870 refreshContents();
26352871 } else
2636
- if (event.getSource() == detachPigmentItem)
2872
+ if (source == detachPigmentItem)
26372873 {
26382874 Object3D obj;
26392875 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2880,7 @@
26442880
26452881 refreshContents();
26462882 } else
2647
- if (event.getSource() == attachBumpItem)
2883
+ if (source == attachBumpItem)
26482884 {
26492885 String texture = GetFile("Attach bump");
26502886 Object3D obj;
....@@ -2656,7 +2892,7 @@
26562892
26572893 refreshContents();
26582894 } else
2659
- if (event.getSource() == detachBumpItem)
2895
+ if (source == detachBumpItem)
26602896 {
26612897 Object3D obj;
26622898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2903,7 @@
26672903
26682904 refreshContents();
26692905 } else
2670
- if (event.getSource() == pigmentBumpItem)
2906
+ if (source == pigmentBumpItem)
26712907 {
26722908 Object3D obj;
26732909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2914,221 @@
26782914
26792915 refreshContents();
26802916 } else
2681
- if (event.getSource() == flashSelectionButton)
2917
+ if (source == flashSelectionButton)
26822918 {
26832919 CameraPane.flash = true;
26842920 refreshContents();
26852921 } else
2686
- if (event.getSource() == oneButton)
2922
+ if (source == oneButton)
26872923 {
26882924 } else
2689
- if (event.getSource() == twoButton)
2925
+ if (source == twoButton)
26902926 {
26912927 radio.layout = twoButton;
26922928 // bug
26932929 //gridPanel.setDividerLocation(1.0);
26942930 //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();
2931
+// bigThree.remove(scenePanel);
2932
+// bigThree.remove(centralPanel);
2933
+// bigThree.remove(XYZPanel);
2934
+// aWindowConstraints.gridx = 0;
2935
+// aWindowConstraints.gridy = 0;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// aWindowConstraints.weightx = 0;
2940
+// aWindowConstraints.weighty = 1;
2941
+// //bigThree.add(jtp, aWindowConstraints);
2942
+// aWindowConstraints.weightx = 1;
2943
+// aWindowConstraints.gridwidth = 3;
2944
+// // aConstraints.gridheight = 3;
2945
+// aWindowConstraints.gridx = 1;
2946
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2947
+// bigThree.add(centralPanel, aWindowConstraints);
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.gridx = 4;
2950
+// aWindowConstraints.gridwidth = 1;
2951
+// // aConstraints.gridheight = 3;
2952
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2953
+// //bigThree.add(XYZPanel, aWindowConstraints);
2954
+// scenePanel.setVisible(false);
2955
+// centralPanel.setVisible(true);
2956
+// XYZPanel.setVisible(false);
2957
+ bigThree.ClearUI();
2958
+ bigThree.add(centralPanel);
2959
+ bigThree.FlushUI();
2960
+
2961
+ cameraView.requestFocusInWindow();
2962
+
2963
+// refreshContents(true);
2964
+//
2965
+// try
2966
+// {
2967
+// java.awt.Robot bot = new java.awt.Robot();
2968
+// int mask = InputEvent.BUTTON1_MASK;
2969
+// bot.mouseMove(100, 100);
2970
+// bot.mousePress(mask);
2971
+// bot.mouseRelease(mask);
2972
+// }
2973
+// catch (Exception e)
2974
+// {
2975
+//
2976
+// }
2977
+
27192978 } else
2720
- if (event.getSource() == threeButton)
2979
+ if (source == threeButton)
27212980 {
27222981 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();
2982
+
2983
+// bigThree.remove(scenePanel);
2984
+// bigThree.remove(centralPanel);
2985
+// bigThree.remove(XYZPanel);
2986
+// aWindowConstraints.gridx = 0;
2987
+// aWindowConstraints.gridy = 0;
2988
+// aWindowConstraints.gridwidth = 1;
2989
+// // aConstraints.gridheight = 3;
2990
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2991
+// aWindowConstraints.weightx = 0;
2992
+// aWindowConstraints.weighty = 1;
2993
+// //bigThree.add(jtp, aWindowConstraints);
2994
+// aWindowConstraints.weightx = 1;
2995
+// aWindowConstraints.gridwidth = 3;
2996
+// // aConstraints.gridheight = 3;
2997
+// aWindowConstraints.gridx = 1;
2998
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2999
+// bigThree.add(centralPanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.gridx = 4;
3002
+// aWindowConstraints.gridwidth = 1;
3003
+// // aConstraints.gridheight = 3;
3004
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3005
+// bigThree.add(XYZPanel, aWindowConstraints);
3006
+// bigThree.validate();
3007
+// scenePanel.setVisible(false);
3008
+// centralPanel.setVisible(true);
3009
+// XYZPanel.setVisible(true);
3010
+ bigThree.ClearUI();
3011
+ bigThree.add(centralPanel);
3012
+ bigThree.add(XYZPanel);
3013
+ bigThree.FlushUI();
3014
+
3015
+ cameraView.requestFocusInWindow();
27473016 } else
2748
- if (event.getSource() == fourButton)
3017
+ if (source == fourButton)
27493018 {
27503019 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();
3020
+
3021
+// bigThree.remove(scenePanel);
3022
+// bigThree.remove(centralPanel);
3023
+// bigThree.remove(XYZPanel);
3024
+// aWindowConstraints.gridx = 0;
3025
+// aWindowConstraints.gridy = 0;
3026
+// aWindowConstraints.gridwidth = 1;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3029
+// aWindowConstraints.weightx = 1;
3030
+// aWindowConstraints.weighty = 1;
3031
+// bigThree.add(scenePanel, aWindowConstraints);
3032
+// aWindowConstraints.weightx = 1;
3033
+// aWindowConstraints.gridwidth = 3;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.gridx = 1;
3036
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3037
+// //bigThree.add(cameraPanel, aWindowConstraints);
3038
+// aWindowConstraints.weightx = 0;
3039
+// aWindowConstraints.gridx = 4;
3040
+// aWindowConstraints.gridwidth = 1;
3041
+// // aWindowConstraints.gridheight = 3;
3042
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3043
+// //bigThree.add(XYZPanel, aWindowConstraints);
3044
+// bigThree.validate();
3045
+// scenePanel.setVisible(true);
3046
+// centralPanel.setVisible(false);
3047
+// XYZPanel.setVisible(false);
3048
+ bigThree.ClearUI();
3049
+ bigThree.add(scenePanel);
3050
+ bigThree.FlushUI();
3051
+
3052
+ cameraView.requestFocusInWindow();
27753053 } else
2776
- if (event.getSource() == sixButton)
3054
+ if (source == sixButton)
27773055 {
27783056 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();
3057
+
3058
+// bigThree.remove(scenePanel);
3059
+// bigThree.remove(centralPanel);
3060
+// bigThree.remove(XYZPanel);
3061
+// aWindowConstraints.gridx = 0;
3062
+// aWindowConstraints.gridy = 0;
3063
+// aWindowConstraints.gridwidth = 1;
3064
+// // aConstraints.gridheight = 3;
3065
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3066
+// aWindowConstraints.weightx = 0;
3067
+// aWindowConstraints.weighty = 1;
3068
+// bigThree.add(scenePanel, aWindowConstraints);
3069
+// aWindowConstraints.weightx = 1;
3070
+// aWindowConstraints.gridwidth = 3;
3071
+// // aWindowConstraints.gridheight = 3;
3072
+// aWindowConstraints.gridx = 1;
3073
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3074
+// bigThree.add(centralPanel, aWindowConstraints);
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.gridx = 4;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aWindowConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// //bigThree.add(XYZPanel, aConstraints);
3081
+// bigThree.validate();
3082
+// scenePanel.setVisible(true);
3083
+// centralPanel.setVisible(true);
3084
+// XYZPanel.setVisible(false);
3085
+ bigThree.ClearUI();
3086
+ bigThree.add(scenePanel);
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.FlushUI();
3089
+
3090
+ cameraView.requestFocusInWindow();
28033091 } else
2804
- if (event.getSource() == sevenButton)
3092
+ if (source == sevenButton)
28053093 {
28063094 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();
3095
+
3096
+// bigThree.remove(scenePanel);
3097
+// bigThree.remove(centralPanel);
3098
+// bigThree.remove(XYZPanel);
3099
+// aWindowConstraints.gridx = 0;
3100
+// aWindowConstraints.gridy = 0;
3101
+// aWindowConstraints.gridwidth = 1;
3102
+// // aWindowConstraints.gridheight = 3;
3103
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3104
+// aWindowConstraints.weightx = 0;
3105
+// aWindowConstraints.weighty = 1;
3106
+// bigThree.add(scenePanel, aWindowConstraints);
3107
+// aWindowConstraints.weightx = 1;
3108
+// aWindowConstraints.gridwidth = 3;
3109
+// // aWindowConstraints.gridheight = 3;
3110
+// aWindowConstraints.gridx = 1;
3111
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3112
+// bigThree.add(centralPanel, aWindowConstraints);
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.gridx = 4;
3115
+// aWindowConstraints.gridwidth = 1;
3116
+// // aConstraints.gridheight = 3;
3117
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3118
+// bigThree.add(XYZPanel, aWindowConstraints);
3119
+// bigThree.validate();
3120
+// scenePanel.setVisible(true);
3121
+// centralPanel.setVisible(true);
3122
+// XYZPanel.setVisible(true);
3123
+ bigThree.ClearUI();
3124
+ bigThree.add(scenePanel);
3125
+ bigThree.add(centralPanel);
3126
+ bigThree.add(XYZPanel);
3127
+ bigThree.FlushUI();
3128
+
3129
+ cameraView.requestFocusInWindow();
28313130 } else
2832
- if (event.getSource() == rootButton)
3131
+ if (source == rootButton)
28333132 {
28343133 Object3D obj;
28353134 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,17 +3138,24 @@
28393138 EditObject(obj);
28403139 }
28413140
3141
+ cameraView.requestFocusInWindow();
28423142 refreshContents(true);
28433143 } else
2844
- if (event.getSource() == closeButton)
3144
+ if (source == closeButton)
28453145 {
28463146 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473147 cRadio ab;
28483148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493149 {
28503150 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
28533159 buttonGroup.remove(ab);
28543160 radioPanel.remove(ab);
28553161
....@@ -2860,13 +3166,15 @@
28603166 break;
28613167 }
28623168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
28633171 refreshContents(true);
28643172 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3173
+ if (source == editItem || source == editButton)
28663174 {
28673175 EditSelection(false);
28683176 } else
2869
- if (event.getSource() == uneditButton)
3177
+ if (source == uneditButton)
28703178 {
28713179 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723180 {
....@@ -2876,14 +3184,14 @@
28763184 child.CloseUI();
28773185 listUI.remove(child);
28783186
2879
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
28803188 }
2881
- objEditor.ctrlPanel.revalidate();
3189
+ objEditor.ctrlPanel.FlushUI();
28823190 //objEditor.jTree.clearSelection();
28833191 //objEditor.ResetSliders();
28843192 refreshContents(true);
28853193 } else
2886
- if (event.getSource() == clearPanelButton)
3194
+ if (source == clearPanelButton)
28873195 {
28883196 assert(copy == group);
28893197 //copy.ClearUI();
....@@ -2894,7 +3202,7 @@
28943202 listUI.clear();
28953203 refreshContents(true);
28963204 } else
2897
- if (event.getSource() == allParamsButton)
3205
+ if (source == allParamsButton)
28983206 {
28993207 assert(copy == group);
29003208
....@@ -2915,19 +3223,19 @@
29153223
29163224 refreshContents(true);
29173225 } else
2918
- if (event.getSource() == unselectButton)
3226
+ if (source == unselectButton)
29193227 {
29203228 objEditor.jTree.clearSelection();
29213229 // ?? oct 2012 GrafreeD.clipboard.clear();
29223230 objEditor.ResetSliders();
29233231 refreshContents(true);
29243232 } else
2925
- if(event.getSource() instanceof cRadio)
3233
+ if(source instanceof cRadio)
29263234 {
29273235 group.parent = keepparent;
29283236 group.attributes = 0;
29293237 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3238
+ /*cRadio*/ radio = (cRadio)source;
29313239 Object3D obj = radio.GetObject();
29323240 System.out.println("Edit " + obj);
29333241 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3270,10 @@
29623270 frontView.object = group;
29633271 sideView.object = group;
29643272 }
2965
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
29663277 /*
29673278 currentLayout = radio.layout;
29683279 if (currentLayout == null)
....@@ -2974,8 +3285,23 @@
29743285 //group.parent = null; // ROOT
29753286 //group.attributes = -1;
29763287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
29773290 refreshContents(true);
2978
- }
3291
+ } else if (event.getSource() == editCameraItem)
3292
+ {
3293
+ cameraView.ProtectCamera();
3294
+ cameraView.repaint();
3295
+ return;
3296
+ } else if (event.getSource() == revertCameraItem)
3297
+ {
3298
+ cameraView.RevertCamera();
3299
+ cameraView.repaint();
3300
+ return;
3301
+ // } else if (event.getSource() == textureButton)
3302
+ // {
3303
+ // return; // true;
3304
+ }
29793305 else
29803306 {
29813307 //return super.action(event, arg);
....@@ -2984,7 +3310,6 @@
29843310 }
29853311
29863312 boolean useclient = false;
2987
- cRadio radio;
29883313
29893314 void ToggleRoot()
29903315 {
....@@ -3036,6 +3361,28 @@
30363361 refreshContents();
30373362 }
30383363
3364
+ void TransformChildren()
3365
+ {
3366
+ Object3D obj;
3367
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3368
+ {
3369
+ obj = (Object3D)e.nextElement();
3370
+ obj.KeepTextureMatrices();
3371
+ obj.TransformChildren();
3372
+ obj.RestoreTextureMatrices();
3373
+
3374
+// if (obj.parent == null)
3375
+// {
3376
+// System.out.println("NULL PARENT!");
3377
+// new Exception().printStackTrace();
3378
+// }
3379
+// else
3380
+// TouchTransform(obj);
3381
+// //obj.parent.Touch();
3382
+ }
3383
+
3384
+ refreshContents();
3385
+ }
30393386
30403387 void ResetTransform()
30413388 {
....@@ -3148,7 +3495,7 @@
31483495 refreshContents();
31493496 }
31503497
3151
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
31523499 {
31533500 Object3D obj;
31543501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3510,16 @@
31633510 LA.matIdentity(Object3D.mat);
31643511 obj.getBounds(minima, maxima, false);
31653512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683516 obj.TransformMesh(Object3D.mat);
3517
+
31693518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
31723523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3548,8 @@
31973548
31983549 int size = obj.MemorySize();
31993550
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3551
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3552
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013553 }
32023554 }
32033555 catch (Exception e)
....@@ -3234,9 +3586,9 @@
32343586 obj = (Object3D)e.nextElement();
32353587
32363588 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
32383590 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
32403592
32413593 // System.err.println((size/1024) + " KB is the size of " + obj);
32423594 }
....@@ -3278,6 +3630,13 @@
32783630 void GenNormals(boolean crease)
32793631 {
32803632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
32813640
32823641 refreshContents();
32833642 }
....@@ -3450,8 +3809,8 @@
34503809
34513810 void ParseVertices()
34523811 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
34553814
34563815 for (int i=0; i<group.selection.size(); i++)
34573816 {
....@@ -3476,7 +3835,7 @@
34763835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783837
3479
- g.add(GrafreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
34803839
34813840 buffer.add(g);
34823841 }
....@@ -3491,7 +3850,7 @@
34913850 makeSomething(buffer, i==group.selection.size()-1);
34923851 }
34933852
3494
- GrafreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
34953854
34963855 refreshContents();
34973856 }
....@@ -3509,7 +3868,16 @@
35093868 String pigment = Object3D.GetPigment(tex);
35103869 //String bump = Object3D.GetBump(tex);
35113870
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3871
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3872
+
3873
+ try
3874
+ {
3875
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3876
+ }
3877
+ catch (Exception e)
3878
+ {
3879
+ System.err.println("FAIL: " + node);
3880
+ }
35133881
35143882 double s = v.s;
35153883
....@@ -3597,11 +3965,11 @@
35973965
35983966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993967
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
36023970 lowres.linkVerticesThis(null);
36033971 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
36053973
36063974 System.err.flush();
36073975
....@@ -3641,7 +4009,7 @@
36414009 return;
36424010
36434011 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
36454013
36464014 Object3D newgroup = new Object3D("Po:" + poses.name);
36474015
....@@ -3835,9 +4203,9 @@
38354203
38364204 void ClipMesh()
38374205 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394207 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
38414209
38424210 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434211 content = ((cGroup)content).get(0);
....@@ -3846,7 +4214,7 @@
38464214 // {
38474215 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484216 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
38504218 }
38514219 // group.selection.ClipMesh(GrafreeD.clipboard);
38524220 System.out.println("DONE.");
....@@ -3893,6 +4261,18 @@
38934261 void MarkLeaves(boolean hide)
38944262 {
38954263 group.selection.MarkLeaves(hide);
4264
+ refreshContents();
4265
+ }
4266
+
4267
+ void RewindLeaves(boolean hide)
4268
+ {
4269
+ group.selection.RewindLeaves(hide);
4270
+ refreshContents();
4271
+ }
4272
+
4273
+ void RandomLeaves(boolean hide)
4274
+ {
4275
+ group.selection.RandomLeaves(hide);
38964276 refreshContents();
38974277 }
38984278
....@@ -3981,7 +4361,7 @@
39814361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824362
39834363 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4364
+ if(elem != group || !newWindow)
39854365 {
39864366 // if (!(elem instanceof Composite))
39874367 // newWindow = false;
....@@ -4071,7 +4451,6 @@
40714451 //case 702: // Event.LIST_DESELECT
40724452 group.deselectAll();
40734453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754454 if (tps != null)
40764455 {
40774456 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4459,28 @@
40804459
40814460 //if (child.parent != null)
40824461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
40834463 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874464 }
40884465 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4466
+// else
4467
+// {
4468
+// objEditor.SetMaterial(group); // .GetMaterial());
4469
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4470
+// System.err.println("info : " + group.GetPath());
4471
+// }
40954472
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4473
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994474 CameraPane.flash = true;
41004475
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024477 // a camera
41034478 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4479
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4480
+ {
4481
+ CameraPane.camerachangeframe = 0; // don't refuse it
4482
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4483
+ }
41064484 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074485 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084486 }
....@@ -4115,6 +4493,26 @@
41154493
41164494 freezemodel = false;
41174495 }
4496
+
4497
+ void refreshContents(boolean cp)
4498
+ {
4499
+ if (!Globals.MOUSEDRAGGED)
4500
+ {
4501
+ objEditor.ClearInfo(); // .GetMaterial());
4502
+
4503
+ for (int i=0; i < group.selection.Size(); i++)
4504
+ {
4505
+ Object3D child = (Object3D) group.selection.get(i);
4506
+
4507
+ objEditor.AddInfo(child, this, true);
4508
+ System.err.println("info : " + child.GetPath());
4509
+ }
4510
+
4511
+ objEditor.SetText(); // jan 2014
4512
+ }
4513
+
4514
+ super.refreshContents(cp);
4515
+ }
41184516
41194517 void linkSomething(Object3D thing)
41204518 {
....@@ -4186,16 +4584,18 @@
41864584 {
41874585 if (group.selection.isEmpty())
41884586 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
41904589 Composite tGroup = null;
41914590 if (group.selection.size() > 0) // 1)
41924591 {
41934592 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
41954594 }
41964595
41974596 if (cut)
41984597 {
4598
+ Save();
41994599 //int indices[] = jList.getSelectedIndices();
42004600 //for (int i = indices.length - 1; i >= 0; i--)
42014601 //jList.remove(indices[i]);
....@@ -4231,16 +4631,16 @@
42314631 //System.out.println("cut " + child);
42324632 //System.out.println("parent = " + child.parent);
42334633 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
42354635 tGroup.add/*Child*/(tmp);
42364636 else
4237
- GrafreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
42384638 }
42394639 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
42414641 tGroup.add/*Child*/(child);
42424642 else
4243
- GrafreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
42444644 }
42454645
42464646 //ResetModel();
....@@ -4272,21 +4672,23 @@
42724672 //System.out.println("cut " + elem);
42734673 //System.out.println("parent = " + elem.parent);
42744674 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
42764676 tGroup.add/*Child*/(tmp);
42774677 else
4278
- GrafreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
42794679 }
42804680 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
42824682 tGroup.add/*Child*/(child);
42834683 else
4284
- GrafreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
42854685 }
42864686
42874687 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
42904692 if (cut)
42914693 {
42924694 ResetModel();
....@@ -4300,7 +4702,7 @@
43004702 // return;
43014703 boolean first = true;
43024704
4303
- if (GrafreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
43044706 {
43054707 Composite temp;
43064708
....@@ -4311,7 +4713,7 @@
43114713 temp = (Composite)Applet3D.clipboard.deepCopy();
43124714 */
43134715 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4716
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154717 {
43164718 Object3D child = (Object3D)e.nextElement();
43174719
....@@ -4345,21 +4747,21 @@
43454747 //Object3D cb = Applet3D.clipboard;
43464748 //temp.addChild(cb);
43474749 //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());
4750
+ assert(Grafreed.clipboard.parent == null);
4751
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4752
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4753
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4754
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534755 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
43564758 }
43574759
43584760 ResetModel();
43594761 refreshContents();
43604762 }
43614763
4362
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
43634765 {
43644766 // if (GrafreeD.clipboard == null)
43654767 // return;
....@@ -4388,15 +4790,22 @@
43884790 if (copyit)
43894791 {
43904792 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
43924801 }
43934802 else
43944803 {
43954804 boolean first = true;
43964805
4397
- if (GrafreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
43984807 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
44004809 Object3D copy;
44014810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024811 {
....@@ -4406,7 +4815,7 @@
44064815 }
44074816 } else
44084817 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
44104819 }
44114820 }
44124821 }
....@@ -4811,21 +5220,6 @@
48115220 }
48125221 */
48135222
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
-
48295223 /*
48305224 public void Callback(Object obj)
48315225 {
....@@ -4849,26 +5243,9 @@
48495243 }
48505244 */
48515245
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
-
48695246 String GetFile(String dialogName)
48705247 {
4871
- if (GrafreeD.standAlone)
5248
+ if (Grafreed.standAlone)
48725249 {
48735250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745251 browser.show();
....@@ -4932,10 +5309,18 @@
49325309 cButton flashSelectionButton;
49335310 cButton editButton;
49345311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
49355313 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375314 cButton unselectButton;
49385315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
49395324 cButton screenfitButton;
49405325 cButton screenfitpointButton;
49415326 cButton snapobjectButton;
....@@ -4946,14 +5331,6 @@
49465331 cButton closeButton;
49475332
49485333 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;
49575334
49585335 //
49595336 //Composite
....@@ -4966,6 +5343,8 @@
49665343 private MenuItem lookFromItem;
49675344 private MenuItem switchItem;
49685345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
49695348 private MenuItem duplicateItem;
49705349 private MenuItem cloneItem;
49715350 private MenuItem cloneSupportItem;
....@@ -4979,7 +5358,7 @@
49795358 private MenuItem linkverticesItem;
49805359 private MenuItem relinkverticesItem;
49815360 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
49835362 private MenuItem stepAllItem;
49845363 private MenuItem revertMeshItem;
49855364 private MenuItem poseMeshItem;
....@@ -4990,6 +5369,7 @@
49905369 private MenuItem mergeGeometriesItem;
49915370 private MenuItem copyItem;
49925371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
49935373 private MenuItem pasteLinkItem;
49945374 private MenuItem pasteCloneItem;
49955375 private MenuItem pasteExpandItem;
....@@ -5028,6 +5408,10 @@
50285408 private MenuItem showleavesItem;
50295409 private MenuItem markleavesItem;
50305410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
50315415
50325416 private MenuItem flipVItem;
50335417 private MenuItem unflipVItem;
....@@ -5039,8 +5423,10 @@
50395423 private MenuItem panoTexturesItem;
50405424
50415425 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
50435427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
50445430 private MenuItem hideItem;
50455431 private MenuItem grabItem;
50465432 private MenuItem backItem;
....@@ -5087,7 +5473,7 @@
50875473 private MenuItem blobItem;
50885474 private MenuItem latheItem;
50895475 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
50915477 private MenuItem meshItem;
50925478 // private MenuItem meshGroupItem;
50935479 private MenuItem springItem;
....@@ -5109,11 +5495,6 @@
51095495 private MenuItem doubleItem;
51105496 private MenuItem tripleItem;
51115497
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175498 private MenuItem computeAOItem;
51185499 private MenuItem recompileItem;
51195500 private MenuItem editScriptItem;
....@@ -5123,4 +5504,8 @@
51235504 private MenuItem analyzeItem;
51245505 private MenuItem dumpItem;
51255506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
51265511 }