.. | .. |
---|
176 | 176 | copyItem.addActionListener(this); |
---|
177 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 178 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 179 | |
---|
181 | 180 | menu.add("-"); |
---|
182 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
246 | 245 | |
---|
247 | 246 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 247 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 249 | |
---|
251 | 250 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 251 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
369 | 368 | billboardItem.addActionListener(this); |
---|
370 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 370 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 372 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 374 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 376 | shadowZItem.addActionListener(this); |
---|
378 | 377 | if (Globals.ADVANCED) |
---|
379 | 378 | { |
---|
.. | .. |
---|
535 | 534 | |
---|
536 | 535 | void SetupUI2(ObjEditor oe) |
---|
537 | 536 | { |
---|
| 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 | + |
---|
538 | 549 | //new Exception().printStackTrace(); |
---|
539 | 550 | |
---|
540 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
565 | 576 | */ |
---|
566 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
567 | 578 | |
---|
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); |
---|
569 | 592 | undoButton.setToolTipText("Undo changes"); |
---|
570 | 593 | undoButton.addActionListener(this); |
---|
571 | 594 | |
---|
572 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 596 | redoButton.setToolTipText("Redo changes"); |
---|
574 | 597 | redoButton.addActionListener(this); |
---|
575 | 598 | |
---|
576 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 600 | saveButton.setToolTipText("Save changes"); |
---|
578 | 601 | saveButton.addActionListener(this); |
---|
579 | 602 | |
---|
.. | .. |
---|
581 | 604 | liveCB.setToolTipText("Enable animation"); |
---|
582 | 605 | liveCB.addItemListener(this); |
---|
583 | 606 | |
---|
584 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | 608 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
586 | 609 | oneStepButton.addActionListener(this); |
---|
587 | 610 | |
---|
.. | .. |
---|
589 | 612 | fastCB.setToolTipText("Fast mode"); |
---|
590 | 613 | fastCB.addItemListener(this); |
---|
591 | 614 | |
---|
592 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
593 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
594 | 617 | trackCB.addItemListener(this); |
---|
595 | 618 | |
---|
.. | .. |
---|
613 | 636 | |
---|
614 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
615 | 638 | |
---|
616 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
618 | 641 | 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); |
---|
620 | 643 | fourButton.addActionListener(this); |
---|
621 | 644 | 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); |
---|
623 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
624 | 647 | 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); |
---|
626 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
627 | 650 | 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); |
---|
629 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
630 | 653 | sevenButton.addActionListener(this); |
---|
631 | 654 | // |
---|
.. | .. |
---|
640 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
641 | 664 | //clearButton.addActionListener(this); |
---|
642 | 665 | |
---|
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); |
---|
646 | 667 | editButton.setToolTipText("Edit selection"); |
---|
647 | 668 | editButton.addActionListener(this); |
---|
648 | 669 | |
---|
649 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
651 | 672 | uneditButton.addActionListener(this); |
---|
652 | 673 | |
---|
653 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
654 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
655 | 676 | allParamsButton.addActionListener(this); |
---|
656 | 677 | |
---|
657 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
658 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
659 | 680 | clearPanelButton.addActionListener(this); |
---|
660 | 681 | |
---|
661 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
663 | 684 | unselectButton.addActionListener(this); |
---|
664 | 685 | |
---|
665 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
666 | 687 | |
---|
667 | | - oe.treePanel.add(commandsPanel); |
---|
668 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
669 | 690 | |
---|
670 | 691 | // oe.aConstraints.gridx += 1; |
---|
671 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
817 | 838 | |
---|
818 | 839 | void SetupViews(ObjEditor oe) |
---|
819 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
820 | 843 | oe.SetupViews(); |
---|
821 | 844 | |
---|
822 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
1428 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1429 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1430 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1431 | 1455 | |
---|
1432 | 1456 | makeSomething(shadow); |
---|
1433 | 1457 | } |
---|
.. | .. |
---|
1977 | 2001 | if (source == dumpItem) |
---|
1978 | 2002 | { |
---|
1979 | 2003 | 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(); |
---|
1980 | 2016 | } else |
---|
1981 | 2017 | if (source == undoButton) |
---|
1982 | 2018 | { |
---|
.. | .. |
---|
2899 | 2935 | bigThree.ClearUI(); |
---|
2900 | 2936 | bigThree.add(centralPanel); |
---|
2901 | 2937 | 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 | + |
---|
2902 | 2956 | } else |
---|
2903 | 2957 | if (source == threeButton) |
---|
2904 | 2958 | { |
---|
.. | .. |
---|
2935 | 2989 | bigThree.add(centralPanel); |
---|
2936 | 2990 | bigThree.add(XYZPanel); |
---|
2937 | 2991 | bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2938 | 2994 | } else |
---|
2939 | 2995 | if (source == fourButton) |
---|
2940 | 2996 | { |
---|
.. | .. |
---|
2970 | 3026 | bigThree.ClearUI(); |
---|
2971 | 3027 | bigThree.add(scenePanel); |
---|
2972 | 3028 | bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2973 | 3031 | } else |
---|
2974 | 3032 | if (source == sixButton) |
---|
2975 | 3033 | { |
---|
.. | .. |
---|
3006 | 3064 | bigThree.add(scenePanel); |
---|
3007 | 3065 | bigThree.add(centralPanel); |
---|
3008 | 3066 | bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
3009 | 3069 | } else |
---|
3010 | 3070 | if (source == sevenButton) |
---|
3011 | 3071 | { |
---|
.. | .. |
---|
3043 | 3103 | bigThree.add(centralPanel); |
---|
3044 | 3104 | bigThree.add(XYZPanel); |
---|
3045 | 3105 | bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
3046 | 3108 | } else |
---|
3047 | 3109 | if (source == rootButton) |
---|
3048 | 3110 | { |
---|
.. | .. |
---|
3054 | 3116 | EditObject(obj); |
---|
3055 | 3117 | } |
---|
3056 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
3057 | 3120 | refreshContents(true); |
---|
3058 | 3121 | } else |
---|
3059 | 3122 | if (source == closeButton) |
---|
.. | .. |
---|
3075 | 3138 | break; |
---|
3076 | 3139 | } |
---|
3077 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
3078 | 3143 | refreshContents(true); |
---|
3079 | 3144 | } else |
---|
3080 | 3145 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3179 | 3244 | } |
---|
3180 | 3245 | |
---|
3181 | 3246 | // fix "+" issue |
---|
3182 | | - group.editWindow = this; |
---|
| 3247 | + //group.editWindow = this; |
---|
3183 | 3248 | |
---|
3184 | 3249 | /* |
---|
3185 | 3250 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3192 | 3257 | //group.parent = null; // ROOT |
---|
3193 | 3258 | //group.attributes = -1; |
---|
3194 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
3195 | 3262 | refreshContents(true); |
---|
3196 | 3263 | } else if (event.getSource() == editCameraItem) |
---|
3197 | 3264 | { |
---|
.. | .. |
---|
3215 | 3282 | } |
---|
3216 | 3283 | |
---|
3217 | 3284 | boolean useclient = false; |
---|
3218 | | - cRadio radio; |
---|
3219 | 3285 | |
---|
3220 | 3286 | void ToggleRoot() |
---|
3221 | 3287 | { |
---|
.. | .. |
---|
5219 | 5285 | cButton clearpanelButton; |
---|
5220 | 5286 | cButton unselectButton; |
---|
5221 | 5287 | |
---|
5222 | | - cButton saveButton; |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
5223 | 5291 | cButton undoButton; |
---|
5224 | 5292 | cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
5225 | 5294 | cButton oneStepButton; |
---|
5226 | 5295 | |
---|
5227 | 5296 | cButton screenfitButton; |
---|
.. | .. |
---|
5234 | 5303 | cButton closeButton; |
---|
5235 | 5304 | |
---|
5236 | 5305 | 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; |
---|
5245 | 5306 | |
---|
5246 | 5307 | // |
---|
5247 | 5308 | //Composite |
---|