Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
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,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
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"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,27 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 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(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.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());
191237
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
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
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,79 +306,103 @@
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"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
230333 backItem = menu.add(new MenuItem("Back"));
231334 backItem.addActionListener(this);
232335 frontItem = menu.add(new MenuItem("Front"));
233336 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
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);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- 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);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.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);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
368
+ }
257369
258370 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
261373 billboardItem = menu.add(new MenuItem("Billboard"));
262374 billboardItem.addActionListener(this);
263375 csgItem = menu.add(new MenuItem("CSG"));
264376 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266378 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268380 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
271386 linkerItem = menu.add(new MenuItem("Linker"));
272387 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275388 attributeItem = menu.add(new MenuItem("Attribute"));
276389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
277392 pointflowItem = menu.add(new MenuItem("Point Flow"));
278393 pointflowItem.addActionListener(this);
394
+ }
279395 menu.add("-");
280396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281397 resetTransformItem.addActionListener(this);
282398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283399 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
286406
287407 oe.menuBar.add(menu = new Menu("Geometry"));
288408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +413,11 @@
293413 genNormalsCADItem.addActionListener(this);
294414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
296418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297419 genNormalsMINEItem.addActionListener(this);
420
+ }
298421 stripifyItem = menu.add(new MenuItem("Stripify"));
299422 stripifyItem.addActionListener(this);
300423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +439,34 @@
316439 reduce34MeshItem.addActionListener(this);
317440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318441 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
323450
324451 oe.menuBar.add(menu = new Menu("Attributes"));
325452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
327458 menu.add("-");
328459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329460 liveleavesItem.addActionListener(this);
330461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
332465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333466 supportleavesItem.addActionListener(this);
334467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335468 unsupportleavesItem.addActionListener(this);
469
+ }
336470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337471 hideleavesItem.addActionListener(this);
338472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +475,14 @@
341475 markleavesItem.addActionListener(this);
342476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
344486 menu.add("-");
345487 flipVItem = menu.add(new MenuItem("Flip V"));
346488 flipVItem.addActionListener(this);
....@@ -376,35 +518,40 @@
376518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377519 sortbynameItem.addActionListener(this);
378520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
379528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380529 extractGeometriesItem.addActionListener(this);
381530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382531 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);
532
+ }
387533
388534 oe.menuBar.add(menu = new Menu("Insert"));
389535 buildCreateMenu(menu);
390536
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
-
402537 oe.menuBar.add(menu = new Menu("Tools"));
403538 buildToolsMenu(menu);
404539 }
405540
406541 void SetupUI2(ObjEditor oe)
407542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
408555 //new Exception().printStackTrace();
409556
410557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +580,199 @@
433580 oe.radioPanel.add(dummyButton);
434581 oe.buttonGroup.add(dummyButton);
435582 */
436
- aConstraints.gridy += 1;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
437586
438587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439588
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
442592
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618
+ liveCB.setToolTipText("Enable animation");
445619 liveCB.addItemListener(this);
446620
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ oneStepButton.setToolTipText("Animate one step forward");
623
+ oneStepButton.addActionListener(this);
624
+
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
627
+ fastCB.addItemListener(this);
628
+
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454632 screenfitButton.setToolTipText("Screen fit");
455633 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
638
+
457639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458640 // 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;
464641
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");
472
- flashSelectionButton.addActionListener(this);
642
+ if (Globals.ADVANCED)
643
+ {
644
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ snapobjectButton.addActionListener(this);
646
+ snapobjectButton.setToolTipText("Snap Object");
647
+ }
648
+
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473650
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
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);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482652 twoButton.setToolTipText("Show center view only");
483653 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485657 fourButton.addActionListener(this);
486658 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488660 sixButton.setToolTipText("2-column layout left");
489661 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491663 threeButton.setToolTipText("2-column layout right");
492664 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494666 sevenButton.setToolTipText("3-column layout");
495667 sevenButton.addActionListener(this);
496668 //
497669
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ rootButton.setToolTipText("Edit selection in new tab");
500672 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
673
+
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503675 closeButton.setToolTipText("Close tab");
504676 closeButton.addActionListener(this);
505677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506678 //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;
515679
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
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.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ editButton.setToolTipText("Edit selection");
749
+ editButton.addActionListener(this);
750
+
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ uneditButton.setToolTipText("Unedit selection");
517753 uneditButton.addActionListener(this);
518754
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);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
+ allParamsButton.setToolTipText("Edit all params");
531757 allParamsButton.addActionListener(this);
532758
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);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ clearPanelButton.setToolTipText("Clear edit panel");
761
+ clearPanelButton.addActionListener(this);
762
+
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ unselectButton.setToolTipText("Unselect");
538765 unselectButton.addActionListener(this);
539766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
775
+
540776 // oe.aConstraints.gridx += 1;
541777 // oe.aConstraints.weighty = 0;
542778 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +784,22 @@
548784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549785 // gcButton.addActionListener(this);
550786
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;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
562790 //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);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564792 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
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);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584793
794
+ oe.treePanel.add(jSPPanel);
795
+ oe.treePanel.Return();
796
+
797
+ oe.treePanel.add(copyOptionsPanel);
798
+ oe.treePanel.Return();
799
+
800
+// mainPanel.setDividerLocation(0.5); //1.0);
801
+// mainPanel.setResizeWeight(0.5);
802
+
585803 //jList.addListSelectionListener(this);
586804 oe.jTree.addTreeSelectionListener(this);
587805 //jTree.setRootVisible(false);
....@@ -604,83 +822,139 @@
604822 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605823 }
606824
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
825
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608826 {
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);
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
618830
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
622834
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);
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
841
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639842 boxCB.setToolTipText("Display bounding boxes");
640843 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
844
+
845
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643846 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644847 zoomBoxCB.addItemListener(this);
645848
849
+ if (true) // Globals.ADVANCED)
850
+ {
851
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
+ supportCB.setToolTipText("Enable rigging");
853
+ supportCB.addItemListener(this);
854
+
855
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856
+ // localCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
861
+ crowdCB.setToolTipText("Used for crowds");
862
+ crowdCB.addItemListener(this);
863
+
864
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
865
+ smoothCB.setToolTipText("Snapping delay");
866
+ smoothCB.addItemListener(this);
867
+
868
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
+ slowCB.setToolTipText("Smooth interpolation");
870
+ slowCB.addItemListener(this);
871
+
646872 // constraints.gridy += 1;
647873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648874 // speakerMocapCB.addItemListener(this);
649875
876
+ panel.Return();
877
+
650878 if (false)
651879 {
652880 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
881
+ //constraints.gridy += 1;
882
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655883 speakerCameraCB.addItemListener(this);
656884
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
885
+ //constraints.gridy += 1;
886
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659887 speakerFocusCB.addItemListener(this);
660888
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
889
+ //constraints.gridy += 1;
890
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
664893 }
665894
666895 //constraints.gridx += 1;
667896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668897 // debugCB.addItemListener(this);
669898
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
903
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
672905 oeilCB.addItemListener(this);
673906
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
927
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676928 lookAtCB.setToolTipText("Look-at target");
677929 lookAtCB.addItemListener(this);
930
+ }
931
+
932
+ }
933
+
934
+ cGridBag fill = new cGridBag();
935
+ fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
940
+
941
+ panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
678944
679945 }
680946
681947 void EditObject(Object3D obj)
682948 {
683949 cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
684958 radioButton.SetObject(obj);
685959 radioButton.layout = sevenButton;
686960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +963,11 @@
689963 buttonGroup.add(radioButton);
690964 radioButton.doClick();
691965 }
966
+
692967 void SetupViews(ObjEditor oe)
693968 {
969
+ theFrame = this;
970
+
694971 oe.SetupViews();
695972
696973 System.out.println("SetupViews");
....@@ -699,23 +976,27 @@
699976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
700977 }
701978
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;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
713991 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
7191000
7201001 // static int COLOR = 1;
7211002 // static int MATERIAL = 2;
....@@ -723,9 +1004,9 @@
7231004
7241005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251006
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
7291010
7301011 public void itemStateChanged(ItemEvent e)
7311012 {
....@@ -753,6 +1034,7 @@
7531034 } else if(e.getSource() == liveCB)
7541035 {
7551036 cameraView.ToggleLive();
1037
+ refreshContents(false);
7561038 }
7571039 else if(e.getSource() == supportCB)
7581040 {
....@@ -817,6 +1099,14 @@
8171099 {
8181100 cameraView.ToggleOeil();
8191101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
8201110 else if(e.getSource() == lookAtCB)
8211111 {
8221112 cameraView.ToggleLookAt();
....@@ -833,7 +1123,8 @@
8331123
8341124 /**/
8351125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
8371128 if ((path == null) || (path.getPathCount() <= 1)) {
8381129 // We can't move the root node or an empty selection
8391130 return;
....@@ -905,7 +1196,9 @@
9051196 // objEditor.DropFile((java.io.File[]) object, true);
9061197 // return;
9071198 // }
908
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091202 {
9101203 // file(s)
9111204 String[] names = string.split("\n");
....@@ -932,7 +1225,7 @@
9321225
9331226 flashIt = false;
9341227 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371230
9381231 if (group.selection.size() == 1)
....@@ -948,23 +1241,33 @@
9481241
9491242 assert target == objEditor.jTree;
9501243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
9511245 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531247 } catch (Exception e) {
9541248 System.out.println("destinationPath : " + destinationPath);
9551249 return;
9561250 }
9571251
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
9591253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
9601263 loadClipboard(true);
9611264 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9681271 }
9691272 public void dropActionChanged(DropTargetDragEvent dtde)
9701273 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1372,104 @@
10691372 {
10701373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711374 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
10841393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851394 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10881401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891402 ragdollItem.addActionListener(this);
10901403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911404 ragdoll2Item.addActionListener(this);
1405
+ }
10921406 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941408 meshItem.addActionListener(this);
10951409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10971413 springItem = menu.add(new MenuItem("Spring"));
10981414 springItem.addActionListener(this);
10991415 flagItem = menu.add(new MenuItem("Flag"));
11001416 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);
11051417 blobItem = menu.add(new MenuItem("Blob"));
11061418 blobItem.addActionListener(this);
11071419 latheItem = menu.add(new MenuItem("Lathe"));
11081420 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1421
+ }
1422
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1423
+ bezierItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
11111428 menu.add("-");
11121429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131430 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
11161433 doubleItem = menu.add(new MenuItem("Fork"));
11171434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
11181437 tripleItem = menu.add(new MenuItem("Trident"));
11191438 tripleItem.addActionListener(this);
1439
+ }
11201440 }
11211441
11221442 void buildToolsMenu(Menu menu)
11231443 {
11241444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251445 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
11271447
11281448 menu.add("-");
11291449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301450 parseverticesItem.addActionListener(this);
11311451 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321452 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341454 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381456 reduceMorphItem.addActionListener(this);
11391457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401458 reduce34MorphItem.addActionListener(this);
1141
-
1459
+ menu.add("-");
11421460 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431461 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
11461468 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471469 memoryItem.addActionListener(this);
11481470 menu.add(analyzeItem = new MenuItem("Analyze"));
11491471 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
11511473 dumpItem.addActionListener(this);
11521474 // menu.add(pathItem = new MenuItem("From-to path"));
11531475 // pathItem.addActionListener(this);
....@@ -1165,6 +1487,7 @@
11651487 menu.add("-");
11661488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671489 editScriptItem.addActionListener(this);
1490
+ }
11681491 }
11691492
11701493 void ScreenFit()
....@@ -1287,6 +1610,7 @@
12871610 shadow.material = new cMaterial(obj.material);
12881611 shadow.material.diffuse = 0.0001f;
12891612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12901614
12911615 makeSomething(shadow);
12921616 }
....@@ -1493,9 +1817,9 @@
14931817
14941818 void Overwrite(int mask)
14951819 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971821 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
14991823
15001824 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011825 content = ((cGroup)content).get(0);
....@@ -1534,7 +1858,7 @@
15341858 {
15351859 ScreenFit();
15361860 } else
1537
- if (source == switchItem)
1861
+ if (source == switchViewItem)
15381862 {
15391863 cVector v1 = new cVector();
15401864 cVector v2 = new cVector();
....@@ -1543,11 +1867,11 @@
15431867 objEditor.cameraView.renderCamera.setAim(v2, v1);
15441868 objEditor.cameraView.repaint();
15451869 } else
1546
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
15471871 {
15481872 makeSomething(new Box());
15491873 } else
1550
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
15511875 {
15521876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15531877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1626,27 +1950,27 @@
16261950
16271951 makeSomething(obj);
16281952 } else
1629
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
16301954 {
16311955 makeSomething(new Grid());
16321956 } else
1633
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
16341958 {
16351959 makeSomething(new Sphere());
16361960 } else
1637
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
16381962 {
16391963 makeSomething(new Cone());
16401964 } else
1641
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
16421966 {
16431967 makeSomething(new Torus());
16441968 } else
1645
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
16461970 {
16471971 makeSomething(new Superellipsoid());
16481972 } else
1649
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
16501974 {
16511975 makeSomething(new Klein());
16521976 } else
....@@ -1666,7 +1990,7 @@
16661990 {
16671991 makeSomething(new BezierSurface());
16681992 } else
1669
- if (source == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
16701994 {
16711995 /*
16721996 Object3D obj = new BezierSurface(5,8);
....@@ -1714,7 +2038,7 @@
17142038 s.setup();
17152039 makeSomething(s);
17162040 } else
1717
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
17182042 {
17192043 makeSomething(new Light());
17202044 } else
....@@ -1764,7 +2088,7 @@
17642088
17652089 group(g);
17662090 } else
1767
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
17682092 {
17692093 Composite csg = new GroupLeaf();
17702094 csg.count = 5;
....@@ -1800,23 +2124,6 @@
18002124 csg.addChild(child);
18012125 child.addChild(csg);
18022126 } else
1803
-
1804
- if (source == importGFDItem)
1805
- {
1806
- ImportGFD();
1807
- } else
1808
- if (source == importVRMLX3DItem)
1809
- {
1810
- ImportVRMLX3D();
1811
- } else
1812
- if (source == import3DSItem)
1813
- {
1814
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1815
- } else
1816
- if (source == importOBJItem)
1817
- {
1818
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1819
- } else
18202127 if (source == computeAOItem)
18212128 {
18222129 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1835,7 +2142,7 @@
18352142 if (source == invariantsItem)
18362143 {
18372144 System.out.println("Invariants:");
1838
- GrafreeD.grafreeD.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
18392146 } else
18402147 if (source == memoryItem)
18412148 {
....@@ -1853,6 +2160,35 @@
18532160 if (source == dumpItem)
18542161 {
18552162 DumpObject();
2163
+ } else
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
2187
+ } else
2188
+ if (source == oneStepButton)
2189
+ {
2190
+ Globals.ONESTEP = true;
2191
+ cameraView.repaint();
18562192 } else
18572193 if (source == screenfitButton)
18582194 {
....@@ -1903,12 +2239,20 @@
19032239 {
19042240 loadClipboard(true);
19052241 } else
2242
+ if (source == undoItem)
2243
+ {
2244
+ Undo();
2245
+ } else
2246
+ if (source == redoItem)
2247
+ {
2248
+ Redo();
2249
+ } else
19062250 if (source == duplicateItem)
19072251 {
1908
- Object3D keep = GrafreeD.clipboard;
2252
+ Object3D keep = Grafreed.clipboard;
19092253 loadClipboard(false);
19102254 paste(false);
1911
- GrafreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
19122256 } else
19132257 if (source == cloneItem)
19142258 {
....@@ -1926,13 +2270,17 @@
19262270 {
19272271 paste(false);
19282272 } else
2273
+ if (source == pasteIntoItem)
2274
+ {
2275
+ pasteInto(true, false);
2276
+ } else
19292277 if (source == pasteLinkItem)
19302278 {
1931
- pasteInto(false);
2279
+ pasteInto(false, false);
19322280 } else
19332281 if (source == pasteCloneItem)
19342282 {
1935
- pasteInto(true);
2283
+ pasteInto(true, true);
19362284 } else
19372285 if (source == pasteExpandItem)
19382286 {
....@@ -2124,9 +2472,9 @@
21242472 // group.selection.get(0).setMasterThis(content); // should be identity
21252473 // refreshContents();
21262474 // }
2127
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21282476 {
2129
- Object3D content = GrafreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
21302478
21312479 if (content instanceof cGroup && ((cGroup)content).transientlink )
21322480 content = ((cGroup)content).get(0);
....@@ -2134,11 +2482,11 @@
21342482 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352483 for (int i=0; i<group.selection.size(); i++)
21362484 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
21392487 group.selection.get(i).linkVerticesThis(content);
21402488 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
21422490 }
21432491 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442492 refreshContents();
....@@ -2148,20 +2496,20 @@
21482496 {
21492497 for (int i=0; i<group.selection.size(); i++)
21502498 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21532501 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
21552503 }
21562504
21572505 refreshContents();
21582506 } else
21592507 if (source == relinkverticesItem)
21602508 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
21632511 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2512
+ CameraPane.SWITCH = random;
21652513
21662514 refreshContents();
21672515 } else
....@@ -2176,9 +2524,9 @@
21762524 } else
21772525 if (source == setMasterItem)
21782526 {
2179
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21802528 {
2181
- Object3D content = GrafreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
21822530
21832531 if (content instanceof cGroup && ((cGroup)content).transientlink )
21842532 content = ((cGroup)content).get(0);
....@@ -2191,9 +2539,9 @@
21912539 {
21922540 if (group.selection.size() == 1)
21932541 {
2194
- if (GrafreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
21952543 {
2196
- Object3D content = GrafreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
21972545
21982546 if (content instanceof cGroup && ((cGroup)content).transientlink )
21992547 content = ((cGroup)content).get(0);
....@@ -2210,7 +2558,7 @@
22102558 {
22112559 RevertMeshes();
22122560 } else
2213
- if (source == resetMeshItem)
2561
+ if (source == resetAllItem)
22142562 {
22152563 ResetAll();
22162564 } else
....@@ -2230,9 +2578,9 @@
22302578 {
22312579 ClearSelection(true);
22322580 } else
2233
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
22342582 {
2235
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
22362584 } else
22372585 if (source == hideItem)
22382586 {
....@@ -2250,16 +2598,16 @@
22502598 {
22512599 makeSomething(new Camera());
22522600 } else
2253
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
22542602 {
22552603 group(new Composite());
22562604 } else
2257
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
22582606 {
22592607 RandomNode random = new RandomNode();
22602608 group(random);
22612609 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
22632611 } else
22642612 if (source == physicsItem)
22652613 {
....@@ -2356,7 +2704,7 @@
23562704 {
23572705 group(new cLinker());
23582706 } else
2359
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
23602708 {
23612709 group(new TextureNode());
23622710 } else
....@@ -2376,7 +2724,7 @@
23762724 {
23772725 CastShadow(2);
23782726 } else
2379
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
23802728 {
23812729 //ungroup();
23822730 for (int i=0; i<group.selection.size(); i++)
....@@ -2398,7 +2746,7 @@
23982746 } else
23992747 if (source == genNormalsMESHItem)
24002748 {
2401
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
24022750 } else
24032751 if (source == genNormalsORGANItem)
24042752 {
....@@ -2463,6 +2811,22 @@
24632811 if (source == unmarkleavesItem)
24642812 {
24652813 MarkLeaves(false);
2814
+ } else
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
24662830 } else
24672831 if (source == flipVItem)
24682832 {
....@@ -2548,9 +2912,13 @@
25482912 {
25492913 SmoothMesh();
25502914 } else
2551
- if (source == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
25522916 {
25532917 TransformGeometry();
2918
+ } else
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
25542922 } else
25552923 if (source == resetTransformItem)
25562924 {
....@@ -2558,7 +2926,11 @@
25582926 } else
25592927 if (source == resetCentroidItem)
25602928 {
2561
- ResetCentroid();
2929
+ ResetCentroid(true);
2930
+ } else
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
25622934 } else
25632935 if (source == resetParentItem)
25642936 {
....@@ -2690,6 +3062,10 @@
26903062 if (source == twoButton)
26913063 {
26923064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
26933069 // bug
26943070 //gridPanel.setDividerLocation(1.0);
26953071 //bigPanel.setDividerLocation(0.0);
....@@ -2720,12 +3096,33 @@
27203096 // centralPanel.setVisible(true);
27213097 // XYZPanel.setVisible(false);
27223098 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
3099
+ bigThree.add(centralPanel);
27243100 bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
27253119 } else
27263120 if (source == threeButton)
27273121 {
27283122 radio.layout = threeButton;
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
27293126
27303127 // bigThree.remove(scenePanel);
27313128 // bigThree.remove(centralPanel);
....@@ -2755,13 +3152,18 @@
27553152 // centralPanel.setVisible(true);
27563153 // XYZPanel.setVisible(true);
27573154 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
3155
+ bigThree.add(centralPanel);
3156
+ bigThree.add(XYZPanel);
27603157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
27613160 } else
27623161 if (source == fourButton)
27633162 {
27643163 radio.layout = fourButton;
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
27653167
27663168 // bigThree.remove(scenePanel);
27673169 // bigThree.remove(centralPanel);
....@@ -2791,12 +3193,17 @@
27913193 // centralPanel.setVisible(false);
27923194 // XYZPanel.setVisible(false);
27933195 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
3196
+ bigThree.add(scenePanel);
27953197 bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
27963200 } else
27973201 if (source == sixButton)
27983202 {
27993203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
28003207
28013208 // bigThree.remove(scenePanel);
28023209 // bigThree.remove(centralPanel);
....@@ -2826,13 +3233,18 @@
28263233 // centralPanel.setVisible(true);
28273234 // XYZPanel.setVisible(false);
28283235 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
3236
+ bigThree.add(scenePanel);
3237
+ bigThree.add(centralPanel);
28313238 bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
28323241 } else
28333242 if (source == sevenButton)
28343243 {
28353244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
28363248
28373249 // bigThree.remove(scenePanel);
28383250 // bigThree.remove(centralPanel);
....@@ -2862,10 +3274,12 @@
28623274 // centralPanel.setVisible(true);
28633275 // XYZPanel.setVisible(true);
28643276 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
3277
+ bigThree.add(scenePanel);
3278
+ bigThree.add(centralPanel);
3279
+ bigThree.add(XYZPanel);
28683280 bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
28693283 } else
28703284 if (source == rootButton)
28713285 {
....@@ -2877,6 +3291,7 @@
28773291 EditObject(obj);
28783292 }
28793293
3294
+ cameraView.requestFocusInWindow();
28803295 refreshContents(true);
28813296 } else
28823297 if (source == closeButton)
....@@ -2886,18 +3301,27 @@
28863301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28873302 {
28883303 ab = (cRadio)e.nextElement();
2889
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28903305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
28913312 buttonGroup.remove(ab);
28923313 radioPanel.remove(ab);
28933314
2894
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
28953317 // ab.GetObject().objectUI = null; // ?????????
28963318
28973319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28983320 break;
28993321 }
29003322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
29013325 refreshContents(true);
29023326 } else
29033327 if (source == editItem || source == editButton)
....@@ -2914,9 +3338,9 @@
29143338 child.CloseUI();
29153339 listUI.remove(child);
29163340
2917
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
29183342 }
2919
- objEditor.ctrlPanel.revalidate();
3343
+ objEditor.ctrlPanel.FlushUI();
29203344 //objEditor.jTree.clearSelection();
29213345 //objEditor.ResetSliders();
29223346 refreshContents(true);
....@@ -3000,7 +3424,11 @@
30003424 frontView.object = group;
30013425 sideView.object = group;
30023426 }
3003
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
30043432 /*
30053433 currentLayout = radio.layout;
30063434 if (currentLayout == null)
....@@ -3012,8 +3440,23 @@
30123440 //group.parent = null; // ROOT
30133441 //group.attributes = -1;
30143442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
30153445 refreshContents(true);
3016
- }
3446
+ } else if (event.getSource() == editCameraItem)
3447
+ {
3448
+ cameraView.ProtectCamera();
3449
+ cameraView.repaint();
3450
+ return;
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3452
+ {
3453
+ cameraView.RevertCamera();
3454
+ cameraView.repaint();
3455
+ return;
3456
+ // } else if (event.getSource() == textureButton)
3457
+ // {
3458
+ // return; // true;
3459
+ }
30173460 else
30183461 {
30193462 //return super.action(event, arg);
....@@ -3022,7 +3465,6 @@
30223465 }
30233466
30243467 boolean useclient = false;
3025
- cRadio radio;
30263468
30273469 void ToggleRoot()
30283470 {
....@@ -3074,6 +3516,28 @@
30743516 refreshContents();
30753517 }
30763518
3519
+ void TransformChildren()
3520
+ {
3521
+ Object3D obj;
3522
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3523
+ {
3524
+ obj = (Object3D)e.nextElement();
3525
+ obj.KeepTextureMatrices();
3526
+ obj.TransformChildren();
3527
+ obj.RestoreTextureMatrices();
3528
+
3529
+// if (obj.parent == null)
3530
+// {
3531
+// System.out.println("NULL PARENT!");
3532
+// new Exception().printStackTrace();
3533
+// }
3534
+// else
3535
+// TouchTransform(obj);
3536
+// //obj.parent.Touch();
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
30773541
30783542 void ResetTransform()
30793543 {
....@@ -3186,7 +3650,7 @@
31863650 refreshContents();
31873651 }
31883652
3189
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
31903654 {
31913655 Object3D obj;
31923656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3201,12 +3665,16 @@
32013665 LA.matIdentity(Object3D.mat);
32023666 obj.getBounds(minima, maxima, false);
32033667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3204
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32053670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32063671 obj.TransformMesh(Object3D.mat);
3672
+
32073673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3208
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32093676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
32103678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32113679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32123680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3235,7 +3703,8 @@
32353703
32363704 int size = obj.MemorySize();
32373705
3238
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32393708 }
32403709 }
32413710 catch (Exception e)
....@@ -3272,9 +3741,9 @@
32723741 obj = (Object3D)e.nextElement();
32733742
32743743 System.out.println("Object is: " + obj);
3275
- GrafreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
32763745 System.out.println("Boundary rep: " + obj.bRep);
3277
- GrafreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
32783747
32793748 // System.err.println((size/1024) + " KB is the size of " + obj);
32803749 }
....@@ -3316,6 +3785,13 @@
33163785 void GenNormals(boolean crease)
33173786 {
33183787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
33193795
33203796 refreshContents();
33213797 }
....@@ -3488,8 +3964,8 @@
34883964
34893965 void ParseVertices()
34903966 {
3491
- boolean epsequal = GrafreeD.epsequal;
3492
- GrafreeD.epsequal = true;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
34933969
34943970 for (int i=0; i<group.selection.size(); i++)
34953971 {
....@@ -3514,7 +3990,7 @@
35143990 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35153991 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35163992
3517
- g.add(GrafreeD.clipboard);
3993
+ g.add(Grafreed.clipboard);
35183994
35193995 buffer.add(g);
35203996 }
....@@ -3529,7 +4005,7 @@
35294005 makeSomething(buffer, i==group.selection.size()-1);
35304006 }
35314007
3532
- GrafreeD.epsequal = epsequal;
4008
+ Grafreed.epsequal = epsequal;
35334009
35344010 refreshContents();
35354011 }
....@@ -3547,7 +4023,16 @@
35474023 String pigment = Object3D.GetPigment(tex);
35484024 //String bump = Object3D.GetBump(tex);
35494025
3550
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4026
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4027
+
4028
+ try
4029
+ {
4030
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4031
+ }
4032
+ catch (Exception e)
4033
+ {
4034
+ System.err.println("FAIL: " + node);
4035
+ }
35514036
35524037 double s = v.s;
35534038
....@@ -3635,11 +4120,11 @@
36354120
36364121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36374122
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
36404125 lowres.linkVerticesThis(null);
36414126 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
36434128
36444129 System.err.flush();
36454130
....@@ -3679,7 +4164,7 @@
36794164 return;
36804165
36814166 Object3D poses = group.selection.get(0);
3682
- Object3D ref = GrafreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
36834168
36844169 Object3D newgroup = new Object3D("Po:" + poses.name);
36854170
....@@ -3873,9 +4358,9 @@
38734358
38744359 void ClipMesh()
38754360 {
3876
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38774362 {
3878
- Object3D content = GrafreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
38794364
38804365 if (content instanceof cGroup && ((cGroup)content).transientlink )
38814366 content = ((cGroup)content).get(0);
....@@ -3884,7 +4369,7 @@
38844369 // {
38854370 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38864371 // }
3887
- group.selection.ClipMesh(GrafreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
38884373 }
38894374 // group.selection.ClipMesh(GrafreeD.clipboard);
38904375 System.out.println("DONE.");
....@@ -3931,6 +4416,18 @@
39314416 void MarkLeaves(boolean hide)
39324417 {
39334418 group.selection.MarkLeaves(hide);
4419
+ refreshContents();
4420
+ }
4421
+
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
39344431 refreshContents();
39354432 }
39364433
....@@ -4016,10 +4513,10 @@
40164513 {
40174514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40184515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4019
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40204517
40214518 Object3D elem = (Object3D)group.selection.elementAt(i);
4022
- if(elem != group)
4519
+ if(elem != group || !newWindow)
40234520 {
40244521 // if (!(elem instanceof Composite))
40254522 // newWindow = false;
....@@ -4109,7 +4606,6 @@
41094606 //case 702: // Event.LIST_DESELECT
41104607 group.deselectAll();
41114608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4112
- objEditor.ClearInfo(); // .GetMaterial());
41134609 if (tps != null)
41144610 {
41154611 for (int i=0; i < tps.length; i++)
....@@ -4118,29 +4614,28 @@
41184614
41194615 //if (child.parent != null)
41204616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
41214618 group.addSelectee(child);
4122
- objEditor.SetMaterial(child); // .GetMaterial());
4123
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4124
- System.err.println("info : " + child.GetPath());
41254619 }
41264620 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
41334627
4134
- objEditor.SetText(); // jan 2014
4135
-
4136
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41374629 CameraPane.flash = true;
41384630
4139
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41404632 // a camera
41414633 {
4142
- CameraPane.camerachangeframe = 0; // don't refuse it
4143
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4635
+ {
4636
+ CameraPane.camerachangeframe = 0; // don't refuse it
4637
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4638
+ }
41444639 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41454640 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41464641 }
....@@ -4153,6 +4648,27 @@
41534648
41544649 freezemodel = false;
41554650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
41564672
41574673 void linkSomething(Object3D thing)
41584674 {
....@@ -4224,16 +4740,19 @@
42244740 {
42254741 if (group.selection.isEmpty())
42264742 return;
4227
- GrafreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
42284745 Composite tGroup = null;
42294746 if (group.selection.size() > 0) // 1)
42304747 {
42314748 tGroup = new cGroup();
4232
- GrafreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
42334750 }
42344751
42354752 if (cut)
42364753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
42374756 //int indices[] = jList.getSelectedIndices();
42384757 //for (int i = indices.length - 1; i >= 0; i--)
42394758 //jList.remove(indices[i]);
....@@ -4269,16 +4788,16 @@
42694788 //System.out.println("cut " + child);
42704789 //System.out.println("parent = " + child.parent);
42714790 // tmp.addChild(child);
4272
- if (GrafreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
42734792 tGroup.add/*Child*/(tmp);
42744793 else
4275
- GrafreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
42764795 }
42774796 else
4278
- if (GrafreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
42794798 tGroup.add/*Child*/(child);
42804799 else
4281
- GrafreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
42824801 }
42834802
42844803 //ResetModel();
....@@ -4310,21 +4829,23 @@
43104829 //System.out.println("cut " + elem);
43114830 //System.out.println("parent = " + elem.parent);
43124831 // tmp.addChild(elem);
4313
- if (GrafreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
43144833 tGroup.add/*Child*/(tmp);
43154834 else
4316
- GrafreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
43174836 }
43184837 else
4319
- if (GrafreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
43204839 tGroup.add/*Child*/(child);
43214840 else
4322
- GrafreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
43234842 }
43244843
43254844 }
4326
- if (GrafreeD.clipboardIsTempGroup)
4327
- GrafreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
43284849 if (cut)
43294850 {
43304851 ResetModel();
....@@ -4338,7 +4859,7 @@
43384859 // return;
43394860 boolean first = true;
43404861
4341
- if (GrafreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
43424863 {
43434864 Composite temp;
43444865
....@@ -4349,7 +4870,7 @@
43494870 temp = (Composite)Applet3D.clipboard.deepCopy();
43504871 */
43514872 Object3D elem;
4352
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4873
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43534874 {
43544875 Object3D child = (Object3D)e.nextElement();
43554876
....@@ -4383,21 +4904,21 @@
43834904 //Object3D cb = Applet3D.clipboard;
43844905 //temp.addChild(cb);
43854906 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4386
- assert(GrafreeD.clipboard.parent == null);
4387
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4388
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4389
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4390
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4907
+ assert(Grafreed.clipboard.parent == null);
4908
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4909
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4910
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4911
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43914912 else
4392
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4393
- GrafreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
43944915 }
43954916
43964917 ResetModel();
43974918 refreshContents();
43984919 }
43994920
4400
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
44014922 {
44024923 // if (GrafreeD.clipboard == null)
44034924 // return;
....@@ -4426,15 +4947,22 @@
44264947 if (copyit)
44274948 {
44284949 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
44304958 }
44314959 else
44324960 {
44334961 boolean first = true;
44344962
4435
- if (GrafreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
44364964 {
4437
- Composite temp = (Composite)GrafreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
44384966 Object3D copy;
44394967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44404968 {
....@@ -4444,7 +4972,7 @@
44444972 }
44454973 } else
44464974 {
4447
- linkSomething(GrafreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
44484976 }
44494977 }
44504978 }
....@@ -4849,21 +5377,6 @@
48495377 }
48505378 */
48515379
4852
- void ImportGFD()
4853
- {
4854
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4855
- browser.show();
4856
- String filename = browser.getFile();
4857
- if (filename != null && filename.length() > 0)
4858
- {
4859
- String fullname = browser.getDirectory() + filename;
4860
-
4861
- //Object3D readobj =
4862
- objEditor.ReadGFD(fullname, objEditor);
4863
- //makeSomething(readobj);
4864
- }
4865
- }
4866
-
48675380 /*
48685381 public void Callback(Object obj)
48695382 {
....@@ -4887,26 +5400,9 @@
48875400 }
48885401 */
48895402
4890
- void ImportVRMLX3D()
4891
- {
4892
- if (GrafreeD.standAlone)
4893
- {
4894
- /**/
4895
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4896
- browser.show();
4897
- String filename = browser.getFile();
4898
- if (filename != null && filename.length() > 0)
4899
- {
4900
- String fullname = browser.getDirectory() + filename;
4901
- LoadVRMLX3D(fullname);
4902
- }
4903
- /**/
4904
- }
4905
- }
4906
-
49075403 String GetFile(String dialogName)
49085404 {
4909
- if (GrafreeD.standAlone)
5405
+ if (Grafreed.standAlone)
49105406 {
49115407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49125408 browser.show();
....@@ -4970,10 +5466,38 @@
49705466 cButton flashSelectionButton;
49715467 cButton editButton;
49725468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
49735470 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755471 cButton unselectButton;
49765472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
5481
+ cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
5500
+
49775501 cButton screenfitButton;
49785502 cButton screenfitpointButton;
49795503 cButton snapobjectButton;
....@@ -4985,14 +5509,6 @@
49855509
49865510 cButton setsupportButton;
49875511
4988
- cButton twoButton;
4989
- cButton sixButton;
4990
- cButton threeButton;
4991
- cButton sevenButton;
4992
- cButton fourButton; // full panel
4993
- cButton oneButton; // full XYZ
4994
- //cButton currentLayout;
4995
-
49965512 //
49975513 //Composite
49985514 Object3D // to do !!
....@@ -5002,9 +5518,11 @@
50025518 //JTree jTree;
50035519 private MenuItem lookAtItem;
50045520 private MenuItem lookFromItem;
5005
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
50065522 private MenuItem cutItem;
5007
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
50085526 private MenuItem cloneItem;
50095527 private MenuItem cloneSupportItem;
50105528 private MenuItem overwriteGeoItem;
....@@ -5017,7 +5535,7 @@
50175535 private MenuItem linkverticesItem;
50185536 private MenuItem relinkverticesItem;
50195537 private MenuItem setMasterItem;
5020
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
50215539 private MenuItem stepAllItem;
50225540 private MenuItem revertMeshItem;
50235541 private MenuItem poseMeshItem;
....@@ -5028,6 +5546,7 @@
50285546 private MenuItem mergeGeometriesItem;
50295547 private MenuItem copyItem;
50305548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
50315550 private MenuItem pasteLinkItem;
50325551 private MenuItem pasteCloneItem;
50335552 private MenuItem pasteExpandItem;
....@@ -5066,6 +5585,10 @@
50665585 private MenuItem showleavesItem;
50675586 private MenuItem markleavesItem;
50685587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
50695592
50705593 private MenuItem flipVItem;
50715594 private MenuItem unflipVItem;
....@@ -5077,15 +5600,17 @@
50775600 private MenuItem panoTexturesItem;
50785601
50795602 private MenuItem resetCentroidItem;
5080
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
50815604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
50825607 private MenuItem hideItem;
50835608 private MenuItem grabItem;
50845609 private MenuItem backItem;
50855610 private MenuItem frontItem;
50865611 private MenuItem cameraItem;
50875612 private MenuItem compositeItem;
5088
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
50895614 private MenuItem physicsItem;
50905615 private MenuItem frameselectorItem;
50915616 private MenuItem scriptNodeItem;
....@@ -5125,7 +5650,7 @@
51255650 private MenuItem blobItem;
51265651 private MenuItem latheItem;
51275652 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
51295654 private MenuItem meshItem;
51305655 // private MenuItem meshGroupItem;
51315656 private MenuItem springItem;
....@@ -5147,11 +5672,6 @@
51475672 private MenuItem doubleItem;
51485673 private MenuItem tripleItem;
51495674
5150
- private MenuItem importGFDItem;
5151
- private MenuItem importVRMLX3DItem;
5152
- private MenuItem import3DSItem;
5153
- private MenuItem importOBJItem;
5154
-
51555675 private MenuItem computeAOItem;
51565676 private MenuItem recompileItem;
51575677 private MenuItem editScriptItem;
....@@ -5161,4 +5681,8 @@
51615681 private MenuItem analyzeItem;
51625682 private MenuItem dumpItem;
51635683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
51645688 }