Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
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,24 @@
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(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449444 trackCB.setToolTipText("Enable tracking");
450445 trackCB.addItemListener(this);
451446
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454448 screenfitButton.setToolTipText("Screen fit");
455449 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
450
+
457451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458452 // screenfitpointButton.addActionListener(this);
459453 // oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461455 snapobjectButton.addActionListener(this);
462456 snapobjectButton.setToolTipText("Snap Object");
463457 oe.aConstraints.gridx += 1;
....@@ -467,76 +461,66 @@
467461 oe.aConstraints.weighty = 0;
468462 oe.aConstraints.gridwidth = 1;
469463
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471465 flashSelectionButton.setToolTipText("Show selection");
472466 flashSelectionButton.addActionListener(this);
473467
474
- oe.toolbarPanel.add(new cButton(" ", false));
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475469
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);
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482471 twoButton.setToolTipText("Show center view only");
483472 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485474 fourButton.addActionListener(this);
486475 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488477 sixButton.setToolTipText("2-column layout left");
489478 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491480 threeButton.setToolTipText("2-column layout right");
492481 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494483 sevenButton.setToolTipText("3-column layout");
495484 sevenButton.addActionListener(this);
496485 //
497486
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit selection in new tab");
500489 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503492 closeButton.setToolTipText("Close tab");
504493 closeButton.addActionListener(this);
505494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506495 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508496
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
511501 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515502
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
517505 uneditButton.addActionListener(this);
518506
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);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
524509 clearPanelButton.addActionListener(this);
525510
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);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
531513 allParamsButton.addActionListener(this);
532514
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);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
538517 unselectButton.addActionListener(this);
539518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
540524 // oe.aConstraints.gridx += 1;
541525 // oe.aConstraints.weighty = 0;
542526 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +532,37 @@
548532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549533 // gcButton.addActionListener(this);
550534
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;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
562538 //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);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564540 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
569544
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);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
574549 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
577553 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
580557 textureCB.addItemListener(this);
581558
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
584562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
585566 //jList.addListSelectionListener(this);
586567 oe.jTree.addTreeSelectionListener(this);
587568 //jTree.setRootVisible(false);
....@@ -604,15 +585,15 @@
604585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605586 }
606587
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608589 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612593 fastCB.setToolTipText("Fast mode");
613594 fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
616597 supportCB.setToolTipText("Enabled rigging");
617598 supportCB.addItemListener(this);
618599
....@@ -620,26 +601,26 @@
620601 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621602 // localCB.addItemListener(this);
622603
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625606 crowdCB.setToolTipText("Used for crowds");
626607 crowdCB.addItemListener(this);
627608
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630611 smoothCB.setToolTipText("Snapping delay");
631612 smoothCB.addItemListener(this);
632613
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635616 slowCB.setToolTipText("Smooth interpolation");
636617 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639620 boxCB.setToolTipText("Display bounding boxes");
640621 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643624 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644625 zoomBoxCB.addItemListener(this);
645626
....@@ -650,16 +631,16 @@
650631 if (false)
651632 {
652633 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655636 speakerCameraCB.addItemListener(this);
656637
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659640 speakerFocusCB.addItemListener(this);
660641
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663644 smoothfocusCB.addItemListener(this);
664645 }
665646
....@@ -667,14 +648,20 @@
667648 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668649 // debugCB.addItemListener(this);
669650
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672653 oeilCB.addItemListener(this);
673654
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676657 lookAtCB.setToolTipText("Look-at target");
677658 lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
678665
679666 }
680667
....@@ -2916,7 +2903,7 @@
29162903
29172904 child.editWindow = null; // ???????????
29182905 }
2919
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
29202907 //objEditor.jTree.clearSelection();
29212908 //objEditor.ResetSliders();
29222909 refreshContents(true);
....@@ -4124,12 +4111,12 @@
41244111 System.err.println("info : " + child.GetPath());
41254112 }
41264113 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
41334120
41344121 objEditor.SetText(); // jan 2014
41354122