Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
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,
....@@ -433,31 +434,28 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
-
438437 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444440 liveCB.setToolTipText("Enabled animation");
445441 liveCB.addItemListener(this);
446442
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
445
+ fastCB.addItemListener(this);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449448 trackCB.setToolTipText("Enable tracking");
450449 trackCB.addItemListener(this);
451450
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454452 screenfitButton.setToolTipText("Screen fit");
455453 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
454
+
457455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458456 // screenfitpointButton.addActionListener(this);
459457 // oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461459 snapobjectButton.addActionListener(this);
462460 snapobjectButton.setToolTipText("Snap Object");
463461 oe.aConstraints.gridx += 1;
....@@ -467,76 +465,66 @@
467465 oe.aConstraints.weighty = 0;
468466 oe.aConstraints.gridwidth = 1;
469467
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471469 flashSelectionButton.setToolTipText("Show selection");
472470 flashSelectionButton.addActionListener(this);
473471
474
- oe.toolbarPanel.add(new cButton(" ", false));
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475473
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);
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482475 twoButton.setToolTipText("Show center view only");
483476 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485478 fourButton.addActionListener(this);
486479 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488481 sixButton.setToolTipText("2-column layout left");
489482 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491484 threeButton.setToolTipText("2-column layout right");
492485 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494487 sevenButton.setToolTipText("3-column layout");
495488 sevenButton.addActionListener(this);
496489 //
497490
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
491
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ rootButton.setToolTipText("Edit selection in new tab");
500493 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503496 closeButton.setToolTipText("Close tab");
504497 closeButton.addActionListener(this);
505498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506499 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508500
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
501
+ cGridBag commandsPanel = new cGridBag();
502
+
503
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ editButton.setToolTipText("Edit selection");
511505 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515506
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
517509 uneditButton.addActionListener(this);
518510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
524513 clearPanelButton.addActionListener(this);
525514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
531517 allParamsButton.addActionListener(this);
532518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
538521 unselectButton.addActionListener(this);
539522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
540528 // oe.aConstraints.gridx += 1;
541529 // oe.aConstraints.weighty = 0;
542530 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +536,37 @@
548536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549537 // gcButton.addActionListener(this);
550538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
562542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564544 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
569548
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);
549
+ cGridBag copyOptionsPanel = new cGridBag();
550
+
551
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
+ colorCB.setToolTipText("Copy color when dropped");
574553 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
+ materialCB.setToolTipText("Copy material when dropped");
577557 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
558
+
559
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
+ textureCB.setToolTipText("Copy texture when dropped");
580561 textureCB.addItemListener(this);
581562
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
584566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
585570 //jList.addListSelectionListener(this);
586571 oe.jTree.addTreeSelectionListener(this);
587572 //jTree.setRootVisible(false);
....@@ -604,42 +589,32 @@
604589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605590 }
606591
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608593 {
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);
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
616595 supportCB.setToolTipText("Enabled rigging");
617596 supportCB.addItemListener(this);
618597
619
- // constraints.gridy += 1;
620598 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621599 // localCB.addItemListener(this);
622600
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625602 crowdCB.setToolTipText("Used for crowds");
626603 crowdCB.addItemListener(this);
627604
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630606 smoothCB.setToolTipText("Snapping delay");
631607 smoothCB.addItemListener(this);
632608
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635610 slowCB.setToolTipText("Smooth interpolation");
636611 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639614 boxCB.setToolTipText("Display bounding boxes");
640615 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643618 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644619 zoomBoxCB.addItemListener(this);
645620
....@@ -650,16 +625,16 @@
650625 if (false)
651626 {
652627 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655630 speakerCameraCB.addItemListener(this);
656631
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659634 speakerFocusCB.addItemListener(this);
660635
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663638 smoothfocusCB.addItemListener(this);
664639 }
665640
....@@ -667,14 +642,18 @@
667642 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668643 // debugCB.addItemListener(this);
669644
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672646 oeilCB.addItemListener(this);
673647
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676649 lookAtCB.setToolTipText("Look-at target");
677650 lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
678657
679658 }
680659
....@@ -1123,7 +1102,7 @@
11231102 {
11241103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251104 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
11271106
11281107 menu.add("-");
11291108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -2916,7 +2895,7 @@
29162895
29172896 child.editWindow = null; // ???????????
29182897 }
2919
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
29202899 //objEditor.jTree.clearSelection();
29212900 //objEditor.ResetSliders();
29222901 refreshContents(true);
....@@ -4124,12 +4103,12 @@
41244103 System.err.println("info : " + child.GetPath());
41254104 }
41264105 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
41334112
41344113 objEditor.SetText(); // jan 2014
41354114