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 {
....@@ -4143,6 +4235,18 @@
41434235 void MarkLeaves(boolean hide)
41444236 {
41454237 group.selection.MarkLeaves(hide);
4238
+ refreshContents();
4239
+ }
4240
+
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);
41464250 refreshContents();
41474251 }
41484252
....@@ -5183,9 +5287,12 @@
51835287 cButton clearpanelButton;
51845288 cButton unselectButton;
51855289
5186
- cButton saveButton;
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
51875293 cButton undoButton;
51885294 cButton redoButton;
5295
+ cButton saveButton;
51895296 cButton oneStepButton;
51905297
51915298 cButton screenfitButton;
....@@ -5198,14 +5305,6 @@
51985305 cButton closeButton;
51995306
52005307 cButton setsupportButton;
5201
-
5202
- cButton twoButton;
5203
- cButton sixButton;
5204
- cButton threeButton;
5205
- cButton sevenButton;
5206
- cButton fourButton; // full panel
5207
- cButton oneButton; // full XYZ
5208
- //cButton currentLayout;
52095308
52105309 //
52115310 //Composite
....@@ -5283,6 +5382,10 @@
52835382 private MenuItem showleavesItem;
52845383 private MenuItem markleavesItem;
52855384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
52865389
52875390 private MenuItem flipVItem;
52885391 private MenuItem unflipVItem;