Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
GroupEditor.java
....@@ -176,7 +176,6 @@
176176 copyItem.addActionListener(this);
177177 pasteItem = menu.add(new MenuItem("Paste"));
178178 pasteItem.addActionListener(this);
179
- menu.add("-");
180179
181180 menu.add("-");
182181 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -246,7 +245,7 @@
246245
247246 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248247 toggleDebugItem.addItemListener(this);
249
- toggleDebugItem.setState(CameraPane.DEBUG);
248
+ toggleDebugItem.setState(Globals.DEBUG);
250249
251250 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252251 toggleFrustumItem.addItemListener(this);
....@@ -369,11 +368,11 @@
369368 billboardItem.addActionListener(this);
370369 csgItem = menu.add(new MenuItem("CSG"));
371370 csgItem.addActionListener(this);
372
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
373372 shadowXItem.addActionListener(this);
374
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
375374 shadowYItem.addActionListener(this);
376
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
377376 shadowZItem.addActionListener(this);
378377 if (Globals.ADVANCED)
379378 {
....@@ -470,6 +469,14 @@
470469 markleavesItem.addActionListener(this);
471470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
472471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
473480 menu.add("-");
474481 flipVItem = menu.add(new MenuItem("Flip V"));
475482 flipVItem.addActionListener(this);
....@@ -527,6 +534,18 @@
527534
528535 void SetupUI2(ObjEditor oe)
529536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
530549 //new Exception().printStackTrace();
531550
532551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -557,15 +576,27 @@
557576 */
558577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
559578
560
- oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561592 undoButton.setToolTipText("Undo changes");
562593 undoButton.addActionListener(this);
563594
564
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565596 redoButton.setToolTipText("Redo changes");
566597 redoButton.addActionListener(this);
567598
568
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569600 saveButton.setToolTipText("Save changes");
570601 saveButton.addActionListener(this);
571602
....@@ -573,7 +604,7 @@
573604 liveCB.setToolTipText("Enable animation");
574605 liveCB.addItemListener(this);
575606
576
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577608 oneStepButton.setToolTipText("Animate one step forward");
578609 oneStepButton.addActionListener(this);
579610
....@@ -581,7 +612,7 @@
581612 fastCB.setToolTipText("Fast mode");
582613 fastCB.addItemListener(this);
583614
584
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
585616 trackCB.setToolTipText("Enable tracking");
586617 trackCB.addItemListener(this);
587618
....@@ -605,19 +636,19 @@
605636
606637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607638
608
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609640 twoButton.setToolTipText("Show center view only");
610641 twoButton.addActionListener(this);
611
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612643 fourButton.addActionListener(this);
613644 fourButton.setToolTipText("Show left panel only");
614
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615646 sixButton.setToolTipText("2-column layout left");
616647 sixButton.addActionListener(this);
617
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618649 threeButton.setToolTipText("2-column layout right");
619650 threeButton.addActionListener(this);
620
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621652 sevenButton.setToolTipText("3-column layout");
622653 sevenButton.addActionListener(this);
623654 //
....@@ -632,32 +663,30 @@
632663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
633664 //clearButton.addActionListener(this);
634665
635
- cGridBag commandsPanel = new cGridBag();
636
-
637
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638667 editButton.setToolTipText("Edit selection");
639668 editButton.addActionListener(this);
640669
641
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642671 uneditButton.setToolTipText("Unedit selection");
643672 uneditButton.addActionListener(this);
644673
645
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646675 allParamsButton.setToolTipText("Edit all params");
647676 allParamsButton.addActionListener(this);
648677
649
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650679 clearPanelButton.setToolTipText("Clear edit panel");
651680 clearPanelButton.addActionListener(this);
652681
653
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654683 unselectButton.setToolTipText("Unselect");
655684 unselectButton.addActionListener(this);
656685
657
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
658687
659
- oe.treePanel.add(commandsPanel);
660
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
661690
662691 // oe.aConstraints.gridx += 1;
663692 // oe.aConstraints.weighty = 0;
....@@ -809,6 +838,8 @@
809838
810839 void SetupViews(ObjEditor oe)
811840 {
841
+ theFrame = this;
842
+
812843 oe.SetupViews();
813844
814845 System.out.println("SetupViews");
....@@ -1420,6 +1451,7 @@
14201451 shadow.material = new cMaterial(obj.material);
14211452 shadow.material.diffuse = 0.0001f;
14221453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
14231455
14241456 makeSomething(shadow);
14251457 }
....@@ -1969,6 +2001,18 @@
19692001 if (source == dumpItem)
19702002 {
19712003 DumpObject();
2004
+ } else
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
19722016 } else
19732017 if (source == undoButton)
19742018 {
....@@ -2609,6 +2653,22 @@
26092653 {
26102654 MarkLeaves(false);
26112655 } else
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
2671
+ } else
26122672 if (source == flipVItem)
26132673 {
26142674 FlipV(true);
....@@ -2875,6 +2935,24 @@
28752935 bigThree.ClearUI();
28762936 bigThree.add(centralPanel);
28772937 bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
28782956 } else
28792957 if (source == threeButton)
28802958 {
....@@ -2911,6 +2989,8 @@
29112989 bigThree.add(centralPanel);
29122990 bigThree.add(XYZPanel);
29132991 bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
29142994 } else
29152995 if (source == fourButton)
29162996 {
....@@ -2946,6 +3026,8 @@
29463026 bigThree.ClearUI();
29473027 bigThree.add(scenePanel);
29483028 bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
29493031 } else
29503032 if (source == sixButton)
29513033 {
....@@ -2982,6 +3064,8 @@
29823064 bigThree.add(scenePanel);
29833065 bigThree.add(centralPanel);
29843066 bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
29853069 } else
29863070 if (source == sevenButton)
29873071 {
....@@ -3019,6 +3103,8 @@
30193103 bigThree.add(centralPanel);
30203104 bigThree.add(XYZPanel);
30213105 bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
30223108 } else
30233109 if (source == rootButton)
30243110 {
....@@ -3030,6 +3116,7 @@
30303116 EditObject(obj);
30313117 }
30323118
3119
+ cameraView.requestFocusInWindow();
30333120 refreshContents(true);
30343121 } else
30353122 if (source == closeButton)
....@@ -3051,6 +3138,8 @@
30513138 break;
30523139 }
30533140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
30543143 refreshContents(true);
30553144 } else
30563145 if (source == editItem || source == editButton)
....@@ -3155,7 +3244,7 @@
31553244 }
31563245
31573246 // fix "+" issue
3158
- group.editWindow = this;
3247
+ //group.editWindow = this;
31593248
31603249 /*
31613250 currentLayout = radio.layout;
....@@ -3168,6 +3257,8 @@
31683257 //group.parent = null; // ROOT
31693258 //group.attributes = -1;
31703259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
31713262 refreshContents(true);
31723263 } else if (event.getSource() == editCameraItem)
31733264 {
....@@ -3191,7 +3282,6 @@
31913282 }
31923283
31933284 boolean useclient = false;
3194
- cRadio radio;
31953285
31963286 void ToggleRoot()
31973287 {
....@@ -4146,6 +4236,18 @@
41464236 refreshContents();
41474237 }
41484238
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
4248
+ refreshContents();
4249
+ }
4250
+
41494251 void SetTexRes(int tr)
41504252 {
41514253 group.selection.SetTexRes(tr);
....@@ -4329,6 +4431,7 @@
43294431
43304432 //if (child.parent != null)
43314433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
43324435 group.addSelectee(child);
43334436 }
43344437 }
....@@ -4369,15 +4472,12 @@
43694472 {
43704473 objEditor.ClearInfo(); // .GetMaterial());
43714474
4372
- for (int i=0; i < group.selection.size(); i++)
4475
+ for (int i=0; i < group.selection.Size(); i++)
43734476 {
4374
- Object3D child = (Object3D) group.selection.reserve(i);
4477
+ Object3D child = (Object3D) group.selection.get(i);
43754478
4376
- objEditor.SetMaterial(child);
43774479 objEditor.AddInfo(child, this, true);
43784480 System.err.println("info : " + child.GetPath());
4379
-
4380
- group.selection.release(i);
43814481 }
43824482
43834483 objEditor.SetText(); // jan 2014
....@@ -5185,9 +5285,12 @@
51855285 cButton clearpanelButton;
51865286 cButton unselectButton;
51875287
5188
- cButton saveButton;
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
51895291 cButton undoButton;
51905292 cButton redoButton;
5293
+ cButton saveButton;
51915294 cButton oneStepButton;
51925295
51935296 cButton screenfitButton;
....@@ -5200,14 +5303,6 @@
52005303 cButton closeButton;
52015304
52025305 cButton setsupportButton;
5203
-
5204
- cButton twoButton;
5205
- cButton sixButton;
5206
- cButton threeButton;
5207
- cButton sevenButton;
5208
- cButton fourButton; // full panel
5209
- cButton oneButton; // full XYZ
5210
- //cButton currentLayout;
52115306
52125307 //
52135308 //Composite
....@@ -5285,6 +5380,10 @@
52855380 private MenuItem showleavesItem;
52865381 private MenuItem markleavesItem;
52875382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
52885387
52895388 private MenuItem flipVItem;
52905389 private MenuItem unflipVItem;