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 {
....@@ -535,6 +534,18 @@
535534
536535 void SetupUI2(ObjEditor oe)
537536 {
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
+
538549 //new Exception().printStackTrace();
539550
540551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -565,15 +576,27 @@
565576 */
566577 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
567578
568
- 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);
569592 undoButton.setToolTipText("Undo changes");
570593 undoButton.addActionListener(this);
571594
572
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573596 redoButton.setToolTipText("Redo changes");
574597 redoButton.addActionListener(this);
575598
576
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577600 saveButton.setToolTipText("Save changes");
578601 saveButton.addActionListener(this);
579602
....@@ -581,7 +604,7 @@
581604 liveCB.setToolTipText("Enable animation");
582605 liveCB.addItemListener(this);
583606
584
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585608 oneStepButton.setToolTipText("Animate one step forward");
586609 oneStepButton.addActionListener(this);
587610
....@@ -589,7 +612,7 @@
589612 fastCB.setToolTipText("Fast mode");
590613 fastCB.addItemListener(this);
591614
592
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
593616 trackCB.setToolTipText("Enable tracking");
594617 trackCB.addItemListener(this);
595618
....@@ -613,19 +636,19 @@
613636
614637 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
615638
616
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617640 twoButton.setToolTipText("Show center view only");
618641 twoButton.addActionListener(this);
619
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620643 fourButton.addActionListener(this);
621644 fourButton.setToolTipText("Show left panel only");
622
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623646 sixButton.setToolTipText("2-column layout left");
624647 sixButton.addActionListener(this);
625
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626649 threeButton.setToolTipText("2-column layout right");
627650 threeButton.addActionListener(this);
628
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629652 sevenButton.setToolTipText("3-column layout");
630653 sevenButton.addActionListener(this);
631654 //
....@@ -640,32 +663,30 @@
640663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
641664 //clearButton.addActionListener(this);
642665
643
- cGridBag commandsPanel = new cGridBag();
644
-
645
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646667 editButton.setToolTipText("Edit selection");
647668 editButton.addActionListener(this);
648669
649
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650671 uneditButton.setToolTipText("Unedit selection");
651672 uneditButton.addActionListener(this);
652673
653
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
654675 allParamsButton.setToolTipText("Edit all params");
655676 allParamsButton.addActionListener(this);
656677
657
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658679 clearPanelButton.setToolTipText("Clear edit panel");
659680 clearPanelButton.addActionListener(this);
660681
661
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662683 unselectButton.setToolTipText("Unselect");
663684 unselectButton.addActionListener(this);
664685
665
- commandsPanel.preferredHeight = 1;
686
+ editCommandsPanel.preferredHeight = 1;
666687
667
- oe.treePanel.add(commandsPanel);
668
- oe.treePanel.Return();
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
669690
670691 // oe.aConstraints.gridx += 1;
671692 // oe.aConstraints.weighty = 0;
....@@ -817,6 +838,8 @@
817838
818839 void SetupViews(ObjEditor oe)
819840 {
841
+ theFrame = this;
842
+
820843 oe.SetupViews();
821844
822845 System.out.println("SetupViews");
....@@ -1428,6 +1451,7 @@
14281451 shadow.material = new cMaterial(obj.material);
14291452 shadow.material.diffuse = 0.0001f;
14301453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
14311455
14321456 makeSomething(shadow);
14331457 }
....@@ -1977,6 +2001,18 @@
19772001 if (source == dumpItem)
19782002 {
19792003 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();
19802016 } else
19812017 if (source == undoButton)
19822018 {
....@@ -2899,6 +2935,24 @@
28992935 bigThree.ClearUI();
29002936 bigThree.add(centralPanel);
29012937 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
+
29022956 } else
29032957 if (source == threeButton)
29042958 {
....@@ -2935,6 +2989,8 @@
29352989 bigThree.add(centralPanel);
29362990 bigThree.add(XYZPanel);
29372991 bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
29382994 } else
29392995 if (source == fourButton)
29402996 {
....@@ -2970,6 +3026,8 @@
29703026 bigThree.ClearUI();
29713027 bigThree.add(scenePanel);
29723028 bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
29733031 } else
29743032 if (source == sixButton)
29753033 {
....@@ -3006,6 +3064,8 @@
30063064 bigThree.add(scenePanel);
30073065 bigThree.add(centralPanel);
30083066 bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
30093069 } else
30103070 if (source == sevenButton)
30113071 {
....@@ -3043,6 +3103,8 @@
30433103 bigThree.add(centralPanel);
30443104 bigThree.add(XYZPanel);
30453105 bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
30463108 } else
30473109 if (source == rootButton)
30483110 {
....@@ -3054,6 +3116,7 @@
30543116 EditObject(obj);
30553117 }
30563118
3119
+ cameraView.requestFocusInWindow();
30573120 refreshContents(true);
30583121 } else
30593122 if (source == closeButton)
....@@ -3075,6 +3138,8 @@
30753138 break;
30763139 }
30773140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
30783143 refreshContents(true);
30793144 } else
30803145 if (source == editItem || source == editButton)
....@@ -3179,7 +3244,7 @@
31793244 }
31803245
31813246 // fix "+" issue
3182
- group.editWindow = this;
3247
+ //group.editWindow = this;
31833248
31843249 /*
31853250 currentLayout = radio.layout;
....@@ -3192,6 +3257,8 @@
31923257 //group.parent = null; // ROOT
31933258 //group.attributes = -1;
31943259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
31953262 refreshContents(true);
31963263 } else if (event.getSource() == editCameraItem)
31973264 {
....@@ -3215,7 +3282,6 @@
32153282 }
32163283
32173284 boolean useclient = false;
3218
- cRadio radio;
32193285
32203286 void ToggleRoot()
32213287 {
....@@ -5219,9 +5285,12 @@
52195285 cButton clearpanelButton;
52205286 cButton unselectButton;
52215287
5222
- cButton saveButton;
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
52235291 cButton undoButton;
52245292 cButton redoButton;
5293
+ cButton saveButton;
52255294 cButton oneStepButton;
52265295
52275296 cButton screenfitButton;
....@@ -5234,14 +5303,6 @@
52345303 cButton closeButton;
52355304
52365305 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;
52455306
52465307 //
52475308 //Composite