.. | .. |
---|
150 | 150 | |
---|
151 | 151 | void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
153 | 155 | Menu menu; |
---|
154 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 158 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
162 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
163 | 166 | duplicateItem.addActionListener(this); |
---|
164 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
165 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
175 | 178 | copyItem.addActionListener(this); |
---|
176 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 180 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 181 | |
---|
180 | 182 | menu.add("-"); |
---|
181 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
202 | 204 | //zBufferItem.addActionListener(this); |
---|
203 | 205 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 206 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
| 207 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | 208 | revertCameraItem.addActionListener(this); |
---|
207 | 209 | |
---|
208 | 210 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
.. | .. |
---|
245 | 247 | |
---|
246 | 248 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 249 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 251 | |
---|
250 | 252 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 253 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 268 | // animationItem.addItemListener(this); |
---|
267 | 269 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 270 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 272 | editCameraItem.addActionListener(this); |
---|
271 | 273 | |
---|
272 | 274 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
334 | 336 | frontItem.addActionListener(this); |
---|
335 | 337 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | 338 | compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
337 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
339 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 346 | ungroupItem.addActionListener(this); |
---|
| 347 | + |
---|
341 | 348 | menu.add("-"); |
---|
| 349 | + |
---|
342 | 350 | randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | 351 | randomItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
344 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 355 | switchGeoItem.addActionListener(this); |
---|
346 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 359 | morphItem.addActionListener(this); |
---|
350 | 360 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 361 | menu.add("-"); |
---|
354 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
368 | 376 | billboardItem.addActionListener(this); |
---|
369 | 377 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 378 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 379 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 380 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 381 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 382 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 383 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 384 | shadowZItem.addActionListener(this); |
---|
377 | 385 | if (Globals.ADVANCED) |
---|
378 | 386 | { |
---|
.. | .. |
---|
469 | 477 | markleavesItem.addActionListener(this); |
---|
470 | 478 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 479 | unmarkleavesItem.addActionListener(this); |
---|
| 480 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 481 | + rewindleavesItem.addActionListener(this); |
---|
| 482 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 483 | + unrewindleavesItem.addActionListener(this); |
---|
| 484 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 485 | + randomleavesItem.addActionListener(this); |
---|
| 486 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 487 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 488 | menu.add("-"); |
---|
473 | 489 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 490 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
526 | 542 | |
---|
527 | 543 | void SetupUI2(ObjEditor oe) |
---|
528 | 544 | { |
---|
| 545 | + // June 2019 |
---|
| 546 | + if (oe == null) |
---|
| 547 | + { |
---|
| 548 | + //super.SetupUI2(this); |
---|
| 549 | + //return; |
---|
| 550 | + } |
---|
| 551 | + |
---|
| 552 | + if (copy != group) |
---|
| 553 | + { |
---|
| 554 | + //super.SetupUI2(this); |
---|
| 555 | + } |
---|
| 556 | + |
---|
529 | 557 | //new Exception().printStackTrace(); |
---|
530 | 558 | |
---|
531 | 559 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
556 | 584 | */ |
---|
557 | 585 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 586 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 587 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + //minButton.setToolTipText("Minimize window"); |
---|
| 589 | + //minButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + maxButton.setToolTipText("Maximize window"); |
---|
| 593 | + maxButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 597 | + fullButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + undoButton.setToolTipText("Undo changes"); |
---|
| 601 | + undoButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + redoButton.setToolTipText("Redo changes"); |
---|
| 605 | + redoButton.addActionListener(this); |
---|
| 606 | + |
---|
| 607 | + oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + saveButton.setToolTipText("Save changes"); |
---|
| 609 | + saveButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 612 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 613 | liveCB.addItemListener(this); |
---|
562 | 614 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 616 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 617 | oneStepButton.addActionListener(this); |
---|
566 | 618 | |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 619 | + oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 620 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 621 | fastCB.addItemListener(this); |
---|
570 | 622 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | 626 | trackCB.setToolTipText("Enable tracking"); |
---|
573 | 627 | trackCB.addItemListener(this); |
---|
574 | 628 | |
---|
575 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
576 | 630 | screenfitButton.setToolTipText("Screen fit"); |
---|
577 | 631 | screenfitButton.addActionListener(this); |
---|
578 | 632 | |
---|
.. | .. |
---|
586 | 640 | snapobjectButton.setToolTipText("Snap Object"); |
---|
587 | 641 | } |
---|
588 | 642 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 643 | + oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
591 | 645 | flashSelectionButton.addActionListener(this); |
---|
592 | 646 | |
---|
593 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
594 | 648 | |
---|
595 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 650 | twoButton.setToolTipText("Show center view only"); |
---|
597 | 651 | twoButton.addActionListener(this); |
---|
598 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
599 | 655 | fourButton.addActionListener(this); |
---|
600 | 656 | fourButton.setToolTipText("Show left panel only"); |
---|
601 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 658 | sixButton.setToolTipText("2-column layout left"); |
---|
603 | 659 | sixButton.addActionListener(this); |
---|
604 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | 661 | threeButton.setToolTipText("2-column layout right"); |
---|
606 | 662 | threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 664 | sevenButton.setToolTipText("3-column layout"); |
---|
609 | 665 | sevenButton.addActionListener(this); |
---|
610 | 666 | // |
---|
611 | 667 | |
---|
612 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
613 | 669 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
614 | 670 | rootButton.addActionListener(this); |
---|
615 | 671 | |
---|
616 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 673 | closeButton.setToolTipText("Close tab"); |
---|
618 | 674 | closeButton.addActionListener(this); |
---|
619 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 676 | //clearButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 677 | + |
---|
| 678 | + // INSERT |
---|
| 679 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + gridButton.setToolTipText("Create grid"); |
---|
| 681 | + gridButton.addActionListener(this); |
---|
| 682 | + |
---|
| 683 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + boxButton.setToolTipText("Create box"); |
---|
| 685 | + boxButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 689 | + sphereButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.Return(); |
---|
623 | 692 | |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 717 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 718 | + overlayButton.addActionListener(this); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + lightButton.setToolTipText("Create light"); |
---|
| 722 | + lightButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + // EDIT panel |
---|
| 725 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | 726 | editButton.setToolTipText("Edit selection"); |
---|
626 | 727 | editButton.addActionListener(this); |
---|
627 | 728 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 729 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 730 | uneditButton.setToolTipText("Unedit selection"); |
---|
630 | 731 | uneditButton.addActionListener(this); |
---|
631 | 732 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | 734 | allParamsButton.setToolTipText("Edit all params"); |
---|
634 | 735 | allParamsButton.addActionListener(this); |
---|
635 | 736 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 737 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 738 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 739 | clearPanelButton.addActionListener(this); |
---|
639 | 740 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 742 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 743 | unselectButton.addActionListener(this); |
---|
643 | 744 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
645 | 746 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
648 | 749 | |
---|
649 | 750 | // oe.aConstraints.gridx += 1; |
---|
650 | 751 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
661 | 762 | |
---|
662 | 763 | JScrollPane jSP; |
---|
663 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
664 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
665 | 766 | ResetModel(); |
---|
666 | 767 | |
---|
667 | 768 | oe.treePanel.add(jSPPanel); |
---|
.. | .. |
---|
766 | 867 | // debugCB.addItemListener(this); |
---|
767 | 868 | |
---|
768 | 869 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
769 | 871 | oeilCB.addItemListener(this); |
---|
770 | 872 | |
---|
| 873 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 874 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 875 | + shadowCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 878 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 879 | + autosaveCB.addItemListener(this); |
---|
| 880 | + |
---|
| 881 | + if (Globals.ADVANCED) |
---|
| 882 | + { |
---|
771 | 883 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 884 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 885 | lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
774 | 887 | |
---|
775 | 888 | } |
---|
776 | 889 | |
---|
.. | .. |
---|
785 | 898 | void EditObject(Object3D obj) |
---|
786 | 899 | { |
---|
787 | 900 | cRadio radioButton = new cRadio(obj.name); |
---|
| 901 | + |
---|
| 902 | + // Patch to avoid bug with transparency. |
---|
| 903 | + radioButton.hadMaterial = obj.material != null; |
---|
| 904 | + if (!radioButton.hadMaterial) |
---|
| 905 | + { |
---|
| 906 | + obj.material = new cMaterial(); |
---|
| 907 | + } |
---|
| 908 | + |
---|
788 | 909 | radioButton.SetObject(obj); |
---|
789 | 910 | radioButton.layout = sevenButton; |
---|
790 | 911 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
796 | 917 | |
---|
797 | 918 | void SetupViews(ObjEditor oe) |
---|
798 | 919 | { |
---|
| 920 | + theFrame = this; |
---|
| 921 | + |
---|
799 | 922 | oe.SetupViews(); |
---|
800 | 923 | |
---|
801 | 924 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 928 | } |
---|
806 | 929 | |
---|
807 | | - JCheckBox liveCB; |
---|
808 | | - JCheckBox supportCB; |
---|
809 | | - JCheckBox localCB; |
---|
810 | | - JCheckBox crowdCB; |
---|
811 | | - JCheckBox smoothCB; |
---|
812 | | - JCheckBox fastCB; |
---|
813 | | - JCheckBox slowCB; |
---|
814 | | - JCheckBox boxCB; |
---|
815 | | - JCheckBox zoomBoxCB; |
---|
816 | | - JCheckBox trackCB; |
---|
817 | | - JCheckBox smoothfocusCB; |
---|
| 930 | + cToggleButton liveCB; |
---|
| 931 | + cCheckBox supportCB; |
---|
| 932 | + cCheckBox localCB; |
---|
| 933 | + cCheckBox crowdCB; |
---|
| 934 | + cCheckBox smoothCB; |
---|
| 935 | + cToggleButton fastCB; |
---|
| 936 | + cCheckBox slowCB; |
---|
| 937 | + cCheckBox boxCB; |
---|
| 938 | + cCheckBox zoomBoxCB; |
---|
| 939 | + cToggleButton trackCB; |
---|
| 940 | + cCheckBox smoothfocusCB; |
---|
818 | 941 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
824 | 950 | |
---|
825 | 951 | // static int COLOR = 1; |
---|
826 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 954 | |
---|
829 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 956 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
834 | 960 | |
---|
835 | 961 | public void itemStateChanged(ItemEvent e) |
---|
836 | 962 | { |
---|
.. | .. |
---|
858 | 984 | } else if(e.getSource() == liveCB) |
---|
859 | 985 | { |
---|
860 | 986 | cameraView.ToggleLive(); |
---|
| 987 | + refreshContents(false); |
---|
861 | 988 | } |
---|
862 | 989 | else if(e.getSource() == supportCB) |
---|
863 | 990 | { |
---|
.. | .. |
---|
922 | 1049 | { |
---|
923 | 1050 | cameraView.ToggleOeil(); |
---|
924 | 1051 | } |
---|
| 1052 | + else if(e.getSource() == shadowCB) |
---|
| 1053 | + { |
---|
| 1054 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1055 | + } |
---|
| 1056 | + else if(e.getSource() == autosaveCB) |
---|
| 1057 | + { |
---|
| 1058 | + Globals.SAVEONMAKE ^= true; |
---|
| 1059 | + } |
---|
925 | 1060 | else if(e.getSource() == lookAtCB) |
---|
926 | 1061 | { |
---|
927 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
938 | 1073 | |
---|
939 | 1074 | /**/ |
---|
940 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
941 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
942 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
943 | 1079 | // We can't move the root node or an empty selection |
---|
944 | 1080 | return; |
---|
.. | .. |
---|
1062 | 1198 | return; |
---|
1063 | 1199 | } |
---|
1064 | 1200 | |
---|
1065 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
1066 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
1067 | 1203 | loadClipboard(true); |
---|
1068 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1069 | 1205 | pasteInto(false, false); |
---|
1070 | | - } else { |
---|
1071 | | - loadClipboard(false); |
---|
1072 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1073 | | - pasteInto(false, false); // true); // ??? |
---|
1074 | | - } |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
1075 | 1211 | } |
---|
1076 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1077 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1265 | 1401 | memoryItem.addActionListener(this); |
---|
1266 | 1402 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1403 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1404 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1405 | dumpItem.addActionListener(this); |
---|
1270 | 1406 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1407 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1546 | |
---|
1410 | 1547 | makeSomething(shadow); |
---|
1411 | 1548 | } |
---|
.. | .. |
---|
1662 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1663 | 1800 | objEditor.cameraView.repaint(); |
---|
1664 | 1801 | } else |
---|
1665 | | - if (source == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1666 | 1803 | { |
---|
1667 | 1804 | makeSomething(new Box()); |
---|
1668 | 1805 | } else |
---|
1669 | | - if (source == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1670 | 1807 | { |
---|
1671 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1672 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1745 | 1882 | |
---|
1746 | 1883 | makeSomething(obj); |
---|
1747 | 1884 | } else |
---|
1748 | | - if (source == gridItem) |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1749 | 1886 | { |
---|
1750 | 1887 | makeSomething(new Grid()); |
---|
1751 | 1888 | } else |
---|
1752 | | - if (source == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1753 | 1890 | { |
---|
1754 | 1891 | makeSomething(new Sphere()); |
---|
1755 | 1892 | } else |
---|
1756 | | - if (source == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1757 | 1894 | { |
---|
1758 | 1895 | makeSomething(new Cone()); |
---|
1759 | 1896 | } else |
---|
1760 | | - if (source == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1761 | 1898 | { |
---|
1762 | 1899 | makeSomething(new Torus()); |
---|
1763 | 1900 | } else |
---|
1764 | | - if (source == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1765 | 1902 | { |
---|
1766 | 1903 | makeSomething(new Superellipsoid()); |
---|
1767 | 1904 | } else |
---|
1768 | | - if (source == kleinItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
1769 | 1906 | { |
---|
1770 | 1907 | makeSomething(new Klein()); |
---|
1771 | 1908 | } else |
---|
.. | .. |
---|
1785 | 1922 | { |
---|
1786 | 1923 | makeSomething(new BezierSurface()); |
---|
1787 | 1924 | } else |
---|
1788 | | - if (source == overlayItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1789 | 1926 | { |
---|
1790 | 1927 | /* |
---|
1791 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1833 | 1970 | s.setup(); |
---|
1834 | 1971 | makeSomething(s); |
---|
1835 | 1972 | } else |
---|
1836 | | - if (source == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1837 | 1974 | { |
---|
1838 | 1975 | makeSomething(new Light()); |
---|
1839 | 1976 | } else |
---|
.. | .. |
---|
1955 | 2092 | if (source == dumpItem) |
---|
1956 | 2093 | { |
---|
1957 | 2094 | DumpObject(); |
---|
| 2095 | + } else |
---|
| 2096 | + if (source == minButton) |
---|
| 2097 | + { |
---|
| 2098 | + Minimize(); |
---|
| 2099 | + } else |
---|
| 2100 | + if (source == maxButton) |
---|
| 2101 | + { |
---|
| 2102 | + Maximize(); |
---|
| 2103 | + } else |
---|
| 2104 | + if (source == fullButton) |
---|
| 2105 | + { |
---|
| 2106 | + ToggleFullScreen(); |
---|
| 2107 | + } else |
---|
| 2108 | + if (source == undoButton) |
---|
| 2109 | + { |
---|
| 2110 | + Undo(); |
---|
| 2111 | + } else |
---|
| 2112 | + if (source == redoButton) |
---|
| 2113 | + { |
---|
| 2114 | + Redo(); |
---|
| 2115 | + } else |
---|
| 2116 | + if (source == saveButton) |
---|
| 2117 | + { |
---|
| 2118 | + Save(); |
---|
1958 | 2119 | } else |
---|
1959 | 2120 | if (source == oneStepButton) |
---|
1960 | 2121 | { |
---|
.. | .. |
---|
2495 | 2656 | { |
---|
2496 | 2657 | CastShadow(2); |
---|
2497 | 2658 | } else |
---|
2498 | | - if (source == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2499 | 2660 | { |
---|
2500 | 2661 | //ungroup(); |
---|
2501 | 2662 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2517 | 2678 | } else |
---|
2518 | 2679 | if (source == genNormalsMESHItem) |
---|
2519 | 2680 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2681 | + GenNormalsMESH(); |
---|
2521 | 2682 | } else |
---|
2522 | 2683 | if (source == genNormalsORGANItem) |
---|
2523 | 2684 | { |
---|
.. | .. |
---|
2582 | 2743 | if (source == unmarkleavesItem) |
---|
2583 | 2744 | { |
---|
2584 | 2745 | MarkLeaves(false); |
---|
| 2746 | + } else |
---|
| 2747 | + if (source == rewindleavesItem) |
---|
| 2748 | + { |
---|
| 2749 | + RewindLeaves(true); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == unrewindleavesItem) |
---|
| 2752 | + { |
---|
| 2753 | + RewindLeaves(false); |
---|
| 2754 | + } else |
---|
| 2755 | + if (source == randomleavesItem) |
---|
| 2756 | + { |
---|
| 2757 | + RandomLeaves(true); |
---|
| 2758 | + } else |
---|
| 2759 | + if (source == unrandomleavesItem) |
---|
| 2760 | + { |
---|
| 2761 | + RandomLeaves(false); |
---|
2585 | 2762 | } else |
---|
2586 | 2763 | if (source == flipVItem) |
---|
2587 | 2764 | { |
---|
.. | .. |
---|
2817 | 2994 | if (source == twoButton) |
---|
2818 | 2995 | { |
---|
2819 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2820 | 3001 | // bug |
---|
2821 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2822 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2849 | 3030 | bigThree.ClearUI(); |
---|
2850 | 3031 | bigThree.add(centralPanel); |
---|
2851 | 3032 | bigThree.FlushUI(); |
---|
| 3033 | + |
---|
| 3034 | + cameraView.requestFocusInWindow(); |
---|
| 3035 | + |
---|
| 3036 | +// refreshContents(true); |
---|
| 3037 | +// |
---|
| 3038 | +// try |
---|
| 3039 | +// { |
---|
| 3040 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3041 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3042 | +// bot.mouseMove(100, 100); |
---|
| 3043 | +// bot.mousePress(mask); |
---|
| 3044 | +// bot.mouseRelease(mask); |
---|
| 3045 | +// } |
---|
| 3046 | +// catch (Exception e) |
---|
| 3047 | +// { |
---|
| 3048 | +// |
---|
| 3049 | +// } |
---|
| 3050 | + |
---|
2852 | 3051 | } else |
---|
2853 | 3052 | if (source == threeButton) |
---|
2854 | 3053 | { |
---|
2855 | 3054 | radio.layout = threeButton; |
---|
| 3055 | + |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
2856 | 3058 | |
---|
2857 | 3059 | // bigThree.remove(scenePanel); |
---|
2858 | 3060 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2885 | 3087 | bigThree.add(centralPanel); |
---|
2886 | 3088 | bigThree.add(XYZPanel); |
---|
2887 | 3089 | bigThree.FlushUI(); |
---|
| 3090 | + |
---|
| 3091 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3092 | } else |
---|
2889 | 3093 | if (source == fourButton) |
---|
2890 | 3094 | { |
---|
2891 | 3095 | radio.layout = fourButton; |
---|
| 3096 | + |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
2892 | 3099 | |
---|
2893 | 3100 | // bigThree.remove(scenePanel); |
---|
2894 | 3101 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2920 | 3127 | bigThree.ClearUI(); |
---|
2921 | 3128 | bigThree.add(scenePanel); |
---|
2922 | 3129 | bigThree.FlushUI(); |
---|
| 3130 | + |
---|
| 3131 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3132 | } else |
---|
2924 | 3133 | if (source == sixButton) |
---|
2925 | 3134 | { |
---|
2926 | 3135 | radio.layout = sixButton; |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
2927 | 3139 | |
---|
2928 | 3140 | // bigThree.remove(scenePanel); |
---|
2929 | 3141 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2956 | 3168 | bigThree.add(scenePanel); |
---|
2957 | 3169 | bigThree.add(centralPanel); |
---|
2958 | 3170 | bigThree.FlushUI(); |
---|
| 3171 | + |
---|
| 3172 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3173 | } else |
---|
2960 | 3174 | if (source == sevenButton) |
---|
2961 | 3175 | { |
---|
2962 | 3176 | radio.layout = sevenButton; |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
2963 | 3180 | |
---|
2964 | 3181 | // bigThree.remove(scenePanel); |
---|
2965 | 3182 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2993 | 3210 | bigThree.add(centralPanel); |
---|
2994 | 3211 | bigThree.add(XYZPanel); |
---|
2995 | 3212 | bigThree.FlushUI(); |
---|
| 3213 | + |
---|
| 3214 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3215 | } else |
---|
2997 | 3216 | if (source == rootButton) |
---|
2998 | 3217 | { |
---|
.. | .. |
---|
3004 | 3223 | EditObject(obj); |
---|
3005 | 3224 | } |
---|
3006 | 3225 | |
---|
| 3226 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3227 | refreshContents(true); |
---|
3008 | 3228 | } else |
---|
3009 | 3229 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3234 | { |
---|
3015 | 3235 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
3018 | 3244 | buttonGroup.remove(ab); |
---|
3019 | 3245 | radioPanel.remove(ab); |
---|
3020 | 3246 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3250 | |
---|
3024 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3252 | break; |
---|
3026 | 3253 | } |
---|
3027 | 3254 | } |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3257 | refreshContents(true); |
---|
3029 | 3258 | } else |
---|
3030 | 3259 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
3041 | 3270 | child.CloseUI(); |
---|
3042 | 3271 | listUI.remove(child); |
---|
3043 | 3272 | |
---|
3044 | | - child.editWindow = null; // ??????????? |
---|
| 3273 | + //child.editWindow = null; // ??????????? |
---|
3045 | 3274 | } |
---|
3046 | 3275 | objEditor.ctrlPanel.FlushUI(); |
---|
3047 | 3276 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3128 | 3357 | sideView.object = group; |
---|
3129 | 3358 | } |
---|
3130 | 3359 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3360 | +// fix "+" issue |
---|
| 3361 | + //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
3132 | 3363 | |
---|
3133 | 3364 | /* |
---|
3134 | 3365 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3141 | 3372 | //group.parent = null; // ROOT |
---|
3142 | 3373 | //group.attributes = -1; |
---|
3143 | 3374 | ResetModel(); |
---|
| 3375 | + |
---|
| 3376 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3377 | refreshContents(true); |
---|
3145 | 3378 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3379 | { |
---|
.. | .. |
---|
3164 | 3397 | } |
---|
3165 | 3398 | |
---|
3166 | 3399 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3400 | |
---|
3169 | 3401 | void ToggleRoot() |
---|
3170 | 3402 | { |
---|
.. | .. |
---|
3403 | 3635 | |
---|
3404 | 3636 | int size = obj.MemorySize(); |
---|
3405 | 3637 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3638 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3639 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 3640 | } |
---|
3408 | 3641 | } |
---|
3409 | 3642 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3717 | void GenNormals(boolean crease) |
---|
3485 | 3718 | { |
---|
3486 | 3719 | group.GenNormalsS(crease); |
---|
| 3720 | + |
---|
| 3721 | + refreshContents(); |
---|
| 3722 | + } |
---|
| 3723 | + |
---|
| 3724 | + void GenNormalsMESH() |
---|
| 3725 | + { |
---|
| 3726 | + group.GenNormalsMeshS(); |
---|
3487 | 3727 | |
---|
3488 | 3728 | refreshContents(); |
---|
3489 | 3729 | } |
---|
.. | .. |
---|
4111 | 4351 | refreshContents(); |
---|
4112 | 4352 | } |
---|
4113 | 4353 | |
---|
| 4354 | + void RewindLeaves(boolean hide) |
---|
| 4355 | + { |
---|
| 4356 | + group.selection.RewindLeaves(hide); |
---|
| 4357 | + refreshContents(); |
---|
| 4358 | + } |
---|
| 4359 | + |
---|
| 4360 | + void RandomLeaves(boolean hide) |
---|
| 4361 | + { |
---|
| 4362 | + group.selection.RandomLeaves(hide); |
---|
| 4363 | + refreshContents(); |
---|
| 4364 | + } |
---|
| 4365 | + |
---|
4114 | 4366 | void SetTexRes(int tr) |
---|
4115 | 4367 | { |
---|
4116 | 4368 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4193 | 4445 | { |
---|
4194 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4195 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4196 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4197 | 4449 | |
---|
4198 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4199 | 4451 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4286 | 4538 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4539 | group.deselectAll(); |
---|
4288 | 4540 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4541 | if (tps != null) |
---|
4291 | 4542 | { |
---|
4292 | 4543 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4546 | |
---|
4296 | 4547 | //if (child.parent != null) |
---|
4297 | 4548 | //child.parent.addSelectee(child); |
---|
| 4549 | + objEditor.SetMaterial(child); |
---|
4298 | 4550 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4551 | } |
---|
4303 | 4552 | } |
---|
4304 | 4553 | // else |
---|
.. | .. |
---|
4308 | 4557 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4558 | // } |
---|
4310 | 4559 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | | - Object3D object = (Object3D) tps[0].getLastPathComponent(); |
---|
4314 | | - |
---|
4315 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera)) |
---|
| 4560 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4316 | 4561 | CameraPane.flash = true; |
---|
4317 | 4562 | |
---|
4318 | | - if (tps != null && tps.length > 0 && object instanceof Camera) |
---|
| 4563 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4319 | 4564 | // a camera |
---|
4320 | 4565 | { |
---|
4321 | | - if (object != Globals.theRenderer.LightCamera()) |
---|
| 4566 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
4322 | 4567 | { |
---|
4323 | 4568 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4324 | 4569 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4335 | 4580 | |
---|
4336 | 4581 | freezemodel = false; |
---|
4337 | 4582 | } |
---|
| 4583 | + |
---|
| 4584 | + void refreshContents(boolean cp) |
---|
| 4585 | + { |
---|
| 4586 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4587 | + { |
---|
| 4588 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4589 | + |
---|
| 4590 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4591 | + { |
---|
| 4592 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4593 | + |
---|
| 4594 | + objEditor.AddInfo(child, this, true); |
---|
| 4595 | + System.err.println("info : " + child.GetPath()); |
---|
| 4596 | + } |
---|
| 4597 | + |
---|
| 4598 | + objEditor.SetText(); // jan 2014 |
---|
| 4599 | + } |
---|
| 4600 | + |
---|
| 4601 | + super.refreshContents(cp); |
---|
| 4602 | + } |
---|
4338 | 4603 | |
---|
4339 | 4604 | void linkSomething(Object3D thing) |
---|
4340 | 4605 | { |
---|
.. | .. |
---|
4406 | 4671 | { |
---|
4407 | 4672 | if (group.selection.isEmpty()) |
---|
4408 | 4673 | return; |
---|
| 4674 | + |
---|
4409 | 4675 | Grafreed.clipboardIsTempGroup = false; |
---|
4410 | 4676 | Composite tGroup = null; |
---|
4411 | 4677 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4416 | 4682 | |
---|
4417 | 4683 | if (cut) |
---|
4418 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
| 4686 | + Save(); |
---|
4419 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
4420 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4421 | 4689 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4505 | 4773 | } |
---|
4506 | 4774 | |
---|
4507 | 4775 | } |
---|
| 4776 | + |
---|
4508 | 4777 | if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 4778 | Grafreed.clipboard = tGroup; |
---|
| 4779 | + |
---|
4510 | 4780 | if (cut) |
---|
4511 | 4781 | { |
---|
4512 | 4782 | ResetModel(); |
---|
.. | .. |
---|
5131 | 5401 | cButton clearpanelButton; |
---|
5132 | 5402 | cButton unselectButton; |
---|
5133 | 5403 | |
---|
| 5404 | + cButton minButton; |
---|
| 5405 | + cButton maxButton; |
---|
| 5406 | + cButton fullButton; |
---|
| 5407 | + cButton undoButton; |
---|
| 5408 | + cButton redoButton; |
---|
| 5409 | + cButton saveButton; |
---|
5134 | 5410 | cButton oneStepButton; |
---|
| 5411 | + |
---|
| 5412 | + cButton groupButton; |
---|
| 5413 | + cButton ungroupButton; |
---|
| 5414 | + cButton compositeButton; |
---|
| 5415 | + |
---|
| 5416 | + cButton gridButton; |
---|
| 5417 | + cButton boxButton; |
---|
| 5418 | + cButton sphereButton; |
---|
| 5419 | + cButton coneButton; |
---|
| 5420 | + cButton torusButton; |
---|
| 5421 | + cButton superButton; |
---|
| 5422 | + cButton kleinButton; |
---|
| 5423 | + cButton particlesButton; |
---|
| 5424 | + cButton overlayButton; |
---|
| 5425 | + cButton lightButton; |
---|
5135 | 5426 | |
---|
5136 | 5427 | cButton screenfitButton; |
---|
5137 | 5428 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5143 | 5434 | cButton closeButton; |
---|
5144 | 5435 | |
---|
5145 | 5436 | cButton setsupportButton; |
---|
5146 | | - |
---|
5147 | | - cButton twoButton; |
---|
5148 | | - cButton sixButton; |
---|
5149 | | - cButton threeButton; |
---|
5150 | | - cButton sevenButton; |
---|
5151 | | - cButton fourButton; // full panel |
---|
5152 | | - cButton oneButton; // full XYZ |
---|
5153 | | - //cButton currentLayout; |
---|
5154 | 5437 | |
---|
5155 | 5438 | // |
---|
5156 | 5439 | //Composite |
---|
.. | .. |
---|
5165 | 5448 | private MenuItem cutItem; |
---|
5166 | 5449 | private MenuItem undoItem; |
---|
5167 | 5450 | private MenuItem redoItem; |
---|
5168 | | - private MenuItem duplicateItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
5169 | 5452 | private MenuItem cloneItem; |
---|
5170 | 5453 | private MenuItem cloneSupportItem; |
---|
5171 | 5454 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5228 | 5511 | private MenuItem showleavesItem; |
---|
5229 | 5512 | private MenuItem markleavesItem; |
---|
5230 | 5513 | private MenuItem unmarkleavesItem; |
---|
| 5514 | + private MenuItem rewindleavesItem; |
---|
| 5515 | + private MenuItem unrewindleavesItem; |
---|
| 5516 | + private MenuItem randomleavesItem; |
---|
| 5517 | + private MenuItem unrandomleavesItem; |
---|
5231 | 5518 | |
---|
5232 | 5519 | private MenuItem flipVItem; |
---|
5233 | 5520 | private MenuItem unflipVItem; |
---|