.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
28 | 29 | { |
---|
29 | 30 | cButton skyboxButton; |
---|
30 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
31 | | - row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
32 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
34 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
35 | 36 | { |
---|
36 | 37 | @Override |
---|
.. | .. |
---|
41 | 42 | }); |
---|
42 | 43 | } |
---|
43 | 44 | |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
44 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
45 | 62 | { |
---|
46 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
56 | 73 | cGridBag row5 = new cGridBag(); |
---|
57 | 74 | cGridBag row6 = new cGridBag(); |
---|
58 | 75 | |
---|
59 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
60 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
61 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
62 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
311 | 328 | } |
---|
312 | 329 | } |
---|
313 | 330 | |
---|
314 | | - public void ChangeSkybox(String name) |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
315 | 332 | { |
---|
316 | | - //cameraView.envyoff = false; |
---|
317 | | - group.skyboxname = name; |
---|
318 | | - group.skyboxext = "jpg"; |
---|
319 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
| 346 | + } |
---|
| 347 | + |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
320 | 358 | } |
---|
321 | 359 | |
---|
| 360 | + public void ChangeTexture(String texture) |
---|
| 361 | + { |
---|
| 362 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 363 | + { |
---|
| 364 | + Object3D obj = group.selection.get(i); |
---|
| 365 | + obj.SetPigmentTexture("@" + texture); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
322 | 371 | //ObjEditor objEditor; |
---|
323 | 372 | public void closeUI2() |
---|
324 | 373 | { |
---|
.. | .. |
---|
356 | 405 | this.copy = this.group = group; |
---|
357 | 406 | //selectees = this.group.selectees; |
---|
358 | 407 | |
---|
359 | | - if (copy.versions == null) |
---|
360 | | - { |
---|
361 | | - copy.versions = new byte[100][]; |
---|
362 | | - copy.versionindex = -1; |
---|
363 | | - } |
---|
| 408 | + assert(false); |
---|
| 409 | + |
---|
| 410 | +// if (copy.versionlist == null) |
---|
| 411 | +// { |
---|
| 412 | +// copy.versionlist = new Object3D[100]; |
---|
| 413 | +// copy.versionindex = -1; |
---|
| 414 | +// |
---|
| 415 | +// //Save(true); |
---|
| 416 | +// } |
---|
364 | 417 | |
---|
365 | 418 | if(ui) |
---|
366 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
383 | 436 | |
---|
384 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
385 | 438 | |
---|
386 | | - if (copy.versions == null) |
---|
387 | | - { |
---|
388 | | - copy.versions = new byte[100][]; |
---|
389 | | - copy.versionindex = -1; |
---|
390 | | - |
---|
391 | | - Save(true); |
---|
392 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
393 | 446 | } |
---|
394 | 447 | |
---|
395 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
479 | 532 | // menu.add("-"); |
---|
480 | 533 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
481 | 534 | duplicateItem.addActionListener(this); |
---|
482 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 535 | + |
---|
| 536 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
483 | 537 | cloneItem.addActionListener(this); |
---|
484 | | - if (Globals.ADVANCED) |
---|
| 538 | + //if (Globals.ADVANCED) |
---|
485 | 539 | { |
---|
486 | 540 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
487 | 541 | cloneSupportItem.addActionListener(this); |
---|
488 | 542 | } |
---|
| 543 | + oe.jTree.popup.addSeparator(); |
---|
489 | 544 | menu.add("-"); |
---|
490 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 545 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
491 | 546 | cutItem.addActionListener(this); |
---|
492 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 547 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
493 | 548 | copyItem.addActionListener(this); |
---|
494 | 549 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
495 | 550 | pasteItem.addActionListener(this); |
---|
496 | 551 | |
---|
497 | | - menu.add("-"); |
---|
498 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 552 | + oe.jTree.popup.addSeparator(); |
---|
| 553 | + //menu.add("-"); |
---|
| 554 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
499 | 555 | pasteIntoItem.addActionListener(this); |
---|
500 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 556 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
501 | 557 | pasteLinkItem.addActionListener(this); |
---|
502 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 558 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
503 | 559 | pasteCloneItem.addActionListener(this); |
---|
504 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 560 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
505 | 561 | // pasteExpandItem.addActionListener(this); |
---|
506 | | - menu.add("-"); |
---|
507 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
508 | | - deleteItem.addActionListener(this); |
---|
| 562 | + //menu.add("-"); |
---|
| 563 | + oe.jTree.popup.addSeparator(); |
---|
509 | 564 | |
---|
510 | 565 | if (Globals.ADVANCED) |
---|
511 | 566 | { |
---|
.. | .. |
---|
591 | 646 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
592 | 647 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
593 | 648 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
594 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
595 | 649 | oe.cameraMenu.add("-"); |
---|
596 | 650 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
597 | 651 | openWindowItem.addActionListener(this); |
---|
598 | | - editLeafItem.addActionListener(this); |
---|
599 | 652 | lookAtItem.addActionListener(this); |
---|
600 | 653 | //lookFromItem.addActinoListener(this); |
---|
601 | 654 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
642 | 695 | setMasterItem.addActionListener(this); |
---|
643 | 696 | } |
---|
644 | 697 | |
---|
645 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
646 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
647 | | -// grabItem.addActionListener(this); |
---|
| 698 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 699 | + |
---|
648 | 700 | backItem = menu.add(new MenuItem("Back")); |
---|
649 | 701 | backItem.addActionListener(this); |
---|
650 | 702 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
652 | 704 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
653 | 705 | // compositeItem.addActionListener(this); |
---|
654 | 706 | |
---|
| 707 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 708 | + grabItem.addActionListener(this); |
---|
| 709 | + |
---|
655 | 710 | if (Globals.ADVANCED) |
---|
656 | 711 | { |
---|
657 | 712 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
658 | 713 | hideItem.addActionListener(this); |
---|
659 | 714 | } |
---|
660 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 715 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
661 | 716 | ungroupItem.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.jTree.popup.addSeparator(); |
---|
| 719 | + |
---|
| 720 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 721 | + deleteItem.addActionListener(this); |
---|
662 | 722 | |
---|
663 | 723 | // menu.add("-"); |
---|
664 | 724 | // |
---|
.. | .. |
---|
695 | 755 | shadowYItem.addActionListener(this); |
---|
696 | 756 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
697 | 757 | shadowZItem.addActionListener(this); |
---|
| 758 | + |
---|
698 | 759 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
699 | 760 | attributeItem.addActionListener(this); |
---|
700 | | - |
---|
701 | 761 | if (Globals.ADVANCED) |
---|
702 | 762 | { |
---|
703 | 763 | menu.add("-"); |
---|
.. | .. |
---|
709 | 769 | pointflowItem.addActionListener(this); |
---|
710 | 770 | } |
---|
711 | 771 | menu.add("-"); |
---|
| 772 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 773 | + textureRatioRItem.addActionListener(this); |
---|
| 774 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 775 | + textureRatioGItem.addActionListener(this); |
---|
| 776 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 777 | + textureRatioBItem.addActionListener(this); |
---|
| 778 | + menu.add("-"); |
---|
712 | 779 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
713 | 780 | resetTransformItem.addActionListener(this); |
---|
714 | 781 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
715 | 782 | resetCentroidItem.addActionListener(this); |
---|
716 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 783 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
717 | 784 | resetCentroidXZItem.addActionListener(this); |
---|
718 | 785 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
719 | 786 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
765 | 832 | } |
---|
766 | 833 | |
---|
767 | 834 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 835 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 836 | + clearVersionsItem.addActionListener(this); |
---|
768 | 837 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
769 | 838 | clearMaterialsItem.addActionListener(this); |
---|
770 | 839 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
787 | 856 | hideleavesItem.addActionListener(this); |
---|
788 | 857 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
789 | 858 | showleavesItem.addActionListener(this); |
---|
790 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 859 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
791 | 860 | markleavesItem.addActionListener(this); |
---|
792 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 861 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
793 | 862 | unmarkleavesItem.addActionListener(this); |
---|
794 | 863 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
795 | 864 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
843 | 912 | shareGeometriesItem.addActionListener(this); |
---|
844 | 913 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
845 | 914 | mergeGeometriesItem.addActionListener(this); |
---|
| 915 | + menu.add("-"); |
---|
| 916 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 917 | + editLeafItem.addActionListener(this); |
---|
846 | 918 | if (Globals.ADVANCED) |
---|
847 | 919 | { |
---|
848 | 920 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
859 | 931 | buildToolsMenu(menu); |
---|
860 | 932 | } |
---|
861 | 933 | |
---|
| 934 | + JTabbedPane resourcecontainer; |
---|
| 935 | + cGridBag currenttab; |
---|
| 936 | + //boolean added; // patch for jar |
---|
| 937 | + |
---|
| 938 | + int totalcount = 0; |
---|
| 939 | + |
---|
| 940 | + int tabcount = 0; |
---|
| 941 | + int colcount = 0; |
---|
| 942 | + int rowcount = 0; |
---|
| 943 | + int texturecount = 0; |
---|
| 944 | + |
---|
| 945 | + int columns = 5; |
---|
| 946 | + int rows = 7; |
---|
| 947 | + |
---|
| 948 | + public void ResourceCallBack(String[] path) |
---|
| 949 | + { |
---|
| 950 | +// for (int i = 0; i < path.length; i++) |
---|
| 951 | +// System.out.print(path[i] + "/"); |
---|
| 952 | +// System.out.println(); |
---|
| 953 | + |
---|
| 954 | + if (//rowcount == 0 || |
---|
| 955 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 956 | + { |
---|
| 957 | + currenttab = new cGridBag(); |
---|
| 958 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 959 | + currenttab.setName(tabname); |
---|
| 960 | + //added = false; |
---|
| 961 | + resourcecontainer.add(currenttab); |
---|
| 962 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 963 | + rowcount = 1; |
---|
| 964 | + colcount = 0; |
---|
| 965 | + texturecount = 0; |
---|
| 966 | + } |
---|
| 967 | + |
---|
| 968 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 969 | + { |
---|
| 970 | + //if (!added) |
---|
| 971 | + { |
---|
| 972 | + //added = true; |
---|
| 973 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 974 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 975 | + } |
---|
| 976 | + |
---|
| 977 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 978 | + totalcount++; |
---|
| 979 | + |
---|
| 980 | + if (++colcount >= columns) |
---|
| 981 | + { |
---|
| 982 | + colcount = 0; |
---|
| 983 | + currenttab.Return(); |
---|
| 984 | + |
---|
| 985 | + if (rowcount++ >= rows) |
---|
| 986 | + { |
---|
| 987 | + rowcount = 0; |
---|
| 988 | + } |
---|
| 989 | + } |
---|
| 990 | + } |
---|
| 991 | + else |
---|
| 992 | + { |
---|
| 993 | +// if (!path[path.length-1].equals("icons")) |
---|
| 994 | +// resourcecontainer.Return(); |
---|
| 995 | + } |
---|
| 996 | + } |
---|
| 997 | + |
---|
| 998 | + void CreateTexturePanel(cGridBag container) |
---|
| 999 | + { |
---|
| 1000 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1001 | + container.add(resourcecontainer); |
---|
| 1002 | + |
---|
| 1003 | + Grafreed.ParseResources("textures", this); |
---|
| 1004 | + |
---|
| 1005 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1006 | + } |
---|
862 | 1007 | |
---|
863 | 1008 | void SetupUI2(ObjEditor oe) |
---|
864 | 1009 | { |
---|
.. | .. |
---|
877 | 1022 | //new Exception().printStackTrace(); |
---|
878 | 1023 | |
---|
879 | 1024 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
880 | | - oe.aConstraints.weightx = 1; |
---|
881 | | - oe.aConstraints.weighty = 0; |
---|
882 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
883 | | - oe.aConstraints.gridwidth = 100; |
---|
884 | | - oe.aConstraints.gridheight = 1; |
---|
885 | 1025 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
886 | 1026 | |
---|
887 | 1027 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
902 | 1042 | oe.radioPanel.add(dummyButton); |
---|
903 | 1043 | oe.buttonGroup.add(dummyButton); |
---|
904 | 1044 | */ |
---|
905 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1045 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
906 | 1046 | |
---|
907 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1047 | + versionManagerPanel.preferredHeight = 4; |
---|
908 | 1048 | |
---|
909 | 1049 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
910 | 1050 | |
---|
.. | .. |
---|
914 | 1054 | |
---|
915 | 1055 | if (Globals.ADVANCED) |
---|
916 | 1056 | { |
---|
917 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
918 | | - maxButton.setToolTipText("Maximize window"); |
---|
919 | | - maxButton.addActionListener(this); |
---|
| 1057 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1059 | +// maxButton.addActionListener(this); |
---|
920 | 1060 | } |
---|
921 | 1061 | |
---|
922 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
923 | | - fullButton.setToolTipText("Full-screen window"); |
---|
924 | | - fullButton.addActionListener(this); |
---|
| 1062 | + cButton gcButton; |
---|
925 | 1063 | |
---|
926 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1066 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1067 | +// { |
---|
| 1068 | +// public void actionPerformed(ActionEvent e) |
---|
| 1069 | +// { |
---|
| 1070 | +// System.gc(); |
---|
| 1071 | +// } |
---|
| 1072 | +// }); |
---|
| 1073 | + |
---|
| 1074 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1076 | + fullScreenButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1080 | + collapseButton.addActionListener(this); |
---|
| 1081 | + |
---|
| 1082 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1084 | +// maximize3DButton.addActionListener(this); |
---|
| 1085 | + |
---|
| 1086 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1088 | + twoButton.addActionListener(this); |
---|
| 1089 | + this.fullscreenLayout = twoButton; |
---|
| 1090 | + |
---|
| 1091 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1093 | + threeButton.addActionListener(this); |
---|
| 1094 | + if (Globals.ADVANCED) |
---|
| 1095 | + { |
---|
| 1096 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1098 | + sixButton.addActionListener(this); |
---|
| 1099 | + } |
---|
| 1100 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1102 | +// sevenButton.addActionListener(this); |
---|
| 1103 | + // |
---|
| 1104 | + |
---|
| 1105 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
927 | 1106 | screenfitButton.setToolTipText("Screen fit"); |
---|
928 | 1107 | screenfitButton.addActionListener(this); |
---|
929 | 1108 | |
---|
930 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | 1110 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 1111 | restoreCameraButton.addActionListener(this); |
---|
933 | 1112 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("New version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 1113 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1114 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1115 | + saveVersionButton.addActionListener(this); |
---|
937 | 1116 | |
---|
938 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
939 | | - undoButton.setToolTipText("Previous version"); |
---|
940 | | - undoButton.addActionListener(this); |
---|
941 | | - undoButton.setEnabled(false); |
---|
| 1117 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1119 | + deleteVersionButton.addActionListener(this); |
---|
| 1120 | + deleteVersionButton.setEnabled(false); |
---|
| 1121 | + |
---|
| 1122 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1124 | + previousVersionButton.addActionListener(this); |
---|
| 1125 | + previousVersionButton.setEnabled(false); |
---|
942 | 1126 | |
---|
943 | 1127 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 1128 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 1130 | restoreButton.addActionListener(this); |
---|
947 | 1131 | restoreButton.setEnabled(false); |
---|
948 | 1132 | |
---|
949 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 1133 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 1135 | replaceButton.addActionListener(this); |
---|
952 | 1136 | replaceButton.setEnabled(false); |
---|
953 | 1137 | |
---|
954 | | - copyOptionsPanel.add(updown); |
---|
| 1138 | + versionManagerPanel.add(updown); |
---|
955 | 1139 | |
---|
956 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
957 | | - redoButton.setToolTipText("Next version"); |
---|
958 | | - redoButton.addActionListener(this); |
---|
959 | | - redoButton.setEnabled(false); |
---|
| 1140 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1142 | + nextVersionButton.addActionListener(this); |
---|
| 1143 | + nextVersionButton.setEnabled(false); |
---|
| 1144 | + |
---|
| 1145 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1147 | + oneStepButton.addActionListener(this); |
---|
960 | 1148 | |
---|
961 | 1149 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 1150 | liveCB.setToolTipText("Enable animation"); |
---|
963 | 1151 | liveCB.addItemListener(this); |
---|
964 | 1152 | |
---|
965 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
966 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
967 | | - oneStepButton.addActionListener(this); |
---|
968 | | - |
---|
969 | 1153 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
970 | 1154 | fastCB.setToolTipText("Fast mode"); |
---|
971 | 1155 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
981 | 1165 | |
---|
982 | 1166 | if (Globals.ADVANCED) |
---|
983 | 1167 | { |
---|
984 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
985 | 1169 | snapobjectButton.addActionListener(this); |
---|
986 | 1170 | snapobjectButton.setToolTipText("Snap Object"); |
---|
987 | 1171 | |
---|
988 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1172 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
989 | 1173 | fourButton.addActionListener(this); |
---|
990 | 1174 | fourButton.setToolTipText("Show control panel only"); |
---|
991 | 1175 | } |
---|
992 | 1176 | |
---|
993 | 1177 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
994 | 1178 | |
---|
995 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
996 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
997 | | - twoButton.addActionListener(this); |
---|
998 | | - this.fullscreenLayout = twoButton; |
---|
999 | | - |
---|
1000 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1001 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1002 | | - threeButton.addActionListener(this); |
---|
1003 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1004 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1005 | | - sixButton.addActionListener(this); |
---|
1006 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1007 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1008 | | -// sevenButton.addActionListener(this); |
---|
1009 | | - // |
---|
1010 | 1179 | |
---|
1011 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1012 | 1181 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1013 | 1182 | rootButton.addActionListener(this); |
---|
1014 | 1183 | |
---|
1015 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1016 | 1185 | closeButton.setToolTipText("Close tab"); |
---|
1017 | 1186 | closeButton.addActionListener(this); |
---|
1018 | 1187 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1021 | 1190 | cGridBag row1 = new cGridBag(); |
---|
1022 | 1191 | |
---|
1023 | 1192 | // INSERT |
---|
1024 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1193 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + gridButton.setToolTipText("Create ground"); |
---|
1026 | 1195 | gridButton.addActionListener(this); |
---|
1027 | 1196 | |
---|
1028 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1198 | boxButton.setToolTipText("Create box"); |
---|
1030 | 1199 | boxButton.addActionListener(this); |
---|
1031 | 1200 | |
---|
1032 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1033 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1034 | | - sphereButton.addActionListener(this); |
---|
1035 | | - |
---|
1036 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1037 | | - coneButton.setToolTipText("Create cone"); |
---|
1038 | | - coneButton.addActionListener(this); |
---|
1039 | | - |
---|
1040 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1041 | | - torusButton.setToolTipText("Create torus"); |
---|
1042 | | - torusButton.addActionListener(this); |
---|
1043 | | - |
---|
1044 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1201 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1045 | 1202 | superButton.setToolTipText("Create superellipsoid"); |
---|
1046 | 1203 | superButton.addActionListener(this); |
---|
1047 | 1204 | |
---|
1048 | | - if (Globals.ADVANCED) |
---|
| 1205 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1207 | + sphereButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + coneButton.setToolTipText("Create cone"); |
---|
| 1211 | + coneButton.addActionListener(this); |
---|
| 1212 | + |
---|
| 1213 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + torusButton.setToolTipText("Create torus"); |
---|
| 1215 | + torusButton.addActionListener(this); |
---|
| 1216 | + |
---|
| 1217 | + if (false) //Globals.ADVANCED) |
---|
1049 | 1218 | { |
---|
1050 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1051 | 1220 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1052 | 1221 | kleinButton.addActionListener(this); |
---|
1053 | 1222 | } |
---|
1054 | 1223 | |
---|
1055 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1056 | 1225 | particlesButton.setToolTipText("Create particle system"); |
---|
1057 | 1226 | particlesButton.addActionListener(this); |
---|
1058 | 1227 | |
---|
.. | .. |
---|
1060 | 1229 | |
---|
1061 | 1230 | cGridBag row2 = new cGridBag(); |
---|
1062 | 1231 | |
---|
1063 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1064 | 1233 | groupButton.setToolTipText("Create group"); |
---|
1065 | 1234 | groupButton.addActionListener(this); |
---|
1066 | 1235 | |
---|
1067 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1237 | compositeButton.setToolTipText("Create composite"); |
---|
1069 | 1238 | compositeButton.addActionListener(this); |
---|
1070 | 1239 | |
---|
1071 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1072 | 1241 | switchButton.setToolTipText("Create item switcher"); |
---|
1073 | 1242 | switchButton.addActionListener(this); |
---|
1074 | 1243 | |
---|
1075 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1076 | 1245 | loopButton.setToolTipText("Create loop"); |
---|
1077 | 1246 | loopButton.addActionListener(this); |
---|
1078 | 1247 | |
---|
1079 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1080 | 1249 | textureButton.setToolTipText("Create texture"); |
---|
1081 | 1250 | textureButton.addActionListener(this); |
---|
1082 | 1251 | |
---|
1083 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1084 | 1253 | overlayButton.setToolTipText("Create overlay"); |
---|
1085 | 1254 | overlayButton.addActionListener(this); |
---|
1086 | 1255 | |
---|
1087 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1256 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1088 | 1257 | lightButton.setToolTipText("Create light"); |
---|
1089 | 1258 | lightButton.addActionListener(this); |
---|
1090 | 1259 | |
---|
1091 | 1260 | oe.toolboxPanel.add(row2); |
---|
1092 | 1261 | |
---|
1093 | | - // ENVYMAPS |
---|
1094 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1095 | | - skyboxpane.preferredHeight = 100; |
---|
| 1262 | + cGridBag textures = new cGridBag(); |
---|
1096 | 1263 | |
---|
1097 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1264 | + CreateTexturePanel(textures); |
---|
1098 | 1265 | |
---|
1099 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1100 | | - skyboxpane.add(skyboxpanel); |
---|
| 1266 | + int tabCount = resourcecontainer.getTabCount(); |
---|
1101 | 1267 | |
---|
1102 | | - AddSkyboxTab0(skyboxpanel); |
---|
1103 | | - AddSkyboxTab1(skyboxpanel); |
---|
1104 | | - AddSkyboxTab2(skyboxpanel); |
---|
1105 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1268 | + if (tabCount > 0) |
---|
| 1269 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1270 | + |
---|
| 1271 | + oe.toolboxPanel.add(textures); |
---|
| 1272 | + |
---|
| 1273 | + textures.preferredHeight = 100; |
---|
| 1274 | + |
---|
| 1275 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1106 | 1276 | |
---|
1107 | 1277 | // EDIT panel |
---|
1108 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1109 | 1279 | editButton.setToolTipText("Pin selection controls"); |
---|
1110 | 1280 | editButton.addActionListener(this); |
---|
1111 | 1281 | |
---|
1112 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1113 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1282 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1283 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1114 | 1284 | uneditButton.addActionListener(this); |
---|
1115 | 1285 | |
---|
1116 | 1286 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1287 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1118 | 1288 | allParamsButton.addActionListener(this); |
---|
1119 | 1289 | |
---|
1120 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1290 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1122 | 1292 | clearPanelButton.addActionListener(this); |
---|
1123 | 1293 | |
---|
1124 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - unselectButton.setToolTipText("Unselect"); |
---|
1126 | | - unselectButton.addActionListener(this); |
---|
| 1294 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1295 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1296 | + //unselectButton.addActionListener(this); |
---|
1127 | 1297 | |
---|
1128 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1298 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | 1299 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1130 | 1300 | flashSelectionButton.addActionListener(this); |
---|
1131 | 1301 | |
---|
.. | .. |
---|
1148 | 1318 | |
---|
1149 | 1319 | cGridBag jSPPanel = new cGridBag(); |
---|
1150 | 1320 | |
---|
| 1321 | + jSPPanel.preferredHeight = 20; |
---|
| 1322 | + |
---|
1151 | 1323 | JScrollPane jSP; |
---|
1152 | 1324 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1153 | 1325 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1156 | 1328 | oe.treePanel.add(jSPPanel); |
---|
1157 | 1329 | oe.treePanel.Return(); |
---|
1158 | 1330 | |
---|
1159 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1331 | + oe.treePanel.add(versionManagerPanel); |
---|
1160 | 1332 | oe.treePanel.Return(); |
---|
1161 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1162 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1163 | | - sliderPane.preferredHeight = 1; |
---|
| 1333 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1334 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1335 | + versionSliderPane.preferredHeight = 3; |
---|
1164 | 1336 | |
---|
1165 | 1337 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1166 | 1338 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1183 | 1355 | dgr.addDragGestureListener(this); |
---|
1184 | 1356 | }catch(Exception e) {} |
---|
1185 | 1357 | */ |
---|
1186 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1358 | + radio.layout = threeButton; // sixButton; |
---|
1187 | 1359 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1188 | 1360 | } |
---|
1189 | 1361 | |
---|
.. | .. |
---|
1234 | 1406 | smoothCB.setToolTipText("Snapping delay"); |
---|
1235 | 1407 | smoothCB.addItemListener(this); |
---|
1236 | 1408 | |
---|
1237 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1238 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1239 | | - slowCB.addItemListener(this); |
---|
| 1409 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1410 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1411 | +// slowCB.addItemListener(this); |
---|
| 1412 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1413 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1414 | + minshaderCB.addItemListener(this); |
---|
1240 | 1415 | |
---|
1241 | 1416 | // constraints.gridy += 1; |
---|
1242 | 1417 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1315 | 1490 | |
---|
1316 | 1491 | void EditObject(Object3D obj) |
---|
1317 | 1492 | { |
---|
| 1493 | + //assert(obj instanceof Composite); |
---|
| 1494 | + |
---|
| 1495 | +// if (obj.versionlist == null) |
---|
| 1496 | +// { |
---|
| 1497 | +// obj.versionlist = new Object3D[100]; |
---|
| 1498 | +// obj.versionindex = -1; |
---|
| 1499 | +// } |
---|
| 1500 | + |
---|
1318 | 1501 | cRadio radioButton = new cRadio(obj.name); |
---|
1319 | 1502 | |
---|
1320 | 1503 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1325 | 1508 | } |
---|
1326 | 1509 | |
---|
1327 | 1510 | radioButton.SetObject(obj); |
---|
1328 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1511 | + radioButton.layout = threeButton; // sixButton; |
---|
1329 | 1512 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1330 | 1513 | radioButton.addActionListener(this); |
---|
1331 | 1514 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1339 | 1522 | |
---|
1340 | 1523 | oe.SetupViews(); |
---|
1341 | 1524 | |
---|
| 1525 | + if (Globals.DEBUG) |
---|
1342 | 1526 | System.out.println("SetupViews"); |
---|
1343 | 1527 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1344 | 1528 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1350 | 1534 | cCheckBox localCB; |
---|
1351 | 1535 | cCheckBox crowdCB; |
---|
1352 | 1536 | cCheckBox smoothCB; |
---|
| 1537 | + cCheckBox minshaderCB; |
---|
| 1538 | + |
---|
1353 | 1539 | cToggleButton fastCB; |
---|
1354 | 1540 | cCheckBox slowCB; |
---|
1355 | 1541 | cCheckBox boxCB; |
---|
.. | .. |
---|
1420 | 1606 | { |
---|
1421 | 1607 | cameraView.ToggleInertia(); |
---|
1422 | 1608 | cameraView.repaint(); |
---|
| 1609 | + } |
---|
| 1610 | + else if(e.getSource() == minshaderCB) |
---|
| 1611 | + { |
---|
| 1612 | + Globals.MINSHADER ^= true; |
---|
| 1613 | + cameraView.programInitialized = false; |
---|
| 1614 | + cameraView.repaint(); |
---|
1423 | 1615 | } |
---|
1424 | 1616 | else if(e.getSource() == localCB) |
---|
1425 | 1617 | { |
---|
.. | .. |
---|
1697 | 1889 | TreePath path; |
---|
1698 | 1890 | |
---|
1699 | 1891 | public TransferableTreePath(TreePath tp) { |
---|
1700 | | - path = tp; |
---|
| 1892 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1893 | + for (int i=0; i<objs.length; i++) |
---|
| 1894 | + { |
---|
| 1895 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1896 | + } |
---|
| 1897 | + path = new TreePath(objs); |
---|
1701 | 1898 | } |
---|
1702 | 1899 | |
---|
1703 | 1900 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1929 | 2126 | switch(axis) |
---|
1930 | 2127 | { |
---|
1931 | 2128 | case 0 : |
---|
1932 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1933 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
1934 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1935 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2129 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2130 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2131 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2132 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1936 | 2133 | norm = cVector.X; |
---|
1937 | 2134 | break; |
---|
1938 | 2135 | case 1 : |
---|
1939 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1940 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1941 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1942 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2136 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2137 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2138 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2139 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1943 | 2140 | norm = cVector.Y; |
---|
1944 | 2141 | break; |
---|
1945 | 2142 | case 2 : |
---|
1946 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1947 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1948 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
1949 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2143 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2144 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2145 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2146 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1950 | 2147 | norm = cVector.Z; |
---|
1951 | 2148 | break; |
---|
1952 | 2149 | } |
---|
.. | .. |
---|
1987 | 2184 | shadow.material = new cMaterial(obj.material); |
---|
1988 | 2185 | shadow.material.diffuse = 0.0001f; |
---|
1989 | 2186 | shadow.material.specular = 0.0001f; |
---|
1990 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2187 | + shadow.material.opacity = 0.75f; |
---|
| 2188 | + |
---|
| 2189 | + AllocProjectedVertices(shadow); |
---|
| 2190 | + |
---|
| 2191 | + shadow.projectedVertices[1].x = 300; |
---|
1991 | 2192 | |
---|
1992 | 2193 | makeSomething(shadow); |
---|
1993 | 2194 | } |
---|
.. | .. |
---|
2508 | 2709 | } else |
---|
2509 | 2710 | if (source == loopItem || source == loopButton) |
---|
2510 | 2711 | { |
---|
| 2712 | + if (!group.selection.isEmpty()) |
---|
| 2713 | + { |
---|
2511 | 2714 | Composite csg = new GroupLeaf(); |
---|
2512 | | - csg.count = 5; |
---|
2513 | 2715 | group(csg); |
---|
| 2716 | + csg.count = 5; |
---|
2514 | 2717 | Composite child = new cGroup("Branch"); |
---|
2515 | 2718 | csg.addChild(child); |
---|
2516 | 2719 | child.addChild(csg); |
---|
| 2720 | + } |
---|
2517 | 2721 | } else |
---|
2518 | 2722 | if (source == doubleItem) |
---|
2519 | 2723 | { |
---|
| 2724 | + if (!group.selection.isEmpty()) |
---|
| 2725 | + { |
---|
2520 | 2726 | Composite csg = new GroupLeaf("Fork"); |
---|
2521 | | - csg.count = 5; |
---|
2522 | 2727 | group(csg); |
---|
| 2728 | + csg.count = 5; |
---|
2523 | 2729 | Composite child = new cGroup("Branch A"); |
---|
2524 | 2730 | csg.addChild(child); |
---|
2525 | 2731 | child.addChild(csg); |
---|
2526 | 2732 | child = new cGroup("Branch B"); |
---|
2527 | 2733 | csg.addChild(child); |
---|
2528 | 2734 | child.addChild(csg); |
---|
| 2735 | + } |
---|
2529 | 2736 | } else |
---|
2530 | 2737 | if (source == tripleItem) |
---|
2531 | 2738 | { |
---|
| 2739 | + if (!group.selection.isEmpty()) |
---|
| 2740 | + { |
---|
2532 | 2741 | Composite csg = new GroupLeaf("Trident"); |
---|
2533 | 2742 | csg.count = 4; |
---|
2534 | 2743 | group(csg); |
---|
.. | .. |
---|
2541 | 2750 | child = new cGroup(); |
---|
2542 | 2751 | csg.addChild(child); |
---|
2543 | 2752 | child.addChild(csg); |
---|
| 2753 | + } |
---|
2544 | 2754 | } else |
---|
2545 | 2755 | if (source == computeAOItem) |
---|
2546 | 2756 | { |
---|
.. | .. |
---|
2560 | 2770 | if (source == invariantsItem) |
---|
2561 | 2771 | { |
---|
2562 | 2772 | System.out.println("Invariants:"); |
---|
2563 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2773 | + Grafreed.grafreed.universe.invariants(); |
---|
2564 | 2774 | } else |
---|
2565 | 2775 | if (source == memoryItem) |
---|
2566 | 2776 | { |
---|
.. | .. |
---|
2587 | 2797 | { |
---|
2588 | 2798 | Maximize(); |
---|
2589 | 2799 | } else |
---|
2590 | | - if (source == fullButton) |
---|
| 2800 | + if (source == fullScreenButton) |
---|
2591 | 2801 | { |
---|
2592 | 2802 | ToggleFullScreen(); |
---|
2593 | 2803 | } else |
---|
2594 | | - if (source == undoButton) |
---|
| 2804 | + if (source == collapseButton) |
---|
| 2805 | + { |
---|
| 2806 | + this.expandedLayout = radio.layout; |
---|
| 2807 | + CollapseToolbar(); |
---|
| 2808 | + } else |
---|
| 2809 | +// if (source == maximize3DButton) |
---|
| 2810 | +// { |
---|
| 2811 | +// this.expandedLayout = radio.layout; |
---|
| 2812 | +// radio.layout = twoButton; |
---|
| 2813 | +// CollapseToolbar(); |
---|
| 2814 | +// Show3DView(); |
---|
| 2815 | +// } else |
---|
| 2816 | + if (source == previousVersionButton) |
---|
2595 | 2817 | { |
---|
2596 | 2818 | // Go to previous version |
---|
2597 | 2819 | //if (!Undo()) |
---|
2598 | 2820 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2599 | | - Undo(); |
---|
| 2821 | + PreviousVersion(); |
---|
2600 | 2822 | } else |
---|
2601 | 2823 | if (source == restoreButton) |
---|
2602 | 2824 | { |
---|
2603 | 2825 | // Restore current version |
---|
2604 | 2826 | Restore(); |
---|
| 2827 | + //restoreButton.setEnabled(false); |
---|
2605 | 2828 | } else |
---|
2606 | 2829 | if (source == replaceButton) |
---|
2607 | 2830 | { |
---|
2608 | 2831 | // Overwrite current version |
---|
2609 | 2832 | Replace(); |
---|
| 2833 | + //replaceButton.setEnabled(false); |
---|
2610 | 2834 | } else |
---|
2611 | | - if (source == redoButton) |
---|
| 2835 | + if (source == nextVersionButton) |
---|
2612 | 2836 | { |
---|
2613 | 2837 | // Go to next version |
---|
2614 | | - Redo(); |
---|
| 2838 | + NextVersion(); |
---|
2615 | 2839 | } else |
---|
2616 | | - if (source == saveButton) |
---|
| 2840 | + if (source == saveVersionButton) |
---|
2617 | 2841 | { |
---|
2618 | 2842 | // Save a new version |
---|
2619 | 2843 | if (!Save(true)) |
---|
2620 | 2844 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2845 | + } else |
---|
| 2846 | + if (source == deleteVersionButton) |
---|
| 2847 | + { |
---|
| 2848 | + // Delete a new version |
---|
| 2849 | + DeleteVersion(); |
---|
2621 | 2850 | } else |
---|
2622 | 2851 | if (source == oneStepButton) |
---|
2623 | 2852 | { |
---|
.. | .. |
---|
2672 | 2901 | } else |
---|
2673 | 2902 | if (source == undoItem) |
---|
2674 | 2903 | { |
---|
2675 | | - Undo(); |
---|
| 2904 | + PreviousVersion(); |
---|
2676 | 2905 | } else |
---|
2677 | 2906 | if (source == redoItem) |
---|
2678 | 2907 | { |
---|
2679 | | - Redo(); |
---|
| 2908 | + NextVersion(); |
---|
2680 | 2909 | } else |
---|
2681 | 2910 | if (source == duplicateItem) |
---|
2682 | 2911 | { |
---|
.. | .. |
---|
3157 | 3386 | } else |
---|
3158 | 3387 | if (source == ungroupItem || source == ungroupButton) |
---|
3159 | 3388 | { |
---|
3160 | | - boolean hasRoot = false; |
---|
| 3389 | + boolean canUngroup = true; |
---|
3161 | 3390 | |
---|
3162 | 3391 | for (int i=0; i<group.selection.size(); i++) |
---|
3163 | 3392 | { |
---|
3164 | | - if (group.selection.get(i) == group) |
---|
| 3393 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem.Size() == 0) |
---|
3165 | 3396 | { |
---|
3166 | | - hasRoot = true; |
---|
| 3397 | + // Cannot ungroup leaves |
---|
| 3398 | + canUngroup = false; |
---|
| 3399 | + break; |
---|
| 3400 | + } |
---|
| 3401 | + |
---|
| 3402 | + if (selectedItem == group) |
---|
| 3403 | + { |
---|
| 3404 | + // Cannot ungroup root |
---|
| 3405 | + canUngroup = false; |
---|
3167 | 3406 | break; |
---|
3168 | 3407 | } |
---|
3169 | 3408 | } |
---|
3170 | 3409 | |
---|
3171 | | - if (!hasRoot) |
---|
| 3410 | + if (canUngroup) |
---|
3172 | 3411 | { |
---|
3173 | 3412 | for (int i=0; i<group.selection.size(); i++) |
---|
3174 | 3413 | { |
---|
3175 | | - Ungroup(group.selection.get(i)); |
---|
| 3414 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3415 | + |
---|
| 3416 | + Ungroup(selectedItem); |
---|
3176 | 3417 | } |
---|
3177 | 3418 | |
---|
3178 | 3419 | ClearSelection(false); |
---|
.. | .. |
---|
3223 | 3464 | if (source == clearMaterialsItem) |
---|
3224 | 3465 | { |
---|
3225 | 3466 | ClearMaterials(); |
---|
| 3467 | + } else |
---|
| 3468 | + if (source == clearVersionsItem) |
---|
| 3469 | + { |
---|
| 3470 | + ClearVersions(); |
---|
3226 | 3471 | } else |
---|
3227 | 3472 | if (source == liveleavesItem) |
---|
3228 | 3473 | { |
---|
.. | .. |
---|
3363 | 3608 | if (source == transformChildrenItem) |
---|
3364 | 3609 | { |
---|
3365 | 3610 | TransformChildren(); |
---|
| 3611 | + } else |
---|
| 3612 | + if (source == textureRatioRItem) |
---|
| 3613 | + { |
---|
| 3614 | + TextureRatio(0); |
---|
| 3615 | + } else |
---|
| 3616 | + if (source == textureRatioGItem) |
---|
| 3617 | + { |
---|
| 3618 | + TextureRatio(1); |
---|
| 3619 | + } else |
---|
| 3620 | + if (source == textureRatioBItem) |
---|
| 3621 | + { |
---|
| 3622 | + TextureRatio(2); |
---|
3366 | 3623 | } else |
---|
3367 | 3624 | if (source == resetTransformItem) |
---|
3368 | 3625 | { |
---|
.. | .. |
---|
3535 | 3792 | if (CameraPane.FULLSCREEN) |
---|
3536 | 3793 | fullscreenLayout = radio.layout; |
---|
3537 | 3794 | |
---|
3538 | | - // bug |
---|
3539 | | - //gridPanel.setDividerLocation(1.0); |
---|
3540 | | - //bigPanel.setDividerLocation(0.0); |
---|
3541 | | -// bigThree.remove(scenePanel); |
---|
3542 | | -// bigThree.remove(centralPanel); |
---|
3543 | | -// bigThree.remove(XYZPanel); |
---|
3544 | | -// aWindowConstraints.gridx = 0; |
---|
3545 | | -// aWindowConstraints.gridy = 0; |
---|
3546 | | -// aWindowConstraints.gridwidth = 1; |
---|
3547 | | -// // aConstraints.gridheight = 3; |
---|
3548 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3549 | | -// aWindowConstraints.weightx = 0; |
---|
3550 | | -// aWindowConstraints.weighty = 1; |
---|
3551 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3552 | | -// aWindowConstraints.weightx = 1; |
---|
3553 | | -// aWindowConstraints.gridwidth = 3; |
---|
3554 | | -// // aConstraints.gridheight = 3; |
---|
3555 | | -// aWindowConstraints.gridx = 1; |
---|
3556 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3557 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3558 | | -// aWindowConstraints.weightx = 0; |
---|
3559 | | -// aWindowConstraints.gridx = 4; |
---|
3560 | | -// aWindowConstraints.gridwidth = 1; |
---|
3561 | | -// // aConstraints.gridheight = 3; |
---|
3562 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3563 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3564 | | -// scenePanel.setVisible(false); |
---|
3565 | | -// centralPanel.setVisible(true); |
---|
3566 | | -// XYZPanel.setVisible(false); |
---|
3567 | | - bigThree.ClearUI(); |
---|
3568 | | - bigThree.add(centralPanel); |
---|
3569 | | - bigThree.FlushUI(); |
---|
| 3795 | + Show3DView(); |
---|
3570 | 3796 | |
---|
3571 | 3797 | cameraView.requestFocusInWindow(); |
---|
3572 | 3798 | |
---|
.. | .. |
---|
3752 | 3978 | } else |
---|
3753 | 3979 | if (source == rootButton) |
---|
3754 | 3980 | { |
---|
| 3981 | + Replace(); |
---|
3755 | 3982 | Object3D obj; |
---|
3756 | 3983 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3757 | 3984 | { |
---|
.. | .. |
---|
3766 | 3993 | if (source == closeButton) |
---|
3767 | 3994 | { |
---|
3768 | 3995 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3996 | + if (copy.versionlist != null) |
---|
| 3997 | + Replace(); |
---|
| 3998 | + |
---|
3769 | 3999 | cRadio ab; |
---|
3770 | 4000 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3771 | 4001 | { |
---|
.. | .. |
---|
3809 | 4039 | { |
---|
3810 | 4040 | Object3D child = (Object3D)e.nextElement(); |
---|
3811 | 4041 | if(child.editWindow != null) |
---|
3812 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3813 | 4042 | child.pinned = false; |
---|
3814 | 4043 | child.CloseUI(); |
---|
3815 | 4044 | listUI.remove(child); |
---|
| 4045 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3816 | 4046 | |
---|
3817 | 4047 | //child.editWindow = null; // ??????????? |
---|
3818 | 4048 | } |
---|
.. | .. |
---|
3831 | 4061 | obj.CloseUI(); |
---|
3832 | 4062 | } |
---|
3833 | 4063 | listUI.clear(); |
---|
| 4064 | + SetPinStates(group.selection.size() > 0); |
---|
3834 | 4065 | refreshContents(true); |
---|
3835 | 4066 | } else |
---|
3836 | 4067 | if (source == allParamsButton) |
---|
.. | .. |
---|
3863 | 4094 | } else |
---|
3864 | 4095 | if(source instanceof cRadio) |
---|
3865 | 4096 | { |
---|
| 4097 | + if (copy.versionlist != null) |
---|
| 4098 | + Replace(); |
---|
| 4099 | + |
---|
3866 | 4100 | group.parent = keepparent; |
---|
3867 | 4101 | group.attributes = 0; |
---|
3868 | 4102 | //group.editWindow = null; |
---|
.. | .. |
---|
3887 | 4121 | |
---|
3888 | 4122 | copy = group; |
---|
3889 | 4123 | |
---|
3890 | | - SetUndoStates(); |
---|
3891 | | - |
---|
3892 | 4124 | //Globals.theRenderer.object = group; |
---|
3893 | 4125 | if(!useclient) |
---|
3894 | 4126 | { |
---|
.. | .. |
---|
3916 | 4148 | */ |
---|
3917 | 4149 | radio.layout.doClick(); |
---|
3918 | 4150 | |
---|
| 4151 | + //assert(copy instanceof Composite); |
---|
| 4152 | + |
---|
| 4153 | + if (copy.versionlist == null) |
---|
| 4154 | + { |
---|
| 4155 | + copy.versionindex = -1; |
---|
| 4156 | + |
---|
| 4157 | + // Cannot work with loops |
---|
| 4158 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4159 | + // and check if any of these nodes are reachable below the root. |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4161 | + |
---|
| 4162 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4163 | + { |
---|
| 4164 | + if (copy.versionlist == null) |
---|
| 4165 | + copy.versionlist = new Object3D[100]; |
---|
| 4166 | + |
---|
| 4167 | + //Save(true); |
---|
| 4168 | + } |
---|
| 4169 | + else |
---|
| 4170 | + copy.versionindex = -2; |
---|
| 4171 | + |
---|
| 4172 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4173 | + } |
---|
| 4174 | + |
---|
| 4175 | + SetVersionStates(); |
---|
| 4176 | + |
---|
3919 | 4177 | ClearUnpinned(); |
---|
| 4178 | + |
---|
3920 | 4179 | //Grafreed.Assert(group != null); |
---|
3921 | 4180 | //Grafreed.Assert(group.selection != null); |
---|
3922 | 4181 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3933 | 4192 | } else if (event.getSource() == editCameraItem) |
---|
3934 | 4193 | { |
---|
3935 | 4194 | cameraView.ProtectCamera(); |
---|
| 4195 | + cameraView.requestFocusInWindow(); |
---|
3936 | 4196 | cameraView.repaint(); |
---|
3937 | 4197 | return; |
---|
3938 | 4198 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3939 | 4199 | { |
---|
3940 | 4200 | cameraView.RevertCamera(); |
---|
| 4201 | + cameraView.requestFocusInWindow(); |
---|
3941 | 4202 | cameraView.repaint(); |
---|
3942 | 4203 | return; |
---|
3943 | 4204 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
4026 | 4287 | refreshContents(); |
---|
4027 | 4288 | } |
---|
4028 | 4289 | |
---|
| 4290 | + void TextureRatio(int axis) |
---|
| 4291 | + { |
---|
| 4292 | + Object3D obj; |
---|
| 4293 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4294 | + { |
---|
| 4295 | + obj = (Object3D)e.nextElement(); |
---|
| 4296 | + obj.TextureRatio(axis); |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + refreshContents(); |
---|
| 4300 | + } |
---|
| 4301 | + |
---|
4029 | 4302 | void ResetTransform() |
---|
4030 | 4303 | { |
---|
4031 | 4304 | ResetTransform(-1); |
---|
.. | .. |
---|
4041 | 4314 | if (obj.toParent == null) |
---|
4042 | 4315 | continue; |
---|
4043 | 4316 | |
---|
4044 | | - if (mask == -1) |
---|
4045 | | - { |
---|
4046 | | - if (obj instanceof Camera) // jan 2014 |
---|
4047 | | - { |
---|
4048 | | - LA.matIdentity(obj.toParent); |
---|
4049 | | - LA.matIdentity(obj.fromParent); |
---|
4050 | | - } |
---|
4051 | | - else |
---|
4052 | | - { |
---|
4053 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4054 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4055 | | - } |
---|
4056 | | - TouchTransform(obj); |
---|
4057 | | - continue; |
---|
4058 | | - } |
---|
4059 | | - if ((mask&2) != 0) // Scale |
---|
4060 | | - { |
---|
4061 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4062 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4063 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4064 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4065 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4066 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4067 | | - } |
---|
4068 | | - if ((mask&4) != 0) // Rotation |
---|
4069 | | - { |
---|
4070 | | - // ? |
---|
4071 | | - } |
---|
4072 | | - if ((mask&1) != 0) // Translation |
---|
4073 | | - { |
---|
4074 | | - if (obj.toParent != null) |
---|
4075 | | - { |
---|
4076 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4077 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4078 | | - } |
---|
4079 | | - } |
---|
| 4317 | + obj.ResetTransform(mask); |
---|
| 4318 | + |
---|
4080 | 4319 | if (obj.parent == null) |
---|
4081 | 4320 | { |
---|
4082 | 4321 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4585 | 4824 | { |
---|
4586 | 4825 | Object3D obj = group.selection.get(i); |
---|
4587 | 4826 | |
---|
| 4827 | + if (obj.toParent == null) |
---|
| 4828 | + { |
---|
| 4829 | + obj.toParent = LA.newMatrix(); |
---|
| 4830 | + obj.fromParent = LA.newMatrix(); |
---|
| 4831 | + } |
---|
| 4832 | + |
---|
4588 | 4833 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4589 | 4834 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4590 | 4835 | } |
---|
.. | .. |
---|
4876 | 5121 | refreshContents(); |
---|
4877 | 5122 | } |
---|
4878 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
4879 | 5130 | void FlipV(boolean flip) |
---|
4880 | 5131 | { |
---|
4881 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5070 | 5321 | |
---|
5071 | 5322 | freezemodel = false; |
---|
5072 | 5323 | } |
---|
5073 | | - |
---|
5074 | | - boolean flashIt = true; |
---|
5075 | | - |
---|
| 5324 | + |
---|
5076 | 5325 | public void valueChanged(TreeSelectionEvent e) |
---|
5077 | 5326 | //public boolean handleEvent(Event event) |
---|
5078 | 5327 | { |
---|
.. | .. |
---|
5116 | 5365 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5117 | 5366 | // a camera |
---|
5118 | 5367 | { |
---|
5119 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5368 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5120 | 5369 | { |
---|
5121 | 5370 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5122 | 5371 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
5145 | 5394 | { |
---|
5146 | 5395 | editButton.setEnabled(enabled); |
---|
5147 | 5396 | uneditButton.setEnabled(enabled); |
---|
5148 | | - unselectButton.setEnabled(enabled); |
---|
| 5397 | + //unselectButton.setEnabled(enabled); |
---|
5149 | 5398 | flashSelectionButton.setEnabled(enabled); |
---|
| 5399 | + |
---|
| 5400 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5401 | + |
---|
| 5402 | + boolean allComposites = true; |
---|
| 5403 | + |
---|
| 5404 | + if (group.selection != null) |
---|
| 5405 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5406 | + { |
---|
| 5407 | + Object next = e.nextElement(); |
---|
| 5408 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5409 | + { |
---|
| 5410 | + allComposites = false; |
---|
| 5411 | + break; |
---|
| 5412 | + } |
---|
| 5413 | + } |
---|
| 5414 | + |
---|
| 5415 | + rootButton.setEnabled(true); // allComposites); |
---|
5150 | 5416 | } |
---|
5151 | 5417 | |
---|
5152 | 5418 | void refreshContents(boolean cp) |
---|
5153 | 5419 | { |
---|
5154 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5420 | + if (Globals.SHOWINFO) |
---|
| 5421 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5155 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5156 | 5423 | { |
---|
5157 | 5424 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5161 | 5428 | Object3D child = (Object3D) group.selection.get(i); |
---|
5162 | 5429 | |
---|
5163 | 5430 | objEditor.AddInfo(child, this, true); |
---|
5164 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5431 | +// System.err.println("info : " + child.GetPath()); |
---|
5165 | 5432 | } |
---|
5166 | 5433 | |
---|
5167 | 5434 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5987 | 6254 | |
---|
5988 | 6255 | cButton restoreCameraButton; |
---|
5989 | 6256 | |
---|
5990 | | - cButton saveButton; |
---|
5991 | 6257 | cButton oneStepButton; |
---|
5992 | 6258 | |
---|
5993 | 6259 | cButton groupButton; |
---|
.. | .. |
---|
6045 | 6311 | private MenuItem lookAtItem; |
---|
6046 | 6312 | private MenuItem lookFromItem; |
---|
6047 | 6313 | private MenuItem switchViewItem; |
---|
6048 | | - private MenuItem cutItem; |
---|
| 6314 | + private JMenuItem cutItem; |
---|
6049 | 6315 | private MenuItem undoItem; |
---|
6050 | 6316 | private MenuItem redoItem; |
---|
6051 | 6317 | private JMenuItem duplicateItem; |
---|
6052 | | - private MenuItem cloneItem; |
---|
| 6318 | + private JMenuItem cloneItem; |
---|
6053 | 6319 | private MenuItem cloneSupportItem; |
---|
6054 | 6320 | private MenuItem overwriteGeoItem; |
---|
6055 | 6321 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6070 | 6336 | private MenuItem cloneGeometriesItem; |
---|
6071 | 6337 | private MenuItem shareGeometriesItem; |
---|
6072 | 6338 | private MenuItem mergeGeometriesItem; |
---|
6073 | | - private MenuItem copyItem; |
---|
| 6339 | + private JMenuItem copyItem; |
---|
6074 | 6340 | private MenuItem pasteItem; |
---|
6075 | | - private MenuItem pasteIntoItem; |
---|
6076 | | - private MenuItem pasteLinkItem; |
---|
6077 | | - private MenuItem pasteCloneItem; |
---|
6078 | | - private MenuItem pasteExpandItem; |
---|
6079 | | - private MenuItem deleteItem; |
---|
| 6341 | + private JMenuItem pasteIntoItem; |
---|
| 6342 | + private JMenuItem pasteLinkItem; |
---|
| 6343 | + private JMenuItem pasteCloneItem; |
---|
| 6344 | + private JMenuItem pasteExpandItem; |
---|
| 6345 | + private JMenuItem deleteItem; |
---|
6080 | 6346 | private MenuItem clearAllItem; |
---|
6081 | 6347 | private MenuItem genUVItem; |
---|
6082 | 6348 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6102 | 6368 | private MenuItem clipMeshItem; |
---|
6103 | 6369 | private MenuItem smoothMeshItem; |
---|
6104 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6105 | 6372 | |
---|
6106 | 6373 | private MenuItem liveleavesItem; |
---|
6107 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6125 | 6392 | private MenuItem maxTexturesItem; |
---|
6126 | 6393 | private MenuItem panoTexturesItem; |
---|
6127 | 6394 | |
---|
| 6395 | + private MenuItem textureRatioRItem; |
---|
| 6396 | + private MenuItem textureRatioGItem; |
---|
| 6397 | + private MenuItem textureRatioBItem; |
---|
6128 | 6398 | private MenuItem resetCentroidItem; |
---|
6129 | 6399 | private MenuItem resetCentroidXZItem; |
---|
6130 | 6400 | private MenuItem resetTransformItem; |
---|
6131 | 6401 | private MenuItem transformGeometryItem; |
---|
6132 | 6402 | private MenuItem transformChildrenItem; |
---|
6133 | 6403 | private MenuItem hideItem; |
---|
6134 | | - private MenuItem grabItem; |
---|
| 6404 | + private JMenuItem grabItem; |
---|
6135 | 6405 | private MenuItem backItem; |
---|
6136 | 6406 | private MenuItem frontItem; |
---|
6137 | 6407 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6144 | 6414 | private MenuItem switchTransfoItem; |
---|
6145 | 6415 | private MenuItem morphItem; |
---|
6146 | 6416 | private MenuItem linkerItem; |
---|
6147 | | - private MenuItem ungroupItem; |
---|
| 6417 | + private JMenuItem ungroupItem; |
---|
6148 | 6418 | private MenuItem editItem; |
---|
6149 | 6419 | private MenuItem openWindowItem; |
---|
6150 | 6420 | private MenuItem editLeafItem; |
---|