.. | .. |
---|
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"); |
---|
.. | .. |
---|
871 | 905 | } else if(e.getSource() == liveCB) |
---|
872 | 906 | { |
---|
873 | 907 | cameraView.ToggleLive(); |
---|
| 908 | + refreshContents(false); |
---|
874 | 909 | } |
---|
875 | 910 | else if(e.getSource() == supportCB) |
---|
876 | 911 | { |
---|
.. | .. |
---|
1278 | 1313 | memoryItem.addActionListener(this); |
---|
1279 | 1314 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1280 | 1315 | analyzeItem.addActionListener(this); |
---|
1281 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1316 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1282 | 1317 | dumpItem.addActionListener(this); |
---|
1283 | 1318 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1284 | 1319 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1969 | 2004 | { |
---|
1970 | 2005 | DumpObject(); |
---|
1971 | 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 |
---|
1972 | 2019 | if (source == undoButton) |
---|
1973 | 2020 | { |
---|
1974 | 2021 | Undo(); |
---|
.. | .. |
---|
2542 | 2589 | } else |
---|
2543 | 2590 | if (source == genNormalsMESHItem) |
---|
2544 | 2591 | { |
---|
2545 | | - GenNormals(true); // TODO |
---|
| 2592 | + GenNormalsMESH(); |
---|
2546 | 2593 | } else |
---|
2547 | 2594 | if (source == genNormalsORGANItem) |
---|
2548 | 2595 | { |
---|
.. | .. |
---|
2607 | 2654 | if (source == unmarkleavesItem) |
---|
2608 | 2655 | { |
---|
2609 | 2656 | MarkLeaves(false); |
---|
| 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); |
---|
2610 | 2673 | } else |
---|
2611 | 2674 | if (source == flipVItem) |
---|
2612 | 2675 | { |
---|
.. | .. |
---|
2874 | 2937 | bigThree.ClearUI(); |
---|
2875 | 2938 | bigThree.add(centralPanel); |
---|
2876 | 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 | + |
---|
2877 | 2958 | } else |
---|
2878 | 2959 | if (source == threeButton) |
---|
2879 | 2960 | { |
---|
.. | .. |
---|
2910 | 2991 | bigThree.add(centralPanel); |
---|
2911 | 2992 | bigThree.add(XYZPanel); |
---|
2912 | 2993 | bigThree.FlushUI(); |
---|
| 2994 | + |
---|
| 2995 | + cameraView.requestFocusInWindow(); |
---|
2913 | 2996 | } else |
---|
2914 | 2997 | if (source == fourButton) |
---|
2915 | 2998 | { |
---|
.. | .. |
---|
2945 | 3028 | bigThree.ClearUI(); |
---|
2946 | 3029 | bigThree.add(scenePanel); |
---|
2947 | 3030 | bigThree.FlushUI(); |
---|
| 3031 | + |
---|
| 3032 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3033 | } else |
---|
2949 | 3034 | if (source == sixButton) |
---|
2950 | 3035 | { |
---|
.. | .. |
---|
2981 | 3066 | bigThree.add(scenePanel); |
---|
2982 | 3067 | bigThree.add(centralPanel); |
---|
2983 | 3068 | bigThree.FlushUI(); |
---|
| 3069 | + |
---|
| 3070 | + cameraView.requestFocusInWindow(); |
---|
2984 | 3071 | } else |
---|
2985 | 3072 | if (source == sevenButton) |
---|
2986 | 3073 | { |
---|
.. | .. |
---|
3018 | 3105 | bigThree.add(centralPanel); |
---|
3019 | 3106 | bigThree.add(XYZPanel); |
---|
3020 | 3107 | bigThree.FlushUI(); |
---|
| 3108 | + |
---|
| 3109 | + cameraView.requestFocusInWindow(); |
---|
3021 | 3110 | } else |
---|
3022 | 3111 | if (source == rootButton) |
---|
3023 | 3112 | { |
---|
.. | .. |
---|
3029 | 3118 | EditObject(obj); |
---|
3030 | 3119 | } |
---|
3031 | 3120 | |
---|
| 3121 | + cameraView.requestFocusInWindow(); |
---|
3032 | 3122 | refreshContents(true); |
---|
3033 | 3123 | } else |
---|
3034 | 3124 | if (source == closeButton) |
---|
.. | .. |
---|
3050 | 3140 | break; |
---|
3051 | 3141 | } |
---|
3052 | 3142 | } |
---|
| 3143 | + |
---|
| 3144 | + cameraView.requestFocusInWindow(); |
---|
3053 | 3145 | refreshContents(true); |
---|
3054 | 3146 | } else |
---|
3055 | 3147 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3154 | 3246 | } |
---|
3155 | 3247 | |
---|
3156 | 3248 | // fix "+" issue |
---|
3157 | | - group.editWindow = this; |
---|
| 3249 | + //group.editWindow = this; |
---|
3158 | 3250 | |
---|
3159 | 3251 | /* |
---|
3160 | 3252 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3167 | 3259 | //group.parent = null; // ROOT |
---|
3168 | 3260 | //group.attributes = -1; |
---|
3169 | 3261 | ResetModel(); |
---|
| 3262 | + |
---|
| 3263 | + cameraView.requestFocusInWindow(); |
---|
3170 | 3264 | refreshContents(true); |
---|
3171 | 3265 | } else if (event.getSource() == editCameraItem) |
---|
3172 | 3266 | { |
---|
.. | .. |
---|
3190 | 3284 | } |
---|
3191 | 3285 | |
---|
3192 | 3286 | boolean useclient = false; |
---|
3193 | | - cRadio radio; |
---|
3194 | 3287 | |
---|
3195 | 3288 | void ToggleRoot() |
---|
3196 | 3289 | { |
---|
.. | .. |
---|
3429 | 3522 | |
---|
3430 | 3523 | int size = obj.MemorySize(); |
---|
3431 | 3524 | |
---|
3432 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3525 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3526 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3433 | 3527 | } |
---|
3434 | 3528 | } |
---|
3435 | 3529 | catch (Exception e) |
---|
.. | .. |
---|
3510 | 3604 | void GenNormals(boolean crease) |
---|
3511 | 3605 | { |
---|
3512 | 3606 | group.GenNormalsS(crease); |
---|
| 3607 | + |
---|
| 3608 | + refreshContents(); |
---|
| 3609 | + } |
---|
| 3610 | + |
---|
| 3611 | + void GenNormalsMESH() |
---|
| 3612 | + { |
---|
| 3613 | + group.GenNormalsMeshS(); |
---|
3513 | 3614 | |
---|
3514 | 3615 | refreshContents(); |
---|
3515 | 3616 | } |
---|
.. | .. |
---|
4137 | 4238 | refreshContents(); |
---|
4138 | 4239 | } |
---|
4139 | 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 | + |
---|
4140 | 4253 | void SetTexRes(int tr) |
---|
4141 | 4254 | { |
---|
4142 | 4255 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4312 | 4425 | //case 702: // Event.LIST_DESELECT |
---|
4313 | 4426 | group.deselectAll(); |
---|
4314 | 4427 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4315 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4316 | 4428 | if (tps != null) |
---|
4317 | 4429 | { |
---|
4318 | 4430 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4321 | 4433 | |
---|
4322 | 4434 | //if (child.parent != null) |
---|
4323 | 4435 | //child.parent.addSelectee(child); |
---|
| 4436 | + objEditor.SetMaterial(child); |
---|
4324 | 4437 | group.addSelectee(child); |
---|
4325 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4326 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4327 | | - System.err.println("info : " + child.GetPath()); |
---|
4328 | 4438 | } |
---|
4329 | 4439 | } |
---|
4330 | 4440 | // else |
---|
.. | .. |
---|
4334 | 4444 | // System.err.println("info : " + group.GetPath()); |
---|
4335 | 4445 | // } |
---|
4336 | 4446 | |
---|
4337 | | - objEditor.SetText(); // jan 2014 |
---|
4338 | | - |
---|
4339 | 4447 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4340 | 4448 | CameraPane.flash = true; |
---|
4341 | 4449 | |
---|
.. | .. |
---|
4359 | 4467 | |
---|
4360 | 4468 | freezemodel = false; |
---|
4361 | 4469 | } |
---|
| 4470 | + |
---|
| 4471 | + void refreshContents(boolean cp) |
---|
| 4472 | + { |
---|
| 4473 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4474 | + { |
---|
| 4475 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4476 | + |
---|
| 4477 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4478 | + { |
---|
| 4479 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4480 | + |
---|
| 4481 | + objEditor.AddInfo(child, this, true); |
---|
| 4482 | + System.err.println("info : " + child.GetPath()); |
---|
| 4483 | + } |
---|
| 4484 | + |
---|
| 4485 | + objEditor.SetText(); // jan 2014 |
---|
| 4486 | + } |
---|
| 4487 | + |
---|
| 4488 | + super.refreshContents(cp); |
---|
| 4489 | + } |
---|
4362 | 4490 | |
---|
4363 | 4491 | void linkSomething(Object3D thing) |
---|
4364 | 4492 | { |
---|
.. | .. |
---|
5159 | 5287 | cButton clearpanelButton; |
---|
5160 | 5288 | cButton unselectButton; |
---|
5161 | 5289 | |
---|
5162 | | - cButton saveButton; |
---|
| 5290 | + cButton minButton; |
---|
| 5291 | + cButton maxButton; |
---|
| 5292 | + cButton fullButton; |
---|
5163 | 5293 | cButton undoButton; |
---|
5164 | 5294 | cButton redoButton; |
---|
| 5295 | + cButton saveButton; |
---|
5165 | 5296 | cButton oneStepButton; |
---|
5166 | 5297 | |
---|
5167 | 5298 | cButton screenfitButton; |
---|
.. | .. |
---|
5174 | 5305 | cButton closeButton; |
---|
5175 | 5306 | |
---|
5176 | 5307 | cButton setsupportButton; |
---|
5177 | | - |
---|
5178 | | - cButton twoButton; |
---|
5179 | | - cButton sixButton; |
---|
5180 | | - cButton threeButton; |
---|
5181 | | - cButton sevenButton; |
---|
5182 | | - cButton fourButton; // full panel |
---|
5183 | | - cButton oneButton; // full XYZ |
---|
5184 | | - //cButton currentLayout; |
---|
5185 | 5308 | |
---|
5186 | 5309 | // |
---|
5187 | 5310 | //Composite |
---|
.. | .. |
---|
5259 | 5382 | private MenuItem showleavesItem; |
---|
5260 | 5383 | private MenuItem markleavesItem; |
---|
5261 | 5384 | private MenuItem unmarkleavesItem; |
---|
| 5385 | + private MenuItem rewindleavesItem; |
---|
| 5386 | + private MenuItem unrewindleavesItem; |
---|
| 5387 | + private MenuItem randomleavesItem; |
---|
| 5388 | + private MenuItem unrandomleavesItem; |
---|
5262 | 5389 | |
---|
5263 | 5390 | private MenuItem flipVItem; |
---|
5264 | 5391 | private MenuItem unflipVItem; |
---|