Normand Briere
2019-06-24 914255f70cf047897212839cbf3a6722703f4457
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +368,35 @@
262368 billboardItem.addActionListener(this);
263369 csgItem = menu.add(new MenuItem("CSG"));
264370 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266372 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268374 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +469,14 @@
341469 markleavesItem.addActionListener(this);
342470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
344480 menu.add("-");
345481 flipVItem = menu.add(new MenuItem("Flip V"));
346482 flipVItem.addActionListener(this);
....@@ -376,35 +512,40 @@
376512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377513 sortbynameItem.addActionListener(this);
378514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
379522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380523 extractGeometriesItem.addActionListener(this);
381524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382525 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
526
+ }
387527
388528 oe.menuBar.add(menu = new Menu("Insert"));
389529 buildCreateMenu(menu);
390530
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402531 oe.menuBar.add(menu = new Menu("Tools"));
403532 buildToolsMenu(menu);
404533 }
405534
406535 void SetupUI2(ObjEditor oe)
407536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
408549 //new Exception().printStackTrace();
409550
410551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,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 = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
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(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
+ fastCB.setToolTipText("Fast mode");
609
+ fastCB.addItemListener(this);
610
+
611
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ oneStepButton.setToolTipText("Animate one step forward");
613
+ oneStepButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
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 = GetButton("icons/fit.png", !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);
471
- flashSelectionButton.setToolTipText("Show selection");
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Highlight selection");
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,46 @@
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
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
+ autosaveCB.setToolTipText("Auto-save on structure change");
820
+ autosaveCB.addItemListener(this);
821
+
822
+ if (Globals.ADVANCED)
823
+ {
824
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676825 lookAtCB.setToolTipText("Look-at target");
677826 lookAtCB.addItemListener(this);
827
+ }
828
+
829
+ }
830
+
831
+ cGridBag fill = new cGridBag();
832
+
833
+ fill.preferredHeight = 200;
834
+
835
+ panel.add(fill);
678836
679837 }
680838
681839 void EditObject(Object3D obj)
682840 {
683841 cRadio radioButton = new cRadio(obj.name);
842
+
843
+ // Patch to avoid bug with transparency.
844
+ radioButton.hadMaterial = obj.material != null;
845
+ if (!radioButton.hadMaterial)
846
+ {
847
+ obj.material = new cMaterial();
848
+ }
849
+
684850 radioButton.SetObject(obj);
685851 radioButton.layout = sevenButton;
686852 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +855,11 @@
689855 buttonGroup.add(radioButton);
690856 radioButton.doClick();
691857 }
858
+
692859 void SetupViews(ObjEditor oe)
693860 {
861
+ theFrame = this;
862
+
694863 oe.SetupViews();
695864
696865 System.out.println("SetupViews");
....@@ -699,23 +868,26 @@
699868 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
700869 }
701870
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
871
+ cCheckBox liveCB;
872
+ cCheckBox supportCB;
873
+ cCheckBox localCB;
874
+ cCheckBox crowdCB;
875
+ cCheckBox smoothCB;
876
+ cCheckBox fastCB;
877
+ cCheckBox slowCB;
878
+ cCheckBox boxCB;
879
+ cCheckBox zoomBoxCB;
880
+ cCheckBox trackCB;
881
+ cCheckBox smoothfocusCB;
713882 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
883
+ cCheckBox speakerCameraCB;
884
+ cCheckBox speakerFocusCB;
885
+ cCheckBox debugCB;
886
+
887
+ cCheckBox oeilCB;
888
+ cCheckBox shadowCB;
889
+ cCheckBox autosaveCB;
890
+ cCheckBox lookAtCB;
719891
720892 // static int COLOR = 1;
721893 // static int MATERIAL = 2;
....@@ -723,9 +895,9 @@
723895
724896 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
725897
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
898
+ cCheckBox colorCB;
899
+ cCheckBox materialCB;
900
+ cCheckBox textureCB;
729901
730902 public void itemStateChanged(ItemEvent e)
731903 {
....@@ -753,6 +925,7 @@
753925 } else if(e.getSource() == liveCB)
754926 {
755927 cameraView.ToggleLive();
928
+ refreshContents(false);
756929 }
757930 else if(e.getSource() == supportCB)
758931 {
....@@ -816,6 +989,14 @@
816989 else if(e.getSource() == oeilCB)
817990 {
818991 cameraView.ToggleOeil();
992
+ }
993
+ else if(e.getSource() == shadowCB)
994
+ {
995
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
996
+ }
997
+ else if(e.getSource() == autosaveCB)
998
+ {
999
+ Globals.SAVEONMAKE ^= true;
8191000 }
8201001 else if(e.getSource() == lookAtCB)
8211002 {
....@@ -905,7 +1086,9 @@
9051086 // objEditor.DropFile((java.io.File[]) object, true);
9061087 // return;
9071088 // }
908
- if (string.charAt(0) == '/')
1089
+
1090
+ // File path for Mac and Windows
1091
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091092 {
9101093 // file(s)
9111094 String[] names = string.split("\n");
....@@ -932,7 +1115,7 @@
9321115
9331116 flashIt = false;
9341117 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1118
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361119 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371120
9381121 if (group.selection.size() == 1)
....@@ -959,11 +1142,11 @@
9591142 {
9601143 loadClipboard(true);
9611144 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1145
+ pasteInto(false, false);
9631146 } else {
9641147 loadClipboard(false);
9651148 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1149
+ pasteInto(false, false); // true); // ???
9671150 }
9681151 }
9691152 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1268,33 @@
10851268 kleinItem.addActionListener(this);
10861269 particleItem = menu.add(new MenuItem("Particle system"));
10871270 particleItem.addActionListener(this);
1271
+ if (Globals.ADVANCED)
1272
+ {
10881273 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891274 ragdollItem.addActionListener(this);
10901275 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911276 ragdoll2Item.addActionListener(this);
1277
+ }
10921278 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1279
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941280 meshItem.addActionListener(this);
10951281 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961282 // meshGroupItem.addActionListener(this);
1283
+ if (Globals.ADVANCED)
1284
+ {
10971285 springItem = menu.add(new MenuItem("Spring"));
10981286 springItem.addActionListener(this);
10991287 flagItem = menu.add(new MenuItem("Flag"));
11001288 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);
11051289 blobItem = menu.add(new MenuItem("Blob"));
11061290 blobItem.addActionListener(this);
11071291 latheItem = menu.add(new MenuItem("Lathe"));
11081292 latheItem.addActionListener(this);
1293
+ }
1294
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1295
+ bezierItem.addActionListener(this);
1296
+ overlayItem = menu.add(new MenuItem("Overlay"));
1297
+ overlayItem.addActionListener(this);
11091298 lightItem = menu.add(new MenuItem("Light"));
11101299 lightItem.addActionListener(this);
11111300 menu.add("-");
....@@ -1115,39 +1304,44 @@
11151304 loopItem.addActionListener(this);
11161305 doubleItem = menu.add(new MenuItem("Fork"));
11171306 doubleItem.addActionListener(this);
1307
+ if (Globals.ADVANCED)
1308
+ {
11181309 tripleItem = menu.add(new MenuItem("Trident"));
11191310 tripleItem.addActionListener(this);
1311
+ }
11201312 }
11211313
11221314 void buildToolsMenu(Menu menu)
11231315 {
11241316 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251317 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1318
+ animationItem.setState(Globals.ANIMATION);
11271319
11281320 menu.add("-");
11291321 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301322 parseverticesItem.addActionListener(this);
11311323 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321324 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1325
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341326 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371327 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381328 reduceMorphItem.addActionListener(this);
11391329 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401330 reduce34MorphItem.addActionListener(this);
1141
-
1331
+ menu.add("-");
11421332 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431333 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451334
1335
+ if (Globals.ADVANCED)
1336
+ {
1337
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1338
+ mirrorItem.addActionListener(this);
1339
+ menu.add("-");
11461340 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471341 memoryItem.addActionListener(this);
11481342 menu.add(analyzeItem = new MenuItem("Analyze"));
11491343 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1344
+ menu.add(dumpItem = new MenuItem("Print"));
11511345 dumpItem.addActionListener(this);
11521346 // menu.add(pathItem = new MenuItem("From-to path"));
11531347 // pathItem.addActionListener(this);
....@@ -1165,6 +1359,7 @@
11651359 menu.add("-");
11661360 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671361 editScriptItem.addActionListener(this);
1362
+ }
11681363 }
11691364
11701365 void ScreenFit()
....@@ -1287,6 +1482,7 @@
12871482 shadow.material = new cMaterial(obj.material);
12881483 shadow.material.diffuse = 0.0001f;
12891484 shadow.material.specular = 0.0001f;
1485
+ //shadow.projectedVertices[1].x = 300;
12901486
12911487 makeSomething(shadow);
12921488 }
....@@ -1493,9 +1689,9 @@
14931689
14941690 void Overwrite(int mask)
14951691 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1692
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971693 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1694
+ Object3D content = Grafreed.clipboard.get(0);
14991695
15001696 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011697 content = ((cGroup)content).get(0);
....@@ -1518,6 +1714,7 @@
15181714 //
15191715 public void actionPerformed(ActionEvent event) // , Object arg)
15201716 {
1717
+ Object source = event.getSource();
15211718 /*
15221719 if (event.getSource() == nameField)
15231720 {
....@@ -1529,11 +1726,11 @@
15291726 }
15301727 else
15311728 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1729
+ if (source == lookAtItem || source == lookFromItem)
15331730 {
15341731 ScreenFit();
15351732 } else
1536
- if (event.getSource() == switchItem)
1733
+ if (source == switchItem)
15371734 {
15381735 cVector v1 = new cVector();
15391736 cVector v2 = new cVector();
....@@ -1542,11 +1739,11 @@
15421739 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431740 objEditor.cameraView.repaint();
15441741 } else
1545
- if (event.getSource() == rectoidItem)
1742
+ if (source == rectoidItem)
15461743 {
15471744 makeSomething(new Box());
15481745 } else
1549
- if (event.getSource() == particleItem)
1746
+ if (source == particleItem)
15501747 {
15511748 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521749 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1764,9 @@
15671764 applyExample(particleGeom, "SMOKE");
15681765 makeSomething(particleGeom);
15691766 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1767
+ if (source == ragdollItem || source == ragdoll2Item)
15711768 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1769
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731770
15741771 ragdoll.toParent = LA.newMatrix();
15751772 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1784,7 @@
15871784 } else
15881785 /*
15891786 */
1590
- if (event.getSource() == heightFieldItem)
1787
+ if (source == heightFieldItem)
15911788 {
15921789 Object3D obj = new Object3D();
15931790
....@@ -1625,31 +1822,31 @@
16251822
16261823 makeSomething(obj);
16271824 } else
1628
- if (event.getSource() == gridItem)
1825
+ if (source == gridItem)
16291826 {
16301827 makeSomething(new Grid());
16311828 } else
1632
- if (event.getSource() == ellipsoidItem)
1829
+ if (source == ellipsoidItem)
16331830 {
16341831 makeSomething(new Sphere());
16351832 } else
1636
- if (event.getSource() == coneItem)
1833
+ if (source == coneItem)
16371834 {
16381835 makeSomething(new Cone());
16391836 } else
1640
- if (event.getSource() == torusItem)
1837
+ if (source == torusItem)
16411838 {
16421839 makeSomething(new Torus());
16431840 } else
1644
- if (event.getSource() == superItem)
1841
+ if (source == superItem)
16451842 {
16461843 makeSomething(new Superellipsoid());
16471844 } else
1648
- if (event.getSource() == kleinItem)
1845
+ if (source == kleinItem)
16491846 {
16501847 makeSomething(new Klein());
16511848 } else
1652
- if (event.getSource() == blobItem)
1849
+ if (source == blobItem)
16531850 {
16541851 Blob blob = new Blob();
16551852 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1854,15 @@
16571854 //blob.retile();
16581855 makeSomething(blob);
16591856 } else
1660
- if (event.getSource() == latheItem)
1857
+ if (source == latheItem)
16611858 {
16621859 makeSomething(new Lathe());
16631860 } else
1664
- if (event.getSource() == bezierItem)
1861
+ if (source == bezierItem)
16651862 {
16661863 makeSomething(new BezierSurface());
16671864 } else
1668
- if (event.getSource() == checkerItem)
1865
+ if (source == overlayItem)
16691866 {
16701867 /*
16711868 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1877,7 @@
16801877 */
16811878 makeSomething(new Checker());
16821879 } else
1683
- if (event.getSource() == meshItem)
1880
+ if (source == meshItem)
16841881 {
16851882 Object3D itemtomake = new Object3D();
16861883 Object3D child;
....@@ -1701,35 +1898,35 @@
17011898 makeSomething(child);
17021899 }
17031900 } else
1704
- if (event.getSource() == springItem)
1901
+ if (source == springItem)
17051902 {
17061903 cSpring s = new cSpring();
17071904 s.setup();
17081905 makeSomething(s);
17091906 } else
1710
- if (event.getSource() == flagItem)
1907
+ if (source == flagItem)
17111908 {
17121909 cSpring s = new cFlag();
17131910 s.setup();
17141911 makeSomething(s);
17151912 } else
1716
- if (event.getSource() == lightItem)
1913
+ if (source == lightItem)
17171914 {
17181915 makeSomething(new Light());
17191916 } else
1720
- if (event.getSource() == csgItem)
1917
+ if (source == csgItem)
17211918 {
17221919 group(new CSG());
17231920 } else
1724
- if (event.getSource() == templateItem)
1921
+ if (source == templateItem)
17251922 {
17261923 group(new cTemplate());
17271924 } else
1728
- if (event.getSource() == attributeItem)
1925
+ if (source == attributeItem)
17291926 {
17301927 makeSomething(new Attribute());
17311928 } else
1732
- if (event.getSource() == pointflowItem)
1929
+ if (source == pointflowItem)
17331930 {
17341931 makeSomething(new PointFlow());
17351932 } else
....@@ -1741,7 +1938,7 @@
17411938 } else
17421939 */
17431940
1744
- if (event.getSource() == superLoopItem)
1941
+ if (source == superLoopItem)
17451942 {
17461943 Composite g = new cGroup();
17471944 for (int i=0; i<15; i++)
....@@ -1763,7 +1960,7 @@
17631960
17641961 group(g);
17651962 } else
1766
- if (event.getSource() == loopItem)
1963
+ if (source == loopItem)
17671964 {
17681965 Composite csg = new GroupLeaf();
17691966 csg.count = 5;
....@@ -1772,7 +1969,7 @@
17721969 csg.addChild(child);
17731970 child.addChild(csg);
17741971 } else
1775
- if (event.getSource() == doubleItem)
1972
+ if (source == doubleItem)
17761973 {
17771974 Composite csg = new GroupLeaf();
17781975 csg.count = 5;
....@@ -1784,7 +1981,7 @@
17841981 csg.addChild(child);
17851982 child.addChild(csg);
17861983 } else
1787
- if (event.getSource() == tripleItem)
1984
+ if (source == tripleItem)
17881985 {
17891986 Composite csg = new GroupLeaf();
17901987 csg.count = 4;
....@@ -1799,71 +1996,83 @@
17991996 csg.addChild(child);
18001997 child.addChild(csg);
18011998 } 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)
1999
+ if (source == computeAOItem)
18202000 {
18212001 Globals.drawMode = CameraPane.OCCLUSION;
18222002 Globals.theRenderer.repaint();
18232003 } else
1824
- if (event.getSource() == recompileItem)
2004
+ if (source == recompileItem)
18252005 {
18262006 Recompile();
18272007 refreshContents();
18282008 } else
1829
- if (event.getSource() == editScriptItem)
2009
+ if (source == editScriptItem)
18302010 {
18312011 OpenDialog();
18322012 refreshContents();
18332013 } else
1834
- if (event.getSource() == invariantsItem)
2014
+ if (source == invariantsItem)
18352015 {
18362016 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2017
+ Grafreed.grafreeD.universe.invariants();
18382018 } else
1839
- if (event.getSource() == memoryItem)
2019
+ if (source == memoryItem)
18402020 {
18412021 //System.out.println("Invariants:");
18422022 PrintMemory();
18432023 } else
1844
- if (event.getSource() == pathItem)
2024
+ if (source == pathItem)
18452025 {
18462026 PrintPath();
18472027 } else
1848
- if (event.getSource() == analyzeItem)
2028
+ if (source == analyzeItem)
18492029 {
18502030 AnalyzeObject();
18512031 } else
1852
- if (event.getSource() == dumpItem)
2032
+ if (source == dumpItem)
18532033 {
18542034 DumpObject();
18552035 } else
1856
- if (event.getSource() == screenfitButton)
2036
+ if (source == minButton)
2037
+ {
2038
+ Minimize();
2039
+ } else
2040
+ if (source == maxButton)
2041
+ {
2042
+ Maximize();
2043
+ } else
2044
+ if (source == fullButton)
2045
+ {
2046
+ ToggleFullScreen();
2047
+ } else
2048
+ if (source == undoButton)
2049
+ {
2050
+ Undo();
2051
+ } else
2052
+ if (source == redoButton)
2053
+ {
2054
+ Redo();
2055
+ } else
2056
+ if (source == saveButton)
2057
+ {
2058
+ Save();
2059
+ } else
2060
+ if (source == oneStepButton)
2061
+ {
2062
+ Globals.ONESTEP = true;
2063
+ cameraView.repaint();
2064
+ } else
2065
+ if (source == screenfitButton)
18572066 {
18582067 //Reload(lastConverter, lastFilename, true);
18592068 ScreenFit();
18602069 } else
1861
- if (event.getSource() == screenfitpointButton)
2070
+ if (source == screenfitpointButton)
18622071 {
18632072 //Reload(lastConverter, lastFilename, true);
18642073 ScreenFitPoint();
18652074 } else
1866
- if (event.getSource() == snapobjectButton)
2075
+ if (source == snapobjectButton)
18672076 {
18682077 //Reload(lastConverter, lastFilename, true);
18692078 SnapObject();
....@@ -1874,13 +2083,13 @@
18742083 // Recompile();
18752084 // refreshContents();
18762085 // } else
1877
- if (event.getSource() == gcButton)
2086
+ if (source == gcButton)
18782087 {
18792088 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802089 System.gc();
18812090 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822091 } else
1883
- if (event.getSource() == editLeafItem)
2092
+ if (source == editLeafItem)
18842093 {
18852094 Object3D obj;
18862095 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2103,74 @@
18942103 }
18952104 refreshContents(true);
18962105 } else
1897
- if (event.getSource() == openWindowItem)
2106
+ if (source == openWindowItem)
18982107 {
18992108 EditSelection(true);
19002109 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2110
+ if (source == cutItem || source == clearButton)
19022111 {
19032112 loadClipboard(true);
19042113 } else
1905
- if (event.getSource() == duplicateItem)
2114
+ if (source == undoItem)
19062115 {
1907
- Object3D keep = GrafreeD.clipboard;
2116
+ Undo();
2117
+ } else
2118
+ if (source == redoItem)
2119
+ {
2120
+ Redo();
2121
+ } else
2122
+ if (source == duplicateItem)
2123
+ {
2124
+ Object3D keep = Grafreed.clipboard;
19082125 loadClipboard(false);
19092126 paste(false);
1910
- GrafreeD.clipboard = keep;
2127
+ Grafreed.clipboard = keep;
19112128 } else
1912
- if (event.getSource() == cloneItem)
2129
+ if (source == cloneItem)
19132130 {
19142131 CloneSelection(false);
19152132 } else
1916
- if (event.getSource() == cloneSupportItem)
2133
+ if (source == cloneSupportItem)
19172134 {
19182135 CloneSelection(true);
19192136 } else
1920
- if (event.getSource() == copyItem)
2137
+ if (source == copyItem)
19212138 {
19222139 loadClipboard(false);
19232140 } else
1924
- if (event.getSource() == pasteItem)
2141
+ if (source == pasteItem)
19252142 {
19262143 paste(false);
19272144 } else
1928
- if (event.getSource() == pasteLinkItem)
2145
+ if (source == pasteIntoItem)
19292146 {
1930
- pasteInto(false);
2147
+ pasteInto(true, false);
19312148 } else
1932
- if (event.getSource() == pasteCloneItem)
2149
+ if (source == pasteLinkItem)
19332150 {
1934
- pasteInto(true);
2151
+ pasteInto(false, false);
19352152 } else
1936
- if (event.getSource() == pasteExpandItem)
2153
+ if (source == pasteCloneItem)
2154
+ {
2155
+ pasteInto(true, true);
2156
+ } else
2157
+ if (source == pasteExpandItem)
19372158 {
19382159 paste(true);
19392160 } else
1940
- if (event.getSource() == synchronizeItem)
2161
+ if (source == synchronizeItem)
19412162 {
19422163 Overwrite(Object3D.TRANSFORM);
19432164 } else
1944
- if (event.getSource() == overwriteNameItem)
2165
+ if (source == overwriteNameItem)
19452166 {
19462167 Overwrite(Object3D.NAME);
19472168 } else
1948
- if (event.getSource() == overwriteUVItem)
2169
+ if (source == overwriteUVItem)
19492170 {
19502171 Overwrite(Object3D.UV);
19512172 } else
1952
- if (event.getSource() == overwriteMatItem)
2173
+ if (source == overwriteMatItem)
19532174 {
19542175 /* july 2015
19552176 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2190,7 @@
19692190
19702191 Overwrite(dropAttributes);
19712192 }
1972
- if (event.getSource() == overwriteGeoItem)
2193
+ if (source == overwriteGeoItem)
19732194 {
19742195 Overwrite(Object3D.GEOMETRY);
19752196 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2207,7 @@
19862207 // refreshContents();
19872208 // }
19882209 } else
1989
- if (event.getSource() == generateMeshItem)
2210
+ if (source == generateMeshItem)
19902211 {
19912212 //if (group.selection.size() == 1)
19922213 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2218,7 @@
19972218 ResetModel();
19982219 refreshContents();
19992220 } else
2000
- if (event.getSource() == extractGeometriesItem)
2221
+ if (source == extractGeometriesItem)
20012222 {
20022223 boolean one = false;
20032224
....@@ -2024,7 +2245,7 @@
20242245 ResetModel();
20252246 refreshContents();
20262247 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2248
+ if (source == cloneGeometriesItem)
20282249 {
20292250 boolean one = false;
20302251
....@@ -2050,7 +2271,7 @@
20502271 ResetModel();
20512272 refreshContents();
20522273 } else
2053
- if (event.getSource() == shareGeometriesItem)
2274
+ if (source == shareGeometriesItem)
20542275 {
20552276 boolean one = false;
20562277
....@@ -2080,7 +2301,7 @@
20802301 refreshContents();
20812302 }
20822303 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2304
+ if (source == mergeGeometriesItem)
20842305 {
20852306 boolean one = false;
20862307
....@@ -2110,7 +2331,7 @@
21102331 ResetModel();
21112332 refreshContents();
21122333 } else
2113
- if (event.getSource() == linkverticesItem)
2334
+ if (source == linkverticesItem)
21142335 {
21152336 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162337 // {
....@@ -2123,9 +2344,9 @@
21232344 // group.selection.get(0).setMasterThis(content); // should be identity
21242345 // refreshContents();
21252346 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2347
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272348 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2349
+ Object3D content = Grafreed.clipboard.get(0);
21292350
21302351 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312352 content = ((cGroup)content).get(0);
....@@ -2133,38 +2354,38 @@
21332354 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342355 for (int i=0; i<group.selection.size(); i++)
21352356 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2357
+ boolean random = CameraPane.SWITCH;
2358
+ CameraPane.SWITCH = false; // parse all random nodes
21382359 group.selection.get(i).linkVerticesThis(content);
21392360 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2361
+ CameraPane.SWITCH = random;
21412362 }
21422363 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432364 refreshContents();
21442365 }
21452366 } else
2146
- if (event.getSource() == resetsupportItem)
2367
+ if (source == resetsupportItem)
21472368 {
21482369 for (int i=0; i<group.selection.size(); i++)
21492370 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2371
+ boolean random = CameraPane.SWITCH;
2372
+ CameraPane.SWITCH = false; // parse all random nodes
21522373 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2374
+ CameraPane.SWITCH = random;
21542375 }
21552376
21562377 refreshContents();
21572378 } else
2158
- if (event.getSource() == relinkverticesItem)
2379
+ if (source == relinkverticesItem)
21592380 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2381
+ boolean random = CameraPane.SWITCH;
2382
+ CameraPane.SWITCH = false; // parse all random nodes
21622383 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2384
+ CameraPane.SWITCH = random;
21642385
21652386 refreshContents();
21662387 } else
2167
- if (event.getSource() == resetreferencesItem)
2388
+ if (source == resetreferencesItem)
21682389 {
21692390 for (int i=0; i<group.selection.size(); i++)
21702391 {
....@@ -2173,11 +2394,11 @@
21732394
21742395 refreshContents();
21752396 } else
2176
- if (event.getSource() == setMasterItem)
2397
+ if (source == setMasterItem)
21772398 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2399
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792400 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2401
+ Object3D content = Grafreed.clipboard.get(0);
21812402
21822403 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832404 content = ((cGroup)content).get(0);
....@@ -2186,13 +2407,13 @@
21862407 refreshContents();
21872408 }
21882409 } else
2189
- if (event.getSource() == poseMeshItem)
2410
+ if (source == poseMeshItem)
21902411 {
21912412 if (group.selection.size() == 1)
21922413 {
2193
- if (GrafreeD.clipboard.size() == 1)
2414
+ if (Grafreed.clipboard.size() == 1)
21942415 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2416
+ Object3D content = Grafreed.clipboard.get(0);
21962417
21972418 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982419 content = ((cGroup)content).get(0);
....@@ -2205,19 +2426,19 @@
22052426 }
22062427
22072428 } else
2208
- if (event.getSource() == revertMeshItem)
2429
+ if (source == revertMeshItem)
22092430 {
22102431 RevertMeshes();
22112432 } else
2212
- if (event.getSource() == resetMeshItem)
2433
+ if (source == resetAllItem)
22132434 {
22142435 ResetAll();
22152436 } else
2216
- if (event.getSource() == stepAllItem)
2437
+ if (source == stepAllItem)
22172438 {
22182439 StepAll();
22192440 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2441
+ if (source == clearItem) // || event.getSource() == clearButton)
22212442 {
22222443 //int indices[] = jList.getSelectedIndices();
22232444 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2446,46 @@
22252446
22262447 ClearSelection(false);
22272448 } else
2228
- if (event.getSource() == clearAllItem)
2449
+ if (source == clearAllItem)
22292450 {
22302451 ClearSelection(true);
22312452 } else
2232
- if (event.getSource() == grabItem)
2453
+ if (source == grabItem)
22332454 {
22342455 group(new cGroup(), true);
22352456 } else
2236
- if (event.getSource() == hideItem)
2457
+ if (source == hideItem)
22372458 {
22382459 group(new HiddenObject());
22392460 } else
2240
- if (event.getSource() == frontItem)
2461
+ if (source == frontItem)
22412462 {
22422463 front();
22432464 } else
2244
- if (event.getSource() == backItem)
2465
+ if (source == backItem)
22452466 {
22462467 back();
22472468 } else
2248
- if (event.getSource() == cameraItem)
2469
+ if (source == cameraItem)
22492470 {
22502471 makeSomething(new Camera());
22512472 } else
2252
- if (event.getSource() == compositeItem)
2473
+ if (source == compositeItem)
22532474 {
22542475 group(new Composite());
22552476 } else
2256
- if (event.getSource() == randomItem)
2477
+ if (source == randomItem)
22572478 {
22582479 RandomNode random = new RandomNode();
22592480 group(random);
22602481 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2482
+ random.name = random.get(0).name + "Switch";
22622483 } else
2263
- if (event.getSource() == physicsItem)
2484
+ if (source == physicsItem)
22642485 {
22652486 group(new PhysicsNode());
22662487 } else
2267
- if (event.getSource() == frameselectorItem)
2488
+ if (source == frameselectorItem)
22682489 {
22692490 for (int i=0; i<group.selection.size(); i++)
22702491 {
....@@ -2276,7 +2497,7 @@
22762497 ResetModel();
22772498 refreshContents();
22782499 } else
2279
- if (event.getSource() == switchGeoItem)
2500
+ if (source == switchGeoItem)
22802501 {
22812502 for (int i=0; i<group.selection.size(); i++)
22822503 {
....@@ -2288,7 +2509,7 @@
22882509 ResetModel();
22892510 refreshContents();
22902511 } else
2291
- if (event.getSource() == switchTransfoItem)
2512
+ if (source == switchTransfoItem)
22922513 {
22932514 for (int i=0; i<group.selection.size(); i++)
22942515 {
....@@ -2300,7 +2521,7 @@
23002521 ResetModel();
23012522 refreshContents();
23022523 } else
2303
- if (event.getSource() == morphItem)
2524
+ if (source == morphItem)
23042525 {
23052526 for (int i=0; i<group.selection.size(); i++)
23062527 {
....@@ -2312,7 +2533,7 @@
23122533 ResetModel();
23132534 refreshContents();
23142535 } else
2315
- if (event.getSource() == scriptNodeItem)
2536
+ if (source == scriptNodeItem)
23162537 {
23172538 boolean atleastone = false;
23182539
....@@ -2351,31 +2572,31 @@
23512572 }
23522573 }
23532574 } else
2354
- if (event.getSource() == linkerItem)
2575
+ if (source == linkerItem)
23552576 {
23562577 group(new cLinker());
23572578 } else
2358
- if (event.getSource() == textureItem)
2579
+ if (source == textureItem)
23592580 {
23602581 group(new TextureNode());
23612582 } else
2362
- if (event.getSource() == billboardItem)
2583
+ if (source == billboardItem)
23632584 {
23642585 group(new BillboardNode());
23652586 } else
2366
- if (event.getSource() == shadowXItem)
2587
+ if (source == shadowXItem)
23672588 {
23682589 CastShadow(0);
23692590 } else
2370
- if (event.getSource() == shadowYItem)
2591
+ if (source == shadowYItem)
23712592 {
23722593 CastShadow(1);
23732594 } else
2374
- if (event.getSource() == shadowZItem)
2595
+ if (source == shadowZItem)
23752596 {
23762597 CastShadow(2);
23772598 } else
2378
- if (event.getSource() == ungroupItem)
2599
+ if (source == ungroupItem)
23792600 {
23802601 //ungroup();
23812602 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2608,203 @@
23872608
23882609 refreshContents();
23892610 } else
2390
- if (event.getSource() == genUVItem)
2611
+ if (source == genUVItem)
23912612 {
23922613 GenUV();
23932614 } else
2394
- if (event.getSource() == genNormalsCADItem)
2615
+ if (source == genNormalsCADItem)
23952616 {
23962617 GenNormals(true);
23972618 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2619
+ if (source == genNormalsMESHItem)
23992620 {
2400
- GenNormals(true); // TODO
2621
+ GenNormalsMESH();
24012622 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2623
+ if (source == genNormalsORGANItem)
24032624 {
24042625 GenNormals(false);
24052626 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2627
+ if (source == genNormalsMINEItem)
24072628 {
24082629 GenNormalsMINE();
24092630 } else
2410
- if (event.getSource() == stripifyItem)
2631
+ if (source == stripifyItem)
24112632 {
24122633 Stripify();
24132634 } else
2414
- if (event.getSource() == unstripifyItem)
2635
+ if (source == unstripifyItem)
24152636 {
24162637 Unstripify();
24172638 } else
2418
- if (event.getSource() == trimItem)
2639
+ if (source == trimItem)
24192640 {
24202641 Trim();
24212642 } else
2422
- if (event.getSource() == untrimItem)
2643
+ if (source == untrimItem)
24232644 {
24242645 Untrim();
24252646 } else
2426
- if (event.getSource() == clearColorsItem)
2647
+ if (source == clearColorsItem)
24272648 {
24282649 ClearColors();
24292650 } else
2430
- if (event.getSource() == clearMaterialsItem)
2651
+ if (source == clearMaterialsItem)
24312652 {
24322653 ClearMaterials();
24332654 } else
2434
- if (event.getSource() == liveleavesItem)
2655
+ if (source == liveleavesItem)
24352656 {
24362657 LiveLeaves(true);
24372658 } else
2438
- if (event.getSource() == unliveleavesItem)
2659
+ if (source == unliveleavesItem)
24392660 {
24402661 LiveLeaves(false);
24412662 } else
2442
- if (event.getSource() == supportleavesItem)
2663
+ if (source == supportleavesItem)
24432664 {
24442665 SupportLeaves(true);
24452666 } else
2446
- if (event.getSource() == unsupportleavesItem)
2667
+ if (source == unsupportleavesItem)
24472668 {
24482669 SupportLeaves(false);
24492670 } else
2450
- if (event.getSource() == hideleavesItem)
2671
+ if (source == hideleavesItem)
24512672 {
24522673 HideLeaves(true);
24532674 } else
2454
- if (event.getSource() == showleavesItem)
2675
+ if (source == showleavesItem)
24552676 {
24562677 HideLeaves(false);
24572678 } else
2458
- if (event.getSource() == markleavesItem)
2679
+ if (source == markleavesItem)
24592680 {
24602681 MarkLeaves(true);
24612682 } else
2462
- if (event.getSource() == unmarkleavesItem)
2683
+ if (source == unmarkleavesItem)
24632684 {
24642685 MarkLeaves(false);
24652686 } else
2466
- if (event.getSource() == flipVItem)
2687
+ if (source == rewindleavesItem)
2688
+ {
2689
+ RewindLeaves(true);
2690
+ } else
2691
+ if (source == unrewindleavesItem)
2692
+ {
2693
+ RewindLeaves(false);
2694
+ } else
2695
+ if (source == randomleavesItem)
2696
+ {
2697
+ RandomLeaves(true);
2698
+ } else
2699
+ if (source == unrandomleavesItem)
2700
+ {
2701
+ RandomLeaves(false);
2702
+ } else
2703
+ if (source == flipVItem)
24672704 {
24682705 FlipV(true);
24692706 } else
2470
- if (event.getSource() == unflipVItem)
2707
+ if (source == unflipVItem)
24712708 {
24722709 FlipV(false);
24732710 } else
2474
- if (event.getSource() == lowTexturesItem)
2711
+ if (source == lowTexturesItem)
24752712 {
24762713 SetTexRes(0);
24772714 } else
2478
- if (event.getSource() == normalTexturesItem)
2715
+ if (source == normalTexturesItem)
24792716 {
24802717 SetTexRes(1);
24812718 } else
2482
- if (event.getSource() == highTexturesItem)
2719
+ if (source == highTexturesItem)
24832720 {
24842721 SetTexRes(2);
24852722 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2723
+ if (source == veryhighTexturesItem)
24872724 {
24882725 SetTexRes(3);
24892726 } else
2490
- if (event.getSource() == maxTexturesItem)
2727
+ if (source == maxTexturesItem)
24912728 {
24922729 SetTexRes(4);
24932730 } else
2494
- if (event.getSource() == panoTexturesItem)
2731
+ if (source == panoTexturesItem)
24952732 {
24962733 SetTexRes(5);
24972734 } else
2498
- if (event.getSource() == reverseNormalsItem)
2735
+ if (source == reverseNormalsItem)
24992736 {
25002737 ReverseNormals();
25012738 } else
2502
- if (event.getSource() == parseverticesItem)
2739
+ if (source == parseverticesItem)
25032740 {
25042741 ParseVertices();
25052742 } else
2506
- if (event.getSource() == textureFieldItem)
2743
+ if (source == textureFieldItem)
25072744 {
25082745 TextureVertices();
25092746 } else
2510
- if (event.getSource() == alignItem)
2747
+ if (source == alignItem)
25112748 {
25122749 Align();
25132750 } else
2514
- if (event.getSource() == mirrorItem)
2751
+ if (source == mirrorItem)
25152752 {
25162753 MirrorPoses();
25172754 } else
2518
- if (event.getSource() == reduceMorphItem)
2755
+ if (source == reduceMorphItem)
25192756 {
25202757 MeshReduction(false);
25212758 } else
2522
- if (event.getSource() == reduce34MorphItem)
2759
+ if (source == reduce34MorphItem)
25232760 {
25242761 MeshReduction(true);
25252762 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2763
+ if (source == reverseTrianglesItem)
25272764 {
25282765 ReverseTriangles();
25292766 } else
2530
- if (event.getSource() == reduceMeshItem)
2767
+ if (source == reduceMeshItem)
25312768 {
25322769 ReduceMesh(false);
25332770 } else
2534
- if (event.getSource() == reduce34MeshItem)
2771
+ if (source == reduce34MeshItem)
25352772 {
25362773 ReduceMesh(true);
25372774 } else
2538
- if (event.getSource() == increaseMeshItem)
2775
+ if (source == increaseMeshItem)
25392776 {
25402777 IncreaseMesh();
25412778 } else
2542
- if (event.getSource() == clipMeshItem)
2779
+ if (source == clipMeshItem)
25432780 {
25442781 ClipMesh();
25452782 } else
2546
- if (event.getSource() == smoothMeshItem)
2783
+ if (source == smoothMeshItem)
25472784 {
25482785 SmoothMesh();
25492786 } else
2550
- if (event.getSource() == transformgeometryItem)
2787
+ if (source == transformGeometryItem)
25512788 {
25522789 TransformGeometry();
25532790 } else
2554
- if (event.getSource() == resetTransformItem)
2791
+ if (source == transformChildrenItem)
2792
+ {
2793
+ TransformChildren();
2794
+ } else
2795
+ if (source == resetTransformItem)
25552796 {
25562797 ResetTransform();
25572798 } else
2558
- if (event.getSource() == resetCentroidItem)
2799
+ if (source == resetCentroidItem)
25592800 {
2560
- ResetCentroid();
2801
+ ResetCentroid(true);
25612802 } else
2562
- if (event.getSource() == resetParentItem)
2803
+ if (source == resetCentroidXZItem)
2804
+ {
2805
+ ResetCentroid(false);
2806
+ } else
2807
+ if (source == resetParentItem)
25632808 {
25642809 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652810 {
....@@ -2569,7 +2814,7 @@
25692814
25702815 refreshContents();
25712816 } else
2572
- if (event.getSource() == repairParentItem)
2817
+ if (source == repairParentItem)
25732818 {
25742819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752820 {
....@@ -2583,7 +2828,7 @@
25832828
25842829 refreshContents();
25852830 } else
2586
- if (event.getSource() == repairShadowItem)
2831
+ if (source == repairShadowItem)
25872832 {
25882833 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892834 {
....@@ -2597,7 +2842,7 @@
25972842
25982843 refreshContents();
25992844 } else
2600
- if (event.getSource() == sortbysizeItem)
2845
+ if (source == sortbysizeItem)
26012846 {
26022847 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032848 {
....@@ -2609,7 +2854,7 @@
26092854 ResetModel();
26102855 refreshContents();
26112856 } else
2612
- if (event.getSource() == sortbynameItem)
2857
+ if (source == sortbynameItem)
26132858 {
26142859 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152860 {
....@@ -2621,7 +2866,7 @@
26212866 ResetModel();
26222867 refreshContents();
26232868 } else
2624
- if (event.getSource() == attachPigmentItem)
2869
+ if (source == attachPigmentItem)
26252870 {
26262871 String texture = GetFile("Attach pigment");
26272872 Object3D obj;
....@@ -2633,7 +2878,7 @@
26332878
26342879 refreshContents();
26352880 } else
2636
- if (event.getSource() == detachPigmentItem)
2881
+ if (source == detachPigmentItem)
26372882 {
26382883 Object3D obj;
26392884 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2889,7 @@
26442889
26452890 refreshContents();
26462891 } else
2647
- if (event.getSource() == attachBumpItem)
2892
+ if (source == attachBumpItem)
26482893 {
26492894 String texture = GetFile("Attach bump");
26502895 Object3D obj;
....@@ -2656,7 +2901,7 @@
26562901
26572902 refreshContents();
26582903 } else
2659
- if (event.getSource() == detachBumpItem)
2904
+ if (source == detachBumpItem)
26602905 {
26612906 Object3D obj;
26622907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2912,7 @@
26672912
26682913 refreshContents();
26692914 } else
2670
- if (event.getSource() == pigmentBumpItem)
2915
+ if (source == pigmentBumpItem)
26712916 {
26722917 Object3D obj;
26732918 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2923,221 @@
26782923
26792924 refreshContents();
26802925 } else
2681
- if (event.getSource() == flashSelectionButton)
2926
+ if (source == flashSelectionButton)
26822927 {
26832928 CameraPane.flash = true;
26842929 refreshContents();
26852930 } else
2686
- if (event.getSource() == oneButton)
2931
+ if (source == oneButton)
26872932 {
26882933 } else
2689
- if (event.getSource() == twoButton)
2934
+ if (source == twoButton)
26902935 {
26912936 radio.layout = twoButton;
26922937 // bug
26932938 //gridPanel.setDividerLocation(1.0);
26942939 //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();
2940
+// bigThree.remove(scenePanel);
2941
+// bigThree.remove(centralPanel);
2942
+// bigThree.remove(XYZPanel);
2943
+// aWindowConstraints.gridx = 0;
2944
+// aWindowConstraints.gridy = 0;
2945
+// aWindowConstraints.gridwidth = 1;
2946
+// // aConstraints.gridheight = 3;
2947
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.weighty = 1;
2950
+// //bigThree.add(jtp, aWindowConstraints);
2951
+// aWindowConstraints.weightx = 1;
2952
+// aWindowConstraints.gridwidth = 3;
2953
+// // aConstraints.gridheight = 3;
2954
+// aWindowConstraints.gridx = 1;
2955
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2956
+// bigThree.add(centralPanel, aWindowConstraints);
2957
+// aWindowConstraints.weightx = 0;
2958
+// aWindowConstraints.gridx = 4;
2959
+// aWindowConstraints.gridwidth = 1;
2960
+// // aConstraints.gridheight = 3;
2961
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2962
+// //bigThree.add(XYZPanel, aWindowConstraints);
2963
+// scenePanel.setVisible(false);
2964
+// centralPanel.setVisible(true);
2965
+// XYZPanel.setVisible(false);
2966
+ bigThree.ClearUI();
2967
+ bigThree.add(centralPanel);
2968
+ bigThree.FlushUI();
2969
+
2970
+ cameraView.requestFocusInWindow();
2971
+
2972
+// refreshContents(true);
2973
+//
2974
+// try
2975
+// {
2976
+// java.awt.Robot bot = new java.awt.Robot();
2977
+// int mask = InputEvent.BUTTON1_MASK;
2978
+// bot.mouseMove(100, 100);
2979
+// bot.mousePress(mask);
2980
+// bot.mouseRelease(mask);
2981
+// }
2982
+// catch (Exception e)
2983
+// {
2984
+//
2985
+// }
2986
+
27192987 } else
2720
- if (event.getSource() == threeButton)
2988
+ if (source == threeButton)
27212989 {
27222990 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();
2991
+
2992
+// bigThree.remove(scenePanel);
2993
+// bigThree.remove(centralPanel);
2994
+// bigThree.remove(XYZPanel);
2995
+// aWindowConstraints.gridx = 0;
2996
+// aWindowConstraints.gridy = 0;
2997
+// aWindowConstraints.gridwidth = 1;
2998
+// // aConstraints.gridheight = 3;
2999
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.weighty = 1;
3002
+// //bigThree.add(jtp, aWindowConstraints);
3003
+// aWindowConstraints.weightx = 1;
3004
+// aWindowConstraints.gridwidth = 3;
3005
+// // aConstraints.gridheight = 3;
3006
+// aWindowConstraints.gridx = 1;
3007
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3008
+// bigThree.add(centralPanel, aWindowConstraints);
3009
+// aWindowConstraints.weightx = 0;
3010
+// aWindowConstraints.gridx = 4;
3011
+// aWindowConstraints.gridwidth = 1;
3012
+// // aConstraints.gridheight = 3;
3013
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3014
+// bigThree.add(XYZPanel, aWindowConstraints);
3015
+// bigThree.validate();
3016
+// scenePanel.setVisible(false);
3017
+// centralPanel.setVisible(true);
3018
+// XYZPanel.setVisible(true);
3019
+ bigThree.ClearUI();
3020
+ bigThree.add(centralPanel);
3021
+ bigThree.add(XYZPanel);
3022
+ bigThree.FlushUI();
3023
+
3024
+ cameraView.requestFocusInWindow();
27473025 } else
2748
- if (event.getSource() == fourButton)
3026
+ if (source == fourButton)
27493027 {
27503028 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();
3029
+
3030
+// bigThree.remove(scenePanel);
3031
+// bigThree.remove(centralPanel);
3032
+// bigThree.remove(XYZPanel);
3033
+// aWindowConstraints.gridx = 0;
3034
+// aWindowConstraints.gridy = 0;
3035
+// aWindowConstraints.gridwidth = 1;
3036
+// // aWindowConstraints.gridheight = 3;
3037
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3038
+// aWindowConstraints.weightx = 1;
3039
+// aWindowConstraints.weighty = 1;
3040
+// bigThree.add(scenePanel, aWindowConstraints);
3041
+// aWindowConstraints.weightx = 1;
3042
+// aWindowConstraints.gridwidth = 3;
3043
+// // aConstraints.gridheight = 3;
3044
+// aWindowConstraints.gridx = 1;
3045
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3046
+// //bigThree.add(cameraPanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 0;
3048
+// aWindowConstraints.gridx = 4;
3049
+// aWindowConstraints.gridwidth = 1;
3050
+// // aWindowConstraints.gridheight = 3;
3051
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3052
+// //bigThree.add(XYZPanel, aWindowConstraints);
3053
+// bigThree.validate();
3054
+// scenePanel.setVisible(true);
3055
+// centralPanel.setVisible(false);
3056
+// XYZPanel.setVisible(false);
3057
+ bigThree.ClearUI();
3058
+ bigThree.add(scenePanel);
3059
+ bigThree.FlushUI();
3060
+
3061
+ cameraView.requestFocusInWindow();
27753062 } else
2776
- if (event.getSource() == sixButton)
3063
+ if (source == sixButton)
27773064 {
27783065 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();
3066
+
3067
+// bigThree.remove(scenePanel);
3068
+// bigThree.remove(centralPanel);
3069
+// bigThree.remove(XYZPanel);
3070
+// aWindowConstraints.gridx = 0;
3071
+// aWindowConstraints.gridy = 0;
3072
+// aWindowConstraints.gridwidth = 1;
3073
+// // aConstraints.gridheight = 3;
3074
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.weighty = 1;
3077
+// bigThree.add(scenePanel, aWindowConstraints);
3078
+// aWindowConstraints.weightx = 1;
3079
+// aWindowConstraints.gridwidth = 3;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.gridx = 1;
3082
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3083
+// bigThree.add(centralPanel, aWindowConstraints);
3084
+// aWindowConstraints.weightx = 0;
3085
+// aWindowConstraints.gridx = 4;
3086
+// aWindowConstraints.gridwidth = 1;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3089
+// //bigThree.add(XYZPanel, aConstraints);
3090
+// bigThree.validate();
3091
+// scenePanel.setVisible(true);
3092
+// centralPanel.setVisible(true);
3093
+// XYZPanel.setVisible(false);
3094
+ bigThree.ClearUI();
3095
+ bigThree.add(scenePanel);
3096
+ bigThree.add(centralPanel);
3097
+ bigThree.FlushUI();
3098
+
3099
+ cameraView.requestFocusInWindow();
28033100 } else
2804
- if (event.getSource() == sevenButton)
3101
+ if (source == sevenButton)
28053102 {
28063103 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();
3104
+
3105
+// bigThree.remove(scenePanel);
3106
+// bigThree.remove(centralPanel);
3107
+// bigThree.remove(XYZPanel);
3108
+// aWindowConstraints.gridx = 0;
3109
+// aWindowConstraints.gridy = 0;
3110
+// aWindowConstraints.gridwidth = 1;
3111
+// // aWindowConstraints.gridheight = 3;
3112
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.weighty = 1;
3115
+// bigThree.add(scenePanel, aWindowConstraints);
3116
+// aWindowConstraints.weightx = 1;
3117
+// aWindowConstraints.gridwidth = 3;
3118
+// // aWindowConstraints.gridheight = 3;
3119
+// aWindowConstraints.gridx = 1;
3120
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3121
+// bigThree.add(centralPanel, aWindowConstraints);
3122
+// aWindowConstraints.weightx = 0;
3123
+// aWindowConstraints.gridx = 4;
3124
+// aWindowConstraints.gridwidth = 1;
3125
+// // aConstraints.gridheight = 3;
3126
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3127
+// bigThree.add(XYZPanel, aWindowConstraints);
3128
+// bigThree.validate();
3129
+// scenePanel.setVisible(true);
3130
+// centralPanel.setVisible(true);
3131
+// XYZPanel.setVisible(true);
3132
+ bigThree.ClearUI();
3133
+ bigThree.add(scenePanel);
3134
+ bigThree.add(centralPanel);
3135
+ bigThree.add(XYZPanel);
3136
+ bigThree.FlushUI();
3137
+
3138
+ cameraView.requestFocusInWindow();
28313139 } else
2832
- if (event.getSource() == rootButton)
3140
+ if (source == rootButton)
28333141 {
28343142 Object3D obj;
28353143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,34 +3147,44 @@
28393147 EditObject(obj);
28403148 }
28413149
3150
+ cameraView.requestFocusInWindow();
28423151 refreshContents(true);
28433152 } else
2844
- if (event.getSource() == closeButton)
3153
+ if (source == closeButton)
28453154 {
28463155 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473156 cRadio ab;
28483157 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493158 {
28503159 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3160
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523161 {
3162
+ // Patch to avoid bug with transparency.
3163
+ if (!ab.hadMaterial)
3164
+ {
3165
+ ab.object.material = null;
3166
+ }
3167
+
28533168 buttonGroup.remove(ab);
28543169 radioPanel.remove(ab);
28553170
2856
- ab.GetObject().editWindow = null;
3171
+ //ab.GetObject().editWindow = null;
3172
+ ab.GetObject().manipWindow = null;
28573173 // ab.GetObject().objectUI = null; // ?????????
28583174
28593175 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603176 break;
28613177 }
28623178 }
3179
+
3180
+ cameraView.requestFocusInWindow();
28633181 refreshContents(true);
28643182 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3183
+ if (source == editItem || source == editButton)
28663184 {
28673185 EditSelection(false);
28683186 } else
2869
- if (event.getSource() == uneditButton)
3187
+ if (source == uneditButton)
28703188 {
28713189 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723190 {
....@@ -2876,14 +3194,14 @@
28763194 child.CloseUI();
28773195 listUI.remove(child);
28783196
2879
- child.editWindow = null; // ???????????
3197
+ //child.editWindow = null; // ???????????
28803198 }
2881
- objEditor.ctrlPanel.revalidate();
3199
+ objEditor.ctrlPanel.FlushUI();
28823200 //objEditor.jTree.clearSelection();
28833201 //objEditor.ResetSliders();
28843202 refreshContents(true);
28853203 } else
2886
- if (event.getSource() == clearPanelButton)
3204
+ if (source == clearPanelButton)
28873205 {
28883206 assert(copy == group);
28893207 //copy.ClearUI();
....@@ -2894,7 +3212,7 @@
28943212 listUI.clear();
28953213 refreshContents(true);
28963214 } else
2897
- if (event.getSource() == allParamsButton)
3215
+ if (source == allParamsButton)
28983216 {
28993217 assert(copy == group);
29003218
....@@ -2915,19 +3233,19 @@
29153233
29163234 refreshContents(true);
29173235 } else
2918
- if (event.getSource() == unselectButton)
3236
+ if (source == unselectButton)
29193237 {
29203238 objEditor.jTree.clearSelection();
29213239 // ?? oct 2012 GrafreeD.clipboard.clear();
29223240 objEditor.ResetSliders();
29233241 refreshContents(true);
29243242 } else
2925
- if(event.getSource() instanceof cRadio)
3243
+ if(source instanceof cRadio)
29263244 {
29273245 group.parent = keepparent;
29283246 group.attributes = 0;
29293247 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3248
+ /*cRadio*/ radio = (cRadio)source;
29313249 Object3D obj = radio.GetObject();
29323250 System.out.println("Edit " + obj);
29333251 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3280,11 @@
29623280 frontView.object = group;
29633281 sideView.object = group;
29643282 }
2965
- group.editWindow = this;
3283
+
3284
+// fix "+" issue
3285
+ //group.editWindow = this;
3286
+ group.manipWindow = this;
3287
+
29663288 /*
29673289 currentLayout = radio.layout;
29683290 if (currentLayout == null)
....@@ -2974,8 +3296,23 @@
29743296 //group.parent = null; // ROOT
29753297 //group.attributes = -1;
29763298 ResetModel();
3299
+
3300
+ cameraView.requestFocusInWindow();
29773301 refreshContents(true);
2978
- }
3302
+ } else if (event.getSource() == editCameraItem)
3303
+ {
3304
+ cameraView.ProtectCamera();
3305
+ cameraView.repaint();
3306
+ return;
3307
+ } else if (event.getSource() == revertCameraItem)
3308
+ {
3309
+ cameraView.RevertCamera();
3310
+ cameraView.repaint();
3311
+ return;
3312
+ // } else if (event.getSource() == textureButton)
3313
+ // {
3314
+ // return; // true;
3315
+ }
29793316 else
29803317 {
29813318 //return super.action(event, arg);
....@@ -2984,7 +3321,6 @@
29843321 }
29853322
29863323 boolean useclient = false;
2987
- cRadio radio;
29883324
29893325 void ToggleRoot()
29903326 {
....@@ -3036,6 +3372,28 @@
30363372 refreshContents();
30373373 }
30383374
3375
+ void TransformChildren()
3376
+ {
3377
+ Object3D obj;
3378
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3379
+ {
3380
+ obj = (Object3D)e.nextElement();
3381
+ obj.KeepTextureMatrices();
3382
+ obj.TransformChildren();
3383
+ obj.RestoreTextureMatrices();
3384
+
3385
+// if (obj.parent == null)
3386
+// {
3387
+// System.out.println("NULL PARENT!");
3388
+// new Exception().printStackTrace();
3389
+// }
3390
+// else
3391
+// TouchTransform(obj);
3392
+// //obj.parent.Touch();
3393
+ }
3394
+
3395
+ refreshContents();
3396
+ }
30393397
30403398 void ResetTransform()
30413399 {
....@@ -3148,7 +3506,7 @@
31483506 refreshContents();
31493507 }
31503508
3151
- void ResetCentroid()
3509
+ void ResetCentroid(boolean full)
31523510 {
31533511 Object3D obj;
31543512 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3521,16 @@
31633521 LA.matIdentity(Object3D.mat);
31643522 obj.getBounds(minima, maxima, false);
31653523 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3524
+ if (full)
3525
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673526 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683527 obj.TransformMesh(Object3D.mat);
3528
+
31693529 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3530
+ if (full)
3531
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713532 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3533
+
31723534 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733535 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743536 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3559,8 @@
31973559
31983560 int size = obj.MemorySize();
31993561
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3562
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3563
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013564 }
32023565 }
32033566 catch (Exception e)
....@@ -3234,9 +3597,9 @@
32343597 obj = (Object3D)e.nextElement();
32353598
32363599 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3600
+ Grafreed.AnalyzeObject(obj);
32383601 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3602
+ Grafreed.AnalyzeObject(obj.bRep);
32403603
32413604 // System.err.println((size/1024) + " KB is the size of " + obj);
32423605 }
....@@ -3278,6 +3641,13 @@
32783641 void GenNormals(boolean crease)
32793642 {
32803643 group.GenNormalsS(crease);
3644
+
3645
+ refreshContents();
3646
+ }
3647
+
3648
+ void GenNormalsMESH()
3649
+ {
3650
+ group.GenNormalsMeshS();
32813651
32823652 refreshContents();
32833653 }
....@@ -3450,8 +3820,8 @@
34503820
34513821 void ParseVertices()
34523822 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3823
+ boolean epsequal = Grafreed.epsequal;
3824
+ Grafreed.epsequal = true;
34553825
34563826 for (int i=0; i<group.selection.size(); i++)
34573827 {
....@@ -3476,7 +3846,7 @@
34763846 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773847 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783848
3479
- g.add(GrafreeD.clipboard);
3849
+ g.add(Grafreed.clipboard);
34803850
34813851 buffer.add(g);
34823852 }
....@@ -3491,7 +3861,7 @@
34913861 makeSomething(buffer, i==group.selection.size()-1);
34923862 }
34933863
3494
- GrafreeD.epsequal = epsequal;
3864
+ Grafreed.epsequal = epsequal;
34953865
34963866 refreshContents();
34973867 }
....@@ -3509,7 +3879,16 @@
35093879 String pigment = Object3D.GetPigment(tex);
35103880 //String bump = Object3D.GetBump(tex);
35113881
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3882
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3883
+
3884
+ try
3885
+ {
3886
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3887
+ }
3888
+ catch (Exception e)
3889
+ {
3890
+ System.err.println("FAIL: " + node);
3891
+ }
35133892
35143893 double s = v.s;
35153894
....@@ -3597,11 +3976,11 @@
35973976
35983977 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993978
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3979
+ boolean random = CameraPane.SWITCH;
3980
+ CameraPane.SWITCH = false; // parse all random nodes
36023981 lowres.linkVerticesThis(null);
36033982 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3983
+ CameraPane.SWITCH = random;
36053984
36063985 System.err.flush();
36073986
....@@ -3641,7 +4020,7 @@
36414020 return;
36424021
36434022 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4023
+ Object3D ref = Grafreed.clipboard.get(0);
36454024
36464025 Object3D newgroup = new Object3D("Po:" + poses.name);
36474026
....@@ -3835,9 +4214,9 @@
38354214
38364215 void ClipMesh()
38374216 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4217
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394218 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4219
+ Object3D content = Grafreed.clipboard.get(0);
38414220
38424221 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434222 content = ((cGroup)content).get(0);
....@@ -3846,7 +4225,7 @@
38464225 // {
38474226 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484227 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4228
+ group.selection.ClipMesh(Grafreed.clipboard);
38504229 }
38514230 // group.selection.ClipMesh(GrafreeD.clipboard);
38524231 System.out.println("DONE.");
....@@ -3893,6 +4272,18 @@
38934272 void MarkLeaves(boolean hide)
38944273 {
38954274 group.selection.MarkLeaves(hide);
4275
+ refreshContents();
4276
+ }
4277
+
4278
+ void RewindLeaves(boolean hide)
4279
+ {
4280
+ group.selection.RewindLeaves(hide);
4281
+ refreshContents();
4282
+ }
4283
+
4284
+ void RandomLeaves(boolean hide)
4285
+ {
4286
+ group.selection.RandomLeaves(hide);
38964287 refreshContents();
38974288 }
38984289
....@@ -3981,7 +4372,7 @@
39814372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824373
39834374 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4375
+ if(elem != group || !newWindow)
39854376 {
39864377 // if (!(elem instanceof Composite))
39874378 // newWindow = false;
....@@ -4071,7 +4462,6 @@
40714462 //case 702: // Event.LIST_DESELECT
40724463 group.deselectAll();
40734464 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754465 if (tps != null)
40764466 {
40774467 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4470,28 @@
40804470
40814471 //if (child.parent != null)
40824472 //child.parent.addSelectee(child);
4473
+ objEditor.SetMaterial(child);
40834474 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874475 }
40884476 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4477
+// else
4478
+// {
4479
+// objEditor.SetMaterial(group); // .GetMaterial());
4480
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4481
+// System.err.println("info : " + group.GetPath());
4482
+// }
40954483
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4484
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994485 CameraPane.flash = true;
41004486
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4487
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024488 // a camera
41034489 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4490
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4491
+ {
4492
+ CameraPane.camerachangeframe = 0; // don't refuse it
4493
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4494
+ }
41064495 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074496 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084497 }
....@@ -4115,6 +4504,26 @@
41154504
41164505 freezemodel = false;
41174506 }
4507
+
4508
+ void refreshContents(boolean cp)
4509
+ {
4510
+ if (!Globals.MOUSEDRAGGED)
4511
+ {
4512
+ objEditor.ClearInfo(); // .GetMaterial());
4513
+
4514
+ for (int i=0; i < group.selection.Size(); i++)
4515
+ {
4516
+ Object3D child = (Object3D) group.selection.get(i);
4517
+
4518
+ objEditor.AddInfo(child, this, true);
4519
+ System.err.println("info : " + child.GetPath());
4520
+ }
4521
+
4522
+ objEditor.SetText(); // jan 2014
4523
+ }
4524
+
4525
+ super.refreshContents(cp);
4526
+ }
41184527
41194528 void linkSomething(Object3D thing)
41204529 {
....@@ -4186,16 +4595,19 @@
41864595 {
41874596 if (group.selection.isEmpty())
41884597 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4598
+
4599
+ Grafreed.clipboardIsTempGroup = false;
41904600 Composite tGroup = null;
41914601 if (group.selection.size() > 0) // 1)
41924602 {
41934603 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4604
+ Grafreed.clipboardIsTempGroup = true;
41954605 }
41964606
41974607 if (cut)
41984608 {
4609
+ if (Globals.SAVEONMAKE)
4610
+ Save();
41994611 //int indices[] = jList.getSelectedIndices();
42004612 //for (int i = indices.length - 1; i >= 0; i--)
42014613 //jList.remove(indices[i]);
....@@ -4231,16 +4643,16 @@
42314643 //System.out.println("cut " + child);
42324644 //System.out.println("parent = " + child.parent);
42334645 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4646
+ if (Grafreed.clipboardIsTempGroup)
42354647 tGroup.add/*Child*/(tmp);
42364648 else
4237
- GrafreeD.clipboard = tmp;
4649
+ Grafreed.clipboard = tmp;
42384650 }
42394651 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4652
+ if (Grafreed.clipboardIsTempGroup)
42414653 tGroup.add/*Child*/(child);
42424654 else
4243
- GrafreeD.clipboard = child;
4655
+ Grafreed.clipboard = child;
42444656 }
42454657
42464658 //ResetModel();
....@@ -4272,21 +4684,23 @@
42724684 //System.out.println("cut " + elem);
42734685 //System.out.println("parent = " + elem.parent);
42744686 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4687
+ if (Grafreed.clipboardIsTempGroup)
42764688 tGroup.add/*Child*/(tmp);
42774689 else
4278
- GrafreeD.clipboard = tmp;
4690
+ Grafreed.clipboard = tmp;
42794691 }
42804692 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4693
+ if (Grafreed.clipboardIsTempGroup)
42824694 tGroup.add/*Child*/(child);
42834695 else
4284
- GrafreeD.clipboard = child;
4696
+ Grafreed.clipboard = child;
42854697 }
42864698
42874699 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4700
+
4701
+ if (Grafreed.clipboardIsTempGroup)
4702
+ Grafreed.clipboard = tGroup;
4703
+
42904704 if (cut)
42914705 {
42924706 ResetModel();
....@@ -4300,7 +4714,7 @@
43004714 // return;
43014715 boolean first = true;
43024716
4303
- if (GrafreeD.clipboardIsTempGroup)
4717
+ if (Grafreed.clipboardIsTempGroup)
43044718 {
43054719 Composite temp;
43064720
....@@ -4311,7 +4725,7 @@
43114725 temp = (Composite)Applet3D.clipboard.deepCopy();
43124726 */
43134727 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4728
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154729 {
43164730 Object3D child = (Object3D)e.nextElement();
43174731
....@@ -4345,21 +4759,21 @@
43454759 //Object3D cb = Applet3D.clipboard;
43464760 //temp.addChild(cb);
43474761 //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());
4762
+ assert(Grafreed.clipboard.parent == null);
4763
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4764
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4765
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4766
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534767 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4768
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4769
+ Grafreed.clipboard.get(0).parent = keepparent;
43564770 }
43574771
43584772 ResetModel();
43594773 refreshContents();
43604774 }
43614775
4362
- void pasteInto(boolean copyit)
4776
+ void pasteInto(boolean copyit, boolean clone)
43634777 {
43644778 // if (GrafreeD.clipboard == null)
43654779 // return;
....@@ -4388,15 +4802,22 @@
43884802 if (copyit)
43894803 {
43904804 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4805
+ if (clone)
4806
+ {
4807
+ CloneClipboard(false); // sept 2014
4808
+ }
4809
+ else
4810
+ {
4811
+ paste(false);
4812
+ }
43924813 }
43934814 else
43944815 {
43954816 boolean first = true;
43964817
4397
- if (GrafreeD.clipboardIsTempGroup)
4818
+ if (Grafreed.clipboardIsTempGroup)
43984819 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4820
+ Composite temp = (Composite)Grafreed.clipboard;
44004821 Object3D copy;
44014822 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024823 {
....@@ -4406,7 +4827,7 @@
44064827 }
44074828 } else
44084829 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4830
+ linkSomething(Grafreed.clipboard); //.get(0));
44104831 }
44114832 }
44124833 }
....@@ -4811,21 +5232,6 @@
48115232 }
48125233 */
48135234
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
-
48295235 /*
48305236 public void Callback(Object obj)
48315237 {
....@@ -4849,26 +5255,9 @@
48495255 }
48505256 */
48515257
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
-
48695258 String GetFile(String dialogName)
48705259 {
4871
- if (GrafreeD.standAlone)
5260
+ if (Grafreed.standAlone)
48725261 {
48735262 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745263 browser.show();
....@@ -4932,10 +5321,18 @@
49325321 cButton flashSelectionButton;
49335322 cButton editButton;
49345323 cButton uneditButton;
5324
+ JCheckBox allParamsButton;
49355325 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375326 cButton unselectButton;
49385327
5328
+ cButton minButton;
5329
+ cButton maxButton;
5330
+ cButton fullButton;
5331
+ cButton undoButton;
5332
+ cButton redoButton;
5333
+ cButton saveButton;
5334
+ cButton oneStepButton;
5335
+
49395336 cButton screenfitButton;
49405337 cButton screenfitpointButton;
49415338 cButton snapobjectButton;
....@@ -4946,14 +5343,6 @@
49465343 cButton closeButton;
49475344
49485345 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;
49575346
49585347 //
49595348 //Composite
....@@ -4966,6 +5355,8 @@
49665355 private MenuItem lookFromItem;
49675356 private MenuItem switchItem;
49685357 private MenuItem cutItem;
5358
+ private MenuItem undoItem;
5359
+ private MenuItem redoItem;
49695360 private MenuItem duplicateItem;
49705361 private MenuItem cloneItem;
49715362 private MenuItem cloneSupportItem;
....@@ -4979,7 +5370,7 @@
49795370 private MenuItem linkverticesItem;
49805371 private MenuItem relinkverticesItem;
49815372 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5373
+ private MenuItem resetAllItem;
49835374 private MenuItem stepAllItem;
49845375 private MenuItem revertMeshItem;
49855376 private MenuItem poseMeshItem;
....@@ -4990,6 +5381,7 @@
49905381 private MenuItem mergeGeometriesItem;
49915382 private MenuItem copyItem;
49925383 private MenuItem pasteItem;
5384
+ private MenuItem pasteIntoItem;
49935385 private MenuItem pasteLinkItem;
49945386 private MenuItem pasteCloneItem;
49955387 private MenuItem pasteExpandItem;
....@@ -5028,6 +5420,10 @@
50285420 private MenuItem showleavesItem;
50295421 private MenuItem markleavesItem;
50305422 private MenuItem unmarkleavesItem;
5423
+ private MenuItem rewindleavesItem;
5424
+ private MenuItem unrewindleavesItem;
5425
+ private MenuItem randomleavesItem;
5426
+ private MenuItem unrandomleavesItem;
50315427
50325428 private MenuItem flipVItem;
50335429 private MenuItem unflipVItem;
....@@ -5039,8 +5435,10 @@
50395435 private MenuItem panoTexturesItem;
50405436
50415437 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5438
+ private MenuItem resetCentroidXZItem;
50435439 private MenuItem resetTransformItem;
5440
+ private MenuItem transformGeometryItem;
5441
+ private MenuItem transformChildrenItem;
50445442 private MenuItem hideItem;
50455443 private MenuItem grabItem;
50465444 private MenuItem backItem;
....@@ -5087,7 +5485,7 @@
50875485 private MenuItem blobItem;
50885486 private MenuItem latheItem;
50895487 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5488
+ private MenuItem overlayItem;
50915489 private MenuItem meshItem;
50925490 // private MenuItem meshGroupItem;
50935491 private MenuItem springItem;
....@@ -5109,11 +5507,6 @@
51095507 private MenuItem doubleItem;
51105508 private MenuItem tripleItem;
51115509
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175510 private MenuItem computeAOItem;
51185511 private MenuItem recompileItem;
51195512 private MenuItem editScriptItem;
....@@ -5123,4 +5516,8 @@
51235516 private MenuItem analyzeItem;
51245517 private MenuItem dumpItem;
51255518 //boolean freezemodel = false;
5519
+
5520
+ Menu cameraMenu;
5521
+ MenuItem editCameraItem;
5522
+ MenuItem revertCameraItem;
51265523 }