Normand Briere
2019-05-02 a7277e6c6381e55761f7fa87276260fac1c94d5e
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,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,31 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
222246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
224251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225252 setMasterItem.addActionListener(this);
253
+ }
226254
227255 oe.menuBar.add(menu = new Menu("Group"));
228256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +261,32 @@
233261 frontItem.addActionListener(this);
234262 compositeItem = menu.add(new MenuItem("Composite"));
235263 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237265 hideItem.addActionListener(this);
238266 ungroupItem = menu.add(new MenuItem("Ungroup"));
239267 ungroupItem.addActionListener(this);
240268 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
242270 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);
247271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248272 switchGeoItem.addActionListener(this);
249273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250274 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
252276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
253285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254286 scriptNodeItem.addActionListener(this);
255287 cameraItem = menu.add(new MenuItem("Camera"));
256288 cameraItem.addActionListener(this);
289
+ }
257290
258291 oe.menuBar.add(menu = new Menu("Object"));
259292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,14 +301,18 @@
268301 shadowYItem.addActionListener(this);
269302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
271307 linkerItem = menu.add(new MenuItem("Linker"));
272308 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275309 attributeItem = menu.add(new MenuItem("Attribute"));
276310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
277313 pointflowItem = menu.add(new MenuItem("Point Flow"));
278314 pointflowItem.addActionListener(this);
315
+ }
279316 menu.add("-");
280317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281318 resetTransformItem.addActionListener(this);
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +356,14 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +373,13 @@
329373 liveleavesItem.addActionListener(this);
330374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
332378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333379 supportleavesItem.addActionListener(this);
334380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335381 unsupportleavesItem.addActionListener(this);
382
+ }
336383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337384 hideleavesItem.addActionListener(this);
338385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +422,8 @@
375422 sortbysizeItem.addActionListener(this);
376423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
378427 menu.add("-");
379428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380429 extractGeometriesItem.addActionListener(this);
....@@ -384,11 +433,11 @@
384433 shareGeometriesItem.addActionListener(this);
385434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386435 mergeGeometriesItem.addActionListener(this);
436
+ }
387437
388438 oe.menuBar.add(menu = new Menu("Insert"));
389439 buildCreateMenu(menu);
390440
391
-
392441 oe.menuBar.add(menu = new Menu("Include"));
393442 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394443 importGFDItem.addActionListener(this);
....@@ -433,110 +482,98 @@
433482 oe.radioPanel.add(dummyButton);
434483 oe.buttonGroup.add(dummyButton);
435484 */
436
- aConstraints.gridy += 1;
437
-
438485 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439486
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444488 liveCB.setToolTipText("Enabled animation");
445489 liveCB.addItemListener(this);
446490
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
491
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ oneStepButton.setToolTipText("Animate one step forward");
493
+ oneStepButton.addActionListener(this);
494
+
495
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
496
+ fastCB.setToolTipText("Fast mode");
497
+ fastCB.addItemListener(this);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449500 trackCB.setToolTipText("Enable tracking");
450501 trackCB.addItemListener(this);
451502
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454504 screenfitButton.setToolTipText("Screen fit");
455505 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
506
+
457507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458508 // 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;
464509
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);
510
+ if (Globals.ADVANCED)
511
+ {
512
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ snapobjectButton.addActionListener(this);
514
+ snapobjectButton.setToolTipText("Snap Object");
515
+ }
516
+
517
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471518 flashSelectionButton.setToolTipText("Show selection");
472519 flashSelectionButton.addActionListener(this);
473520
474
- oe.toolbarPanel.add(new cButton(" ", false));
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475522
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);
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482524 twoButton.setToolTipText("Show center view only");
483525 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485527 fourButton.addActionListener(this);
486528 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488530 sixButton.setToolTipText("2-column layout left");
489531 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491533 threeButton.setToolTipText("2-column layout right");
492534 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494536 sevenButton.setToolTipText("3-column layout");
495537 sevenButton.addActionListener(this);
496538 //
497539
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
540
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
+ rootButton.setToolTipText("Edit selection in new tab");
500542 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503545 closeButton.setToolTipText("Close tab");
504546 closeButton.addActionListener(this);
505547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506548 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508549
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
550
+ cGridBag commandsPanel = new cGridBag();
551
+
552
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
+ editButton.setToolTipText("Edit selection");
511554 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515555
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
517558 uneditButton.addActionListener(this);
518559
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);
560
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
+ allParamsButton.setToolTipText("Edit all params");
531562 allParamsButton.addActionListener(this);
532563
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);
564
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565
+ clearPanelButton.setToolTipText("Clear edit panel");
566
+ clearPanelButton.addActionListener(this);
567
+
568
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569
+ unselectButton.setToolTipText("Unselect");
538570 unselectButton.addActionListener(this);
539571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
540577 // oe.aConstraints.gridx += 1;
541578 // oe.aConstraints.weighty = 0;
542579 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +585,37 @@
548585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549586 // gcButton.addActionListener(this);
550587
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;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
562591 //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);
592
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564593 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
569597
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);
598
+ cGridBag copyOptionsPanel = new cGridBag();
599
+
600
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
+ colorCB.setToolTipText("Copy color when dropped");
574602 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
603
+
604
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
+ materialCB.setToolTipText("Copy material when dropped");
577606 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
607
+
608
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
+ textureCB.setToolTipText("Copy texture when dropped");
580610 textureCB.addItemListener(this);
581611
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
584615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
585619 //jList.addListSelectionListener(this);
586620 oe.jTree.addTreeSelectionListener(this);
587621 //jTree.setRootVisible(false);
....@@ -604,45 +638,37 @@
604638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605639 }
606640
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608642 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639644 boxCB.setToolTipText("Display bounding boxes");
640645 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643648 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644649 zoomBoxCB.addItemListener(this);
645650
651
+ if (Globals.ADVANCED)
652
+ {
653
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
+ supportCB.setToolTipText("Enable rigging");
655
+ supportCB.addItemListener(this);
656
+
657
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658
+ // localCB.addItemListener(this);
659
+
660
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661
+ crowdCB.setToolTipText("Used for crowds");
662
+ crowdCB.addItemListener(this);
663
+
664
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
665
+ smoothCB.setToolTipText("Snapping delay");
666
+ smoothCB.addItemListener(this);
667
+
668
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
669
+ slowCB.setToolTipText("Smooth interpolation");
670
+ slowCB.addItemListener(this);
671
+
646672 // constraints.gridy += 1;
647673 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648674 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +676,16 @@
650676 if (false)
651677 {
652678 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655681 speakerCameraCB.addItemListener(this);
656682
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659685 speakerFocusCB.addItemListener(this);
660686
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663689 smoothfocusCB.addItemListener(this);
664690 }
665691
....@@ -667,14 +693,20 @@
667693 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668694 // debugCB.addItemListener(this);
669695
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672697 oeilCB.addItemListener(this);
673698
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676700 lookAtCB.setToolTipText("Look-at target");
677701 lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
678710
679711 }
680712
....@@ -959,11 +991,11 @@
959991 {
960992 loadClipboard(true);
961993 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
994
+ pasteInto(false, false);
963995 } else {
964996 loadClipboard(false);
965997 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
967999 }
9681000 }
9691001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1117,33 @@
10851117 kleinItem.addActionListener(this);
10861118 particleItem = menu.add(new MenuItem("Particle system"));
10871119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10881122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891123 ragdollItem.addActionListener(this);
10901124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911125 ragdoll2Item.addActionListener(this);
1126
+ }
10921127 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941129 meshItem.addActionListener(this);
10951130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10971134 springItem = menu.add(new MenuItem("Spring"));
10981135 springItem.addActionListener(this);
10991136 flagItem = menu.add(new MenuItem("Flag"));
11001137 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);
11051138 blobItem = menu.add(new MenuItem("Blob"));
11061139 blobItem.addActionListener(this);
11071140 latheItem = menu.add(new MenuItem("Lathe"));
11081141 latheItem.addActionListener(this);
1142
+ }
1143
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1144
+ bezierItem.addActionListener(this);
1145
+ overlayItem = menu.add(new MenuItem("Overlay"));
1146
+ overlayItem.addActionListener(this);
11091147 lightItem = menu.add(new MenuItem("Light"));
11101148 lightItem.addActionListener(this);
11111149 menu.add("-");
....@@ -1115,34 +1153,39 @@
11151153 loopItem.addActionListener(this);
11161154 doubleItem = menu.add(new MenuItem("Fork"));
11171155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
11181158 tripleItem = menu.add(new MenuItem("Trident"));
11191159 tripleItem.addActionListener(this);
1160
+ }
11201161 }
11211162
11221163 void buildToolsMenu(Menu menu)
11231164 {
11241165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251166 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
11271168
11281169 menu.add("-");
11291170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301171 parseverticesItem.addActionListener(this);
11311172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321173 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341175 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381177 reduceMorphItem.addActionListener(this);
11391178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401179 reduce34MorphItem.addActionListener(this);
1141
-
1180
+ menu.add("-");
11421181 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431182 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
11461189 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471190 memoryItem.addActionListener(this);
11481191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1208,7 @@
11651208 menu.add("-");
11661209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671210 editScriptItem.addActionListener(this);
1211
+ }
11681212 }
11691213
11701214 void ScreenFit()
....@@ -1666,7 +1710,7 @@
16661710 {
16671711 makeSomething(new BezierSurface());
16681712 } else
1669
- if (source == checkerItem)
1713
+ if (source == overlayItem)
16701714 {
16711715 /*
16721716 Object3D obj = new BezierSurface(5,8);
....@@ -1854,6 +1898,11 @@
18541898 {
18551899 DumpObject();
18561900 } else
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
18571906 if (source == screenfitButton)
18581907 {
18591908 //Reload(lastConverter, lastFilename, true);
....@@ -1926,13 +1975,17 @@
19261975 {
19271976 paste(false);
19281977 } else
1978
+ if (source == pasteIntoItem)
1979
+ {
1980
+ pasteInto(true, false);
1981
+ } else
19291982 if (source == pasteLinkItem)
19301983 {
1931
- pasteInto(false);
1984
+ pasteInto(false, false);
19321985 } else
19331986 if (source == pasteCloneItem)
19341987 {
1935
- pasteInto(true);
1988
+ pasteInto(true, true);
19361989 } else
19371990 if (source == pasteExpandItem)
19381991 {
....@@ -2134,11 +2187,11 @@
21342187 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352188 for (int i=0; i<group.selection.size(); i++)
21362189 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
21392192 group.selection.get(i).linkVerticesThis(content);
21402193 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
21422195 }
21432196 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442197 refreshContents();
....@@ -2148,20 +2201,20 @@
21482201 {
21492202 for (int i=0; i<group.selection.size(); i++)
21502203 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
21532206 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21552208 }
21562209
21572210 refreshContents();
21582211 } else
21592212 if (source == relinkverticesItem)
21602213 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
21632216 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2217
+ CameraPane.SWITCH = random;
21652218
21662219 refreshContents();
21672220 } else
....@@ -2259,7 +2312,7 @@
22592312 RandomNode random = new RandomNode();
22602313 group(random);
22612314 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
22632316 } else
22642317 if (source == physicsItem)
22652318 {
....@@ -2720,7 +2773,7 @@
27202773 // centralPanel.setVisible(true);
27212774 // XYZPanel.setVisible(false);
27222775 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
2776
+ bigThree.add(centralPanel);
27242777 bigThree.FlushUI();
27252778 } else
27262779 if (source == threeButton)
....@@ -2755,8 +2808,8 @@
27552808 // centralPanel.setVisible(true);
27562809 // XYZPanel.setVisible(true);
27572810 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
2811
+ bigThree.add(centralPanel);
2812
+ bigThree.add(XYZPanel);
27602813 bigThree.FlushUI();
27612814 } else
27622815 if (source == fourButton)
....@@ -2791,7 +2844,7 @@
27912844 // centralPanel.setVisible(false);
27922845 // XYZPanel.setVisible(false);
27932846 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
2847
+ bigThree.add(scenePanel);
27952848 bigThree.FlushUI();
27962849 } else
27972850 if (source == sixButton)
....@@ -2826,8 +2879,8 @@
28262879 // centralPanel.setVisible(true);
28272880 // XYZPanel.setVisible(false);
28282881 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
2882
+ bigThree.add(scenePanel);
2883
+ bigThree.add(centralPanel);
28312884 bigThree.FlushUI();
28322885 } else
28332886 if (source == sevenButton)
....@@ -2862,9 +2915,9 @@
28622915 // centralPanel.setVisible(true);
28632916 // XYZPanel.setVisible(true);
28642917 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
2918
+ bigThree.add(scenePanel);
2919
+ bigThree.add(centralPanel);
2920
+ bigThree.add(XYZPanel);
28682921 bigThree.FlushUI();
28692922 } else
28702923 if (source == rootButton)
....@@ -2916,7 +2969,7 @@
29162969
29172970 child.editWindow = null; // ???????????
29182971 }
2919
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
29202973 //objEditor.jTree.clearSelection();
29212974 //objEditor.ResetSliders();
29222975 refreshContents(true);
....@@ -3635,11 +3688,11 @@
36353688
36363689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36373690
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
36403693 lowres.linkVerticesThis(null);
36413694 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
36433696
36443697 System.err.flush();
36453698
....@@ -4124,12 +4177,12 @@
41244177 System.err.println("info : " + child.GetPath());
41254178 }
41264179 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
41334186
41344187 objEditor.SetText(); // jan 2014
41354188
....@@ -4397,7 +4450,7 @@
43974450 refreshContents();
43984451 }
43994452
4400
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
44014454 {
44024455 // if (GrafreeD.clipboard == null)
44034456 // return;
....@@ -4426,7 +4479,14 @@
44264479 if (copyit)
44274480 {
44284481 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
44304490 }
44314491 else
44324492 {
....@@ -4970,10 +5030,12 @@
49705030 cButton flashSelectionButton;
49715031 cButton editButton;
49725032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
49735034 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755035 cButton unselectButton;
49765036
5037
+ cButton oneStepButton;
5038
+
49775039 cButton screenfitButton;
49785040 cButton screenfitpointButton;
49795041 cButton snapobjectButton;
....@@ -5028,6 +5090,7 @@
50285090 private MenuItem mergeGeometriesItem;
50295091 private MenuItem copyItem;
50305092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
50315094 private MenuItem pasteLinkItem;
50325095 private MenuItem pasteCloneItem;
50335096 private MenuItem pasteExpandItem;
....@@ -5125,7 +5188,7 @@
51255188 private MenuItem blobItem;
51265189 private MenuItem latheItem;
51275190 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
51295192 private MenuItem meshItem;
51305193 // private MenuItem meshGroupItem;
51315194 private MenuItem springItem;