Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
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,131 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ oe.jTree = new cTree();
154
+
155
+ Menu menu;
156
+ oe.menuBar.add(menu = new Menu("Edit"));
157
+ //editItem = menu.add(new MenuItem("Edit"));
158
+ //editItem.addActionListener(this);
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
166
+ duplicateItem.addActionListener(this);
167
+ cloneItem = menu.add(new MenuItem("Clone"));
168
+ cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
171
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
172
+ cloneSupportItem.addActionListener(this);
173
+ }
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
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
185
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
186
+ pasteLinkItem.addActionListener(this);
187
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
188
+ pasteCloneItem.addActionListener(this);
189
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
190
+// pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
192
+ clearItem = menu.add(new MenuItem("Clear"));
193
+ clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
198
+ clearAllItem = menu.add(new MenuItem("Clear All"));
199
+ clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
+ revertCameraItem.addActionListener(this);
209
+
210
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+ toggleFullScreenItem.addItemListener(this);
212
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+ cameraMenu.add("-");
214
+
215
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+ toggleTextureItem.addItemListener(this);
217
+ toggleTextureItem.setState(CameraPane.textureon);
218
+
219
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+ toggleSwitchItem.addItemListener(this);
221
+ toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
237
+
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
152276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154278 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +284,17 @@
160284 lookAtItem.addActionListener(this);
161285 //lookFromItem.addActinoListener(this);
162286 //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
-
287
+ }
288
+
192289 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);
290
+ if (Globals.ADVANCED)
291
+ {
197292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198293 revertMeshItem.addActionListener(this);
199294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200295 resetreferencesItem.addActionListener(this);
201296 menu.add("-");
297
+ }
202298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203299 overwriteGeoItem.addActionListener(this);
204300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +306,26 @@
210306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211307 overwriteUVItem.addActionListener(this);
212308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
213311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214312 generateMeshItem.addActionListener(this);
215313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216314 poseMeshItem.addActionListener(this);
217315 menu.add("-");
316
+ }
218317 resetsupportItem = menu.add(new MenuItem("Reset support"));
219318 resetsupportItem.addActionListener(this);
220319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221320 linkverticesItem.addActionListener(this);
222321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
224326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225327 setMasterItem.addActionListener(this);
328
+ }
226329
227330 oe.menuBar.add(menu = new Menu("Group"));
228331 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +336,38 @@
233336 frontItem.addActionListener(this);
234337 compositeItem = menu.add(new MenuItem("Composite"));
235338 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237343 hideItem.addActionListener(this);
344
+ }
238345 ungroupItem = menu.add(new MenuItem("Ungroup"));
239346 ungroupItem.addActionListener(this);
347
+
240348 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
349
+
350
+ randomItem = menu.add(new MenuItem("Switch node"));
242351 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);
352
+ if (Globals.ADVANCED)
353
+ {
247354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248355 switchGeoItem.addActionListener(this);
249356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250357 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
252359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
253366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254367 scriptNodeItem.addActionListener(this);
255368 cameraItem = menu.add(new MenuItem("Camera"));
256369 cameraItem.addActionListener(this);
370
+ }
257371
258372 oe.menuBar.add(menu = new Menu("Object"));
259373 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +376,35 @@
262376 billboardItem.addActionListener(this);
263377 csgItem = menu.add(new MenuItem("CSG"));
264378 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
379
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266380 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
381
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268382 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
383
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270384 shadowZItem.addActionListener(this);
385
+ if (Globals.ADVANCED)
386
+ {
387
+ menu.add("-");
271388 linkerItem = menu.add(new MenuItem("Linker"));
272389 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275390 attributeItem = menu.add(new MenuItem("Attribute"));
276391 attributeItem.addActionListener(this);
392
+ templateItem = menu.add(new MenuItem("Template"));
393
+ templateItem.addActionListener(this);
277394 pointflowItem = menu.add(new MenuItem("Point Flow"));
278395 pointflowItem.addActionListener(this);
396
+ }
279397 menu.add("-");
280398 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281399 resetTransformItem.addActionListener(this);
282400 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283401 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
402
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
403
+ resetCentroidXZItem.addActionListener(this);
404
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
405
+ transformGeometryItem.addActionListener(this);
406
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
407
+ transformChildrenItem.addActionListener(this);
286408
287409 oe.menuBar.add(menu = new Menu("Geometry"));
288410 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +415,11 @@
293415 genNormalsCADItem.addActionListener(this);
294416 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295417 genNormalsMESHItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
296420 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297421 genNormalsMINEItem.addActionListener(this);
422
+ }
298423 stripifyItem = menu.add(new MenuItem("Stripify"));
299424 stripifyItem.addActionListener(this);
300425 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +441,34 @@
316441 reduce34MeshItem.addActionListener(this);
317442 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318443 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321444 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322445 clipMeshItem.addActionListener(this);
446
+
447
+ if (Globals.ADVANCED)
448
+ {
449
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
450
+ smoothMeshItem.addActionListener(this);
451
+ }
323452
324453 oe.menuBar.add(menu = new Menu("Attributes"));
325454 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326455 clearMaterialsItem.addActionListener(this);
456
+ resetAllItem = menu.add(new MenuItem("Reset All"));
457
+ resetAllItem.addActionListener(this);
458
+ stepAllItem = menu.add(new MenuItem("Step All"));
459
+ stepAllItem.addActionListener(this);
327460 menu.add("-");
328461 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329462 liveleavesItem.addActionListener(this);
330463 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331464 unliveleavesItem.addActionListener(this);
465
+ if (Globals.ADVANCED)
466
+ {
332467 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333468 supportleavesItem.addActionListener(this);
334469 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335470 unsupportleavesItem.addActionListener(this);
471
+ }
336472 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337473 hideleavesItem.addActionListener(this);
338474 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +477,14 @@
341477 markleavesItem.addActionListener(this);
342478 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343479 unmarkleavesItem.addActionListener(this);
480
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
481
+ rewindleavesItem.addActionListener(this);
482
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
483
+ unrewindleavesItem.addActionListener(this);
484
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
485
+ randomleavesItem.addActionListener(this);
486
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
487
+ unrandomleavesItem.addActionListener(this);
344488 menu.add("-");
345489 flipVItem = menu.add(new MenuItem("Flip V"));
346490 flipVItem.addActionListener(this);
....@@ -376,35 +520,40 @@
376520 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377521 sortbynameItem.addActionListener(this);
378522 menu.add("-");
523
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
524
+ shareGeometriesItem.addActionListener(this);
525
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
526
+ mergeGeometriesItem.addActionListener(this);
527
+ if (Globals.ADVANCED)
528
+ {
529
+ // Pretty much the same as duplicate and clone.
379530 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380531 extractGeometriesItem.addActionListener(this);
381532 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382533 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);
534
+ }
387535
388536 oe.menuBar.add(menu = new Menu("Insert"));
389537 buildCreateMenu(menu);
390538
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
-
402539 oe.menuBar.add(menu = new Menu("Tools"));
403540 buildToolsMenu(menu);
404541 }
405542
406543 void SetupUI2(ObjEditor oe)
407544 {
545
+ // June 2019
546
+ if (oe == null)
547
+ {
548
+ //super.SetupUI2(this);
549
+ //return;
550
+ }
551
+
552
+ if (copy != group)
553
+ {
554
+ //super.SetupUI2(this);
555
+ }
556
+
408557 //new Exception().printStackTrace();
409558
410559 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +582,171 @@
433582 oe.radioPanel.add(dummyButton);
434583 oe.buttonGroup.add(dummyButton);
435584 */
436
- aConstraints.gridy += 1;
437
-
438585 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439586
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
587
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ //minButton.setToolTipText("Minimize window");
589
+ //minButton.addActionListener(this);
442590
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
591
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ maxButton.setToolTipText("Maximize window");
593
+ maxButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ fullButton.setToolTipText("Full-screen window");
597
+ fullButton.addActionListener(this);
598
+
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ undoButton.setToolTipText("Undo changes");
601
+ undoButton.addActionListener(this);
602
+
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604
+ redoButton.setToolTipText("Redo changes");
605
+ redoButton.addActionListener(this);
606
+
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ saveButton.setToolTipText("Save changes");
609
+ saveButton.addActionListener(this);
610
+
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612
+ liveCB.setToolTipText("Enable animation");
445613 liveCB.addItemListener(this);
446614
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ oneStepButton.setToolTipText("Animate one step forward");
617
+ oneStepButton.addActionListener(this);
618
+
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620
+ fastCB.setToolTipText("Fast mode");
621
+ fastCB.addItemListener(this);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
449626 trackCB.setToolTipText("Enable tracking");
450627 trackCB.addItemListener(this);
451628
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454630 screenfitButton.setToolTipText("Screen fit");
455631 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
632
+
457633 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458634 // 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;
464635
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");
636
+ if (Globals.ADVANCED)
637
+ {
638
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ snapobjectButton.addActionListener(this);
640
+ snapobjectButton.setToolTipText("Snap Object");
641
+ }
642
+
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
+ flashSelectionButton.setToolTipText("Highlight selection");
472645 flashSelectionButton.addActionListener(this);
473646
474
- oe.toolbarPanel.add(new cButton(" ", false));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475648
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);
649
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482650 twoButton.setToolTipText("Show center view only");
483651 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
652
+ this.fullscreenLayout = twoButton;
653
+
654
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485655 fourButton.addActionListener(this);
486656 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488658 sixButton.setToolTipText("2-column layout left");
489659 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
660
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491661 threeButton.setToolTipText("2-column layout right");
492662 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
663
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494664 sevenButton.setToolTipText("3-column layout");
495665 sevenButton.addActionListener(this);
496666 //
497667
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ rootButton.setToolTipText("Edit selection in new tab");
500670 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
671
+
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503673 closeButton.setToolTipText("Close tab");
504674 closeButton.addActionListener(this);
505675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506676 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515677
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
725
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
+ editButton.setToolTipText("Edit selection");
727
+ editButton.addActionListener(this);
728
+
729
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ uneditButton.setToolTipText("Unedit selection");
517731 uneditButton.addActionListener(this);
518732
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);
733
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
+ allParamsButton.setToolTipText("Edit all params");
531735 allParamsButton.addActionListener(this);
532736
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);
737
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ clearPanelButton.setToolTipText("Clear edit panel");
739
+ clearPanelButton.addActionListener(this);
740
+
741
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ unselectButton.setToolTipText("Unselect");
538743 unselectButton.addActionListener(this);
539744
745
+ editCommandsPanel.preferredHeight = 1;
746
+
747
+// oe.treePanel.add(commandsPanel);
748
+// oe.treePanel.Return();
749
+
540750 // oe.aConstraints.gridx += 1;
541751 // oe.aConstraints.weighty = 0;
542752 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +758,37 @@
548758 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549759 // gcButton.addActionListener(this);
550760
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;
761
+ cGridBag jSPPanel = new cGridBag();
762
+
763
+ JScrollPane jSP;
562764 //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);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564766 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
767
+
768
+ oe.treePanel.add(jSPPanel);
769
+ oe.treePanel.Return();
569770
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);
771
+ cGridBag copyOptionsPanel = new cGridBag();
772
+
773
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
+ colorCB.setToolTipText("Copy color when dropped");
574775 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
776
+
777
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
+ materialCB.setToolTipText("Copy material when dropped");
577779 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
780
+
781
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
+ textureCB.setToolTipText("Copy texture when dropped");
580783 textureCB.addItemListener(this);
581784
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
785
+ copyOptionsPanel.preferredHeight = 1;
786
+ oe.treePanel.add(copyOptionsPanel);
787
+ oe.treePanel.Return();
584788
789
+// mainPanel.setDividerLocation(0.5); //1.0);
790
+// mainPanel.setResizeWeight(0.5);
791
+
585792 //jList.addListSelectionListener(this);
586793 oe.jTree.addTreeSelectionListener(this);
587794 //jTree.setRootVisible(false);
....@@ -604,45 +811,37 @@
604811 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605812 }
606813
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
814
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608815 {
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);
816
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639817 boxCB.setToolTipText("Display bounding boxes");
640818 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
819
+
820
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643821 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644822 zoomBoxCB.addItemListener(this);
645823
824
+ if (true) // Globals.ADVANCED)
825
+ {
826
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
827
+ supportCB.setToolTipText("Enable rigging");
828
+ supportCB.addItemListener(this);
829
+
830
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
831
+ // localCB.addItemListener(this);
832
+
833
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
834
+ crowdCB.setToolTipText("Used for crowds");
835
+ crowdCB.addItemListener(this);
836
+
837
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
838
+ smoothCB.setToolTipText("Snapping delay");
839
+ smoothCB.addItemListener(this);
840
+
841
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
842
+ slowCB.setToolTipText("Smooth interpolation");
843
+ slowCB.addItemListener(this);
844
+
646845 // constraints.gridy += 1;
647846 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648847 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +849,16 @@
650849 if (false)
651850 {
652851 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
852
+ //constraints.gridy += 1;
853
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655854 speakerCameraCB.addItemListener(this);
656855
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
856
+ //constraints.gridy += 1;
857
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659858 speakerFocusCB.addItemListener(this);
660859
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
860
+ //constraints.gridy += 1;
861
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663862 smoothfocusCB.addItemListener(this);
664863 }
665864
....@@ -667,20 +866,46 @@
667866 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668867 // debugCB.addItemListener(this);
669868
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
869
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
+ oeilCB.setToolTipText("Move camera when tracking target");
672871 oeilCB.addItemListener(this);
673872
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
873
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
+ shadowCB.setToolTipText("Compute shadows when live");
875
+ shadowCB.addItemListener(this);
876
+
877
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
+ autosaveCB.setToolTipText("Auto-save on structure change");
879
+ autosaveCB.addItemListener(this);
880
+
881
+ if (Globals.ADVANCED)
882
+ {
883
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676884 lookAtCB.setToolTipText("Look-at target");
677885 lookAtCB.addItemListener(this);
886
+ }
887
+
888
+ }
889
+
890
+ cGridBag fill = new cGridBag();
891
+
892
+ fill.preferredHeight = 200;
893
+
894
+ panel.add(fill);
678895
679896 }
680897
681898 void EditObject(Object3D obj)
682899 {
683900 cRadio radioButton = new cRadio(obj.name);
901
+
902
+ // Patch to avoid bug with transparency.
903
+ radioButton.hadMaterial = obj.material != null;
904
+ if (!radioButton.hadMaterial)
905
+ {
906
+ obj.material = new cMaterial();
907
+ }
908
+
684909 radioButton.SetObject(obj);
685910 radioButton.layout = sevenButton;
686911 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +914,11 @@
689914 buttonGroup.add(radioButton);
690915 radioButton.doClick();
691916 }
917
+
692918 void SetupViews(ObjEditor oe)
693919 {
920
+ theFrame = this;
921
+
694922 oe.SetupViews();
695923
696924 System.out.println("SetupViews");
....@@ -699,23 +927,26 @@
699927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
700928 }
701929
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;
930
+ cToggleButton liveCB;
931
+ cCheckBox supportCB;
932
+ cCheckBox localCB;
933
+ cCheckBox crowdCB;
934
+ cCheckBox smoothCB;
935
+ cToggleButton fastCB;
936
+ cCheckBox slowCB;
937
+ cCheckBox boxCB;
938
+ cCheckBox zoomBoxCB;
939
+ cToggleButton trackCB;
940
+ cCheckBox smoothfocusCB;
713941 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
942
+ cCheckBox speakerCameraCB;
943
+ cCheckBox speakerFocusCB;
944
+ cCheckBox debugCB;
945
+
946
+ cCheckBox oeilCB;
947
+ cCheckBox shadowCB;
948
+ cCheckBox autosaveCB;
949
+ cCheckBox lookAtCB;
719950
720951 // static int COLOR = 1;
721952 // static int MATERIAL = 2;
....@@ -723,9 +954,9 @@
723954
724955 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
725956
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
957
+ cCheckBox colorCB;
958
+ cCheckBox materialCB;
959
+ cCheckBox textureCB;
729960
730961 public void itemStateChanged(ItemEvent e)
731962 {
....@@ -753,6 +984,7 @@
753984 } else if(e.getSource() == liveCB)
754985 {
755986 cameraView.ToggleLive();
987
+ refreshContents(false);
756988 }
757989 else if(e.getSource() == supportCB)
758990 {
....@@ -817,6 +1049,14 @@
8171049 {
8181050 cameraView.ToggleOeil();
8191051 }
1052
+ else if(e.getSource() == shadowCB)
1053
+ {
1054
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1055
+ }
1056
+ else if(e.getSource() == autosaveCB)
1057
+ {
1058
+ Globals.SAVEONMAKE ^= true;
1059
+ }
8201060 else if(e.getSource() == lookAtCB)
8211061 {
8221062 cameraView.ToggleLookAt();
....@@ -833,7 +1073,8 @@
8331073
8341074 /**/
8351075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
8371078 if ((path == null) || (path.getPathCount() <= 1)) {
8381079 // We can't move the root node or an empty selection
8391080 return;
....@@ -905,7 +1146,9 @@
9051146 // objEditor.DropFile((java.io.File[]) object, true);
9061147 // return;
9071148 // }
908
- if (string.charAt(0) == '/')
1149
+
1150
+ // File path for Mac and Windows
1151
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091152 {
9101153 // file(s)
9111154 String[] names = string.split("\n");
....@@ -932,7 +1175,7 @@
9321175
9331176 flashIt = false;
9341177 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1178
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361179 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371180
9381181 if (group.selection.size() == 1)
....@@ -955,16 +1198,16 @@
9551198 return;
9561199 }
9571200
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
959
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
9601203 loadClipboard(true);
9611204 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1205
+ pasteInto(false, false);
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
9681211 }
9691212 public void dropActionChanged(DropTargetDragEvent dtde)
9701213 // Called if the user has modified the current drop gesture
....@@ -1085,27 +1328,33 @@
10851328 kleinItem.addActionListener(this);
10861329 particleItem = menu.add(new MenuItem("Particle system"));
10871330 particleItem.addActionListener(this);
1331
+ if (Globals.ADVANCED)
1332
+ {
10881333 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891334 ragdollItem.addActionListener(this);
10901335 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911336 ragdoll2Item.addActionListener(this);
1337
+ }
10921338 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1339
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941340 meshItem.addActionListener(this);
10951341 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961342 // meshGroupItem.addActionListener(this);
1343
+ if (Globals.ADVANCED)
1344
+ {
10971345 springItem = menu.add(new MenuItem("Spring"));
10981346 springItem.addActionListener(this);
10991347 flagItem = menu.add(new MenuItem("Flag"));
11001348 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);
11051349 blobItem = menu.add(new MenuItem("Blob"));
11061350 blobItem.addActionListener(this);
11071351 latheItem = menu.add(new MenuItem("Lathe"));
11081352 latheItem.addActionListener(this);
1353
+ }
1354
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1355
+ bezierItem.addActionListener(this);
1356
+ overlayItem = menu.add(new MenuItem("Overlay"));
1357
+ overlayItem.addActionListener(this);
11091358 lightItem = menu.add(new MenuItem("Light"));
11101359 lightItem.addActionListener(this);
11111360 menu.add("-");
....@@ -1115,39 +1364,44 @@
11151364 loopItem.addActionListener(this);
11161365 doubleItem = menu.add(new MenuItem("Fork"));
11171366 doubleItem.addActionListener(this);
1367
+ if (Globals.ADVANCED)
1368
+ {
11181369 tripleItem = menu.add(new MenuItem("Trident"));
11191370 tripleItem.addActionListener(this);
1371
+ }
11201372 }
11211373
11221374 void buildToolsMenu(Menu menu)
11231375 {
11241376 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251377 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1378
+ animationItem.setState(Globals.ANIMATION);
11271379
11281380 menu.add("-");
11291381 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301382 parseverticesItem.addActionListener(this);
11311383 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321384 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1385
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341386 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371387 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381388 reduceMorphItem.addActionListener(this);
11391389 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401390 reduce34MorphItem.addActionListener(this);
1141
-
1391
+ menu.add("-");
11421392 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431393 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451394
1395
+ if (Globals.ADVANCED)
1396
+ {
1397
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1398
+ mirrorItem.addActionListener(this);
1399
+ menu.add("-");
11461400 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471401 memoryItem.addActionListener(this);
11481402 menu.add(analyzeItem = new MenuItem("Analyze"));
11491403 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1404
+ menu.add(dumpItem = new MenuItem("Print"));
11511405 dumpItem.addActionListener(this);
11521406 // menu.add(pathItem = new MenuItem("From-to path"));
11531407 // pathItem.addActionListener(this);
....@@ -1165,6 +1419,7 @@
11651419 menu.add("-");
11661420 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671421 editScriptItem.addActionListener(this);
1422
+ }
11681423 }
11691424
11701425 void ScreenFit()
....@@ -1287,6 +1542,7 @@
12871542 shadow.material = new cMaterial(obj.material);
12881543 shadow.material.diffuse = 0.0001f;
12891544 shadow.material.specular = 0.0001f;
1545
+ //shadow.projectedVertices[1].x = 300;
12901546
12911547 makeSomething(shadow);
12921548 }
....@@ -1493,9 +1749,9 @@
14931749
14941750 void Overwrite(int mask)
14951751 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1752
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971753 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1754
+ Object3D content = Grafreed.clipboard.get(0);
14991755
15001756 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011757 content = ((cGroup)content).get(0);
....@@ -1518,6 +1774,7 @@
15181774 //
15191775 public void actionPerformed(ActionEvent event) // , Object arg)
15201776 {
1777
+ Object source = event.getSource();
15211778 /*
15221779 if (event.getSource() == nameField)
15231780 {
....@@ -1529,11 +1786,11 @@
15291786 }
15301787 else
15311788 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1789
+ if (source == lookAtItem || source == lookFromItem)
15331790 {
15341791 ScreenFit();
15351792 } else
1536
- if (event.getSource() == switchItem)
1793
+ if (source == switchItem)
15371794 {
15381795 cVector v1 = new cVector();
15391796 cVector v2 = new cVector();
....@@ -1542,11 +1799,11 @@
15421799 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431800 objEditor.cameraView.repaint();
15441801 } else
1545
- if (event.getSource() == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
15461803 {
15471804 makeSomething(new Box());
15481805 } else
1549
- if (event.getSource() == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
15501807 {
15511808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1824,9 @@
15671824 applyExample(particleGeom, "SMOKE");
15681825 makeSomething(particleGeom);
15691826 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1827
+ if (source == ragdollItem || source == ragdoll2Item)
15711828 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1829
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731830
15741831 ragdoll.toParent = LA.newMatrix();
15751832 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1844,7 @@
15871844 } else
15881845 /*
15891846 */
1590
- if (event.getSource() == heightFieldItem)
1847
+ if (source == heightFieldItem)
15911848 {
15921849 Object3D obj = new Object3D();
15931850
....@@ -1625,31 +1882,31 @@
16251882
16261883 makeSomething(obj);
16271884 } else
1628
- if (event.getSource() == gridItem)
1885
+ if (source == gridItem || source == gridButton)
16291886 {
16301887 makeSomething(new Grid());
16311888 } else
1632
- if (event.getSource() == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
16331890 {
16341891 makeSomething(new Sphere());
16351892 } else
1636
- if (event.getSource() == coneItem)
1893
+ if (source == coneItem || source == coneButton)
16371894 {
16381895 makeSomething(new Cone());
16391896 } else
1640
- if (event.getSource() == torusItem)
1897
+ if (source == torusItem || source == torusButton)
16411898 {
16421899 makeSomething(new Torus());
16431900 } else
1644
- if (event.getSource() == superItem)
1901
+ if (source == superItem || source == superButton)
16451902 {
16461903 makeSomething(new Superellipsoid());
16471904 } else
1648
- if (event.getSource() == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
16491906 {
16501907 makeSomething(new Klein());
16511908 } else
1652
- if (event.getSource() == blobItem)
1909
+ if (source == blobItem)
16531910 {
16541911 Blob blob = new Blob();
16551912 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1914,15 @@
16571914 //blob.retile();
16581915 makeSomething(blob);
16591916 } else
1660
- if (event.getSource() == latheItem)
1917
+ if (source == latheItem)
16611918 {
16621919 makeSomething(new Lathe());
16631920 } else
1664
- if (event.getSource() == bezierItem)
1921
+ if (source == bezierItem)
16651922 {
16661923 makeSomething(new BezierSurface());
16671924 } else
1668
- if (event.getSource() == checkerItem)
1925
+ if (source == overlayItem || source == overlayButton)
16691926 {
16701927 /*
16711928 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1937,7 @@
16801937 */
16811938 makeSomething(new Checker());
16821939 } else
1683
- if (event.getSource() == meshItem)
1940
+ if (source == meshItem)
16841941 {
16851942 Object3D itemtomake = new Object3D();
16861943 Object3D child;
....@@ -1701,35 +1958,35 @@
17011958 makeSomething(child);
17021959 }
17031960 } else
1704
- if (event.getSource() == springItem)
1961
+ if (source == springItem)
17051962 {
17061963 cSpring s = new cSpring();
17071964 s.setup();
17081965 makeSomething(s);
17091966 } else
1710
- if (event.getSource() == flagItem)
1967
+ if (source == flagItem)
17111968 {
17121969 cSpring s = new cFlag();
17131970 s.setup();
17141971 makeSomething(s);
17151972 } else
1716
- if (event.getSource() == lightItem)
1973
+ if (source == lightItem || source == lightButton)
17171974 {
17181975 makeSomething(new Light());
17191976 } else
1720
- if (event.getSource() == csgItem)
1977
+ if (source == csgItem)
17211978 {
17221979 group(new CSG());
17231980 } else
1724
- if (event.getSource() == templateItem)
1981
+ if (source == templateItem)
17251982 {
17261983 group(new cTemplate());
17271984 } else
1728
- if (event.getSource() == attributeItem)
1985
+ if (source == attributeItem)
17291986 {
17301987 makeSomething(new Attribute());
17311988 } else
1732
- if (event.getSource() == pointflowItem)
1989
+ if (source == pointflowItem)
17331990 {
17341991 makeSomething(new PointFlow());
17351992 } else
....@@ -1741,7 +1998,7 @@
17411998 } else
17421999 */
17432000
1744
- if (event.getSource() == superLoopItem)
2001
+ if (source == superLoopItem)
17452002 {
17462003 Composite g = new cGroup();
17472004 for (int i=0; i<15; i++)
....@@ -1763,7 +2020,7 @@
17632020
17642021 group(g);
17652022 } else
1766
- if (event.getSource() == loopItem)
2023
+ if (source == loopItem)
17672024 {
17682025 Composite csg = new GroupLeaf();
17692026 csg.count = 5;
....@@ -1772,7 +2029,7 @@
17722029 csg.addChild(child);
17732030 child.addChild(csg);
17742031 } else
1775
- if (event.getSource() == doubleItem)
2032
+ if (source == doubleItem)
17762033 {
17772034 Composite csg = new GroupLeaf();
17782035 csg.count = 5;
....@@ -1784,7 +2041,7 @@
17842041 csg.addChild(child);
17852042 child.addChild(csg);
17862043 } else
1787
- if (event.getSource() == tripleItem)
2044
+ if (source == tripleItem)
17882045 {
17892046 Composite csg = new GroupLeaf();
17902047 csg.count = 4;
....@@ -1799,71 +2056,83 @@
17992056 csg.addChild(child);
18002057 child.addChild(csg);
18012058 } 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)
2059
+ if (source == computeAOItem)
18202060 {
18212061 Globals.drawMode = CameraPane.OCCLUSION;
18222062 Globals.theRenderer.repaint();
18232063 } else
1824
- if (event.getSource() == recompileItem)
2064
+ if (source == recompileItem)
18252065 {
18262066 Recompile();
18272067 refreshContents();
18282068 } else
1829
- if (event.getSource() == editScriptItem)
2069
+ if (source == editScriptItem)
18302070 {
18312071 OpenDialog();
18322072 refreshContents();
18332073 } else
1834
- if (event.getSource() == invariantsItem)
2074
+ if (source == invariantsItem)
18352075 {
18362076 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2077
+ Grafreed.grafreeD.universe.invariants();
18382078 } else
1839
- if (event.getSource() == memoryItem)
2079
+ if (source == memoryItem)
18402080 {
18412081 //System.out.println("Invariants:");
18422082 PrintMemory();
18432083 } else
1844
- if (event.getSource() == pathItem)
2084
+ if (source == pathItem)
18452085 {
18462086 PrintPath();
18472087 } else
1848
- if (event.getSource() == analyzeItem)
2088
+ if (source == analyzeItem)
18492089 {
18502090 AnalyzeObject();
18512091 } else
1852
- if (event.getSource() == dumpItem)
2092
+ if (source == dumpItem)
18532093 {
18542094 DumpObject();
18552095 } else
1856
- if (event.getSource() == screenfitButton)
2096
+ if (source == minButton)
2097
+ {
2098
+ Minimize();
2099
+ } else
2100
+ if (source == maxButton)
2101
+ {
2102
+ Maximize();
2103
+ } else
2104
+ if (source == fullButton)
2105
+ {
2106
+ ToggleFullScreen();
2107
+ } else
2108
+ if (source == undoButton)
2109
+ {
2110
+ Undo();
2111
+ } else
2112
+ if (source == redoButton)
2113
+ {
2114
+ Redo();
2115
+ } else
2116
+ if (source == saveButton)
2117
+ {
2118
+ Save();
2119
+ } else
2120
+ if (source == oneStepButton)
2121
+ {
2122
+ Globals.ONESTEP = true;
2123
+ cameraView.repaint();
2124
+ } else
2125
+ if (source == screenfitButton)
18572126 {
18582127 //Reload(lastConverter, lastFilename, true);
18592128 ScreenFit();
18602129 } else
1861
- if (event.getSource() == screenfitpointButton)
2130
+ if (source == screenfitpointButton)
18622131 {
18632132 //Reload(lastConverter, lastFilename, true);
18642133 ScreenFitPoint();
18652134 } else
1866
- if (event.getSource() == snapobjectButton)
2135
+ if (source == snapobjectButton)
18672136 {
18682137 //Reload(lastConverter, lastFilename, true);
18692138 SnapObject();
....@@ -1874,13 +2143,13 @@
18742143 // Recompile();
18752144 // refreshContents();
18762145 // } else
1877
- if (event.getSource() == gcButton)
2146
+ if (source == gcButton)
18782147 {
18792148 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802149 System.gc();
18812150 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822151 } else
1883
- if (event.getSource() == editLeafItem)
2152
+ if (source == editLeafItem)
18842153 {
18852154 Object3D obj;
18862155 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2163,74 @@
18942163 }
18952164 refreshContents(true);
18962165 } else
1897
- if (event.getSource() == openWindowItem)
2166
+ if (source == openWindowItem)
18982167 {
18992168 EditSelection(true);
19002169 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2170
+ if (source == cutItem || source == clearButton)
19022171 {
19032172 loadClipboard(true);
19042173 } else
1905
- if (event.getSource() == duplicateItem)
2174
+ if (source == undoItem)
19062175 {
1907
- Object3D keep = GrafreeD.clipboard;
2176
+ Undo();
2177
+ } else
2178
+ if (source == redoItem)
2179
+ {
2180
+ Redo();
2181
+ } else
2182
+ if (source == duplicateItem)
2183
+ {
2184
+ Object3D keep = Grafreed.clipboard;
19082185 loadClipboard(false);
19092186 paste(false);
1910
- GrafreeD.clipboard = keep;
2187
+ Grafreed.clipboard = keep;
19112188 } else
1912
- if (event.getSource() == cloneItem)
2189
+ if (source == cloneItem)
19132190 {
19142191 CloneSelection(false);
19152192 } else
1916
- if (event.getSource() == cloneSupportItem)
2193
+ if (source == cloneSupportItem)
19172194 {
19182195 CloneSelection(true);
19192196 } else
1920
- if (event.getSource() == copyItem)
2197
+ if (source == copyItem)
19212198 {
19222199 loadClipboard(false);
19232200 } else
1924
- if (event.getSource() == pasteItem)
2201
+ if (source == pasteItem)
19252202 {
19262203 paste(false);
19272204 } else
1928
- if (event.getSource() == pasteLinkItem)
2205
+ if (source == pasteIntoItem)
19292206 {
1930
- pasteInto(false);
2207
+ pasteInto(true, false);
19312208 } else
1932
- if (event.getSource() == pasteCloneItem)
2209
+ if (source == pasteLinkItem)
19332210 {
1934
- pasteInto(true);
2211
+ pasteInto(false, false);
19352212 } else
1936
- if (event.getSource() == pasteExpandItem)
2213
+ if (source == pasteCloneItem)
2214
+ {
2215
+ pasteInto(true, true);
2216
+ } else
2217
+ if (source == pasteExpandItem)
19372218 {
19382219 paste(true);
19392220 } else
1940
- if (event.getSource() == synchronizeItem)
2221
+ if (source == synchronizeItem)
19412222 {
19422223 Overwrite(Object3D.TRANSFORM);
19432224 } else
1944
- if (event.getSource() == overwriteNameItem)
2225
+ if (source == overwriteNameItem)
19452226 {
19462227 Overwrite(Object3D.NAME);
19472228 } else
1948
- if (event.getSource() == overwriteUVItem)
2229
+ if (source == overwriteUVItem)
19492230 {
19502231 Overwrite(Object3D.UV);
19512232 } else
1952
- if (event.getSource() == overwriteMatItem)
2233
+ if (source == overwriteMatItem)
19532234 {
19542235 /* july 2015
19552236 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2250,7 @@
19692250
19702251 Overwrite(dropAttributes);
19712252 }
1972
- if (event.getSource() == overwriteGeoItem)
2253
+ if (source == overwriteGeoItem)
19732254 {
19742255 Overwrite(Object3D.GEOMETRY);
19752256 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2267,7 @@
19862267 // refreshContents();
19872268 // }
19882269 } else
1989
- if (event.getSource() == generateMeshItem)
2270
+ if (source == generateMeshItem)
19902271 {
19912272 //if (group.selection.size() == 1)
19922273 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2278,7 @@
19972278 ResetModel();
19982279 refreshContents();
19992280 } else
2000
- if (event.getSource() == extractGeometriesItem)
2281
+ if (source == extractGeometriesItem)
20012282 {
20022283 boolean one = false;
20032284
....@@ -2024,7 +2305,7 @@
20242305 ResetModel();
20252306 refreshContents();
20262307 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2308
+ if (source == cloneGeometriesItem)
20282309 {
20292310 boolean one = false;
20302311
....@@ -2050,7 +2331,7 @@
20502331 ResetModel();
20512332 refreshContents();
20522333 } else
2053
- if (event.getSource() == shareGeometriesItem)
2334
+ if (source == shareGeometriesItem)
20542335 {
20552336 boolean one = false;
20562337
....@@ -2080,7 +2361,7 @@
20802361 refreshContents();
20812362 }
20822363 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2364
+ if (source == mergeGeometriesItem)
20842365 {
20852366 boolean one = false;
20862367
....@@ -2110,7 +2391,7 @@
21102391 ResetModel();
21112392 refreshContents();
21122393 } else
2113
- if (event.getSource() == linkverticesItem)
2394
+ if (source == linkverticesItem)
21142395 {
21152396 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162397 // {
....@@ -2123,9 +2404,9 @@
21232404 // group.selection.get(0).setMasterThis(content); // should be identity
21242405 // refreshContents();
21252406 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2407
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272408 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2409
+ Object3D content = Grafreed.clipboard.get(0);
21292410
21302411 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312412 content = ((cGroup)content).get(0);
....@@ -2133,38 +2414,38 @@
21332414 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342415 for (int i=0; i<group.selection.size(); i++)
21352416 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2417
+ boolean random = CameraPane.SWITCH;
2418
+ CameraPane.SWITCH = false; // parse all random nodes
21382419 group.selection.get(i).linkVerticesThis(content);
21392420 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2421
+ CameraPane.SWITCH = random;
21412422 }
21422423 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432424 refreshContents();
21442425 }
21452426 } else
2146
- if (event.getSource() == resetsupportItem)
2427
+ if (source == resetsupportItem)
21472428 {
21482429 for (int i=0; i<group.selection.size(); i++)
21492430 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2431
+ boolean random = CameraPane.SWITCH;
2432
+ CameraPane.SWITCH = false; // parse all random nodes
21522433 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2434
+ CameraPane.SWITCH = random;
21542435 }
21552436
21562437 refreshContents();
21572438 } else
2158
- if (event.getSource() == relinkverticesItem)
2439
+ if (source == relinkverticesItem)
21592440 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2441
+ boolean random = CameraPane.SWITCH;
2442
+ CameraPane.SWITCH = false; // parse all random nodes
21622443 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2444
+ CameraPane.SWITCH = random;
21642445
21652446 refreshContents();
21662447 } else
2167
- if (event.getSource() == resetreferencesItem)
2448
+ if (source == resetreferencesItem)
21682449 {
21692450 for (int i=0; i<group.selection.size(); i++)
21702451 {
....@@ -2173,11 +2454,11 @@
21732454
21742455 refreshContents();
21752456 } else
2176
- if (event.getSource() == setMasterItem)
2457
+ if (source == setMasterItem)
21772458 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2459
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792460 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2461
+ Object3D content = Grafreed.clipboard.get(0);
21812462
21822463 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832464 content = ((cGroup)content).get(0);
....@@ -2186,13 +2467,13 @@
21862467 refreshContents();
21872468 }
21882469 } else
2189
- if (event.getSource() == poseMeshItem)
2470
+ if (source == poseMeshItem)
21902471 {
21912472 if (group.selection.size() == 1)
21922473 {
2193
- if (GrafreeD.clipboard.size() == 1)
2474
+ if (Grafreed.clipboard.size() == 1)
21942475 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2476
+ Object3D content = Grafreed.clipboard.get(0);
21962477
21972478 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982479 content = ((cGroup)content).get(0);
....@@ -2205,19 +2486,19 @@
22052486 }
22062487
22072488 } else
2208
- if (event.getSource() == revertMeshItem)
2489
+ if (source == revertMeshItem)
22092490 {
22102491 RevertMeshes();
22112492 } else
2212
- if (event.getSource() == resetMeshItem)
2493
+ if (source == resetAllItem)
22132494 {
22142495 ResetAll();
22152496 } else
2216
- if (event.getSource() == stepAllItem)
2497
+ if (source == stepAllItem)
22172498 {
22182499 StepAll();
22192500 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2501
+ if (source == clearItem) // || event.getSource() == clearButton)
22212502 {
22222503 //int indices[] = jList.getSelectedIndices();
22232504 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2506,46 @@
22252506
22262507 ClearSelection(false);
22272508 } else
2228
- if (event.getSource() == clearAllItem)
2509
+ if (source == clearAllItem)
22292510 {
22302511 ClearSelection(true);
22312512 } else
2232
- if (event.getSource() == grabItem)
2513
+ if (source == grabItem)
22332514 {
22342515 group(new cGroup(), true);
22352516 } else
2236
- if (event.getSource() == hideItem)
2517
+ if (source == hideItem)
22372518 {
22382519 group(new HiddenObject());
22392520 } else
2240
- if (event.getSource() == frontItem)
2521
+ if (source == frontItem)
22412522 {
22422523 front();
22432524 } else
2244
- if (event.getSource() == backItem)
2525
+ if (source == backItem)
22452526 {
22462527 back();
22472528 } else
2248
- if (event.getSource() == cameraItem)
2529
+ if (source == cameraItem)
22492530 {
22502531 makeSomething(new Camera());
22512532 } else
2252
- if (event.getSource() == compositeItem)
2533
+ if (source == compositeItem)
22532534 {
22542535 group(new Composite());
22552536 } else
2256
- if (event.getSource() == randomItem)
2537
+ if (source == randomItem)
22572538 {
22582539 RandomNode random = new RandomNode();
22592540 group(random);
22602541 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2542
+ random.name = random.get(0).name + "Switch";
22622543 } else
2263
- if (event.getSource() == physicsItem)
2544
+ if (source == physicsItem)
22642545 {
22652546 group(new PhysicsNode());
22662547 } else
2267
- if (event.getSource() == frameselectorItem)
2548
+ if (source == frameselectorItem)
22682549 {
22692550 for (int i=0; i<group.selection.size(); i++)
22702551 {
....@@ -2276,7 +2557,7 @@
22762557 ResetModel();
22772558 refreshContents();
22782559 } else
2279
- if (event.getSource() == switchGeoItem)
2560
+ if (source == switchGeoItem)
22802561 {
22812562 for (int i=0; i<group.selection.size(); i++)
22822563 {
....@@ -2288,7 +2569,7 @@
22882569 ResetModel();
22892570 refreshContents();
22902571 } else
2291
- if (event.getSource() == switchTransfoItem)
2572
+ if (source == switchTransfoItem)
22922573 {
22932574 for (int i=0; i<group.selection.size(); i++)
22942575 {
....@@ -2300,7 +2581,7 @@
23002581 ResetModel();
23012582 refreshContents();
23022583 } else
2303
- if (event.getSource() == morphItem)
2584
+ if (source == morphItem)
23042585 {
23052586 for (int i=0; i<group.selection.size(); i++)
23062587 {
....@@ -2312,7 +2593,7 @@
23122593 ResetModel();
23132594 refreshContents();
23142595 } else
2315
- if (event.getSource() == scriptNodeItem)
2596
+ if (source == scriptNodeItem)
23162597 {
23172598 boolean atleastone = false;
23182599
....@@ -2351,31 +2632,31 @@
23512632 }
23522633 }
23532634 } else
2354
- if (event.getSource() == linkerItem)
2635
+ if (source == linkerItem)
23552636 {
23562637 group(new cLinker());
23572638 } else
2358
- if (event.getSource() == textureItem)
2639
+ if (source == textureItem)
23592640 {
23602641 group(new TextureNode());
23612642 } else
2362
- if (event.getSource() == billboardItem)
2643
+ if (source == billboardItem)
23632644 {
23642645 group(new BillboardNode());
23652646 } else
2366
- if (event.getSource() == shadowXItem)
2647
+ if (source == shadowXItem)
23672648 {
23682649 CastShadow(0);
23692650 } else
2370
- if (event.getSource() == shadowYItem)
2651
+ if (source == shadowYItem)
23712652 {
23722653 CastShadow(1);
23732654 } else
2374
- if (event.getSource() == shadowZItem)
2655
+ if (source == shadowZItem)
23752656 {
23762657 CastShadow(2);
23772658 } else
2378
- if (event.getSource() == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
23792660 {
23802661 //ungroup();
23812662 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2668,203 @@
23872668
23882669 refreshContents();
23892670 } else
2390
- if (event.getSource() == genUVItem)
2671
+ if (source == genUVItem)
23912672 {
23922673 GenUV();
23932674 } else
2394
- if (event.getSource() == genNormalsCADItem)
2675
+ if (source == genNormalsCADItem)
23952676 {
23962677 GenNormals(true);
23972678 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2679
+ if (source == genNormalsMESHItem)
23992680 {
2400
- GenNormals(true); // TODO
2681
+ GenNormalsMESH();
24012682 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2683
+ if (source == genNormalsORGANItem)
24032684 {
24042685 GenNormals(false);
24052686 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2687
+ if (source == genNormalsMINEItem)
24072688 {
24082689 GenNormalsMINE();
24092690 } else
2410
- if (event.getSource() == stripifyItem)
2691
+ if (source == stripifyItem)
24112692 {
24122693 Stripify();
24132694 } else
2414
- if (event.getSource() == unstripifyItem)
2695
+ if (source == unstripifyItem)
24152696 {
24162697 Unstripify();
24172698 } else
2418
- if (event.getSource() == trimItem)
2699
+ if (source == trimItem)
24192700 {
24202701 Trim();
24212702 } else
2422
- if (event.getSource() == untrimItem)
2703
+ if (source == untrimItem)
24232704 {
24242705 Untrim();
24252706 } else
2426
- if (event.getSource() == clearColorsItem)
2707
+ if (source == clearColorsItem)
24272708 {
24282709 ClearColors();
24292710 } else
2430
- if (event.getSource() == clearMaterialsItem)
2711
+ if (source == clearMaterialsItem)
24312712 {
24322713 ClearMaterials();
24332714 } else
2434
- if (event.getSource() == liveleavesItem)
2715
+ if (source == liveleavesItem)
24352716 {
24362717 LiveLeaves(true);
24372718 } else
2438
- if (event.getSource() == unliveleavesItem)
2719
+ if (source == unliveleavesItem)
24392720 {
24402721 LiveLeaves(false);
24412722 } else
2442
- if (event.getSource() == supportleavesItem)
2723
+ if (source == supportleavesItem)
24432724 {
24442725 SupportLeaves(true);
24452726 } else
2446
- if (event.getSource() == unsupportleavesItem)
2727
+ if (source == unsupportleavesItem)
24472728 {
24482729 SupportLeaves(false);
24492730 } else
2450
- if (event.getSource() == hideleavesItem)
2731
+ if (source == hideleavesItem)
24512732 {
24522733 HideLeaves(true);
24532734 } else
2454
- if (event.getSource() == showleavesItem)
2735
+ if (source == showleavesItem)
24552736 {
24562737 HideLeaves(false);
24572738 } else
2458
- if (event.getSource() == markleavesItem)
2739
+ if (source == markleavesItem)
24592740 {
24602741 MarkLeaves(true);
24612742 } else
2462
- if (event.getSource() == unmarkleavesItem)
2743
+ if (source == unmarkleavesItem)
24632744 {
24642745 MarkLeaves(false);
24652746 } else
2466
- if (event.getSource() == flipVItem)
2747
+ if (source == rewindleavesItem)
2748
+ {
2749
+ RewindLeaves(true);
2750
+ } else
2751
+ if (source == unrewindleavesItem)
2752
+ {
2753
+ RewindLeaves(false);
2754
+ } else
2755
+ if (source == randomleavesItem)
2756
+ {
2757
+ RandomLeaves(true);
2758
+ } else
2759
+ if (source == unrandomleavesItem)
2760
+ {
2761
+ RandomLeaves(false);
2762
+ } else
2763
+ if (source == flipVItem)
24672764 {
24682765 FlipV(true);
24692766 } else
2470
- if (event.getSource() == unflipVItem)
2767
+ if (source == unflipVItem)
24712768 {
24722769 FlipV(false);
24732770 } else
2474
- if (event.getSource() == lowTexturesItem)
2771
+ if (source == lowTexturesItem)
24752772 {
24762773 SetTexRes(0);
24772774 } else
2478
- if (event.getSource() == normalTexturesItem)
2775
+ if (source == normalTexturesItem)
24792776 {
24802777 SetTexRes(1);
24812778 } else
2482
- if (event.getSource() == highTexturesItem)
2779
+ if (source == highTexturesItem)
24832780 {
24842781 SetTexRes(2);
24852782 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2783
+ if (source == veryhighTexturesItem)
24872784 {
24882785 SetTexRes(3);
24892786 } else
2490
- if (event.getSource() == maxTexturesItem)
2787
+ if (source == maxTexturesItem)
24912788 {
24922789 SetTexRes(4);
24932790 } else
2494
- if (event.getSource() == panoTexturesItem)
2791
+ if (source == panoTexturesItem)
24952792 {
24962793 SetTexRes(5);
24972794 } else
2498
- if (event.getSource() == reverseNormalsItem)
2795
+ if (source == reverseNormalsItem)
24992796 {
25002797 ReverseNormals();
25012798 } else
2502
- if (event.getSource() == parseverticesItem)
2799
+ if (source == parseverticesItem)
25032800 {
25042801 ParseVertices();
25052802 } else
2506
- if (event.getSource() == textureFieldItem)
2803
+ if (source == textureFieldItem)
25072804 {
25082805 TextureVertices();
25092806 } else
2510
- if (event.getSource() == alignItem)
2807
+ if (source == alignItem)
25112808 {
25122809 Align();
25132810 } else
2514
- if (event.getSource() == mirrorItem)
2811
+ if (source == mirrorItem)
25152812 {
25162813 MirrorPoses();
25172814 } else
2518
- if (event.getSource() == reduceMorphItem)
2815
+ if (source == reduceMorphItem)
25192816 {
25202817 MeshReduction(false);
25212818 } else
2522
- if (event.getSource() == reduce34MorphItem)
2819
+ if (source == reduce34MorphItem)
25232820 {
25242821 MeshReduction(true);
25252822 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2823
+ if (source == reverseTrianglesItem)
25272824 {
25282825 ReverseTriangles();
25292826 } else
2530
- if (event.getSource() == reduceMeshItem)
2827
+ if (source == reduceMeshItem)
25312828 {
25322829 ReduceMesh(false);
25332830 } else
2534
- if (event.getSource() == reduce34MeshItem)
2831
+ if (source == reduce34MeshItem)
25352832 {
25362833 ReduceMesh(true);
25372834 } else
2538
- if (event.getSource() == increaseMeshItem)
2835
+ if (source == increaseMeshItem)
25392836 {
25402837 IncreaseMesh();
25412838 } else
2542
- if (event.getSource() == clipMeshItem)
2839
+ if (source == clipMeshItem)
25432840 {
25442841 ClipMesh();
25452842 } else
2546
- if (event.getSource() == smoothMeshItem)
2843
+ if (source == smoothMeshItem)
25472844 {
25482845 SmoothMesh();
25492846 } else
2550
- if (event.getSource() == transformgeometryItem)
2847
+ if (source == transformGeometryItem)
25512848 {
25522849 TransformGeometry();
25532850 } else
2554
- if (event.getSource() == resetTransformItem)
2851
+ if (source == transformChildrenItem)
2852
+ {
2853
+ TransformChildren();
2854
+ } else
2855
+ if (source == resetTransformItem)
25552856 {
25562857 ResetTransform();
25572858 } else
2558
- if (event.getSource() == resetCentroidItem)
2859
+ if (source == resetCentroidItem)
25592860 {
2560
- ResetCentroid();
2861
+ ResetCentroid(true);
25612862 } else
2562
- if (event.getSource() == resetParentItem)
2863
+ if (source == resetCentroidXZItem)
2864
+ {
2865
+ ResetCentroid(false);
2866
+ } else
2867
+ if (source == resetParentItem)
25632868 {
25642869 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652870 {
....@@ -2569,7 +2874,7 @@
25692874
25702875 refreshContents();
25712876 } else
2572
- if (event.getSource() == repairParentItem)
2877
+ if (source == repairParentItem)
25732878 {
25742879 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752880 {
....@@ -2583,7 +2888,7 @@
25832888
25842889 refreshContents();
25852890 } else
2586
- if (event.getSource() == repairShadowItem)
2891
+ if (source == repairShadowItem)
25872892 {
25882893 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892894 {
....@@ -2597,7 +2902,7 @@
25972902
25982903 refreshContents();
25992904 } else
2600
- if (event.getSource() == sortbysizeItem)
2905
+ if (source == sortbysizeItem)
26012906 {
26022907 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032908 {
....@@ -2609,7 +2914,7 @@
26092914 ResetModel();
26102915 refreshContents();
26112916 } else
2612
- if (event.getSource() == sortbynameItem)
2917
+ if (source == sortbynameItem)
26132918 {
26142919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152920 {
....@@ -2621,7 +2926,7 @@
26212926 ResetModel();
26222927 refreshContents();
26232928 } else
2624
- if (event.getSource() == attachPigmentItem)
2929
+ if (source == attachPigmentItem)
26252930 {
26262931 String texture = GetFile("Attach pigment");
26272932 Object3D obj;
....@@ -2633,7 +2938,7 @@
26332938
26342939 refreshContents();
26352940 } else
2636
- if (event.getSource() == detachPigmentItem)
2941
+ if (source == detachPigmentItem)
26372942 {
26382943 Object3D obj;
26392944 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2949,7 @@
26442949
26452950 refreshContents();
26462951 } else
2647
- if (event.getSource() == attachBumpItem)
2952
+ if (source == attachBumpItem)
26482953 {
26492954 String texture = GetFile("Attach bump");
26502955 Object3D obj;
....@@ -2656,7 +2961,7 @@
26562961
26572962 refreshContents();
26582963 } else
2659
- if (event.getSource() == detachBumpItem)
2964
+ if (source == detachBumpItem)
26602965 {
26612966 Object3D obj;
26622967 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2972,7 @@
26672972
26682973 refreshContents();
26692974 } else
2670
- if (event.getSource() == pigmentBumpItem)
2975
+ if (source == pigmentBumpItem)
26712976 {
26722977 Object3D obj;
26732978 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2983,237 @@
26782983
26792984 refreshContents();
26802985 } else
2681
- if (event.getSource() == flashSelectionButton)
2986
+ if (source == flashSelectionButton)
26822987 {
26832988 CameraPane.flash = true;
26842989 refreshContents();
26852990 } else
2686
- if (event.getSource() == oneButton)
2991
+ if (source == oneButton)
26872992 {
26882993 } else
2689
- if (event.getSource() == twoButton)
2994
+ if (source == twoButton)
26902995 {
26912996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
26923001 // bug
26933002 //gridPanel.setDividerLocation(1.0);
26943003 //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();
3004
+// bigThree.remove(scenePanel);
3005
+// bigThree.remove(centralPanel);
3006
+// bigThree.remove(XYZPanel);
3007
+// aWindowConstraints.gridx = 0;
3008
+// aWindowConstraints.gridy = 0;
3009
+// aWindowConstraints.gridwidth = 1;
3010
+// // aConstraints.gridheight = 3;
3011
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3012
+// aWindowConstraints.weightx = 0;
3013
+// aWindowConstraints.weighty = 1;
3014
+// //bigThree.add(jtp, aWindowConstraints);
3015
+// aWindowConstraints.weightx = 1;
3016
+// aWindowConstraints.gridwidth = 3;
3017
+// // aConstraints.gridheight = 3;
3018
+// aWindowConstraints.gridx = 1;
3019
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3020
+// bigThree.add(centralPanel, aWindowConstraints);
3021
+// aWindowConstraints.weightx = 0;
3022
+// aWindowConstraints.gridx = 4;
3023
+// aWindowConstraints.gridwidth = 1;
3024
+// // aConstraints.gridheight = 3;
3025
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3026
+// //bigThree.add(XYZPanel, aWindowConstraints);
3027
+// scenePanel.setVisible(false);
3028
+// centralPanel.setVisible(true);
3029
+// XYZPanel.setVisible(false);
3030
+ bigThree.ClearUI();
3031
+ bigThree.add(centralPanel);
3032
+ bigThree.FlushUI();
3033
+
3034
+ cameraView.requestFocusInWindow();
3035
+
3036
+// refreshContents(true);
3037
+//
3038
+// try
3039
+// {
3040
+// java.awt.Robot bot = new java.awt.Robot();
3041
+// int mask = InputEvent.BUTTON1_MASK;
3042
+// bot.mouseMove(100, 100);
3043
+// bot.mousePress(mask);
3044
+// bot.mouseRelease(mask);
3045
+// }
3046
+// catch (Exception e)
3047
+// {
3048
+//
3049
+// }
3050
+
27193051 } else
2720
- if (event.getSource() == threeButton)
3052
+ if (source == threeButton)
27213053 {
27223054 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();
3055
+
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
3058
+
3059
+// bigThree.remove(scenePanel);
3060
+// bigThree.remove(centralPanel);
3061
+// bigThree.remove(XYZPanel);
3062
+// aWindowConstraints.gridx = 0;
3063
+// aWindowConstraints.gridy = 0;
3064
+// aWindowConstraints.gridwidth = 1;
3065
+// // aConstraints.gridheight = 3;
3066
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3067
+// aWindowConstraints.weightx = 0;
3068
+// aWindowConstraints.weighty = 1;
3069
+// //bigThree.add(jtp, aWindowConstraints);
3070
+// aWindowConstraints.weightx = 1;
3071
+// aWindowConstraints.gridwidth = 3;
3072
+// // aConstraints.gridheight = 3;
3073
+// aWindowConstraints.gridx = 1;
3074
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3075
+// bigThree.add(centralPanel, aWindowConstraints);
3076
+// aWindowConstraints.weightx = 0;
3077
+// aWindowConstraints.gridx = 4;
3078
+// aWindowConstraints.gridwidth = 1;
3079
+// // aConstraints.gridheight = 3;
3080
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3081
+// bigThree.add(XYZPanel, aWindowConstraints);
3082
+// bigThree.validate();
3083
+// scenePanel.setVisible(false);
3084
+// centralPanel.setVisible(true);
3085
+// XYZPanel.setVisible(true);
3086
+ bigThree.ClearUI();
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.add(XYZPanel);
3089
+ bigThree.FlushUI();
3090
+
3091
+ cameraView.requestFocusInWindow();
27473092 } else
2748
- if (event.getSource() == fourButton)
3093
+ if (source == fourButton)
27493094 {
27503095 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();
3096
+
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
3099
+
3100
+// bigThree.remove(scenePanel);
3101
+// bigThree.remove(centralPanel);
3102
+// bigThree.remove(XYZPanel);
3103
+// aWindowConstraints.gridx = 0;
3104
+// aWindowConstraints.gridy = 0;
3105
+// aWindowConstraints.gridwidth = 1;
3106
+// // aWindowConstraints.gridheight = 3;
3107
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3108
+// aWindowConstraints.weightx = 1;
3109
+// aWindowConstraints.weighty = 1;
3110
+// bigThree.add(scenePanel, aWindowConstraints);
3111
+// aWindowConstraints.weightx = 1;
3112
+// aWindowConstraints.gridwidth = 3;
3113
+// // aConstraints.gridheight = 3;
3114
+// aWindowConstraints.gridx = 1;
3115
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3116
+// //bigThree.add(cameraPanel, aWindowConstraints);
3117
+// aWindowConstraints.weightx = 0;
3118
+// aWindowConstraints.gridx = 4;
3119
+// aWindowConstraints.gridwidth = 1;
3120
+// // aWindowConstraints.gridheight = 3;
3121
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3122
+// //bigThree.add(XYZPanel, aWindowConstraints);
3123
+// bigThree.validate();
3124
+// scenePanel.setVisible(true);
3125
+// centralPanel.setVisible(false);
3126
+// XYZPanel.setVisible(false);
3127
+ bigThree.ClearUI();
3128
+ bigThree.add(scenePanel);
3129
+ bigThree.FlushUI();
3130
+
3131
+ cameraView.requestFocusInWindow();
27753132 } else
2776
- if (event.getSource() == sixButton)
3133
+ if (source == sixButton)
27773134 {
27783135 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();
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
3139
+
3140
+// bigThree.remove(scenePanel);
3141
+// bigThree.remove(centralPanel);
3142
+// bigThree.remove(XYZPanel);
3143
+// aWindowConstraints.gridx = 0;
3144
+// aWindowConstraints.gridy = 0;
3145
+// aWindowConstraints.gridwidth = 1;
3146
+// // aConstraints.gridheight = 3;
3147
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3148
+// aWindowConstraints.weightx = 0;
3149
+// aWindowConstraints.weighty = 1;
3150
+// bigThree.add(scenePanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 1;
3152
+// aWindowConstraints.gridwidth = 3;
3153
+// // aWindowConstraints.gridheight = 3;
3154
+// aWindowConstraints.gridx = 1;
3155
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3156
+// bigThree.add(centralPanel, aWindowConstraints);
3157
+// aWindowConstraints.weightx = 0;
3158
+// aWindowConstraints.gridx = 4;
3159
+// aWindowConstraints.gridwidth = 1;
3160
+// // aWindowConstraints.gridheight = 3;
3161
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3162
+// //bigThree.add(XYZPanel, aConstraints);
3163
+// bigThree.validate();
3164
+// scenePanel.setVisible(true);
3165
+// centralPanel.setVisible(true);
3166
+// XYZPanel.setVisible(false);
3167
+ bigThree.ClearUI();
3168
+ bigThree.add(scenePanel);
3169
+ bigThree.add(centralPanel);
3170
+ bigThree.FlushUI();
3171
+
3172
+ cameraView.requestFocusInWindow();
28033173 } else
2804
- if (event.getSource() == sevenButton)
3174
+ if (source == sevenButton)
28053175 {
28063176 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();
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
3180
+
3181
+// bigThree.remove(scenePanel);
3182
+// bigThree.remove(centralPanel);
3183
+// bigThree.remove(XYZPanel);
3184
+// aWindowConstraints.gridx = 0;
3185
+// aWindowConstraints.gridy = 0;
3186
+// aWindowConstraints.gridwidth = 1;
3187
+// // aWindowConstraints.gridheight = 3;
3188
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3189
+// aWindowConstraints.weightx = 0;
3190
+// aWindowConstraints.weighty = 1;
3191
+// bigThree.add(scenePanel, aWindowConstraints);
3192
+// aWindowConstraints.weightx = 1;
3193
+// aWindowConstraints.gridwidth = 3;
3194
+// // aWindowConstraints.gridheight = 3;
3195
+// aWindowConstraints.gridx = 1;
3196
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3197
+// bigThree.add(centralPanel, aWindowConstraints);
3198
+// aWindowConstraints.weightx = 0;
3199
+// aWindowConstraints.gridx = 4;
3200
+// aWindowConstraints.gridwidth = 1;
3201
+// // aConstraints.gridheight = 3;
3202
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3203
+// bigThree.add(XYZPanel, aWindowConstraints);
3204
+// bigThree.validate();
3205
+// scenePanel.setVisible(true);
3206
+// centralPanel.setVisible(true);
3207
+// XYZPanel.setVisible(true);
3208
+ bigThree.ClearUI();
3209
+ bigThree.add(scenePanel);
3210
+ bigThree.add(centralPanel);
3211
+ bigThree.add(XYZPanel);
3212
+ bigThree.FlushUI();
3213
+
3214
+ cameraView.requestFocusInWindow();
28313215 } else
2832
- if (event.getSource() == rootButton)
3216
+ if (source == rootButton)
28333217 {
28343218 Object3D obj;
28353219 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,34 +3223,44 @@
28393223 EditObject(obj);
28403224 }
28413225
3226
+ cameraView.requestFocusInWindow();
28423227 refreshContents(true);
28433228 } else
2844
- if (event.getSource() == closeButton)
3229
+ if (source == closeButton)
28453230 {
28463231 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473232 cRadio ab;
28483233 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493234 {
28503235 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3236
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523237 {
3238
+ // Patch to avoid bug with transparency.
3239
+ if (!ab.hadMaterial)
3240
+ {
3241
+ ab.object.material = null;
3242
+ }
3243
+
28533244 buttonGroup.remove(ab);
28543245 radioPanel.remove(ab);
28553246
2856
- ab.GetObject().editWindow = null;
3247
+ //ab.GetObject().editWindow = null;
3248
+ ab.GetObject().manipWindow = null;
28573249 // ab.GetObject().objectUI = null; // ?????????
28583250
28593251 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603252 break;
28613253 }
28623254 }
3255
+
3256
+ cameraView.requestFocusInWindow();
28633257 refreshContents(true);
28643258 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3259
+ if (source == editItem || source == editButton)
28663260 {
28673261 EditSelection(false);
28683262 } else
2869
- if (event.getSource() == uneditButton)
3263
+ if (source == uneditButton)
28703264 {
28713265 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723266 {
....@@ -2876,14 +3270,14 @@
28763270 child.CloseUI();
28773271 listUI.remove(child);
28783272
2879
- child.editWindow = null; // ???????????
3273
+ //child.editWindow = null; // ???????????
28803274 }
2881
- objEditor.ctrlPanel.revalidate();
3275
+ objEditor.ctrlPanel.FlushUI();
28823276 //objEditor.jTree.clearSelection();
28833277 //objEditor.ResetSliders();
28843278 refreshContents(true);
28853279 } else
2886
- if (event.getSource() == clearPanelButton)
3280
+ if (source == clearPanelButton)
28873281 {
28883282 assert(copy == group);
28893283 //copy.ClearUI();
....@@ -2894,7 +3288,7 @@
28943288 listUI.clear();
28953289 refreshContents(true);
28963290 } else
2897
- if (event.getSource() == allParamsButton)
3291
+ if (source == allParamsButton)
28983292 {
28993293 assert(copy == group);
29003294
....@@ -2915,19 +3309,19 @@
29153309
29163310 refreshContents(true);
29173311 } else
2918
- if (event.getSource() == unselectButton)
3312
+ if (source == unselectButton)
29193313 {
29203314 objEditor.jTree.clearSelection();
29213315 // ?? oct 2012 GrafreeD.clipboard.clear();
29223316 objEditor.ResetSliders();
29233317 refreshContents(true);
29243318 } else
2925
- if(event.getSource() instanceof cRadio)
3319
+ if(source instanceof cRadio)
29263320 {
29273321 group.parent = keepparent;
29283322 group.attributes = 0;
29293323 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3324
+ /*cRadio*/ radio = (cRadio)source;
29313325 Object3D obj = radio.GetObject();
29323326 System.out.println("Edit " + obj);
29333327 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3356,11 @@
29623356 frontView.object = group;
29633357 sideView.object = group;
29643358 }
2965
- group.editWindow = this;
3359
+
3360
+// fix "+" issue
3361
+ //group.editWindow = this;
3362
+ group.manipWindow = this;
3363
+
29663364 /*
29673365 currentLayout = radio.layout;
29683366 if (currentLayout == null)
....@@ -2974,8 +3372,23 @@
29743372 //group.parent = null; // ROOT
29753373 //group.attributes = -1;
29763374 ResetModel();
3375
+
3376
+ cameraView.requestFocusInWindow();
29773377 refreshContents(true);
2978
- }
3378
+ } else if (event.getSource() == editCameraItem)
3379
+ {
3380
+ cameraView.ProtectCamera();
3381
+ cameraView.repaint();
3382
+ return;
3383
+ } else if (event.getSource() == revertCameraItem)
3384
+ {
3385
+ cameraView.RevertCamera();
3386
+ cameraView.repaint();
3387
+ return;
3388
+ // } else if (event.getSource() == textureButton)
3389
+ // {
3390
+ // return; // true;
3391
+ }
29793392 else
29803393 {
29813394 //return super.action(event, arg);
....@@ -2984,7 +3397,6 @@
29843397 }
29853398
29863399 boolean useclient = false;
2987
- cRadio radio;
29883400
29893401 void ToggleRoot()
29903402 {
....@@ -3036,6 +3448,28 @@
30363448 refreshContents();
30373449 }
30383450
3451
+ void TransformChildren()
3452
+ {
3453
+ Object3D obj;
3454
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3455
+ {
3456
+ obj = (Object3D)e.nextElement();
3457
+ obj.KeepTextureMatrices();
3458
+ obj.TransformChildren();
3459
+ obj.RestoreTextureMatrices();
3460
+
3461
+// if (obj.parent == null)
3462
+// {
3463
+// System.out.println("NULL PARENT!");
3464
+// new Exception().printStackTrace();
3465
+// }
3466
+// else
3467
+// TouchTransform(obj);
3468
+// //obj.parent.Touch();
3469
+ }
3470
+
3471
+ refreshContents();
3472
+ }
30393473
30403474 void ResetTransform()
30413475 {
....@@ -3148,7 +3582,7 @@
31483582 refreshContents();
31493583 }
31503584
3151
- void ResetCentroid()
3585
+ void ResetCentroid(boolean full)
31523586 {
31533587 Object3D obj;
31543588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3597,16 @@
31633597 LA.matIdentity(Object3D.mat);
31643598 obj.getBounds(minima, maxima, false);
31653599 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3600
+ if (full)
3601
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673602 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683603 obj.TransformMesh(Object3D.mat);
3604
+
31693605 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3606
+ if (full)
3607
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713608 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3609
+
31723610 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733611 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743612 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3635,8 @@
31973635
31983636 int size = obj.MemorySize();
31993637
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3638
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3639
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013640 }
32023641 }
32033642 catch (Exception e)
....@@ -3234,9 +3673,9 @@
32343673 obj = (Object3D)e.nextElement();
32353674
32363675 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3676
+ Grafreed.AnalyzeObject(obj);
32383677 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3678
+ Grafreed.AnalyzeObject(obj.bRep);
32403679
32413680 // System.err.println((size/1024) + " KB is the size of " + obj);
32423681 }
....@@ -3278,6 +3717,13 @@
32783717 void GenNormals(boolean crease)
32793718 {
32803719 group.GenNormalsS(crease);
3720
+
3721
+ refreshContents();
3722
+ }
3723
+
3724
+ void GenNormalsMESH()
3725
+ {
3726
+ group.GenNormalsMeshS();
32813727
32823728 refreshContents();
32833729 }
....@@ -3450,8 +3896,8 @@
34503896
34513897 void ParseVertices()
34523898 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3899
+ boolean epsequal = Grafreed.epsequal;
3900
+ Grafreed.epsequal = true;
34553901
34563902 for (int i=0; i<group.selection.size(); i++)
34573903 {
....@@ -3476,7 +3922,7 @@
34763922 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773923 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783924
3479
- g.add(GrafreeD.clipboard);
3925
+ g.add(Grafreed.clipboard);
34803926
34813927 buffer.add(g);
34823928 }
....@@ -3491,7 +3937,7 @@
34913937 makeSomething(buffer, i==group.selection.size()-1);
34923938 }
34933939
3494
- GrafreeD.epsequal = epsequal;
3940
+ Grafreed.epsequal = epsequal;
34953941
34963942 refreshContents();
34973943 }
....@@ -3509,7 +3955,16 @@
35093955 String pigment = Object3D.GetPigment(tex);
35103956 //String bump = Object3D.GetBump(tex);
35113957
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3958
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3959
+
3960
+ try
3961
+ {
3962
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3963
+ }
3964
+ catch (Exception e)
3965
+ {
3966
+ System.err.println("FAIL: " + node);
3967
+ }
35133968
35143969 double s = v.s;
35153970
....@@ -3597,11 +4052,11 @@
35974052
35984053 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35994054
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
4055
+ boolean random = CameraPane.SWITCH;
4056
+ CameraPane.SWITCH = false; // parse all random nodes
36024057 lowres.linkVerticesThis(null);
36034058 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
4059
+ CameraPane.SWITCH = random;
36054060
36064061 System.err.flush();
36074062
....@@ -3641,7 +4096,7 @@
36414096 return;
36424097
36434098 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4099
+ Object3D ref = Grafreed.clipboard.get(0);
36454100
36464101 Object3D newgroup = new Object3D("Po:" + poses.name);
36474102
....@@ -3835,9 +4290,9 @@
38354290
38364291 void ClipMesh()
38374292 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4293
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394294 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4295
+ Object3D content = Grafreed.clipboard.get(0);
38414296
38424297 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434298 content = ((cGroup)content).get(0);
....@@ -3846,7 +4301,7 @@
38464301 // {
38474302 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484303 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4304
+ group.selection.ClipMesh(Grafreed.clipboard);
38504305 }
38514306 // group.selection.ClipMesh(GrafreeD.clipboard);
38524307 System.out.println("DONE.");
....@@ -3893,6 +4348,18 @@
38934348 void MarkLeaves(boolean hide)
38944349 {
38954350 group.selection.MarkLeaves(hide);
4351
+ refreshContents();
4352
+ }
4353
+
4354
+ void RewindLeaves(boolean hide)
4355
+ {
4356
+ group.selection.RewindLeaves(hide);
4357
+ refreshContents();
4358
+ }
4359
+
4360
+ void RandomLeaves(boolean hide)
4361
+ {
4362
+ group.selection.RandomLeaves(hide);
38964363 refreshContents();
38974364 }
38984365
....@@ -3978,10 +4445,10 @@
39784445 {
39794446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39804447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3981
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824449
39834450 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4451
+ if(elem != group || !newWindow)
39854452 {
39864453 // if (!(elem instanceof Composite))
39874454 // newWindow = false;
....@@ -4071,7 +4538,6 @@
40714538 //case 702: // Event.LIST_DESELECT
40724539 group.deselectAll();
40734540 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754541 if (tps != null)
40764542 {
40774543 for (int i=0; i < tps.length; i++)
....@@ -4080,29 +4546,28 @@
40804546
40814547 //if (child.parent != null)
40824548 //child.parent.addSelectee(child);
4549
+ objEditor.SetMaterial(child);
40834550 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874551 }
40884552 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4553
+// else
4554
+// {
4555
+// objEditor.SetMaterial(group); // .GetMaterial());
4556
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4557
+// System.err.println("info : " + group.GetPath());
4558
+// }
40954559
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4560
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994561 CameraPane.flash = true;
41004562
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4563
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024564 // a camera
41034565 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4566
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4567
+ {
4568
+ CameraPane.camerachangeframe = 0; // don't refuse it
4569
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4570
+ }
41064571 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074572 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084573 }
....@@ -4115,6 +4580,26 @@
41154580
41164581 freezemodel = false;
41174582 }
4583
+
4584
+ void refreshContents(boolean cp)
4585
+ {
4586
+ if (!Globals.MOUSEDRAGGED)
4587
+ {
4588
+ objEditor.ClearInfo(); // .GetMaterial());
4589
+
4590
+ for (int i=0; i < group.selection.Size(); i++)
4591
+ {
4592
+ Object3D child = (Object3D) group.selection.get(i);
4593
+
4594
+ objEditor.AddInfo(child, this, true);
4595
+ System.err.println("info : " + child.GetPath());
4596
+ }
4597
+
4598
+ objEditor.SetText(); // jan 2014
4599
+ }
4600
+
4601
+ super.refreshContents(cp);
4602
+ }
41184603
41194604 void linkSomething(Object3D thing)
41204605 {
....@@ -4186,16 +4671,19 @@
41864671 {
41874672 if (group.selection.isEmpty())
41884673 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4674
+
4675
+ Grafreed.clipboardIsTempGroup = false;
41904676 Composite tGroup = null;
41914677 if (group.selection.size() > 0) // 1)
41924678 {
41934679 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4680
+ Grafreed.clipboardIsTempGroup = true;
41954681 }
41964682
41974683 if (cut)
41984684 {
4685
+ if (Globals.SAVEONMAKE)
4686
+ Save();
41994687 //int indices[] = jList.getSelectedIndices();
42004688 //for (int i = indices.length - 1; i >= 0; i--)
42014689 //jList.remove(indices[i]);
....@@ -4231,16 +4719,16 @@
42314719 //System.out.println("cut " + child);
42324720 //System.out.println("parent = " + child.parent);
42334721 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4722
+ if (Grafreed.clipboardIsTempGroup)
42354723 tGroup.add/*Child*/(tmp);
42364724 else
4237
- GrafreeD.clipboard = tmp;
4725
+ Grafreed.clipboard = tmp;
42384726 }
42394727 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4728
+ if (Grafreed.clipboardIsTempGroup)
42414729 tGroup.add/*Child*/(child);
42424730 else
4243
- GrafreeD.clipboard = child;
4731
+ Grafreed.clipboard = child;
42444732 }
42454733
42464734 //ResetModel();
....@@ -4272,21 +4760,23 @@
42724760 //System.out.println("cut " + elem);
42734761 //System.out.println("parent = " + elem.parent);
42744762 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4763
+ if (Grafreed.clipboardIsTempGroup)
42764764 tGroup.add/*Child*/(tmp);
42774765 else
4278
- GrafreeD.clipboard = tmp;
4766
+ Grafreed.clipboard = tmp;
42794767 }
42804768 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4769
+ if (Grafreed.clipboardIsTempGroup)
42824770 tGroup.add/*Child*/(child);
42834771 else
4284
- GrafreeD.clipboard = child;
4772
+ Grafreed.clipboard = child;
42854773 }
42864774
42874775 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4776
+
4777
+ if (Grafreed.clipboardIsTempGroup)
4778
+ Grafreed.clipboard = tGroup;
4779
+
42904780 if (cut)
42914781 {
42924782 ResetModel();
....@@ -4300,7 +4790,7 @@
43004790 // return;
43014791 boolean first = true;
43024792
4303
- if (GrafreeD.clipboardIsTempGroup)
4793
+ if (Grafreed.clipboardIsTempGroup)
43044794 {
43054795 Composite temp;
43064796
....@@ -4311,7 +4801,7 @@
43114801 temp = (Composite)Applet3D.clipboard.deepCopy();
43124802 */
43134803 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4804
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154805 {
43164806 Object3D child = (Object3D)e.nextElement();
43174807
....@@ -4345,21 +4835,21 @@
43454835 //Object3D cb = Applet3D.clipboard;
43464836 //temp.addChild(cb);
43474837 //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());
4838
+ assert(Grafreed.clipboard.parent == null);
4839
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4840
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4841
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4842
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534843 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4844
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4845
+ Grafreed.clipboard.get(0).parent = keepparent;
43564846 }
43574847
43584848 ResetModel();
43594849 refreshContents();
43604850 }
43614851
4362
- void pasteInto(boolean copyit)
4852
+ void pasteInto(boolean copyit, boolean clone)
43634853 {
43644854 // if (GrafreeD.clipboard == null)
43654855 // return;
....@@ -4388,15 +4878,22 @@
43884878 if (copyit)
43894879 {
43904880 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4881
+ if (clone)
4882
+ {
4883
+ CloneClipboard(false); // sept 2014
4884
+ }
4885
+ else
4886
+ {
4887
+ paste(false);
4888
+ }
43924889 }
43934890 else
43944891 {
43954892 boolean first = true;
43964893
4397
- if (GrafreeD.clipboardIsTempGroup)
4894
+ if (Grafreed.clipboardIsTempGroup)
43984895 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4896
+ Composite temp = (Composite)Grafreed.clipboard;
44004897 Object3D copy;
44014898 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024899 {
....@@ -4406,7 +4903,7 @@
44064903 }
44074904 } else
44084905 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4906
+ linkSomething(Grafreed.clipboard); //.get(0));
44104907 }
44114908 }
44124909 }
....@@ -4811,21 +5308,6 @@
48115308 }
48125309 */
48135310
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
-
48295311 /*
48305312 public void Callback(Object obj)
48315313 {
....@@ -4849,26 +5331,9 @@
48495331 }
48505332 */
48515333
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
-
48695334 String GetFile(String dialogName)
48705335 {
4871
- if (GrafreeD.standAlone)
5336
+ if (Grafreed.standAlone)
48725337 {
48735338 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745339 browser.show();
....@@ -4932,10 +5397,33 @@
49325397 cButton flashSelectionButton;
49335398 cButton editButton;
49345399 cButton uneditButton;
5400
+ JCheckBox allParamsButton;
49355401 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375402 cButton unselectButton;
49385403
5404
+ cButton minButton;
5405
+ cButton maxButton;
5406
+ cButton fullButton;
5407
+ cButton undoButton;
5408
+ cButton redoButton;
5409
+ cButton saveButton;
5410
+ cButton oneStepButton;
5411
+
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
5426
+
49395427 cButton screenfitButton;
49405428 cButton screenfitpointButton;
49415429 cButton snapobjectButton;
....@@ -4946,14 +5434,6 @@
49465434 cButton closeButton;
49475435
49485436 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;
49575437
49585438 //
49595439 //Composite
....@@ -4966,7 +5446,9 @@
49665446 private MenuItem lookFromItem;
49675447 private MenuItem switchItem;
49685448 private MenuItem cutItem;
4969
- private MenuItem duplicateItem;
5449
+ private MenuItem undoItem;
5450
+ private MenuItem redoItem;
5451
+ private JMenuItem duplicateItem;
49705452 private MenuItem cloneItem;
49715453 private MenuItem cloneSupportItem;
49725454 private MenuItem overwriteGeoItem;
....@@ -4979,7 +5461,7 @@
49795461 private MenuItem linkverticesItem;
49805462 private MenuItem relinkverticesItem;
49815463 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5464
+ private MenuItem resetAllItem;
49835465 private MenuItem stepAllItem;
49845466 private MenuItem revertMeshItem;
49855467 private MenuItem poseMeshItem;
....@@ -4990,6 +5472,7 @@
49905472 private MenuItem mergeGeometriesItem;
49915473 private MenuItem copyItem;
49925474 private MenuItem pasteItem;
5475
+ private MenuItem pasteIntoItem;
49935476 private MenuItem pasteLinkItem;
49945477 private MenuItem pasteCloneItem;
49955478 private MenuItem pasteExpandItem;
....@@ -5028,6 +5511,10 @@
50285511 private MenuItem showleavesItem;
50295512 private MenuItem markleavesItem;
50305513 private MenuItem unmarkleavesItem;
5514
+ private MenuItem rewindleavesItem;
5515
+ private MenuItem unrewindleavesItem;
5516
+ private MenuItem randomleavesItem;
5517
+ private MenuItem unrandomleavesItem;
50315518
50325519 private MenuItem flipVItem;
50335520 private MenuItem unflipVItem;
....@@ -5039,8 +5526,10 @@
50395526 private MenuItem panoTexturesItem;
50405527
50415528 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5529
+ private MenuItem resetCentroidXZItem;
50435530 private MenuItem resetTransformItem;
5531
+ private MenuItem transformGeometryItem;
5532
+ private MenuItem transformChildrenItem;
50445533 private MenuItem hideItem;
50455534 private MenuItem grabItem;
50465535 private MenuItem backItem;
....@@ -5087,7 +5576,7 @@
50875576 private MenuItem blobItem;
50885577 private MenuItem latheItem;
50895578 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5579
+ private MenuItem overlayItem;
50915580 private MenuItem meshItem;
50925581 // private MenuItem meshGroupItem;
50935582 private MenuItem springItem;
....@@ -5109,11 +5598,6 @@
51095598 private MenuItem doubleItem;
51105599 private MenuItem tripleItem;
51115600
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175601 private MenuItem computeAOItem;
51185602 private MenuItem recompileItem;
51195603 private MenuItem editScriptItem;
....@@ -5123,4 +5607,8 @@
51235607 private MenuItem analyzeItem;
51245608 private MenuItem dumpItem;
51255609 //boolean freezemodel = false;
5610
+
5611
+ Menu cameraMenu;
5612
+ MenuItem editCameraItem;
5613
+ MenuItem revertCameraItem;
51265614 }