.. | .. |
---|
29 | 29 | { |
---|
30 | 30 | cButton skyboxButton; |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | | - row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
36 | 36 | { |
---|
37 | 37 | @Override |
---|
.. | .. |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | 48 | final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
49 | | - row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
50 | 50 | textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
.. | .. |
---|
73 | 73 | cGridBag row5 = new cGridBag(); |
---|
74 | 74 | cGridBag row6 = new cGridBag(); |
---|
75 | 75 | |
---|
76 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
77 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
78 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
79 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
330 | 330 | |
---|
331 | 331 | public void ChangeSkybox(String skybox) |
---|
332 | 332 | { |
---|
333 | | - //cameraView.envyoff = false; |
---|
334 | | - group.skyboxname = skybox; |
---|
335 | | - group.skyboxext = "jpg"; |
---|
336 | | - 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 | + } |
---|
337 | 346 | } |
---|
338 | 347 | |
---|
339 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
340 | 349 | { |
---|
341 | | - JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
342 | 351 | |
---|
343 | 352 | AddSkyboxTab0(skyboxpane); |
---|
344 | 353 | AddSkyboxTab1(skyboxpane); |
---|
.. | .. |
---|
357 | 366 | } |
---|
358 | 367 | |
---|
359 | 368 | refreshContents(); |
---|
360 | | - } |
---|
361 | | - |
---|
362 | | - public void Show3DView() |
---|
363 | | - { |
---|
364 | | - // bug |
---|
365 | | - //gridPanel.setDividerLocation(1.0); |
---|
366 | | - //bigPanel.setDividerLocation(0.0); |
---|
367 | | - bigThree.ClearUI(); |
---|
368 | | - bigThree.add(centralPanel); |
---|
369 | | - bigThree.FlushUI(); |
---|
370 | 369 | } |
---|
371 | 370 | |
---|
372 | 371 | //ObjEditor objEditor; |
---|
.. | .. |
---|
406 | 405 | this.copy = this.group = group; |
---|
407 | 406 | //selectees = this.group.selectees; |
---|
408 | 407 | |
---|
409 | | - if (copy.versionlist == null) |
---|
410 | | - { |
---|
411 | | - copy.versionlist = new Object3D[100]; |
---|
412 | | - copy.versionindex = -1; |
---|
413 | | - |
---|
414 | | - Save(true); |
---|
415 | | - } |
---|
| 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 | +// } |
---|
416 | 417 | |
---|
417 | 418 | if(ui) |
---|
418 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
435 | 436 | |
---|
436 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
437 | 438 | |
---|
438 | | - if (copy.versionlist == null) |
---|
439 | | - { |
---|
440 | | - copy.versionlist = new Object3D[100]; |
---|
441 | | - copy.versionindex = -1; |
---|
442 | | - |
---|
443 | | - Save(true); |
---|
444 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
445 | 446 | } |
---|
446 | 447 | |
---|
447 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
482 | 483 | |
---|
483 | 484 | Object3D parent = obj.parent; |
---|
484 | 485 | obj.parent = null; |
---|
| 486 | + |
---|
485 | 487 | // Object3D support = obj.support; |
---|
486 | 488 | // obj.support = null; |
---|
487 | 489 | if (!supports) |
---|
488 | 490 | obj.SaveSupports(); |
---|
| 491 | + |
---|
489 | 492 | Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
| 493 | + |
---|
| 494 | + clone.ResetUUIDs(); |
---|
| 495 | + |
---|
490 | 496 | obj.parent = parent; |
---|
491 | 497 | // obj.support = support; |
---|
492 | 498 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
531 | 537 | // menu.add("-"); |
---|
532 | 538 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
533 | 539 | duplicateItem.addActionListener(this); |
---|
534 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 540 | + |
---|
| 541 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
535 | 542 | cloneItem.addActionListener(this); |
---|
536 | | - if (Globals.ADVANCED) |
---|
| 543 | + //if (Globals.ADVANCED) |
---|
537 | 544 | { |
---|
538 | 545 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
539 | 546 | cloneSupportItem.addActionListener(this); |
---|
540 | 547 | } |
---|
| 548 | + oe.jTree.popup.addSeparator(); |
---|
541 | 549 | menu.add("-"); |
---|
542 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 550 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
543 | 551 | cutItem.addActionListener(this); |
---|
544 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 552 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
545 | 553 | copyItem.addActionListener(this); |
---|
546 | 554 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
547 | 555 | pasteItem.addActionListener(this); |
---|
548 | 556 | |
---|
549 | | - menu.add("-"); |
---|
550 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 557 | + oe.jTree.popup.addSeparator(); |
---|
| 558 | + //menu.add("-"); |
---|
| 559 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
551 | 560 | pasteIntoItem.addActionListener(this); |
---|
552 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 561 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
553 | 562 | pasteLinkItem.addActionListener(this); |
---|
554 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 563 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
555 | 564 | pasteCloneItem.addActionListener(this); |
---|
556 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
557 | | -// pasteExpandItem.addActionListener(this); |
---|
558 | | - menu.add("-"); |
---|
559 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
560 | | - deleteItem.addActionListener(this); |
---|
| 565 | +// CRASH |
---|
| 566 | + pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
| 567 | +// |
---|
| 568 | + pasteExpandItem.addActionListener(this); |
---|
| 569 | + //menu.add("-"); |
---|
| 570 | + oe.jTree.popup.addSeparator(); |
---|
561 | 571 | |
---|
562 | 572 | if (Globals.ADVANCED) |
---|
563 | 573 | { |
---|
.. | .. |
---|
692 | 702 | setMasterItem.addActionListener(this); |
---|
693 | 703 | } |
---|
694 | 704 | |
---|
695 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
696 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
697 | | -// grabItem.addActionListener(this); |
---|
| 705 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 706 | + |
---|
698 | 707 | backItem = menu.add(new MenuItem("Back")); |
---|
699 | 708 | backItem.addActionListener(this); |
---|
700 | 709 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
702 | 711 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
703 | 712 | // compositeItem.addActionListener(this); |
---|
704 | 713 | |
---|
| 714 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 715 | + grabItem.addActionListener(this); |
---|
| 716 | + |
---|
705 | 717 | if (Globals.ADVANCED) |
---|
706 | 718 | { |
---|
707 | 719 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
708 | 720 | hideItem.addActionListener(this); |
---|
709 | 721 | } |
---|
710 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 722 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
711 | 723 | ungroupItem.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.jTree.popup.addSeparator(); |
---|
| 726 | + |
---|
| 727 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 728 | + deleteItem.addActionListener(this); |
---|
712 | 729 | |
---|
713 | 730 | // menu.add("-"); |
---|
714 | 731 | // |
---|
.. | .. |
---|
745 | 762 | shadowYItem.addActionListener(this); |
---|
746 | 763 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
747 | 764 | shadowZItem.addActionListener(this); |
---|
| 765 | + |
---|
748 | 766 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
749 | 767 | attributeItem.addActionListener(this); |
---|
750 | | - |
---|
751 | 768 | if (Globals.ADVANCED) |
---|
752 | 769 | { |
---|
753 | 770 | menu.add("-"); |
---|
.. | .. |
---|
759 | 776 | pointflowItem.addActionListener(this); |
---|
760 | 777 | } |
---|
761 | 778 | menu.add("-"); |
---|
| 779 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 780 | + textureRatioRItem.addActionListener(this); |
---|
| 781 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 782 | + textureRatioGItem.addActionListener(this); |
---|
| 783 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 784 | + textureRatioBItem.addActionListener(this); |
---|
| 785 | + menu.add("-"); |
---|
762 | 786 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
763 | 787 | resetTransformItem.addActionListener(this); |
---|
764 | 788 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
765 | 789 | resetCentroidItem.addActionListener(this); |
---|
766 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 790 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
767 | 791 | resetCentroidXZItem.addActionListener(this); |
---|
768 | 792 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
769 | 793 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
779 | 803 | genNormalsCADItem.addActionListener(this); |
---|
780 | 804 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
781 | 805 | genNormalsMESHItem.addActionListener(this); |
---|
782 | | - if (Globals.ADVANCED) |
---|
| 806 | + //if (Globals.ADVANCED) |
---|
783 | 807 | { |
---|
784 | 808 | genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
785 | 809 | genNormalsMINEItem.addActionListener(this); |
---|
.. | .. |
---|
815 | 839 | } |
---|
816 | 840 | |
---|
817 | 841 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 842 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 843 | + clearVersionsItem.addActionListener(this); |
---|
818 | 844 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
819 | 845 | clearMaterialsItem.addActionListener(this); |
---|
820 | 846 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
837 | 863 | hideleavesItem.addActionListener(this); |
---|
838 | 864 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
839 | 865 | showleavesItem.addActionListener(this); |
---|
840 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 866 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
841 | 867 | markleavesItem.addActionListener(this); |
---|
842 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 868 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
843 | 869 | unmarkleavesItem.addActionListener(this); |
---|
844 | 870 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
845 | 871 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
914 | 940 | |
---|
915 | 941 | JTabbedPane resourcecontainer; |
---|
916 | 942 | cGridBag currenttab; |
---|
917 | | - boolean added; // patch for jar |
---|
| 943 | + //boolean added; // patch for jar |
---|
918 | 944 | |
---|
| 945 | + int totalcount = 0; |
---|
| 946 | + |
---|
919 | 947 | int tabcount = 0; |
---|
920 | 948 | int colcount = 0; |
---|
921 | 949 | int rowcount = 0; |
---|
.. | .. |
---|
931 | 959 | // System.out.println(); |
---|
932 | 960 | |
---|
933 | 961 | if (//rowcount == 0 || |
---|
934 | | - path.length == 1) |
---|
| 962 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
935 | 963 | { |
---|
936 | 964 | currenttab = new cGridBag(); |
---|
937 | | - added = false; |
---|
938 | 965 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
939 | 966 | currenttab.setName(tabname); |
---|
| 967 | + //added = false; |
---|
| 968 | + resourcecontainer.add(currenttab); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
940 | 970 | rowcount = 1; |
---|
941 | 971 | colcount = 0; |
---|
942 | 972 | texturecount = 0; |
---|
943 | 973 | } |
---|
944 | 974 | |
---|
945 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 975 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
946 | 976 | { |
---|
947 | | - if (!added) |
---|
| 977 | + //if (!added) |
---|
948 | 978 | { |
---|
949 | | - added = true; |
---|
950 | | - resourcecontainer.add(currenttab); |
---|
| 979 | + //added = true; |
---|
951 | 980 | String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
952 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 981 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
953 | 982 | } |
---|
954 | 983 | |
---|
955 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 984 | + columns = 5; |
---|
| 985 | + |
---|
| 986 | + if (path[0].contains("D&R") || path[0].contains("Paint")) |
---|
| 987 | + columns = 4; |
---|
| 988 | + |
---|
| 989 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 990 | + totalcount++; |
---|
956 | 991 | |
---|
957 | 992 | if (++colcount >= columns) |
---|
958 | 993 | { |
---|
.. | .. |
---|
978 | 1013 | container.add(resourcecontainer); |
---|
979 | 1014 | |
---|
980 | 1015 | Grafreed.ParseResources("textures", this); |
---|
| 1016 | + |
---|
| 1017 | + // 935. System.out.println("Total = " + totalcount); |
---|
981 | 1018 | } |
---|
982 | 1019 | |
---|
983 | 1020 | void SetupUI2(ObjEditor oe) |
---|
.. | .. |
---|
1017 | 1054 | oe.radioPanel.add(dummyButton); |
---|
1018 | 1055 | oe.buttonGroup.add(dummyButton); |
---|
1019 | 1056 | */ |
---|
1020 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1057 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1021 | 1058 | |
---|
1022 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1059 | + versionManagerPanel.preferredHeight = 4; |
---|
1023 | 1060 | |
---|
1024 | 1061 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1025 | 1062 | |
---|
.. | .. |
---|
1034 | 1071 | // maxButton.addActionListener(this); |
---|
1035 | 1072 | } |
---|
1036 | 1073 | |
---|
1037 | | -// cButton gcButton; |
---|
1038 | | -// |
---|
| 1074 | + cButton gcButton; |
---|
| 1075 | + |
---|
1039 | 1076 | // oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1040 | 1077 | // gcButton.setToolTipText("Garbage collect"); |
---|
1041 | 1078 | // gcButton.addActionListener(new ActionListener() |
---|
.. | .. |
---|
1046 | 1083 | // } |
---|
1047 | 1084 | // }); |
---|
1048 | 1085 | |
---|
1049 | | - oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1086 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1088 | + fullScreenButton.addActionListener(this); |
---|
| 1089 | + |
---|
| 1090 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1050 | 1091 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1051 | 1092 | collapseButton.addActionListener(this); |
---|
1052 | 1093 | |
---|
1053 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1054 | | - maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1055 | | - maximize3DButton.addActionListener(this); |
---|
| 1094 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1096 | +// maximize3DButton.addActionListener(this); |
---|
1056 | 1097 | |
---|
1057 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1098 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1058 | 1099 | twoButton.setToolTipText("Show 3D view only"); |
---|
1059 | 1100 | twoButton.addActionListener(this); |
---|
1060 | 1101 | this.fullscreenLayout = twoButton; |
---|
1061 | 1102 | |
---|
1062 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1103 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1063 | 1104 | threeButton.setToolTipText("Show controls and 3D view"); |
---|
1064 | 1105 | threeButton.addActionListener(this); |
---|
1065 | 1106 | if (Globals.ADVANCED) |
---|
1066 | 1107 | { |
---|
1067 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1108 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1109 | sixButton.setToolTipText("Show 3D view and controls"); |
---|
1069 | 1110 | sixButton.addActionListener(this); |
---|
1070 | 1111 | } |
---|
.. | .. |
---|
1073 | 1114 | // sevenButton.addActionListener(this); |
---|
1074 | 1115 | // |
---|
1075 | 1116 | |
---|
1076 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | | - fullButton.setToolTipText("Full-screen window"); |
---|
1078 | | - fullButton.addActionListener(this); |
---|
1079 | | - |
---|
1080 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
1082 | 1119 | screenfitButton.addActionListener(this); |
---|
1083 | 1120 | |
---|
1084 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1121 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1122 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1086 | 1123 | restoreCameraButton.addActionListener(this); |
---|
1087 | 1124 | |
---|
1088 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1126 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1090 | 1127 | saveVersionButton.addActionListener(this); |
---|
1091 | 1128 | |
---|
1092 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1130 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1094 | 1131 | deleteVersionButton.addActionListener(this); |
---|
| 1132 | + deleteVersionButton.setEnabled(false); |
---|
1095 | 1133 | |
---|
1096 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1135 | previousVersionButton.setToolTipText("Previous version"); |
---|
1098 | 1136 | previousVersionButton.addActionListener(this); |
---|
1099 | 1137 | previousVersionButton.setEnabled(false); |
---|
1100 | 1138 | |
---|
1101 | 1139 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1102 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1103 | 1141 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1104 | 1142 | restoreButton.addActionListener(this); |
---|
1105 | | - //restoreButton.setEnabled(false); |
---|
| 1143 | + restoreButton.setEnabled(false); |
---|
1106 | 1144 | |
---|
1107 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1145 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1146 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1109 | 1147 | replaceButton.addActionListener(this); |
---|
1110 | | - //replaceButton.setEnabled(false); |
---|
| 1148 | + replaceButton.setEnabled(false); |
---|
1111 | 1149 | |
---|
1112 | | - copyOptionsPanel.add(updown); |
---|
| 1150 | + versionManagerPanel.add(updown); |
---|
1113 | 1151 | |
---|
1114 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1152 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | 1153 | nextVersionButton.setToolTipText("Next version"); |
---|
1116 | 1154 | nextVersionButton.addActionListener(this); |
---|
1117 | 1155 | nextVersionButton.setEnabled(false); |
---|
1118 | 1156 | |
---|
1119 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1157 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1120 | 1158 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1121 | 1159 | oneStepButton.addActionListener(this); |
---|
1122 | 1160 | |
---|
.. | .. |
---|
1139 | 1177 | |
---|
1140 | 1178 | if (Globals.ADVANCED) |
---|
1141 | 1179 | { |
---|
1142 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1143 | 1181 | snapobjectButton.addActionListener(this); |
---|
1144 | 1182 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1145 | 1183 | |
---|
1146 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1147 | 1185 | fourButton.addActionListener(this); |
---|
1148 | 1186 | fourButton.setToolTipText("Show control panel only"); |
---|
1149 | 1187 | } |
---|
.. | .. |
---|
1151 | 1189 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1152 | 1190 | |
---|
1153 | 1191 | |
---|
1154 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1192 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1155 | 1193 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1156 | 1194 | rootButton.addActionListener(this); |
---|
1157 | 1195 | |
---|
1158 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1159 | 1197 | closeButton.setToolTipText("Close tab"); |
---|
1160 | 1198 | closeButton.addActionListener(this); |
---|
1161 | 1199 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
1162 | 1200 | //clearButton.addActionListener(this); |
---|
1163 | 1201 | |
---|
1164 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
1165 | 1204 | |
---|
1166 | 1205 | // INSERT |
---|
1167 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1168 | 1207 | gridButton.setToolTipText("Create ground"); |
---|
1169 | 1208 | gridButton.addActionListener(this); |
---|
1170 | 1209 | |
---|
1171 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1172 | 1211 | boxButton.setToolTipText("Create box"); |
---|
1173 | 1212 | boxButton.addActionListener(this); |
---|
1174 | 1213 | |
---|
1175 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1176 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1177 | | - sphereButton.addActionListener(this); |
---|
1178 | | - |
---|
1179 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1180 | | - coneButton.setToolTipText("Create cone"); |
---|
1181 | | - coneButton.addActionListener(this); |
---|
1182 | | - |
---|
1183 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1184 | | - torusButton.setToolTipText("Create torus"); |
---|
1185 | | - torusButton.addActionListener(this); |
---|
1186 | | - |
---|
1187 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1188 | 1215 | superButton.setToolTipText("Create superellipsoid"); |
---|
1189 | 1216 | superButton.addActionListener(this); |
---|
1190 | 1217 | |
---|
1191 | | - if (Globals.ADVANCED) |
---|
| 1218 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1220 | + sphereButton.addActionListener(this); |
---|
| 1221 | + |
---|
| 1222 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1223 | + coneButton.setToolTipText("Create cone"); |
---|
| 1224 | + coneButton.addActionListener(this); |
---|
| 1225 | + |
---|
| 1226 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1227 | + torusButton.setToolTipText("Create torus"); |
---|
| 1228 | + torusButton.addActionListener(this); |
---|
| 1229 | + |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
1192 | 1231 | { |
---|
1193 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1194 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1195 | 1234 | kleinButton.addActionListener(this); |
---|
1196 | 1235 | } |
---|
1197 | 1236 | |
---|
1198 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1199 | 1238 | particlesButton.setToolTipText("Create particle system"); |
---|
1200 | 1239 | particlesButton.addActionListener(this); |
---|
1201 | 1240 | |
---|
1202 | 1241 | oe.toolboxPanel.add(row1); |
---|
1203 | 1242 | |
---|
1204 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
1205 | 1245 | |
---|
1206 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1207 | 1247 | groupButton.setToolTipText("Create group"); |
---|
1208 | 1248 | groupButton.addActionListener(this); |
---|
1209 | 1249 | |
---|
1210 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1211 | 1251 | compositeButton.setToolTipText("Create composite"); |
---|
1212 | 1252 | compositeButton.addActionListener(this); |
---|
1213 | 1253 | |
---|
1214 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1215 | 1255 | switchButton.setToolTipText("Create item switcher"); |
---|
1216 | 1256 | switchButton.addActionListener(this); |
---|
1217 | 1257 | |
---|
1218 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1219 | 1259 | loopButton.setToolTipText("Create loop"); |
---|
1220 | 1260 | loopButton.addActionListener(this); |
---|
1221 | 1261 | |
---|
1222 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1223 | 1263 | textureButton.setToolTipText("Create texture"); |
---|
1224 | 1264 | textureButton.addActionListener(this); |
---|
1225 | 1265 | |
---|
1226 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1227 | 1267 | overlayButton.setToolTipText("Create overlay"); |
---|
1228 | 1268 | overlayButton.addActionListener(this); |
---|
1229 | 1269 | |
---|
1230 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1270 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1231 | 1271 | lightButton.setToolTipText("Create light"); |
---|
1232 | 1272 | lightButton.addActionListener(this); |
---|
1233 | 1273 | |
---|
.. | .. |
---|
1237 | 1277 | |
---|
1238 | 1278 | CreateTexturePanel(textures); |
---|
1239 | 1279 | |
---|
| 1280 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1281 | + |
---|
| 1282 | + if (tabCount > 0) |
---|
| 1283 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1284 | + |
---|
1240 | 1285 | oe.toolboxPanel.add(textures); |
---|
1241 | 1286 | |
---|
1242 | 1287 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1244 | 1289 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1245 | 1290 | |
---|
1246 | 1291 | // EDIT panel |
---|
1247 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1292 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1248 | 1293 | editButton.setToolTipText("Pin selection controls"); |
---|
1249 | 1294 | editButton.addActionListener(this); |
---|
1250 | 1295 | |
---|
1251 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1296 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1252 | 1297 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1253 | 1298 | uneditButton.addActionListener(this); |
---|
1254 | 1299 | |
---|
.. | .. |
---|
1256 | 1301 | allParamsButton.setToolTipText("Show all controls"); |
---|
1257 | 1302 | allParamsButton.addActionListener(this); |
---|
1258 | 1303 | |
---|
1259 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1304 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1260 | 1305 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1261 | 1306 | clearPanelButton.addActionListener(this); |
---|
1262 | 1307 | |
---|
.. | .. |
---|
1264 | 1309 | //unselectButton.setToolTipText("Unselect"); |
---|
1265 | 1310 | //unselectButton.addActionListener(this); |
---|
1266 | 1311 | |
---|
1267 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1312 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1268 | 1313 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1269 | 1314 | flashSelectionButton.addActionListener(this); |
---|
1270 | 1315 | |
---|
.. | .. |
---|
1287 | 1332 | |
---|
1288 | 1333 | cGridBag jSPPanel = new cGridBag(); |
---|
1289 | 1334 | |
---|
| 1335 | + jSPPanel.preferredHeight = 20; |
---|
| 1336 | + |
---|
1290 | 1337 | JScrollPane jSP; |
---|
1291 | 1338 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1292 | 1339 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1295 | 1342 | oe.treePanel.add(jSPPanel); |
---|
1296 | 1343 | oe.treePanel.Return(); |
---|
1297 | 1344 | |
---|
1298 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1345 | + oe.treePanel.add(versionManagerPanel); |
---|
1299 | 1346 | oe.treePanel.Return(); |
---|
1300 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1301 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1302 | | - sliderPane.preferredHeight = 1; |
---|
| 1347 | + |
---|
| 1348 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1349 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1350 | + versionSliderPane.preferredHeight = 3; |
---|
1303 | 1351 | |
---|
1304 | 1352 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1305 | 1353 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1356 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1357 | 1405 | // supportCB.addItemListener(this); |
---|
1358 | 1406 | |
---|
1359 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1360 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1361 | 1409 | freezeCB.addItemListener(this); |
---|
1362 | 1410 | |
---|
.. | .. |
---|
1365 | 1413 | |
---|
1366 | 1414 | panel.Return(); |
---|
1367 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1368 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1369 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1370 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1371 | 1422 | |
---|
1372 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1373 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
.. | .. |
---|
1380 | 1431 | minshaderCB.setToolTipText("Minimal fast shader"); |
---|
1381 | 1432 | minshaderCB.addItemListener(this); |
---|
1382 | 1433 | |
---|
1383 | | -// constraints.gridy += 1; |
---|
1384 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1385 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1386 | 1436 | |
---|
1387 | | - panel.Return(); |
---|
1388 | | - |
---|
1389 | 1437 | if (false) |
---|
1390 | 1438 | { |
---|
1391 | 1439 | // handled in scripts |
---|
1392 | | - //constraints.gridy += 1; |
---|
1393 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1394 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1395 | 1442 | |
---|
1396 | | - //constraints.gridy += 1; |
---|
1397 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1398 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1399 | 1445 | |
---|
1400 | | - //constraints.gridy += 1; |
---|
1401 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1402 | | - smoothfocusCB.addItemListener(this); |
---|
1403 | 1446 | panel.Return(); |
---|
1404 | 1447 | } |
---|
1405 | 1448 | |
---|
1406 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1407 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1408 | 1455 | // debugCB.addItemListener(this); |
---|
1409 | 1456 | |
---|
.. | .. |
---|
1457 | 1504 | |
---|
1458 | 1505 | void EditObject(Object3D obj) |
---|
1459 | 1506 | { |
---|
1460 | | - assert(obj instanceof Composite); |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
1461 | 1508 | |
---|
1462 | | - if (obj.versionlist == null) |
---|
1463 | | - { |
---|
1464 | | - obj.versionlist = new Object3D[100]; |
---|
1465 | | - obj.versionindex = -1; |
---|
1466 | | - } |
---|
| 1509 | +// if (obj.versionlist == null) |
---|
| 1510 | +// { |
---|
| 1511 | +// obj.versionlist = new Object3D[100]; |
---|
| 1512 | +// obj.versionindex = -1; |
---|
| 1513 | +// } |
---|
1467 | 1514 | |
---|
1468 | 1515 | cRadio radioButton = new cRadio(obj.name); |
---|
1469 | 1516 | |
---|
.. | .. |
---|
1489 | 1536 | |
---|
1490 | 1537 | oe.SetupViews(); |
---|
1491 | 1538 | |
---|
| 1539 | + if (Globals.DEBUG) |
---|
1492 | 1540 | System.out.println("SetupViews"); |
---|
1493 | 1541 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1494 | 1542 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
2041 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
2042 | 2090 | objEditor.ScreenFit(obj, false); |
---|
2043 | 2091 | |
---|
2044 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
2045 | 2093 | refreshContents(); |
---|
2046 | 2094 | } |
---|
2047 | 2095 | |
---|
.. | .. |
---|
2078 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
2079 | 2127 | } |
---|
2080 | 2128 | |
---|
2081 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
2082 | 2130 | |
---|
2083 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
2084 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
2092 | 2140 | switch(axis) |
---|
2093 | 2141 | { |
---|
2094 | 2142 | case 0 : |
---|
2095 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2096 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
2097 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2098 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2143 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2144 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2145 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2146 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
2099 | 2147 | norm = cVector.X; |
---|
2100 | 2148 | break; |
---|
2101 | 2149 | case 1 : |
---|
2102 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2103 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2104 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
2105 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2150 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2151 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2152 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2153 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
2106 | 2154 | norm = cVector.Y; |
---|
2107 | 2155 | break; |
---|
2108 | 2156 | case 2 : |
---|
2109 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
2110 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
2111 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
2112 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2157 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2158 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2159 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2160 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
2113 | 2161 | norm = cVector.Z; |
---|
2114 | 2162 | break; |
---|
2115 | 2163 | } |
---|
.. | .. |
---|
2150 | 2198 | shadow.material = new cMaterial(obj.material); |
---|
2151 | 2199 | shadow.material.diffuse = 0.0001f; |
---|
2152 | 2200 | shadow.material.specular = 0.0001f; |
---|
2153 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2201 | + shadow.material.opacity = 0.75f; |
---|
| 2202 | + |
---|
| 2203 | + AllocProjectedVertices(shadow); |
---|
| 2204 | + |
---|
| 2205 | + shadow.projectedVertices[1].x = 300; |
---|
2154 | 2206 | |
---|
2155 | 2207 | makeSomething(shadow); |
---|
2156 | 2208 | } |
---|
.. | .. |
---|
2671 | 2723 | } else |
---|
2672 | 2724 | if (source == loopItem || source == loopButton) |
---|
2673 | 2725 | { |
---|
| 2726 | + if (!group.selection.isEmpty()) |
---|
| 2727 | + { |
---|
2674 | 2728 | Composite csg = new GroupLeaf(); |
---|
2675 | | - csg.count = 5; |
---|
2676 | 2729 | group(csg); |
---|
| 2730 | + csg.count = 5; |
---|
2677 | 2731 | Composite child = new cGroup("Branch"); |
---|
2678 | 2732 | csg.addChild(child); |
---|
2679 | 2733 | child.addChild(csg); |
---|
| 2734 | + } |
---|
2680 | 2735 | } else |
---|
2681 | 2736 | if (source == doubleItem) |
---|
2682 | 2737 | { |
---|
| 2738 | + if (!group.selection.isEmpty()) |
---|
| 2739 | + { |
---|
2683 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
2684 | | - csg.count = 5; |
---|
2685 | 2741 | group(csg); |
---|
| 2742 | + csg.count = 5; |
---|
2686 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2687 | 2744 | csg.addChild(child); |
---|
2688 | 2745 | child.addChild(csg); |
---|
2689 | 2746 | child = new cGroup("Branch B"); |
---|
2690 | 2747 | csg.addChild(child); |
---|
2691 | 2748 | child.addChild(csg); |
---|
| 2749 | + } |
---|
2692 | 2750 | } else |
---|
2693 | 2751 | if (source == tripleItem) |
---|
2694 | 2752 | { |
---|
| 2753 | + if (!group.selection.isEmpty()) |
---|
| 2754 | + { |
---|
2695 | 2755 | Composite csg = new GroupLeaf("Trident"); |
---|
2696 | 2756 | csg.count = 4; |
---|
2697 | 2757 | group(csg); |
---|
.. | .. |
---|
2704 | 2764 | child = new cGroup(); |
---|
2705 | 2765 | csg.addChild(child); |
---|
2706 | 2766 | child.addChild(csg); |
---|
| 2767 | + } |
---|
2707 | 2768 | } else |
---|
2708 | 2769 | if (source == computeAOItem) |
---|
2709 | 2770 | { |
---|
.. | .. |
---|
2750 | 2811 | { |
---|
2751 | 2812 | Maximize(); |
---|
2752 | 2813 | } else |
---|
2753 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2754 | 2815 | { |
---|
2755 | 2816 | ToggleFullScreen(); |
---|
2756 | 2817 | } else |
---|
.. | .. |
---|
2759 | 2820 | this.expandedLayout = radio.layout; |
---|
2760 | 2821 | CollapseToolbar(); |
---|
2761 | 2822 | } else |
---|
2762 | | - if (source == maximize3DButton) |
---|
2763 | | - { |
---|
2764 | | - this.expandedLayout = radio.layout; |
---|
2765 | | - radio.layout = twoButton; |
---|
2766 | | - Show3DView(); |
---|
2767 | | - CollapseToolbar(); |
---|
2768 | | - } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
2769 | 2830 | if (source == previousVersionButton) |
---|
2770 | 2831 | { |
---|
2771 | 2832 | // Go to previous version |
---|
.. | .. |
---|
2793 | 2854 | if (source == saveVersionButton) |
---|
2794 | 2855 | { |
---|
2795 | 2856 | // Save a new version |
---|
2796 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2797 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2798 | 2859 | } else |
---|
2799 | 2860 | if (source == deleteVersionButton) |
---|
.. | .. |
---|
3339 | 3400 | } else |
---|
3340 | 3401 | if (source == ungroupItem || source == ungroupButton) |
---|
3341 | 3402 | { |
---|
3342 | | - boolean hasRoot = false; |
---|
| 3403 | + boolean canUngroup = true; |
---|
3343 | 3404 | |
---|
3344 | 3405 | for (int i=0; i<group.selection.size(); i++) |
---|
3345 | 3406 | { |
---|
3346 | | - if (group.selection.get(i) == group) |
---|
| 3407 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3408 | + |
---|
| 3409 | + if (selectedItem.Size() == 0) |
---|
3347 | 3410 | { |
---|
3348 | | - hasRoot = true; |
---|
| 3411 | + // Cannot ungroup leaves |
---|
| 3412 | + canUngroup = false; |
---|
| 3413 | + break; |
---|
| 3414 | + } |
---|
| 3415 | + |
---|
| 3416 | + if (selectedItem == group) |
---|
| 3417 | + { |
---|
| 3418 | + // Cannot ungroup root |
---|
| 3419 | + canUngroup = false; |
---|
3349 | 3420 | break; |
---|
3350 | 3421 | } |
---|
3351 | 3422 | } |
---|
3352 | 3423 | |
---|
3353 | | - if (!hasRoot) |
---|
| 3424 | + if (canUngroup) |
---|
3354 | 3425 | { |
---|
3355 | 3426 | for (int i=0; i<group.selection.size(); i++) |
---|
3356 | 3427 | { |
---|
3357 | | - Ungroup(group.selection.get(i)); |
---|
| 3428 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3429 | + |
---|
| 3430 | + Ungroup(selectedItem); |
---|
3358 | 3431 | } |
---|
3359 | 3432 | |
---|
3360 | 3433 | ClearSelection(false); |
---|
.. | .. |
---|
3405 | 3478 | if (source == clearMaterialsItem) |
---|
3406 | 3479 | { |
---|
3407 | 3480 | ClearMaterials(); |
---|
| 3481 | + } else |
---|
| 3482 | + if (source == clearVersionsItem) |
---|
| 3483 | + { |
---|
| 3484 | + ClearVersions(); |
---|
3408 | 3485 | } else |
---|
3409 | 3486 | if (source == liveleavesItem) |
---|
3410 | 3487 | { |
---|
.. | .. |
---|
3545 | 3622 | if (source == transformChildrenItem) |
---|
3546 | 3623 | { |
---|
3547 | 3624 | TransformChildren(); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioRItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(0); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioGItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(1); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == textureRatioBItem) |
---|
| 3635 | + { |
---|
| 3636 | + TextureRatio(2); |
---|
3548 | 3637 | } else |
---|
3549 | 3638 | if (source == resetTransformItem) |
---|
3550 | 3639 | { |
---|
.. | .. |
---|
3918 | 4007 | if (source == closeButton) |
---|
3919 | 4008 | { |
---|
3920 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
| 4012 | + |
---|
3921 | 4013 | cRadio ab; |
---|
3922 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3923 | 4015 | { |
---|
.. | .. |
---|
4016 | 4108 | } else |
---|
4017 | 4109 | if(source instanceof cRadio) |
---|
4018 | 4110 | { |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
| 4113 | + |
---|
4019 | 4114 | group.parent = keepparent; |
---|
4020 | 4115 | group.attributes = 0; |
---|
4021 | 4116 | //group.editWindow = null; |
---|
.. | .. |
---|
4067 | 4162 | */ |
---|
4068 | 4163 | radio.layout.doClick(); |
---|
4069 | 4164 | |
---|
4070 | | - SetUndoStates(); |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
| 4166 | + |
---|
| 4167 | + if (copy.versionlist == null) |
---|
| 4168 | + { |
---|
| 4169 | + copy.versionindex = -1; |
---|
| 4170 | + |
---|
| 4171 | + // Cannot work with loops |
---|
| 4172 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4173 | + // and check if any of these nodes are reachable below the root. |
---|
| 4174 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4175 | + |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4177 | + { |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
| 4180 | + |
---|
| 4181 | + //Save(true); |
---|
| 4182 | + } |
---|
| 4183 | + else |
---|
| 4184 | + copy.versionindex = -2; |
---|
| 4185 | + |
---|
| 4186 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4187 | + } |
---|
| 4188 | + |
---|
| 4189 | + SetVersionStates(); |
---|
4071 | 4190 | |
---|
4072 | 4191 | ClearUnpinned(); |
---|
4073 | 4192 | |
---|
.. | .. |
---|
4182 | 4301 | refreshContents(); |
---|
4183 | 4302 | } |
---|
4184 | 4303 | |
---|
| 4304 | + void TextureRatio(int axis) |
---|
| 4305 | + { |
---|
| 4306 | + Object3D obj; |
---|
| 4307 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4308 | + { |
---|
| 4309 | + obj = (Object3D)e.nextElement(); |
---|
| 4310 | + obj.TextureRatio(axis); |
---|
| 4311 | + } |
---|
| 4312 | + |
---|
| 4313 | + refreshContents(); |
---|
| 4314 | + } |
---|
| 4315 | + |
---|
4185 | 4316 | void ResetTransform() |
---|
4186 | 4317 | { |
---|
4187 | 4318 | ResetTransform(-1); |
---|
| 4319 | + } |
---|
| 4320 | + |
---|
| 4321 | + void ScaleSelection(int scale) |
---|
| 4322 | + { |
---|
| 4323 | + Object3D obj; |
---|
| 4324 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4325 | + { |
---|
| 4326 | + obj = (Object3D)e.nextElement(); |
---|
| 4327 | + |
---|
| 4328 | + if (obj.toParent == null) |
---|
| 4329 | + continue; |
---|
| 4330 | + |
---|
| 4331 | + obj.Scale(scale); |
---|
| 4332 | + |
---|
| 4333 | + if (obj.parent == null) |
---|
| 4334 | + { |
---|
| 4335 | + System.out.println("NULL PARENT!"); |
---|
| 4336 | + // new Exception().printStackTrace(); |
---|
| 4337 | + } |
---|
| 4338 | + else |
---|
| 4339 | + TouchTransform(obj); |
---|
| 4340 | + //obj.parent.Touch(); |
---|
| 4341 | + } |
---|
| 4342 | + |
---|
| 4343 | + refreshContents(); |
---|
4188 | 4344 | } |
---|
4189 | 4345 | |
---|
4190 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
4197 | 4353 | if (obj.toParent == null) |
---|
4198 | 4354 | continue; |
---|
4199 | 4355 | |
---|
4200 | | - if (mask == -1) |
---|
4201 | | - { |
---|
4202 | | - if (obj instanceof Camera) // jan 2014 |
---|
4203 | | - { |
---|
4204 | | - LA.matIdentity(obj.toParent); |
---|
4205 | | - LA.matIdentity(obj.fromParent); |
---|
4206 | | - } |
---|
4207 | | - else |
---|
4208 | | - { |
---|
4209 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4210 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4211 | | - } |
---|
4212 | | - TouchTransform(obj); |
---|
4213 | | - continue; |
---|
4214 | | - } |
---|
4215 | | - if ((mask&2) != 0) // Scale |
---|
4216 | | - { |
---|
4217 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4218 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4219 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4220 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4221 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4222 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4223 | | - } |
---|
4224 | | - if ((mask&4) != 0) // Rotation |
---|
4225 | | - { |
---|
4226 | | - // ? |
---|
4227 | | - } |
---|
4228 | | - if ((mask&1) != 0) // Translation |
---|
4229 | | - { |
---|
4230 | | - if (obj.toParent != null) |
---|
4231 | | - { |
---|
4232 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4233 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4234 | | - } |
---|
4235 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4236 | 4358 | if (obj.parent == null) |
---|
4237 | 4359 | { |
---|
4238 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4741 | 4863 | { |
---|
4742 | 4864 | Object3D obj = group.selection.get(i); |
---|
4743 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4744 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4745 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4746 | 4874 | } |
---|
4747 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4748 | 4877 | refreshContents(); |
---|
4749 | 4878 | } |
---|
4750 | 4879 | |
---|
.. | .. |
---|
5032 | 5161 | refreshContents(); |
---|
5033 | 5162 | } |
---|
5034 | 5163 | |
---|
| 5164 | + void ClearVersions() |
---|
| 5165 | + { |
---|
| 5166 | + group.selection.ClearVersions(); |
---|
| 5167 | + refreshContents(); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
5035 | 5170 | void FlipV(boolean flip) |
---|
5036 | 5171 | { |
---|
5037 | 5172 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5270 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5271 | 5406 | // a camera |
---|
5272 | 5407 | { |
---|
5273 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5408 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5274 | 5409 | { |
---|
5275 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5276 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5277 | 5412 | } |
---|
5278 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5279 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5306 | 5441 | |
---|
5307 | 5442 | boolean allComposites = true; |
---|
5308 | 5443 | |
---|
| 5444 | + if (group.selection != null) |
---|
5309 | 5445 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
5310 | 5446 | { |
---|
5311 | | - if (!(e.nextElement() instanceof Composite)) |
---|
| 5447 | + Object next = e.nextElement(); |
---|
| 5448 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
5312 | 5449 | { |
---|
5313 | 5450 | allComposites = false; |
---|
5314 | 5451 | break; |
---|
5315 | 5452 | } |
---|
5316 | 5453 | } |
---|
5317 | 5454 | |
---|
5318 | | - rootButton.setEnabled(allComposites); |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5319 | 5456 | } |
---|
5320 | 5457 | |
---|
5321 | 5458 | void refreshContents(boolean cp) |
---|
5322 | 5459 | { |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
5323 | 5461 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5324 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5325 | 5463 | { |
---|
.. | .. |
---|
6213 | 6351 | private MenuItem lookAtItem; |
---|
6214 | 6352 | private MenuItem lookFromItem; |
---|
6215 | 6353 | private MenuItem switchViewItem; |
---|
6216 | | - private MenuItem cutItem; |
---|
| 6354 | + private JMenuItem cutItem; |
---|
6217 | 6355 | private MenuItem undoItem; |
---|
6218 | 6356 | private MenuItem redoItem; |
---|
6219 | 6357 | private JMenuItem duplicateItem; |
---|
6220 | | - private MenuItem cloneItem; |
---|
| 6358 | + private JMenuItem cloneItem; |
---|
6221 | 6359 | private MenuItem cloneSupportItem; |
---|
6222 | 6360 | private MenuItem overwriteGeoItem; |
---|
6223 | 6361 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6238 | 6376 | private MenuItem cloneGeometriesItem; |
---|
6239 | 6377 | private MenuItem shareGeometriesItem; |
---|
6240 | 6378 | private MenuItem mergeGeometriesItem; |
---|
6241 | | - private MenuItem copyItem; |
---|
| 6379 | + private JMenuItem copyItem; |
---|
6242 | 6380 | private MenuItem pasteItem; |
---|
6243 | | - private MenuItem pasteIntoItem; |
---|
6244 | | - private MenuItem pasteLinkItem; |
---|
6245 | | - private MenuItem pasteCloneItem; |
---|
6246 | | - private MenuItem pasteExpandItem; |
---|
6247 | | - private MenuItem deleteItem; |
---|
| 6381 | + private JMenuItem pasteIntoItem; |
---|
| 6382 | + private JMenuItem pasteLinkItem; |
---|
| 6383 | + private JMenuItem pasteCloneItem; |
---|
| 6384 | + private JMenuItem pasteExpandItem; |
---|
| 6385 | + private JMenuItem deleteItem; |
---|
6248 | 6386 | private MenuItem clearAllItem; |
---|
6249 | 6387 | private MenuItem genUVItem; |
---|
6250 | 6388 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6270 | 6408 | private MenuItem clipMeshItem; |
---|
6271 | 6409 | private MenuItem smoothMeshItem; |
---|
6272 | 6410 | private MenuItem clearMaterialsItem; |
---|
| 6411 | + private MenuItem clearVersionsItem; |
---|
6273 | 6412 | |
---|
6274 | 6413 | private MenuItem liveleavesItem; |
---|
6275 | 6414 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6293 | 6432 | private MenuItem maxTexturesItem; |
---|
6294 | 6433 | private MenuItem panoTexturesItem; |
---|
6295 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6296 | 6438 | private MenuItem resetCentroidItem; |
---|
6297 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6298 | 6440 | private MenuItem resetTransformItem; |
---|
6299 | 6441 | private MenuItem transformGeometryItem; |
---|
6300 | 6442 | private MenuItem transformChildrenItem; |
---|
6301 | 6443 | private MenuItem hideItem; |
---|
6302 | | - private MenuItem grabItem; |
---|
| 6444 | + private JMenuItem grabItem; |
---|
6303 | 6445 | private MenuItem backItem; |
---|
6304 | 6446 | private MenuItem frontItem; |
---|
6305 | 6447 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6312 | 6454 | private MenuItem switchTransfoItem; |
---|
6313 | 6455 | private MenuItem morphItem; |
---|
6314 | 6456 | private MenuItem linkerItem; |
---|
6315 | | - private MenuItem ungroupItem; |
---|
| 6457 | + private JMenuItem ungroupItem; |
---|
6316 | 6458 | private MenuItem editItem; |
---|
6317 | 6459 | private MenuItem openWindowItem; |
---|
6318 | 6460 | private MenuItem editLeafItem; |
---|