.. | .. |
---|
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 |
---|
.. | .. |
---|
42 | 42 | }); |
---|
43 | 43 | } |
---|
44 | 44 | |
---|
45 | | - public void AddTextureButton(String f, final String t, cGridBag row) |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | | - final String path = "textures/" + f + "/"; // + t; |
---|
49 | | - row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
50 | | - textureButton.setToolTipText(f + "s"); |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
53 | 53 | @Override |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
350 | 359 | |
---|
351 | 360 | public void ChangeTexture(String texture) |
---|
352 | 361 | { |
---|
353 | | - cameraView.repaint(); |
---|
| 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 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
354 | 379 | } |
---|
355 | 380 | |
---|
356 | 381 | //ObjEditor objEditor; |
---|
.. | .. |
---|
390 | 415 | this.copy = this.group = group; |
---|
391 | 416 | //selectees = this.group.selectees; |
---|
392 | 417 | |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
393 | 420 | if (copy.versionlist == null) |
---|
394 | 421 | { |
---|
395 | 422 | copy.versionlist = new Object3D[100]; |
---|
396 | 423 | copy.versionindex = -1; |
---|
| 424 | + |
---|
| 425 | + //Save(true); |
---|
397 | 426 | } |
---|
398 | 427 | |
---|
399 | 428 | if(ui) |
---|
.. | .. |
---|
422 | 451 | copy.versionlist = new Object3D[100]; |
---|
423 | 452 | copy.versionindex = -1; |
---|
424 | 453 | |
---|
425 | | - Save(true); |
---|
| 454 | + //Save(true); |
---|
426 | 455 | } |
---|
427 | 456 | } |
---|
428 | 457 | |
---|
.. | .. |
---|
513 | 542 | // menu.add("-"); |
---|
514 | 543 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
515 | 544 | duplicateItem.addActionListener(this); |
---|
516 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 545 | + |
---|
| 546 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
517 | 547 | cloneItem.addActionListener(this); |
---|
518 | | - if (Globals.ADVANCED) |
---|
| 548 | + //if (Globals.ADVANCED) |
---|
519 | 549 | { |
---|
520 | 550 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
521 | 551 | cloneSupportItem.addActionListener(this); |
---|
522 | 552 | } |
---|
| 553 | + oe.jTree.popup.addSeparator(); |
---|
523 | 554 | menu.add("-"); |
---|
524 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 555 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
525 | 556 | cutItem.addActionListener(this); |
---|
526 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 557 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
527 | 558 | copyItem.addActionListener(this); |
---|
528 | 559 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
529 | 560 | pasteItem.addActionListener(this); |
---|
530 | 561 | |
---|
531 | | - menu.add("-"); |
---|
532 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 562 | + oe.jTree.popup.addSeparator(); |
---|
| 563 | + //menu.add("-"); |
---|
| 564 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
533 | 565 | pasteIntoItem.addActionListener(this); |
---|
534 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 566 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
535 | 567 | pasteLinkItem.addActionListener(this); |
---|
536 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 568 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
537 | 569 | pasteCloneItem.addActionListener(this); |
---|
538 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 570 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
539 | 571 | // pasteExpandItem.addActionListener(this); |
---|
540 | | - menu.add("-"); |
---|
541 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
542 | | - deleteItem.addActionListener(this); |
---|
| 572 | + //menu.add("-"); |
---|
| 573 | + oe.jTree.popup.addSeparator(); |
---|
543 | 574 | |
---|
544 | 575 | if (Globals.ADVANCED) |
---|
545 | 576 | { |
---|
.. | .. |
---|
625 | 656 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
626 | 657 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
627 | 658 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
628 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
629 | 659 | oe.cameraMenu.add("-"); |
---|
630 | 660 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
631 | 661 | openWindowItem.addActionListener(this); |
---|
632 | | - editLeafItem.addActionListener(this); |
---|
633 | 662 | lookAtItem.addActionListener(this); |
---|
634 | 663 | //lookFromItem.addActinoListener(this); |
---|
635 | 664 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
676 | 705 | setMasterItem.addActionListener(this); |
---|
677 | 706 | } |
---|
678 | 707 | |
---|
679 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
680 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
681 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
682 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
683 | 711 | backItem.addActionListener(this); |
---|
684 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
686 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
687 | 715 | // compositeItem.addActionListener(this); |
---|
688 | 716 | |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
| 719 | + |
---|
689 | 720 | if (Globals.ADVANCED) |
---|
690 | 721 | { |
---|
691 | 722 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
692 | 723 | hideItem.addActionListener(this); |
---|
693 | 724 | } |
---|
694 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 725 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
695 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
696 | 732 | |
---|
697 | 733 | // menu.add("-"); |
---|
698 | 734 | // |
---|
.. | .. |
---|
821 | 857 | hideleavesItem.addActionListener(this); |
---|
822 | 858 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
823 | 859 | showleavesItem.addActionListener(this); |
---|
824 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 860 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
825 | 861 | markleavesItem.addActionListener(this); |
---|
826 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 862 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
827 | 863 | unmarkleavesItem.addActionListener(this); |
---|
828 | 864 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
829 | 865 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
877 | 913 | shareGeometriesItem.addActionListener(this); |
---|
878 | 914 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
879 | 915 | mergeGeometriesItem.addActionListener(this); |
---|
| 916 | + menu.add("-"); |
---|
| 917 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 918 | + editLeafItem.addActionListener(this); |
---|
880 | 919 | if (Globals.ADVANCED) |
---|
881 | 920 | { |
---|
882 | 921 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
895 | 934 | |
---|
896 | 935 | JTabbedPane resourcecontainer; |
---|
897 | 936 | cGridBag currenttab; |
---|
898 | | - boolean added; // patch for jar |
---|
| 937 | + //boolean added; // patch for jar |
---|
899 | 938 | |
---|
900 | 939 | int tabcount = 0; |
---|
901 | 940 | int colcount = 0; |
---|
902 | 941 | int rowcount = 0; |
---|
| 942 | + int texturecount = 0; |
---|
903 | 943 | |
---|
904 | 944 | int columns = 5; |
---|
905 | 945 | int rows = 7; |
---|
906 | 946 | |
---|
907 | 947 | public void ResourceCallBack(String[] path) |
---|
908 | 948 | { |
---|
909 | | - for (int i = 0; i < path.length; i++) |
---|
910 | | - System.out.print(path[i] + "/"); |
---|
911 | | - System.out.println(); |
---|
912 | | - if (rowcount == 0) |
---|
| 949 | +// for (int i = 0; i < path.length; i++) |
---|
| 950 | +// System.out.print(path[i] + "/"); |
---|
| 951 | +// System.out.println(); |
---|
| 952 | + |
---|
| 953 | + if (//rowcount == 0 || |
---|
| 954 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
913 | 955 | { |
---|
914 | 956 | currenttab = new cGridBag(); |
---|
915 | | - added = false; |
---|
916 | | - String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 957 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
917 | 958 | currenttab.setName(tabname); |
---|
| 959 | + //added = false; |
---|
| 960 | + resourcecontainer.add(currenttab); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
918 | 962 | rowcount = 1; |
---|
| 963 | + colcount = 0; |
---|
| 964 | + texturecount = 0; |
---|
919 | 965 | } |
---|
920 | 966 | |
---|
921 | | - if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg")) |
---|
| 967 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
922 | 968 | { |
---|
923 | | - if (!added) |
---|
| 969 | + //if (!added) |
---|
924 | 970 | { |
---|
925 | | - added = true; |
---|
926 | | - resourcecontainer.add(currenttab); |
---|
927 | | - String tabname = String.valueOf((char)('A'+tabcount)); |
---|
928 | | - resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 971 | + //added = true; |
---|
| 972 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 973 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
929 | 974 | } |
---|
930 | 975 | |
---|
931 | | - AddTextureButton(path[0], path[1], currenttab); |
---|
| 976 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 977 | + |
---|
932 | 978 | if (++colcount >= columns) |
---|
933 | 979 | { |
---|
934 | 980 | colcount = 0; |
---|
.. | .. |
---|
949 | 995 | |
---|
950 | 996 | void CreateTexturePanel(cGridBag container) |
---|
951 | 997 | { |
---|
952 | | - resourcecontainer = new JTabbedPane(); |
---|
| 998 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
953 | 999 | container.add(resourcecontainer); |
---|
954 | 1000 | |
---|
955 | 1001 | Grafreed.ParseResources("textures", this); |
---|
.. | .. |
---|
972 | 1018 | //new Exception().printStackTrace(); |
---|
973 | 1019 | |
---|
974 | 1020 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
975 | | - oe.aConstraints.weightx = 1; |
---|
976 | | - oe.aConstraints.weighty = 0; |
---|
977 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
978 | | - oe.aConstraints.gridwidth = 100; |
---|
979 | | - oe.aConstraints.gridheight = 1; |
---|
980 | 1021 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
981 | 1022 | |
---|
982 | 1023 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
997 | 1038 | oe.radioPanel.add(dummyButton); |
---|
998 | 1039 | oe.buttonGroup.add(dummyButton); |
---|
999 | 1040 | */ |
---|
1000 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1041 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1001 | 1042 | |
---|
1002 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1043 | + versionManagerPanel.preferredHeight = 4; |
---|
1003 | 1044 | |
---|
1004 | 1045 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1005 | 1046 | |
---|
.. | .. |
---|
1009 | 1050 | |
---|
1010 | 1051 | if (Globals.ADVANCED) |
---|
1011 | 1052 | { |
---|
1012 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1013 | | - maxButton.setToolTipText("Maximize window"); |
---|
1014 | | - maxButton.addActionListener(this); |
---|
| 1053 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1054 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1055 | +// maxButton.addActionListener(this); |
---|
1015 | 1056 | } |
---|
1016 | 1057 | |
---|
1017 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | + cButton gcButton; |
---|
| 1059 | + |
---|
| 1060 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1062 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1063 | +// { |
---|
| 1064 | +// public void actionPerformed(ActionEvent e) |
---|
| 1065 | +// { |
---|
| 1066 | +// System.gc(); |
---|
| 1067 | +// } |
---|
| 1068 | +// }); |
---|
| 1069 | + |
---|
| 1070 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1071 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1072 | + collapseButton.addActionListener(this); |
---|
| 1073 | + |
---|
| 1074 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1076 | + maximize3DButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1080 | + twoButton.addActionListener(this); |
---|
| 1081 | + this.fullscreenLayout = twoButton; |
---|
| 1082 | + |
---|
| 1083 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1085 | + threeButton.addActionListener(this); |
---|
| 1086 | + if (Globals.ADVANCED) |
---|
| 1087 | + { |
---|
| 1088 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1089 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1090 | + sixButton.addActionListener(this); |
---|
| 1091 | + } |
---|
| 1092 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1094 | +// sevenButton.addActionListener(this); |
---|
| 1095 | + // |
---|
| 1096 | + |
---|
| 1097 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1018 | 1098 | fullButton.setToolTipText("Full-screen window"); |
---|
1019 | 1099 | fullButton.addActionListener(this); |
---|
1020 | 1100 | |
---|
1021 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1022 | 1102 | screenfitButton.setToolTipText("Screen fit"); |
---|
1023 | 1103 | screenfitButton.addActionListener(this); |
---|
1024 | 1104 | |
---|
1025 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1026 | 1106 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1027 | 1107 | restoreCameraButton.addActionListener(this); |
---|
1028 | 1108 | |
---|
1029 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1030 | 1110 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1031 | 1111 | saveVersionButton.addActionListener(this); |
---|
1032 | 1112 | |
---|
1033 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1034 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1035 | 1115 | deleteVersionButton.addActionListener(this); |
---|
| 1116 | + deleteVersionButton.setEnabled(false); |
---|
1036 | 1117 | |
---|
1037 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1038 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
1039 | 1120 | previousVersionButton.addActionListener(this); |
---|
1040 | 1121 | previousVersionButton.setEnabled(false); |
---|
1041 | 1122 | |
---|
1042 | 1123 | cGridBag updown = new cGridBag().setVertical(true); |
---|
1043 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1044 | 1125 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1045 | 1126 | restoreButton.addActionListener(this); |
---|
1046 | | - //restoreButton.setEnabled(false); |
---|
| 1127 | + restoreButton.setEnabled(false); |
---|
1047 | 1128 | |
---|
1048 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1049 | 1130 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1050 | 1131 | replaceButton.addActionListener(this); |
---|
1051 | | - //replaceButton.setEnabled(false); |
---|
| 1132 | + replaceButton.setEnabled(false); |
---|
1052 | 1133 | |
---|
1053 | | - copyOptionsPanel.add(updown); |
---|
| 1134 | + versionManagerPanel.add(updown); |
---|
1054 | 1135 | |
---|
1055 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1056 | 1137 | nextVersionButton.setToolTipText("Next version"); |
---|
1057 | 1138 | nextVersionButton.addActionListener(this); |
---|
1058 | 1139 | nextVersionButton.setEnabled(false); |
---|
| 1140 | + |
---|
| 1141 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1142 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1143 | + oneStepButton.addActionListener(this); |
---|
1059 | 1144 | |
---|
1060 | 1145 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
1061 | 1146 | liveCB.setToolTipText("Enable animation"); |
---|
1062 | 1147 | liveCB.addItemListener(this); |
---|
1063 | 1148 | |
---|
1064 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1065 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
1066 | | - oneStepButton.addActionListener(this); |
---|
1067 | | - |
---|
1068 | 1149 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
1069 | 1150 | fastCB.setToolTipText("Fast mode"); |
---|
1070 | 1151 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
1080 | 1161 | |
---|
1081 | 1162 | if (Globals.ADVANCED) |
---|
1082 | 1163 | { |
---|
1083 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1164 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1084 | 1165 | snapobjectButton.addActionListener(this); |
---|
1085 | 1166 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1086 | 1167 | |
---|
1087 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1088 | 1169 | fourButton.addActionListener(this); |
---|
1089 | 1170 | fourButton.setToolTipText("Show control panel only"); |
---|
1090 | 1171 | } |
---|
1091 | 1172 | |
---|
1092 | 1173 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1093 | 1174 | |
---|
1094 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1095 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
1096 | | - twoButton.addActionListener(this); |
---|
1097 | | - this.fullscreenLayout = twoButton; |
---|
1098 | | - |
---|
1099 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1100 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1101 | | - threeButton.addActionListener(this); |
---|
1102 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1103 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1104 | | - sixButton.addActionListener(this); |
---|
1105 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1106 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1107 | | -// sevenButton.addActionListener(this); |
---|
1108 | | - // |
---|
1109 | 1175 | |
---|
1110 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1176 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1111 | 1177 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1112 | 1178 | rootButton.addActionListener(this); |
---|
1113 | 1179 | |
---|
1114 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | 1181 | closeButton.setToolTipText("Close tab"); |
---|
1116 | 1182 | closeButton.addActionListener(this); |
---|
1117 | 1183 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1120 | 1186 | cGridBag row1 = new cGridBag(); |
---|
1121 | 1187 | |
---|
1122 | 1188 | // INSERT |
---|
1123 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1124 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1189 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1190 | + gridButton.setToolTipText("Create ground"); |
---|
1125 | 1191 | gridButton.addActionListener(this); |
---|
1126 | 1192 | |
---|
1127 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1193 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1128 | 1194 | boxButton.setToolTipText("Create box"); |
---|
1129 | 1195 | boxButton.addActionListener(this); |
---|
1130 | 1196 | |
---|
1131 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1132 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1133 | | - sphereButton.addActionListener(this); |
---|
1134 | | - |
---|
1135 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1136 | | - coneButton.setToolTipText("Create cone"); |
---|
1137 | | - coneButton.addActionListener(this); |
---|
1138 | | - |
---|
1139 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1140 | | - torusButton.setToolTipText("Create torus"); |
---|
1141 | | - torusButton.addActionListener(this); |
---|
1142 | | - |
---|
1143 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1144 | 1198 | superButton.setToolTipText("Create superellipsoid"); |
---|
1145 | 1199 | superButton.addActionListener(this); |
---|
1146 | 1200 | |
---|
| 1201 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1202 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1203 | + sphereButton.addActionListener(this); |
---|
| 1204 | + |
---|
| 1205 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + coneButton.setToolTipText("Create cone"); |
---|
| 1207 | + coneButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + torusButton.setToolTipText("Create torus"); |
---|
| 1211 | + torusButton.addActionListener(this); |
---|
| 1212 | + |
---|
1147 | 1213 | if (Globals.ADVANCED) |
---|
1148 | 1214 | { |
---|
1149 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1215 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1150 | 1216 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1151 | 1217 | kleinButton.addActionListener(this); |
---|
1152 | 1218 | } |
---|
1153 | 1219 | |
---|
1154 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1155 | 1221 | particlesButton.setToolTipText("Create particle system"); |
---|
1156 | 1222 | particlesButton.addActionListener(this); |
---|
1157 | 1223 | |
---|
.. | .. |
---|
1159 | 1225 | |
---|
1160 | 1226 | cGridBag row2 = new cGridBag(); |
---|
1161 | 1227 | |
---|
1162 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1228 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1163 | 1229 | groupButton.setToolTipText("Create group"); |
---|
1164 | 1230 | groupButton.addActionListener(this); |
---|
1165 | 1231 | |
---|
1166 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1167 | 1233 | compositeButton.setToolTipText("Create composite"); |
---|
1168 | 1234 | compositeButton.addActionListener(this); |
---|
1169 | 1235 | |
---|
1170 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1171 | 1237 | switchButton.setToolTipText("Create item switcher"); |
---|
1172 | 1238 | switchButton.addActionListener(this); |
---|
1173 | 1239 | |
---|
1174 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1175 | 1241 | loopButton.setToolTipText("Create loop"); |
---|
1176 | 1242 | loopButton.addActionListener(this); |
---|
1177 | 1243 | |
---|
1178 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1179 | 1245 | textureButton.setToolTipText("Create texture"); |
---|
1180 | 1246 | textureButton.addActionListener(this); |
---|
1181 | 1247 | |
---|
1182 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1183 | 1249 | overlayButton.setToolTipText("Create overlay"); |
---|
1184 | 1250 | overlayButton.addActionListener(this); |
---|
1185 | 1251 | |
---|
1186 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1187 | 1253 | lightButton.setToolTipText("Create light"); |
---|
1188 | 1254 | lightButton.addActionListener(this); |
---|
1189 | 1255 | |
---|
.. | .. |
---|
1193 | 1259 | |
---|
1194 | 1260 | CreateTexturePanel(textures); |
---|
1195 | 1261 | |
---|
| 1262 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1263 | + |
---|
| 1264 | + if (tabCount > 0) |
---|
| 1265 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1266 | + |
---|
1196 | 1267 | oe.toolboxPanel.add(textures); |
---|
1197 | 1268 | |
---|
1198 | 1269 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1200 | 1271 | CreateSkyboxPanel(oe.skyboxPanel); |
---|
1201 | 1272 | |
---|
1202 | 1273 | // EDIT panel |
---|
1203 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1274 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1204 | 1275 | editButton.setToolTipText("Pin selection controls"); |
---|
1205 | 1276 | editButton.addActionListener(this); |
---|
1206 | 1277 | |
---|
1207 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1208 | 1279 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1209 | 1280 | uneditButton.addActionListener(this); |
---|
1210 | 1281 | |
---|
.. | .. |
---|
1212 | 1283 | allParamsButton.setToolTipText("Show all controls"); |
---|
1213 | 1284 | allParamsButton.addActionListener(this); |
---|
1214 | 1285 | |
---|
1215 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1286 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1216 | 1287 | clearPanelButton.setToolTipText("Clear all controls"); |
---|
1217 | 1288 | clearPanelButton.addActionListener(this); |
---|
1218 | 1289 | |
---|
.. | .. |
---|
1220 | 1291 | //unselectButton.setToolTipText("Unselect"); |
---|
1221 | 1292 | //unselectButton.addActionListener(this); |
---|
1222 | 1293 | |
---|
1223 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1294 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1224 | 1295 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1225 | 1296 | flashSelectionButton.addActionListener(this); |
---|
1226 | 1297 | |
---|
.. | .. |
---|
1243 | 1314 | |
---|
1244 | 1315 | cGridBag jSPPanel = new cGridBag(); |
---|
1245 | 1316 | |
---|
| 1317 | + jSPPanel.preferredHeight = 20; |
---|
| 1318 | + |
---|
1246 | 1319 | JScrollPane jSP; |
---|
1247 | 1320 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1248 | 1321 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1251 | 1324 | oe.treePanel.add(jSPPanel); |
---|
1252 | 1325 | oe.treePanel.Return(); |
---|
1253 | 1326 | |
---|
1254 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1327 | + oe.treePanel.add(versionManagerPanel); |
---|
1255 | 1328 | oe.treePanel.Return(); |
---|
1256 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1257 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1258 | | - sliderPane.preferredHeight = 1; |
---|
| 1329 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1330 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1331 | + versionSliderPane.preferredHeight = 3; |
---|
1259 | 1332 | |
---|
1260 | 1333 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1261 | 1334 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1413 | 1486 | |
---|
1414 | 1487 | void EditObject(Object3D obj) |
---|
1415 | 1488 | { |
---|
| 1489 | + assert(obj instanceof Composite); |
---|
| 1490 | + |
---|
| 1491 | +// if (obj.versionlist == null) |
---|
| 1492 | +// { |
---|
| 1493 | +// obj.versionlist = new Object3D[100]; |
---|
| 1494 | +// obj.versionindex = -1; |
---|
| 1495 | +// } |
---|
| 1496 | + |
---|
1416 | 1497 | cRadio radioButton = new cRadio(obj.name); |
---|
1417 | 1498 | |
---|
1418 | 1499 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1437 | 1518 | |
---|
1438 | 1519 | oe.SetupViews(); |
---|
1439 | 1520 | |
---|
| 1521 | + if (Globals.DEBUG) |
---|
1440 | 1522 | System.out.println("SetupViews"); |
---|
1441 | 1523 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1442 | 1524 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1803 | 1885 | TreePath path; |
---|
1804 | 1886 | |
---|
1805 | 1887 | public TransferableTreePath(TreePath tp) { |
---|
1806 | | - path = tp; |
---|
| 1888 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1889 | + for (int i=0; i<objs.length; i++) |
---|
| 1890 | + { |
---|
| 1891 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1892 | + } |
---|
| 1893 | + path = new TreePath(objs); |
---|
1807 | 1894 | } |
---|
1808 | 1895 | |
---|
1809 | 1896 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2093 | 2180 | shadow.material = new cMaterial(obj.material); |
---|
2094 | 2181 | shadow.material.diffuse = 0.0001f; |
---|
2095 | 2182 | shadow.material.specular = 0.0001f; |
---|
2096 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2183 | + shadow.material.opacity = 0.75f; |
---|
| 2184 | + |
---|
| 2185 | + AllocProjectedVertices(shadow); |
---|
| 2186 | + |
---|
| 2187 | + shadow.projectedVertices[1].x = 300; |
---|
2097 | 2188 | |
---|
2098 | 2189 | makeSomething(shadow); |
---|
2099 | 2190 | } |
---|
.. | .. |
---|
2614 | 2705 | } else |
---|
2615 | 2706 | if (source == loopItem || source == loopButton) |
---|
2616 | 2707 | { |
---|
| 2708 | + if (!group.selection.isEmpty()) |
---|
| 2709 | + { |
---|
2617 | 2710 | Composite csg = new GroupLeaf(); |
---|
2618 | 2711 | csg.count = 5; |
---|
2619 | | - group(csg); |
---|
2620 | 2712 | Composite child = new cGroup("Branch"); |
---|
2621 | 2713 | csg.addChild(child); |
---|
2622 | 2714 | child.addChild(csg); |
---|
| 2715 | + group(csg); |
---|
| 2716 | + } |
---|
2623 | 2717 | } else |
---|
2624 | 2718 | if (source == doubleItem) |
---|
2625 | 2719 | { |
---|
| 2720 | + if (!group.selection.isEmpty()) |
---|
| 2721 | + { |
---|
2626 | 2722 | Composite csg = new GroupLeaf("Fork"); |
---|
2627 | 2723 | csg.count = 5; |
---|
2628 | | - group(csg); |
---|
2629 | 2724 | Composite child = new cGroup("Branch A"); |
---|
2630 | 2725 | csg.addChild(child); |
---|
2631 | 2726 | child.addChild(csg); |
---|
2632 | 2727 | child = new cGroup("Branch B"); |
---|
2633 | 2728 | csg.addChild(child); |
---|
2634 | 2729 | child.addChild(csg); |
---|
| 2730 | + group(csg); |
---|
| 2731 | + } |
---|
2635 | 2732 | } else |
---|
2636 | 2733 | if (source == tripleItem) |
---|
2637 | 2734 | { |
---|
| 2735 | + if (!group.selection.isEmpty()) |
---|
| 2736 | + { |
---|
2638 | 2737 | Composite csg = new GroupLeaf("Trident"); |
---|
2639 | 2738 | csg.count = 4; |
---|
2640 | 2739 | group(csg); |
---|
.. | .. |
---|
2647 | 2746 | child = new cGroup(); |
---|
2648 | 2747 | csg.addChild(child); |
---|
2649 | 2748 | child.addChild(csg); |
---|
| 2749 | + } |
---|
2650 | 2750 | } else |
---|
2651 | 2751 | if (source == computeAOItem) |
---|
2652 | 2752 | { |
---|
.. | .. |
---|
2696 | 2796 | if (source == fullButton) |
---|
2697 | 2797 | { |
---|
2698 | 2798 | ToggleFullScreen(); |
---|
| 2799 | + } else |
---|
| 2800 | + if (source == collapseButton) |
---|
| 2801 | + { |
---|
| 2802 | + this.expandedLayout = radio.layout; |
---|
| 2803 | + CollapseToolbar(); |
---|
| 2804 | + } else |
---|
| 2805 | + if (source == maximize3DButton) |
---|
| 2806 | + { |
---|
| 2807 | + this.expandedLayout = radio.layout; |
---|
| 2808 | + radio.layout = twoButton; |
---|
| 2809 | + Show3DView(); |
---|
| 2810 | + CollapseToolbar(); |
---|
2699 | 2811 | } else |
---|
2700 | 2812 | if (source == previousVersionButton) |
---|
2701 | 2813 | { |
---|
.. | .. |
---|
3270 | 3382 | } else |
---|
3271 | 3383 | if (source == ungroupItem || source == ungroupButton) |
---|
3272 | 3384 | { |
---|
3273 | | - boolean hasRoot = false; |
---|
| 3385 | + boolean canUngroup = true; |
---|
3274 | 3386 | |
---|
3275 | 3387 | for (int i=0; i<group.selection.size(); i++) |
---|
3276 | 3388 | { |
---|
3277 | | - if (group.selection.get(i) == group) |
---|
| 3389 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3390 | + |
---|
| 3391 | + if (selectedItem.Size() == 0) |
---|
3278 | 3392 | { |
---|
3279 | | - hasRoot = true; |
---|
| 3393 | + // Cannot ungroup leaves |
---|
| 3394 | + canUngroup = false; |
---|
| 3395 | + break; |
---|
| 3396 | + } |
---|
| 3397 | + |
---|
| 3398 | + if (selectedItem == group) |
---|
| 3399 | + { |
---|
| 3400 | + // Cannot ungroup root |
---|
| 3401 | + canUngroup = false; |
---|
3280 | 3402 | break; |
---|
3281 | 3403 | } |
---|
3282 | 3404 | } |
---|
3283 | 3405 | |
---|
3284 | | - if (!hasRoot) |
---|
| 3406 | + if (canUngroup) |
---|
3285 | 3407 | { |
---|
3286 | 3408 | for (int i=0; i<group.selection.size(); i++) |
---|
3287 | 3409 | { |
---|
3288 | | - Ungroup(group.selection.get(i)); |
---|
| 3410 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3411 | + |
---|
| 3412 | + Ungroup(selectedItem); |
---|
3289 | 3413 | } |
---|
3290 | 3414 | |
---|
3291 | 3415 | ClearSelection(false); |
---|
.. | .. |
---|
3648 | 3772 | if (CameraPane.FULLSCREEN) |
---|
3649 | 3773 | fullscreenLayout = radio.layout; |
---|
3650 | 3774 | |
---|
3651 | | - // bug |
---|
3652 | | - //gridPanel.setDividerLocation(1.0); |
---|
3653 | | - //bigPanel.setDividerLocation(0.0); |
---|
3654 | | -// bigThree.remove(scenePanel); |
---|
3655 | | -// bigThree.remove(centralPanel); |
---|
3656 | | -// bigThree.remove(XYZPanel); |
---|
3657 | | -// aWindowConstraints.gridx = 0; |
---|
3658 | | -// aWindowConstraints.gridy = 0; |
---|
3659 | | -// aWindowConstraints.gridwidth = 1; |
---|
3660 | | -// // aConstraints.gridheight = 3; |
---|
3661 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3662 | | -// aWindowConstraints.weightx = 0; |
---|
3663 | | -// aWindowConstraints.weighty = 1; |
---|
3664 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3665 | | -// aWindowConstraints.weightx = 1; |
---|
3666 | | -// aWindowConstraints.gridwidth = 3; |
---|
3667 | | -// // aConstraints.gridheight = 3; |
---|
3668 | | -// aWindowConstraints.gridx = 1; |
---|
3669 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3670 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3671 | | -// aWindowConstraints.weightx = 0; |
---|
3672 | | -// aWindowConstraints.gridx = 4; |
---|
3673 | | -// aWindowConstraints.gridwidth = 1; |
---|
3674 | | -// // aConstraints.gridheight = 3; |
---|
3675 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3676 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3677 | | -// scenePanel.setVisible(false); |
---|
3678 | | -// centralPanel.setVisible(true); |
---|
3679 | | -// XYZPanel.setVisible(false); |
---|
3680 | | - bigThree.ClearUI(); |
---|
3681 | | - bigThree.add(centralPanel); |
---|
3682 | | - bigThree.FlushUI(); |
---|
| 3775 | + Show3DView(); |
---|
3683 | 3776 | |
---|
3684 | 3777 | cameraView.requestFocusInWindow(); |
---|
3685 | 3778 | |
---|
.. | .. |
---|
3865 | 3958 | } else |
---|
3866 | 3959 | if (source == rootButton) |
---|
3867 | 3960 | { |
---|
| 3961 | + Replace(); |
---|
3868 | 3962 | Object3D obj; |
---|
3869 | 3963 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3870 | 3964 | { |
---|
.. | .. |
---|
3879 | 3973 | if (source == closeButton) |
---|
3880 | 3974 | { |
---|
3881 | 3975 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3976 | + Replace(); |
---|
| 3977 | + |
---|
3882 | 3978 | cRadio ab; |
---|
3883 | 3979 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3884 | 3980 | { |
---|
.. | .. |
---|
3977 | 4073 | } else |
---|
3978 | 4074 | if(source instanceof cRadio) |
---|
3979 | 4075 | { |
---|
| 4076 | + Replace(); |
---|
| 4077 | + |
---|
3980 | 4078 | group.parent = keepparent; |
---|
3981 | 4079 | group.attributes = 0; |
---|
3982 | 4080 | //group.editWindow = null; |
---|
.. | .. |
---|
4001 | 4099 | |
---|
4002 | 4100 | copy = group; |
---|
4003 | 4101 | |
---|
4004 | | - SetUndoStates(); |
---|
4005 | | - |
---|
4006 | 4102 | //Globals.theRenderer.object = group; |
---|
4007 | 4103 | if(!useclient) |
---|
4008 | 4104 | { |
---|
.. | .. |
---|
4030 | 4126 | */ |
---|
4031 | 4127 | radio.layout.doClick(); |
---|
4032 | 4128 | |
---|
| 4129 | + assert(copy instanceof Composite); |
---|
| 4130 | + |
---|
| 4131 | + if (copy.versionlist == null) |
---|
| 4132 | + { |
---|
| 4133 | + copy.versionindex = -1; |
---|
| 4134 | + |
---|
| 4135 | + // Cannot work with loops |
---|
| 4136 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4137 | + // and check if any of these nodes are reachable below the root. |
---|
| 4138 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4139 | + |
---|
| 4140 | + if (!copy.HasTags()) |
---|
| 4141 | + { |
---|
| 4142 | + copy.versionlist = new Object3D[100]; |
---|
| 4143 | + |
---|
| 4144 | + Save(true); |
---|
| 4145 | + } |
---|
| 4146 | + |
---|
| 4147 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4148 | + } |
---|
| 4149 | + |
---|
| 4150 | + SetVersionStates(); |
---|
| 4151 | + |
---|
4033 | 4152 | ClearUnpinned(); |
---|
4034 | 4153 | |
---|
4035 | 4154 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
4173 | 4292 | TouchTransform(obj); |
---|
4174 | 4293 | continue; |
---|
4175 | 4294 | } |
---|
4176 | | - if ((mask&2) != 0) // Scale |
---|
| 4295 | + if ((mask&2) != 0) // Scale/rotation |
---|
4177 | 4296 | { |
---|
4178 | 4297 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4179 | 4298 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4181 | 4300 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4182 | 4301 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4183 | 4302 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4184 | | - } |
---|
4185 | | - if ((mask&4) != 0) // Rotation |
---|
4186 | | - { |
---|
4187 | | - // ? |
---|
4188 | 4303 | } |
---|
4189 | 4304 | if ((mask&1) != 0) // Translation |
---|
4190 | 4305 | { |
---|
.. | .. |
---|
5264 | 5379 | flashSelectionButton.setEnabled(enabled); |
---|
5265 | 5380 | |
---|
5266 | 5381 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5382 | + |
---|
| 5383 | + boolean allComposites = true; |
---|
| 5384 | + |
---|
| 5385 | + if (group.selection != null) |
---|
| 5386 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5387 | + { |
---|
| 5388 | + Object next = e.nextElement(); |
---|
| 5389 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5390 | + { |
---|
| 5391 | + allComposites = false; |
---|
| 5392 | + break; |
---|
| 5393 | + } |
---|
| 5394 | + } |
---|
| 5395 | + |
---|
| 5396 | + rootButton.setEnabled(allComposites); |
---|
5267 | 5397 | } |
---|
5268 | 5398 | |
---|
5269 | 5399 | void refreshContents(boolean cp) |
---|
5270 | 5400 | { |
---|
| 5401 | + if (Globals.ADVANCED) |
---|
5271 | 5402 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5272 | 5403 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5273 | 5404 | { |
---|
.. | .. |
---|
5278 | 5409 | Object3D child = (Object3D) group.selection.get(i); |
---|
5279 | 5410 | |
---|
5280 | 5411 | objEditor.AddInfo(child, this, true); |
---|
5281 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5412 | +// System.err.println("info : " + child.GetPath()); |
---|
5282 | 5413 | } |
---|
5283 | 5414 | |
---|
5284 | 5415 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6161 | 6292 | private MenuItem lookAtItem; |
---|
6162 | 6293 | private MenuItem lookFromItem; |
---|
6163 | 6294 | private MenuItem switchViewItem; |
---|
6164 | | - private MenuItem cutItem; |
---|
| 6295 | + private JMenuItem cutItem; |
---|
6165 | 6296 | private MenuItem undoItem; |
---|
6166 | 6297 | private MenuItem redoItem; |
---|
6167 | 6298 | private JMenuItem duplicateItem; |
---|
6168 | | - private MenuItem cloneItem; |
---|
| 6299 | + private JMenuItem cloneItem; |
---|
6169 | 6300 | private MenuItem cloneSupportItem; |
---|
6170 | 6301 | private MenuItem overwriteGeoItem; |
---|
6171 | 6302 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6186 | 6317 | private MenuItem cloneGeometriesItem; |
---|
6187 | 6318 | private MenuItem shareGeometriesItem; |
---|
6188 | 6319 | private MenuItem mergeGeometriesItem; |
---|
6189 | | - private MenuItem copyItem; |
---|
| 6320 | + private JMenuItem copyItem; |
---|
6190 | 6321 | private MenuItem pasteItem; |
---|
6191 | | - private MenuItem pasteIntoItem; |
---|
6192 | | - private MenuItem pasteLinkItem; |
---|
6193 | | - private MenuItem pasteCloneItem; |
---|
6194 | | - private MenuItem pasteExpandItem; |
---|
6195 | | - private MenuItem deleteItem; |
---|
| 6322 | + private JMenuItem pasteIntoItem; |
---|
| 6323 | + private JMenuItem pasteLinkItem; |
---|
| 6324 | + private JMenuItem pasteCloneItem; |
---|
| 6325 | + private JMenuItem pasteExpandItem; |
---|
| 6326 | + private JMenuItem deleteItem; |
---|
6196 | 6327 | private MenuItem clearAllItem; |
---|
6197 | 6328 | private MenuItem genUVItem; |
---|
6198 | 6329 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6247 | 6378 | private MenuItem transformGeometryItem; |
---|
6248 | 6379 | private MenuItem transformChildrenItem; |
---|
6249 | 6380 | private MenuItem hideItem; |
---|
6250 | | - private MenuItem grabItem; |
---|
| 6381 | + private JMenuItem grabItem; |
---|
6251 | 6382 | private MenuItem backItem; |
---|
6252 | 6383 | private MenuItem frontItem; |
---|
6253 | 6384 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6260 | 6391 | private MenuItem switchTransfoItem; |
---|
6261 | 6392 | private MenuItem morphItem; |
---|
6262 | 6393 | private MenuItem linkerItem; |
---|
6263 | | - private MenuItem ungroupItem; |
---|
| 6394 | + private JMenuItem ungroupItem; |
---|
6264 | 6395 | private MenuItem editItem; |
---|
6265 | 6396 | private MenuItem openWindowItem; |
---|
6266 | 6397 | private MenuItem editLeafItem; |
---|