Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
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,36 +163,48 @@
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("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175174 cutItem = menu.add(new MenuItem("Cut"));
176175 cutItem.addActionListener(this);
177176 copyItem = menu.add(new MenuItem("Copy"));
178177 copyItem.addActionListener(this);
179178 pasteItem = menu.add(new MenuItem("Paste"));
180179 pasteItem.addActionListener(this);
180
+ menu.add("-");
181
+ cloneItem = menu.add(new MenuItem("Clone"));
182
+ cloneItem.addActionListener(this);
183
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
+ cloneSupportItem.addActionListener(this);
185
+ menu.add("-");
186
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
187
+ pasteIntoItem.addActionListener(this);
181188 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182189 pasteLinkItem.addActionListener(this);
183190 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184191 pasteCloneItem.addActionListener(this);
185192 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186193 // pasteExpandItem.addActionListener(this);
194
+ menu.add("-");
187195 clearItem = menu.add(new MenuItem("Clear"));
188196 clearItem.addActionListener(this);
197
+
198
+ if (Globals.ADVANCED)
199
+ {
200
+ // Deletes the cameras...
189201 clearAllItem = menu.add(new MenuItem("Clear All"));
190202 clearAllItem.addActionListener(this);
203
+ }
191204
192205 oe.menuBar.add(menu = new Menu("Setting"));
206
+ if (Globals.ADVANCED)
207
+ {
193208 resetMeshItem = menu.add(new MenuItem("Reset All"));
194209 resetMeshItem.addActionListener(this);
195210 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +214,7 @@
199214 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200215 resetreferencesItem.addActionListener(this);
201216 menu.add("-");
217
+ }
202218 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203219 overwriteGeoItem.addActionListener(this);
204220 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +226,26 @@
210226 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211227 overwriteUVItem.addActionListener(this);
212228 menu.add("-");
229
+ if (Globals.ADVANCED)
230
+ {
213231 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214232 generateMeshItem.addActionListener(this);
215233 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216234 poseMeshItem.addActionListener(this);
217235 menu.add("-");
236
+ }
218237 resetsupportItem = menu.add(new MenuItem("Reset support"));
219238 resetsupportItem.addActionListener(this);
220239 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221240 linkverticesItem.addActionListener(this);
222241 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223242 relinkverticesItem.addActionListener(this);
243
+
244
+ if (Globals.ADVANCED)
245
+ {
224246 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225247 setMasterItem.addActionListener(this);
248
+ }
226249
227250 oe.menuBar.add(menu = new Menu("Group"));
228251 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +256,31 @@
233256 frontItem.addActionListener(this);
234257 compositeItem = menu.add(new MenuItem("Composite"));
235258 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
259
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237260 hideItem.addActionListener(this);
238261 ungroupItem = menu.add(new MenuItem("Ungroup"));
239262 ungroupItem.addActionListener(this);
240263 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
264
+ randomItem = menu.add(new MenuItem("Switch node"));
242265 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);
247266 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248267 switchGeoItem.addActionListener(this);
249268 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250269 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
270
+ morphItem = menu.add(new MenuItem("Morph Group"));
252271 morphItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ physicsItem = menu.add(new MenuItem("Physics"));
276
+ physicsItem.addActionListener(this);
277
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278
+ frameselectorItem.addActionListener(this);
253279 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254280 scriptNodeItem.addActionListener(this);
255281 cameraItem = menu.add(new MenuItem("Camera"));
256282 cameraItem.addActionListener(this);
283
+ }
257284
258285 oe.menuBar.add(menu = new Menu("Object"));
259286 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,15 +295,18 @@
268295 shadowYItem.addActionListener(this);
269296 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270297 shadowZItem.addActionListener(this);
298
+ if (Globals.ADVANCED)
299
+ {
271300 linkerItem = menu.add(new MenuItem("Linker"));
272301 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275302 attributeItem = menu.add(new MenuItem("Attribute"));
276303 attributeItem.addActionListener(this);
304
+ templateItem = menu.add(new MenuItem("Template"));
305
+ templateItem.addActionListener(this);
277306 pointflowItem = menu.add(new MenuItem("Point Flow"));
278307 pointflowItem.addActionListener(this);
279308 menu.add("-");
309
+ }
280310 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281311 resetTransformItem.addActionListener(this);
282312 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
....@@ -293,8 +323,11 @@
293323 genNormalsCADItem.addActionListener(this);
294324 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295325 genNormalsMESHItem.addActionListener(this);
326
+ if (Globals.ADVANCED)
327
+ {
296328 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297329 genNormalsMINEItem.addActionListener(this);
330
+ }
298331 stripifyItem = menu.add(new MenuItem("Stripify"));
299332 stripifyItem.addActionListener(this);
300333 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +349,14 @@
316349 reduce34MeshItem.addActionListener(this);
317350 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318351 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321352 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322353 clipMeshItem.addActionListener(this);
354
+
355
+ if (Globals.ADVANCED)
356
+ {
357
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
358
+ smoothMeshItem.addActionListener(this);
359
+ }
323360
324361 oe.menuBar.add(menu = new Menu("Attributes"));
325362 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +366,13 @@
329366 liveleavesItem.addActionListener(this);
330367 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331368 unliveleavesItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
332371 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333372 supportleavesItem.addActionListener(this);
334373 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335374 unsupportleavesItem.addActionListener(this);
375
+ }
336376 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337377 hideleavesItem.addActionListener(this);
338378 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +415,8 @@
375415 sortbysizeItem.addActionListener(this);
376416 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377417 sortbynameItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
378420 menu.add("-");
379421 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380422 extractGeometriesItem.addActionListener(this);
....@@ -384,11 +426,11 @@
384426 shareGeometriesItem.addActionListener(this);
385427 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386428 mergeGeometriesItem.addActionListener(this);
429
+ }
387430
388431 oe.menuBar.add(menu = new Menu("Insert"));
389432 buildCreateMenu(menu);
390433
391
-
392434 oe.menuBar.add(menu = new Menu("Include"));
393435 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394436 importGFDItem.addActionListener(this);
....@@ -433,110 +475,98 @@
433475 oe.radioPanel.add(dummyButton);
434476 oe.buttonGroup.add(dummyButton);
435477 */
436
- aConstraints.gridy += 1;
437
-
438478 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439479
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444481 liveCB.setToolTipText("Enabled animation");
445482 liveCB.addItemListener(this);
446483
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
484
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485
+ oneStepButton.setToolTipText("Animate one step forward");
486
+ oneStepButton.addActionListener(this);
487
+
488
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
489
+ fastCB.setToolTipText("Fast mode");
490
+ fastCB.addItemListener(this);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449493 trackCB.setToolTipText("Enable tracking");
450494 trackCB.addItemListener(this);
451495
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454497 screenfitButton.setToolTipText("Screen fit");
455498 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
499
+
457500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458501 // 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;
464502
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);
503
+ if (Globals.ADVANCED)
504
+ {
505
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ snapobjectButton.addActionListener(this);
507
+ snapobjectButton.setToolTipText("Snap Object");
508
+ }
509
+
510
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471511 flashSelectionButton.setToolTipText("Show selection");
472512 flashSelectionButton.addActionListener(this);
473513
474
- oe.toolbarPanel.add(new cButton(" ", false));
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475515
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);
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482517 twoButton.setToolTipText("Show center view only");
483518 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485520 fourButton.addActionListener(this);
486521 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488523 sixButton.setToolTipText("2-column layout left");
489524 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491526 threeButton.setToolTipText("2-column layout right");
492527 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494529 sevenButton.setToolTipText("3-column layout");
495530 sevenButton.addActionListener(this);
496531 //
497532
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
500535 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503538 closeButton.setToolTipText("Close tab");
504539 closeButton.addActionListener(this);
505540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506541 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508542
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
+ cGridBag commandsPanel = new cGridBag();
544
+
545
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
+ editButton.setToolTipText("Edit selection");
511547 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515548
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
517551 uneditButton.addActionListener(this);
518552
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);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
531555 allParamsButton.addActionListener(this);
532556
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);
557
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
558
+ clearPanelButton.setToolTipText("Clear edit panel");
559
+ clearPanelButton.addActionListener(this);
560
+
561
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
562
+ unselectButton.setToolTipText("Unselect");
538563 unselectButton.addActionListener(this);
539564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
540570 // oe.aConstraints.gridx += 1;
541571 // oe.aConstraints.weighty = 0;
542572 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +578,37 @@
548578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549579 // gcButton.addActionListener(this);
550580
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;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
562584 //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);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564586 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
569590
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);
591
+ cGridBag copyOptionsPanel = new cGridBag();
592
+
593
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
+ colorCB.setToolTipText("Copy color when dropped");
574595 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
596
+
597
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
+ materialCB.setToolTipText("Copy material when dropped");
577599 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
600
+
601
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
+ textureCB.setToolTipText("Copy texture when dropped");
580603 textureCB.addItemListener(this);
581604
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
584608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
585612 //jList.addListSelectionListener(this);
586613 oe.jTree.addTreeSelectionListener(this);
587614 //jTree.setRootVisible(false);
....@@ -604,45 +631,37 @@
604631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605632 }
606633
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608635 {
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);
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639637 boxCB.setToolTipText("Display bounding boxes");
640638 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643641 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644642 zoomBoxCB.addItemListener(this);
645643
644
+ if (Globals.ADVANCED)
645
+ {
646
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
+ supportCB.setToolTipText("Enable rigging");
648
+ supportCB.addItemListener(this);
649
+
650
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651
+ // localCB.addItemListener(this);
652
+
653
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654
+ crowdCB.setToolTipText("Used for crowds");
655
+ crowdCB.addItemListener(this);
656
+
657
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
658
+ smoothCB.setToolTipText("Snapping delay");
659
+ smoothCB.addItemListener(this);
660
+
661
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
+ slowCB.setToolTipText("Smooth interpolation");
663
+ slowCB.addItemListener(this);
664
+
646665 // constraints.gridy += 1;
647666 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648667 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +669,16 @@
650669 if (false)
651670 {
652671 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655674 speakerCameraCB.addItemListener(this);
656675
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659678 speakerFocusCB.addItemListener(this);
660679
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663682 smoothfocusCB.addItemListener(this);
664683 }
665684
....@@ -667,14 +686,20 @@
667686 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668687 // debugCB.addItemListener(this);
669688
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672690 oeilCB.addItemListener(this);
673691
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676693 lookAtCB.setToolTipText("Look-at target");
677694 lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
678703
679704 }
680705
....@@ -959,11 +984,11 @@
959984 {
960985 loadClipboard(true);
961986 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
987
+ pasteInto(false, false);
963988 } else {
964989 loadClipboard(false);
965990 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
967992 }
968993 }
969994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1110,33 @@
10851110 kleinItem.addActionListener(this);
10861111 particleItem = menu.add(new MenuItem("Particle system"));
10871112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10881115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891116 ragdollItem.addActionListener(this);
10901117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911118 ragdoll2Item.addActionListener(this);
1119
+ }
10921120 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941122 meshItem.addActionListener(this);
10951123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10971127 springItem = menu.add(new MenuItem("Spring"));
10981128 springItem.addActionListener(this);
10991129 flagItem = menu.add(new MenuItem("Flag"));
11001130 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);
11051131 blobItem = menu.add(new MenuItem("Blob"));
11061132 blobItem.addActionListener(this);
11071133 latheItem = menu.add(new MenuItem("Lathe"));
11081134 latheItem.addActionListener(this);
1135
+ }
1136
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1137
+ bezierItem.addActionListener(this);
1138
+ overlayItem = menu.add(new MenuItem("Overlay"));
1139
+ overlayItem.addActionListener(this);
11091140 lightItem = menu.add(new MenuItem("Light"));
11101141 lightItem.addActionListener(this);
11111142 menu.add("-");
....@@ -1115,25 +1146,26 @@
11151146 loopItem.addActionListener(this);
11161147 doubleItem = menu.add(new MenuItem("Fork"));
11171148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
11181151 tripleItem = menu.add(new MenuItem("Trident"));
11191152 tripleItem.addActionListener(this);
1153
+ }
11201154 }
11211155
11221156 void buildToolsMenu(Menu menu)
11231157 {
11241158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251159 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
11271161
11281162 menu.add("-");
11291163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301164 parseverticesItem.addActionListener(this);
11311165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321166 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
11341168 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381170 reduceMorphItem.addActionListener(this);
11391171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1141,8 +1173,12 @@
11411173
11421174 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431175 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
11461182 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471183 memoryItem.addActionListener(this);
11481184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1201,7 @@
11651201 menu.add("-");
11661202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671203 editScriptItem.addActionListener(this);
1204
+ }
11681205 }
11691206
11701207 void ScreenFit()
....@@ -1666,7 +1703,7 @@
16661703 {
16671704 makeSomething(new BezierSurface());
16681705 } else
1669
- if (source == checkerItem)
1706
+ if (source == overlayItem)
16701707 {
16711708 /*
16721709 Object3D obj = new BezierSurface(5,8);
....@@ -1854,6 +1891,11 @@
18541891 {
18551892 DumpObject();
18561893 } else
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
18571899 if (source == screenfitButton)
18581900 {
18591901 //Reload(lastConverter, lastFilename, true);
....@@ -1926,13 +1968,17 @@
19261968 {
19271969 paste(false);
19281970 } else
1971
+ if (source == pasteIntoItem)
1972
+ {
1973
+ pasteInto(true, false);
1974
+ } else
19291975 if (source == pasteLinkItem)
19301976 {
1931
- pasteInto(false);
1977
+ pasteInto(false, false);
19321978 } else
19331979 if (source == pasteCloneItem)
19341980 {
1935
- pasteInto(true);
1981
+ pasteInto(true, true);
19361982 } else
19371983 if (source == pasteExpandItem)
19381984 {
....@@ -2134,11 +2180,11 @@
21342180 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352181 for (int i=0; i<group.selection.size(); i++)
21362182 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
21392185 group.selection.get(i).linkVerticesThis(content);
21402186 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
21422188 }
21432189 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442190 refreshContents();
....@@ -2148,20 +2194,20 @@
21482194 {
21492195 for (int i=0; i<group.selection.size(); i++)
21502196 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
21532199 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
21552201 }
21562202
21572203 refreshContents();
21582204 } else
21592205 if (source == relinkverticesItem)
21602206 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
21632209 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2210
+ CameraPane.SWITCH = random;
21652211
21662212 refreshContents();
21672213 } else
....@@ -2259,7 +2305,7 @@
22592305 RandomNode random = new RandomNode();
22602306 group(random);
22612307 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
22632309 } else
22642310 if (source == physicsItem)
22652311 {
....@@ -2720,7 +2766,7 @@
27202766 // centralPanel.setVisible(true);
27212767 // XYZPanel.setVisible(false);
27222768 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
2769
+ bigThree.add(centralPanel);
27242770 bigThree.FlushUI();
27252771 } else
27262772 if (source == threeButton)
....@@ -2755,8 +2801,8 @@
27552801 // centralPanel.setVisible(true);
27562802 // XYZPanel.setVisible(true);
27572803 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
2804
+ bigThree.add(centralPanel);
2805
+ bigThree.add(XYZPanel);
27602806 bigThree.FlushUI();
27612807 } else
27622808 if (source == fourButton)
....@@ -2791,7 +2837,7 @@
27912837 // centralPanel.setVisible(false);
27922838 // XYZPanel.setVisible(false);
27932839 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
2840
+ bigThree.add(scenePanel);
27952841 bigThree.FlushUI();
27962842 } else
27972843 if (source == sixButton)
....@@ -2826,8 +2872,8 @@
28262872 // centralPanel.setVisible(true);
28272873 // XYZPanel.setVisible(false);
28282874 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
2875
+ bigThree.add(scenePanel);
2876
+ bigThree.add(centralPanel);
28312877 bigThree.FlushUI();
28322878 } else
28332879 if (source == sevenButton)
....@@ -2862,9 +2908,9 @@
28622908 // centralPanel.setVisible(true);
28632909 // XYZPanel.setVisible(true);
28642910 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
2911
+ bigThree.add(scenePanel);
2912
+ bigThree.add(centralPanel);
2913
+ bigThree.add(XYZPanel);
28682914 bigThree.FlushUI();
28692915 } else
28702916 if (source == rootButton)
....@@ -2916,7 +2962,7 @@
29162962
29172963 child.editWindow = null; // ???????????
29182964 }
2919
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
29202966 //objEditor.jTree.clearSelection();
29212967 //objEditor.ResetSliders();
29222968 refreshContents(true);
....@@ -3635,11 +3681,11 @@
36353681
36363682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36373683
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
36403686 lowres.linkVerticesThis(null);
36413687 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
36433689
36443690 System.err.flush();
36453691
....@@ -4124,12 +4170,12 @@
41244170 System.err.println("info : " + child.GetPath());
41254171 }
41264172 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
41334179
41344180 objEditor.SetText(); // jan 2014
41354181
....@@ -4397,7 +4443,7 @@
43974443 refreshContents();
43984444 }
43994445
4400
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
44014447 {
44024448 // if (GrafreeD.clipboard == null)
44034449 // return;
....@@ -4426,7 +4472,14 @@
44264472 if (copyit)
44274473 {
44284474 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
44304483 }
44314484 else
44324485 {
....@@ -4970,10 +5023,12 @@
49705023 cButton flashSelectionButton;
49715024 cButton editButton;
49725025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
49735027 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755028 cButton unselectButton;
49765029
5030
+ cButton oneStepButton;
5031
+
49775032 cButton screenfitButton;
49785033 cButton screenfitpointButton;
49795034 cButton snapobjectButton;
....@@ -5028,6 +5083,7 @@
50285083 private MenuItem mergeGeometriesItem;
50295084 private MenuItem copyItem;
50305085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
50315087 private MenuItem pasteLinkItem;
50325088 private MenuItem pasteCloneItem;
50335089 private MenuItem pasteExpandItem;
....@@ -5125,7 +5181,7 @@
51255181 private MenuItem blobItem;
51265182 private MenuItem latheItem;
51275183 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
51295185 private MenuItem meshItem;
51305186 // private MenuItem meshGroupItem;
51315187 private MenuItem springItem;