.. | .. |
---|
246 | 246 | |
---|
247 | 247 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 248 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 249 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 250 | |
---|
251 | 251 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 252 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
470 | 470 | markleavesItem.addActionListener(this); |
---|
471 | 471 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
472 | 472 | 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); |
---|
473 | 481 | menu.add("-"); |
---|
474 | 482 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
475 | 483 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
527 | 535 | |
---|
528 | 536 | void SetupUI2(ObjEditor oe) |
---|
529 | 537 | { |
---|
| 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 | + |
---|
530 | 550 | //new Exception().printStackTrace(); |
---|
531 | 551 | |
---|
532 | 552 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
557 | 577 | */ |
---|
558 | 578 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
559 | 579 | |
---|
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); |
---|
561 | 593 | undoButton.setToolTipText("Undo changes"); |
---|
562 | 594 | undoButton.addActionListener(this); |
---|
563 | 595 | |
---|
564 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 597 | redoButton.setToolTipText("Redo changes"); |
---|
566 | 598 | redoButton.addActionListener(this); |
---|
567 | 599 | |
---|
568 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 601 | saveButton.setToolTipText("Save changes"); |
---|
570 | 602 | saveButton.addActionListener(this); |
---|
571 | 603 | |
---|
.. | .. |
---|
573 | 605 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 606 | liveCB.addItemListener(this); |
---|
575 | 607 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 609 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | 610 | oneStepButton.addActionListener(this); |
---|
579 | 611 | |
---|
.. | .. |
---|
581 | 613 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 614 | fastCB.addItemListener(this); |
---|
583 | 615 | |
---|
584 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 616 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
585 | 617 | trackCB.setToolTipText("Enable tracking"); |
---|
586 | 618 | trackCB.addItemListener(this); |
---|
587 | 619 | |
---|
.. | .. |
---|
809 | 841 | |
---|
810 | 842 | void SetupViews(ObjEditor oe) |
---|
811 | 843 | { |
---|
| 844 | + theFrame = this; |
---|
| 845 | + |
---|
812 | 846 | oe.SetupViews(); |
---|
813 | 847 | |
---|
814 | 848 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
1970 | 2004 | { |
---|
1971 | 2005 | DumpObject(); |
---|
1972 | 2006 | } 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 |
---|
1973 | 2019 | if (source == undoButton) |
---|
1974 | 2020 | { |
---|
1975 | 2021 | Undo(); |
---|
.. | .. |
---|
2609 | 2655 | { |
---|
2610 | 2656 | MarkLeaves(false); |
---|
2611 | 2657 | } 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 |
---|
2612 | 2674 | if (source == flipVItem) |
---|
2613 | 2675 | { |
---|
2614 | 2676 | FlipV(true); |
---|
.. | .. |
---|
2875 | 2937 | bigThree.ClearUI(); |
---|
2876 | 2938 | bigThree.add(centralPanel); |
---|
2877 | 2939 | 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 | + |
---|
2878 | 2958 | } else |
---|
2879 | 2959 | if (source == threeButton) |
---|
2880 | 2960 | { |
---|
.. | .. |
---|
2911 | 2991 | bigThree.add(centralPanel); |
---|
2912 | 2992 | bigThree.add(XYZPanel); |
---|
2913 | 2993 | bigThree.FlushUI(); |
---|
| 2994 | + |
---|
| 2995 | + cameraView.requestFocusInWindow(); |
---|
2914 | 2996 | } else |
---|
2915 | 2997 | if (source == fourButton) |
---|
2916 | 2998 | { |
---|
.. | .. |
---|
2946 | 3028 | bigThree.ClearUI(); |
---|
2947 | 3029 | bigThree.add(scenePanel); |
---|
2948 | 3030 | bigThree.FlushUI(); |
---|
| 3031 | + |
---|
| 3032 | + cameraView.requestFocusInWindow(); |
---|
2949 | 3033 | } else |
---|
2950 | 3034 | if (source == sixButton) |
---|
2951 | 3035 | { |
---|
.. | .. |
---|
2982 | 3066 | bigThree.add(scenePanel); |
---|
2983 | 3067 | bigThree.add(centralPanel); |
---|
2984 | 3068 | bigThree.FlushUI(); |
---|
| 3069 | + |
---|
| 3070 | + cameraView.requestFocusInWindow(); |
---|
2985 | 3071 | } else |
---|
2986 | 3072 | if (source == sevenButton) |
---|
2987 | 3073 | { |
---|
.. | .. |
---|
3019 | 3105 | bigThree.add(centralPanel); |
---|
3020 | 3106 | bigThree.add(XYZPanel); |
---|
3021 | 3107 | bigThree.FlushUI(); |
---|
| 3108 | + |
---|
| 3109 | + cameraView.requestFocusInWindow(); |
---|
3022 | 3110 | } else |
---|
3023 | 3111 | if (source == rootButton) |
---|
3024 | 3112 | { |
---|
.. | .. |
---|
3030 | 3118 | EditObject(obj); |
---|
3031 | 3119 | } |
---|
3032 | 3120 | |
---|
| 3121 | + cameraView.requestFocusInWindow(); |
---|
3033 | 3122 | refreshContents(true); |
---|
3034 | 3123 | } else |
---|
3035 | 3124 | if (source == closeButton) |
---|
.. | .. |
---|
3051 | 3140 | break; |
---|
3052 | 3141 | } |
---|
3053 | 3142 | } |
---|
| 3143 | + |
---|
| 3144 | + cameraView.requestFocusInWindow(); |
---|
3054 | 3145 | refreshContents(true); |
---|
3055 | 3146 | } else |
---|
3056 | 3147 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3155 | 3246 | } |
---|
3156 | 3247 | |
---|
3157 | 3248 | // fix "+" issue |
---|
3158 | | - group.editWindow = this; |
---|
| 3249 | + //group.editWindow = this; |
---|
3159 | 3250 | |
---|
3160 | 3251 | /* |
---|
3161 | 3252 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3168 | 3259 | //group.parent = null; // ROOT |
---|
3169 | 3260 | //group.attributes = -1; |
---|
3170 | 3261 | ResetModel(); |
---|
| 3262 | + |
---|
| 3263 | + cameraView.requestFocusInWindow(); |
---|
3171 | 3264 | refreshContents(true); |
---|
3172 | 3265 | } else if (event.getSource() == editCameraItem) |
---|
3173 | 3266 | { |
---|
.. | .. |
---|
3191 | 3284 | } |
---|
3192 | 3285 | |
---|
3193 | 3286 | boolean useclient = false; |
---|
3194 | | - cRadio radio; |
---|
3195 | 3287 | |
---|
3196 | 3288 | void ToggleRoot() |
---|
3197 | 3289 | { |
---|
.. | .. |
---|
4146 | 4238 | refreshContents(); |
---|
4147 | 4239 | } |
---|
4148 | 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); |
---|
| 4250 | + refreshContents(); |
---|
| 4251 | + } |
---|
| 4252 | + |
---|
4149 | 4253 | void SetTexRes(int tr) |
---|
4150 | 4254 | { |
---|
4151 | 4255 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4329 | 4433 | |
---|
4330 | 4434 | //if (child.parent != null) |
---|
4331 | 4435 | //child.parent.addSelectee(child); |
---|
| 4436 | + objEditor.SetMaterial(child); |
---|
4332 | 4437 | group.addSelectee(child); |
---|
4333 | 4438 | } |
---|
4334 | 4439 | } |
---|
.. | .. |
---|
4369 | 4474 | { |
---|
4370 | 4475 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4371 | 4476 | |
---|
4372 | | - for (int i=0; i < group.selection.size(); i++) |
---|
| 4477 | + for (int i=0; i < group.selection.Size(); i++) |
---|
4373 | 4478 | { |
---|
4374 | | - Object3D child = (Object3D) group.selection.reserve(i); |
---|
| 4479 | + Object3D child = (Object3D) group.selection.get(i); |
---|
4375 | 4480 | |
---|
4376 | | - objEditor.SetMaterial(child); |
---|
4377 | 4481 | objEditor.AddInfo(child, this, true); |
---|
4378 | 4482 | System.err.println("info : " + child.GetPath()); |
---|
4379 | | - |
---|
4380 | | - group.selection.release(i); |
---|
4381 | 4483 | } |
---|
4382 | 4484 | |
---|
4383 | 4485 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5185 | 5287 | cButton clearpanelButton; |
---|
5186 | 5288 | cButton unselectButton; |
---|
5187 | 5289 | |
---|
5188 | | - cButton saveButton; |
---|
| 5290 | + cButton minButton; |
---|
| 5291 | + cButton maxButton; |
---|
| 5292 | + cButton fullButton; |
---|
5189 | 5293 | cButton undoButton; |
---|
5190 | 5294 | cButton redoButton; |
---|
| 5295 | + cButton saveButton; |
---|
5191 | 5296 | cButton oneStepButton; |
---|
5192 | 5297 | |
---|
5193 | 5298 | cButton screenfitButton; |
---|
.. | .. |
---|
5200 | 5305 | cButton closeButton; |
---|
5201 | 5306 | |
---|
5202 | 5307 | 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; |
---|
5211 | 5308 | |
---|
5212 | 5309 | // |
---|
5213 | 5310 | //Composite |
---|
.. | .. |
---|
5285 | 5382 | private MenuItem showleavesItem; |
---|
5286 | 5383 | private MenuItem markleavesItem; |
---|
5287 | 5384 | private MenuItem unmarkleavesItem; |
---|
| 5385 | + private MenuItem rewindleavesItem; |
---|
| 5386 | + private MenuItem unrewindleavesItem; |
---|
| 5387 | + private MenuItem randomleavesItem; |
---|
| 5388 | + private MenuItem unrandomleavesItem; |
---|
5288 | 5389 | |
---|
5289 | 5390 | private MenuItem flipVItem; |
---|
5290 | 5391 | private MenuItem unflipVItem; |
---|