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);
....@@ -535,6 +535,18 @@
535535
536536 void SetupUI2(ObjEditor oe)
537537 {
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
+
538550 //new Exception().printStackTrace();
539551
540552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -565,15 +577,27 @@
565577 */
566578 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
567579
568
- 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);
569593 undoButton.setToolTipText("Undo changes");
570594 undoButton.addActionListener(this);
571595
572
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573597 redoButton.setToolTipText("Redo changes");
574598 redoButton.addActionListener(this);
575599
576
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577601 saveButton.setToolTipText("Save changes");
578602 saveButton.addActionListener(this);
579603
....@@ -581,7 +605,7 @@
581605 liveCB.setToolTipText("Enable animation");
582606 liveCB.addItemListener(this);
583607
584
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585609 oneStepButton.setToolTipText("Animate one step forward");
586610 oneStepButton.addActionListener(this);
587611
....@@ -589,7 +613,7 @@
589613 fastCB.setToolTipText("Fast mode");
590614 fastCB.addItemListener(this);
591615
592
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
593617 trackCB.setToolTipText("Enable tracking");
594618 trackCB.addItemListener(this);
595619
....@@ -817,6 +841,8 @@
817841
818842 void SetupViews(ObjEditor oe)
819843 {
844
+ theFrame = this;
845
+
820846 oe.SetupViews();
821847
822848 System.out.println("SetupViews");
....@@ -1978,6 +2004,18 @@
19782004 {
19792005 DumpObject();
19802006 } 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
19812019 if (source == undoButton)
19822020 {
19832021 Undo();
....@@ -2899,6 +2937,24 @@
28992937 bigThree.ClearUI();
29002938 bigThree.add(centralPanel);
29012939 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
+
29022958 } else
29032959 if (source == threeButton)
29042960 {
....@@ -2935,6 +2991,8 @@
29352991 bigThree.add(centralPanel);
29362992 bigThree.add(XYZPanel);
29372993 bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
29382996 } else
29392997 if (source == fourButton)
29402998 {
....@@ -2970,6 +3028,8 @@
29703028 bigThree.ClearUI();
29713029 bigThree.add(scenePanel);
29723030 bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
29733033 } else
29743034 if (source == sixButton)
29753035 {
....@@ -3006,6 +3066,8 @@
30063066 bigThree.add(scenePanel);
30073067 bigThree.add(centralPanel);
30083068 bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
30093071 } else
30103072 if (source == sevenButton)
30113073 {
....@@ -3043,6 +3105,8 @@
30433105 bigThree.add(centralPanel);
30443106 bigThree.add(XYZPanel);
30453107 bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
30463110 } else
30473111 if (source == rootButton)
30483112 {
....@@ -3054,6 +3118,7 @@
30543118 EditObject(obj);
30553119 }
30563120
3121
+ cameraView.requestFocusInWindow();
30573122 refreshContents(true);
30583123 } else
30593124 if (source == closeButton)
....@@ -3075,6 +3140,8 @@
30753140 break;
30763141 }
30773142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
30783145 refreshContents(true);
30793146 } else
30803147 if (source == editItem || source == editButton)
....@@ -3179,7 +3246,7 @@
31793246 }
31803247
31813248 // fix "+" issue
3182
- group.editWindow = this;
3249
+ //group.editWindow = this;
31833250
31843251 /*
31853252 currentLayout = radio.layout;
....@@ -3192,6 +3259,8 @@
31923259 //group.parent = null; // ROOT
31933260 //group.attributes = -1;
31943261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
31953264 refreshContents(true);
31963265 } else if (event.getSource() == editCameraItem)
31973266 {
....@@ -3215,7 +3284,6 @@
32153284 }
32163285
32173286 boolean useclient = false;
3218
- cRadio radio;
32193287
32203288 void ToggleRoot()
32213289 {
....@@ -5219,9 +5287,12 @@
52195287 cButton clearpanelButton;
52205288 cButton unselectButton;
52215289
5222
- cButton saveButton;
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
52235293 cButton undoButton;
52245294 cButton redoButton;
5295
+ cButton saveButton;
52255296 cButton oneStepButton;
52265297
52275298 cButton screenfitButton;
....@@ -5234,14 +5305,6 @@
52345305 cButton closeButton;
52355306
52365307 cButton setsupportButton;
5237
-
5238
- cButton twoButton;
5239
- cButton sixButton;
5240
- cButton threeButton;
5241
- cButton sevenButton;
5242
- cButton fourButton; // full panel
5243
- cButton oneButton; // full XYZ
5244
- //cButton currentLayout;
52455308
52465309 //
52475310 //Composite