Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
GroupEditor.java
....@@ -246,7 +246,7 @@
246246
247247 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248248 toggleDebugItem.addItemListener(this);
249
- toggleDebugItem.setState(CameraPane.DEBUG);
249
+ toggleDebugItem.setState(Globals.DEBUG);
250250
251251 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252252 toggleFrustumItem.addItemListener(this);
....@@ -470,6 +470,14 @@
470470 markleavesItem.addActionListener(this);
471471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
472472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
473481 menu.add("-");
474482 flipVItem = menu.add(new MenuItem("Flip V"));
475483 flipVItem.addActionListener(this);
....@@ -527,6 +535,18 @@
527535
528536 void SetupUI2(ObjEditor oe)
529537 {
538
+ // June 2019
539
+ if (oe == null)
540
+ {
541
+ //super.SetupUI2(this);
542
+ //return;
543
+ }
544
+
545
+ if (copy != group)
546
+ {
547
+ //super.SetupUI2(this);
548
+ }
549
+
530550 //new Exception().printStackTrace();
531551
532552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -557,15 +577,27 @@
557577 */
558578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
559579
560
- oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
581
+ //minButton.setToolTipText("Minimize window");
582
+ //minButton.addActionListener(this);
583
+
584
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ maxButton.setToolTipText("Maximize window");
586
+ maxButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ fullButton.setToolTipText("Full-screen window");
590
+ fullButton.addActionListener(this);
591
+
592
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561593 undoButton.setToolTipText("Undo changes");
562594 undoButton.addActionListener(this);
563595
564
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565597 redoButton.setToolTipText("Redo changes");
566598 redoButton.addActionListener(this);
567599
568
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569601 saveButton.setToolTipText("Save changes");
570602 saveButton.addActionListener(this);
571603
....@@ -573,7 +605,7 @@
573605 liveCB.setToolTipText("Enable animation");
574606 liveCB.addItemListener(this);
575607
576
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577609 oneStepButton.setToolTipText("Animate one step forward");
578610 oneStepButton.addActionListener(this);
579611
....@@ -581,7 +613,7 @@
581613 fastCB.setToolTipText("Fast mode");
582614 fastCB.addItemListener(this);
583615
584
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
585617 trackCB.setToolTipText("Enable tracking");
586618 trackCB.addItemListener(this);
587619
....@@ -809,6 +841,8 @@
809841
810842 void SetupViews(ObjEditor oe)
811843 {
844
+ theFrame = this;
845
+
812846 oe.SetupViews();
813847
814848 System.out.println("SetupViews");
....@@ -1970,6 +2004,18 @@
19702004 {
19712005 DumpObject();
19722006 } else
2007
+ if (source == minButton)
2008
+ {
2009
+ Minimize();
2010
+ } else
2011
+ if (source == maxButton)
2012
+ {
2013
+ Maximize();
2014
+ } else
2015
+ if (source == fullButton)
2016
+ {
2017
+ ToggleFullScreen();
2018
+ } else
19732019 if (source == undoButton)
19742020 {
19752021 Undo();
....@@ -2609,6 +2655,22 @@
26092655 {
26102656 MarkLeaves(false);
26112657 } else
2658
+ if (source == rewindleavesItem)
2659
+ {
2660
+ RewindLeaves(true);
2661
+ } else
2662
+ if (source == unrewindleavesItem)
2663
+ {
2664
+ RewindLeaves(false);
2665
+ } else
2666
+ if (source == randomleavesItem)
2667
+ {
2668
+ RandomLeaves(true);
2669
+ } else
2670
+ if (source == unrandomleavesItem)
2671
+ {
2672
+ RandomLeaves(false);
2673
+ } else
26122674 if (source == flipVItem)
26132675 {
26142676 FlipV(true);
....@@ -2875,6 +2937,24 @@
28752937 bigThree.ClearUI();
28762938 bigThree.add(centralPanel);
28772939 bigThree.FlushUI();
2940
+
2941
+ cameraView.requestFocusInWindow();
2942
+
2943
+// refreshContents(true);
2944
+//
2945
+// try
2946
+// {
2947
+// java.awt.Robot bot = new java.awt.Robot();
2948
+// int mask = InputEvent.BUTTON1_MASK;
2949
+// bot.mouseMove(100, 100);
2950
+// bot.mousePress(mask);
2951
+// bot.mouseRelease(mask);
2952
+// }
2953
+// catch (Exception e)
2954
+// {
2955
+//
2956
+// }
2957
+
28782958 } else
28792959 if (source == threeButton)
28802960 {
....@@ -2911,6 +2991,8 @@
29112991 bigThree.add(centralPanel);
29122992 bigThree.add(XYZPanel);
29132993 bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
29142996 } else
29152997 if (source == fourButton)
29162998 {
....@@ -2946,6 +3028,8 @@
29463028 bigThree.ClearUI();
29473029 bigThree.add(scenePanel);
29483030 bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
29493033 } else
29503034 if (source == sixButton)
29513035 {
....@@ -2982,6 +3066,8 @@
29823066 bigThree.add(scenePanel);
29833067 bigThree.add(centralPanel);
29843068 bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
29853071 } else
29863072 if (source == sevenButton)
29873073 {
....@@ -3019,6 +3105,8 @@
30193105 bigThree.add(centralPanel);
30203106 bigThree.add(XYZPanel);
30213107 bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
30223110 } else
30233111 if (source == rootButton)
30243112 {
....@@ -3030,6 +3118,7 @@
30303118 EditObject(obj);
30313119 }
30323120
3121
+ cameraView.requestFocusInWindow();
30333122 refreshContents(true);
30343123 } else
30353124 if (source == closeButton)
....@@ -3051,6 +3140,8 @@
30513140 break;
30523141 }
30533142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
30543145 refreshContents(true);
30553146 } else
30563147 if (source == editItem || source == editButton)
....@@ -3155,7 +3246,7 @@
31553246 }
31563247
31573248 // fix "+" issue
3158
- group.editWindow = this;
3249
+ //group.editWindow = this;
31593250
31603251 /*
31613252 currentLayout = radio.layout;
....@@ -3168,6 +3259,8 @@
31683259 //group.parent = null; // ROOT
31693260 //group.attributes = -1;
31703261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
31713264 refreshContents(true);
31723265 } else if (event.getSource() == editCameraItem)
31733266 {
....@@ -3191,7 +3284,6 @@
31913284 }
31923285
31933286 boolean useclient = false;
3194
- cRadio radio;
31953287
31963288 void ToggleRoot()
31973289 {
....@@ -4146,6 +4238,18 @@
41464238 refreshContents();
41474239 }
41484240
4241
+ void RewindLeaves(boolean hide)
4242
+ {
4243
+ group.selection.RewindLeaves(hide);
4244
+ refreshContents();
4245
+ }
4246
+
4247
+ void RandomLeaves(boolean hide)
4248
+ {
4249
+ group.selection.RandomLeaves(hide);
4250
+ refreshContents();
4251
+ }
4252
+
41494253 void SetTexRes(int tr)
41504254 {
41514255 group.selection.SetTexRes(tr);
....@@ -4329,6 +4433,7 @@
43294433
43304434 //if (child.parent != null)
43314435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
43324437 group.addSelectee(child);
43334438 }
43344439 }
....@@ -4369,15 +4474,12 @@
43694474 {
43704475 objEditor.ClearInfo(); // .GetMaterial());
43714476
4372
- for (int i=0; i < group.selection.size(); i++)
4477
+ for (int i=0; i < group.selection.Size(); i++)
43734478 {
4374
- Object3D child = (Object3D) group.selection.reserve(i);
4479
+ Object3D child = (Object3D) group.selection.get(i);
43754480
4376
- objEditor.SetMaterial(child);
43774481 objEditor.AddInfo(child, this, true);
43784482 System.err.println("info : " + child.GetPath());
4379
-
4380
- group.selection.release(i);
43814483 }
43824484
43834485 objEditor.SetText(); // jan 2014
....@@ -5185,9 +5287,12 @@
51855287 cButton clearpanelButton;
51865288 cButton unselectButton;
51875289
5188
- cButton saveButton;
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
51895293 cButton undoButton;
51905294 cButton redoButton;
5295
+ cButton saveButton;
51915296 cButton oneStepButton;
51925297
51935298 cButton screenfitButton;
....@@ -5200,14 +5305,6 @@
52005305 cButton closeButton;
52015306
52025307 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;
52115308
52125309 //
52135310 //Composite
....@@ -5285,6 +5382,10 @@
52855382 private MenuItem showleavesItem;
52865383 private MenuItem markleavesItem;
52875384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
52885389
52895390 private MenuItem flipVItem;
52905391 private MenuItem unflipVItem;