.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
19 | | - Grafreed.iResourceCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
20 | 20 | ObjectUI, |
---|
21 | 21 | Runnable, |
---|
22 | 22 | ActionListener, |
---|
.. | .. |
---|
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, String c, final String t, int count, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
45 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
46 | 62 | { |
---|
47 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
57 | 73 | cGridBag row5 = new cGridBag(); |
---|
58 | 74 | cGridBag row6 = new cGridBag(); |
---|
59 | 75 | |
---|
60 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
61 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
62 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
63 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
312 | 328 | } |
---|
313 | 329 | } |
---|
314 | 330 | |
---|
315 | | - public void CallBack(String[] path) |
---|
316 | | - { |
---|
317 | | - for (int i = 0; i < path.length; i++) |
---|
318 | | - { |
---|
319 | | - System.out.print(path[i] + "/"); |
---|
320 | | - } |
---|
321 | | - |
---|
322 | | - System.out.println(); |
---|
323 | | - } |
---|
324 | | - |
---|
325 | 331 | public void ChangeSkybox(String skybox) |
---|
326 | 332 | { |
---|
327 | | - //cameraView.envyoff = false; |
---|
328 | | - group.skyboxname = skybox; |
---|
329 | | - group.skyboxext = "jpg"; |
---|
330 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
| 346 | + } |
---|
331 | 347 | |
---|
332 | | - Grafreed.ParseResources("textures", this); |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
333 | 358 | } |
---|
334 | 359 | |
---|
| 360 | + public void ChangeTexture(String texture) |
---|
| 361 | + { |
---|
| 362 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 363 | + { |
---|
| 364 | + Object3D obj = group.selection.get(i); |
---|
| 365 | + obj.SetPigmentTexture("@" + texture); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
335 | 371 | //ObjEditor objEditor; |
---|
336 | 372 | public void closeUI2() |
---|
337 | 373 | { |
---|
.. | .. |
---|
369 | 405 | this.copy = this.group = group; |
---|
370 | 406 | //selectees = this.group.selectees; |
---|
371 | 407 | |
---|
372 | | - if (copy.versionlist == null) |
---|
373 | | - { |
---|
374 | | - copy.versionlist = new Object3D[100]; |
---|
375 | | - copy.versionindex = -1; |
---|
376 | | - } |
---|
| 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 | +// } |
---|
377 | 417 | |
---|
378 | 418 | if(ui) |
---|
379 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
396 | 436 | |
---|
397 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
398 | 438 | |
---|
399 | | - if (copy.versionlist == null) |
---|
400 | | - { |
---|
401 | | - copy.versionlist = new Object3D[100]; |
---|
402 | | - copy.versionindex = -1; |
---|
403 | | - |
---|
404 | | - Save(true); |
---|
405 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
406 | 446 | } |
---|
407 | 447 | |
---|
408 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
492 | 532 | // menu.add("-"); |
---|
493 | 533 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
494 | 534 | duplicateItem.addActionListener(this); |
---|
495 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 535 | + |
---|
| 536 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
496 | 537 | cloneItem.addActionListener(this); |
---|
497 | | - if (Globals.ADVANCED) |
---|
| 538 | + //if (Globals.ADVANCED) |
---|
498 | 539 | { |
---|
499 | 540 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
500 | 541 | cloneSupportItem.addActionListener(this); |
---|
501 | 542 | } |
---|
| 543 | + oe.jTree.popup.addSeparator(); |
---|
502 | 544 | menu.add("-"); |
---|
503 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 545 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
504 | 546 | cutItem.addActionListener(this); |
---|
505 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 547 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
506 | 548 | copyItem.addActionListener(this); |
---|
507 | 549 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
508 | 550 | pasteItem.addActionListener(this); |
---|
509 | 551 | |
---|
510 | | - menu.add("-"); |
---|
511 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 552 | + oe.jTree.popup.addSeparator(); |
---|
| 553 | + //menu.add("-"); |
---|
| 554 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
512 | 555 | pasteIntoItem.addActionListener(this); |
---|
513 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 556 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
514 | 557 | pasteLinkItem.addActionListener(this); |
---|
515 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 558 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
516 | 559 | pasteCloneItem.addActionListener(this); |
---|
517 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 560 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
518 | 561 | // pasteExpandItem.addActionListener(this); |
---|
519 | | - menu.add("-"); |
---|
520 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
521 | | - deleteItem.addActionListener(this); |
---|
| 562 | + //menu.add("-"); |
---|
| 563 | + oe.jTree.popup.addSeparator(); |
---|
522 | 564 | |
---|
523 | 565 | if (Globals.ADVANCED) |
---|
524 | 566 | { |
---|
.. | .. |
---|
604 | 646 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
605 | 647 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
606 | 648 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
607 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
608 | 649 | oe.cameraMenu.add("-"); |
---|
609 | 650 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
610 | 651 | openWindowItem.addActionListener(this); |
---|
611 | | - editLeafItem.addActionListener(this); |
---|
612 | 652 | lookAtItem.addActionListener(this); |
---|
613 | 653 | //lookFromItem.addActinoListener(this); |
---|
614 | 654 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
655 | 695 | setMasterItem.addActionListener(this); |
---|
656 | 696 | } |
---|
657 | 697 | |
---|
658 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
659 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
660 | | -// grabItem.addActionListener(this); |
---|
| 698 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 699 | + |
---|
661 | 700 | backItem = menu.add(new MenuItem("Back")); |
---|
662 | 701 | backItem.addActionListener(this); |
---|
663 | 702 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
665 | 704 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
666 | 705 | // compositeItem.addActionListener(this); |
---|
667 | 706 | |
---|
| 707 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 708 | + grabItem.addActionListener(this); |
---|
| 709 | + |
---|
668 | 710 | if (Globals.ADVANCED) |
---|
669 | 711 | { |
---|
670 | 712 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
671 | 713 | hideItem.addActionListener(this); |
---|
672 | 714 | } |
---|
673 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 715 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
674 | 716 | ungroupItem.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.jTree.popup.addSeparator(); |
---|
| 719 | + |
---|
| 720 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 721 | + deleteItem.addActionListener(this); |
---|
675 | 722 | |
---|
676 | 723 | // menu.add("-"); |
---|
677 | 724 | // |
---|
.. | .. |
---|
708 | 755 | shadowYItem.addActionListener(this); |
---|
709 | 756 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
710 | 757 | shadowZItem.addActionListener(this); |
---|
| 758 | + |
---|
711 | 759 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
712 | 760 | attributeItem.addActionListener(this); |
---|
713 | | - |
---|
714 | 761 | if (Globals.ADVANCED) |
---|
715 | 762 | { |
---|
716 | 763 | menu.add("-"); |
---|
.. | .. |
---|
722 | 769 | pointflowItem.addActionListener(this); |
---|
723 | 770 | } |
---|
724 | 771 | menu.add("-"); |
---|
| 772 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 773 | + textureRatioRItem.addActionListener(this); |
---|
| 774 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 775 | + textureRatioGItem.addActionListener(this); |
---|
| 776 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 777 | + textureRatioBItem.addActionListener(this); |
---|
| 778 | + menu.add("-"); |
---|
725 | 779 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
726 | 780 | resetTransformItem.addActionListener(this); |
---|
727 | 781 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
728 | 782 | resetCentroidItem.addActionListener(this); |
---|
729 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 783 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
730 | 784 | resetCentroidXZItem.addActionListener(this); |
---|
731 | 785 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
732 | 786 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
778 | 832 | } |
---|
779 | 833 | |
---|
780 | 834 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 835 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 836 | + clearVersionsItem.addActionListener(this); |
---|
781 | 837 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
782 | 838 | clearMaterialsItem.addActionListener(this); |
---|
783 | 839 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
800 | 856 | hideleavesItem.addActionListener(this); |
---|
801 | 857 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
802 | 858 | showleavesItem.addActionListener(this); |
---|
803 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 859 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
804 | 860 | markleavesItem.addActionListener(this); |
---|
805 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 861 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
806 | 862 | unmarkleavesItem.addActionListener(this); |
---|
807 | 863 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
808 | 864 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
856 | 912 | shareGeometriesItem.addActionListener(this); |
---|
857 | 913 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
858 | 914 | mergeGeometriesItem.addActionListener(this); |
---|
| 915 | + menu.add("-"); |
---|
| 916 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 917 | + editLeafItem.addActionListener(this); |
---|
859 | 918 | if (Globals.ADVANCED) |
---|
860 | 919 | { |
---|
861 | 920 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
872 | 931 | buildToolsMenu(menu); |
---|
873 | 932 | } |
---|
874 | 933 | |
---|
| 934 | + JTabbedPane resourcecontainer; |
---|
| 935 | + cGridBag currenttab; |
---|
| 936 | + //boolean added; // patch for jar |
---|
| 937 | + |
---|
| 938 | + int totalcount = 0; |
---|
| 939 | + |
---|
| 940 | + int tabcount = 0; |
---|
| 941 | + int colcount = 0; |
---|
| 942 | + int rowcount = 0; |
---|
| 943 | + int texturecount = 0; |
---|
| 944 | + |
---|
| 945 | + int columns = 5; |
---|
| 946 | + int rows = 7; |
---|
| 947 | + |
---|
| 948 | + public void ResourceCallBack(String[] path) |
---|
| 949 | + { |
---|
| 950 | +// for (int i = 0; i < path.length; i++) |
---|
| 951 | +// System.out.print(path[i] + "/"); |
---|
| 952 | +// System.out.println(); |
---|
| 953 | + |
---|
| 954 | + if (//rowcount == 0 || |
---|
| 955 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 956 | + { |
---|
| 957 | + currenttab = new cGridBag(); |
---|
| 958 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 959 | + currenttab.setName(tabname); |
---|
| 960 | + //added = false; |
---|
| 961 | + resourcecontainer.add(currenttab); |
---|
| 962 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 963 | + rowcount = 1; |
---|
| 964 | + colcount = 0; |
---|
| 965 | + texturecount = 0; |
---|
| 966 | + } |
---|
| 967 | + |
---|
| 968 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 969 | + { |
---|
| 970 | + //if (!added) |
---|
| 971 | + { |
---|
| 972 | + //added = true; |
---|
| 973 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 974 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 975 | + } |
---|
| 976 | + |
---|
| 977 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 978 | + totalcount++; |
---|
| 979 | + |
---|
| 980 | + if (++colcount >= columns) |
---|
| 981 | + { |
---|
| 982 | + colcount = 0; |
---|
| 983 | + currenttab.Return(); |
---|
| 984 | + |
---|
| 985 | + if (rowcount++ >= rows) |
---|
| 986 | + { |
---|
| 987 | + rowcount = 0; |
---|
| 988 | + } |
---|
| 989 | + } |
---|
| 990 | + } |
---|
| 991 | + else |
---|
| 992 | + { |
---|
| 993 | +// if (!path[path.length-1].equals("icons")) |
---|
| 994 | +// resourcecontainer.Return(); |
---|
| 995 | + } |
---|
| 996 | + } |
---|
| 997 | + |
---|
| 998 | + void CreateTexturePanel(cGridBag container) |
---|
| 999 | + { |
---|
| 1000 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1001 | + container.add(resourcecontainer); |
---|
| 1002 | + |
---|
| 1003 | + Grafreed.ParseResources("textures", this); |
---|
| 1004 | + |
---|
| 1005 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1006 | + } |
---|
875 | 1007 | |
---|
876 | 1008 | void SetupUI2(ObjEditor oe) |
---|
877 | 1009 | { |
---|
.. | .. |
---|
890 | 1022 | //new Exception().printStackTrace(); |
---|
891 | 1023 | |
---|
892 | 1024 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
893 | | - oe.aConstraints.weightx = 1; |
---|
894 | | - oe.aConstraints.weighty = 0; |
---|
895 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
896 | | - oe.aConstraints.gridwidth = 100; |
---|
897 | | - oe.aConstraints.gridheight = 1; |
---|
898 | 1025 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
899 | 1026 | |
---|
900 | 1027 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
915 | 1042 | oe.radioPanel.add(dummyButton); |
---|
916 | 1043 | oe.buttonGroup.add(dummyButton); |
---|
917 | 1044 | */ |
---|
918 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1045 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
919 | 1046 | |
---|
920 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1047 | + versionManagerPanel.preferredHeight = 4; |
---|
921 | 1048 | |
---|
922 | 1049 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
923 | 1050 | |
---|
.. | .. |
---|
927 | 1054 | |
---|
928 | 1055 | if (Globals.ADVANCED) |
---|
929 | 1056 | { |
---|
930 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | | - maxButton.setToolTipText("Maximize window"); |
---|
932 | | - maxButton.addActionListener(this); |
---|
| 1057 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1059 | +// maxButton.addActionListener(this); |
---|
933 | 1060 | } |
---|
934 | 1061 | |
---|
935 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
936 | | - fullButton.setToolTipText("Full-screen window"); |
---|
937 | | - fullButton.addActionListener(this); |
---|
| 1062 | + cButton gcButton; |
---|
938 | 1063 | |
---|
939 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1066 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1067 | +// { |
---|
| 1068 | +// public void actionPerformed(ActionEvent e) |
---|
| 1069 | +// { |
---|
| 1070 | +// System.gc(); |
---|
| 1071 | +// } |
---|
| 1072 | +// }); |
---|
| 1073 | + |
---|
| 1074 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1076 | + fullScreenButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1080 | + collapseButton.addActionListener(this); |
---|
| 1081 | + |
---|
| 1082 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1084 | +// maximize3DButton.addActionListener(this); |
---|
| 1085 | + |
---|
| 1086 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1088 | + twoButton.addActionListener(this); |
---|
| 1089 | + this.fullscreenLayout = twoButton; |
---|
| 1090 | + |
---|
| 1091 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1093 | + threeButton.addActionListener(this); |
---|
| 1094 | + if (Globals.ADVANCED) |
---|
| 1095 | + { |
---|
| 1096 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1098 | + sixButton.addActionListener(this); |
---|
| 1099 | + } |
---|
| 1100 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1102 | +// sevenButton.addActionListener(this); |
---|
| 1103 | + // |
---|
| 1104 | + |
---|
| 1105 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
940 | 1106 | screenfitButton.setToolTipText("Screen fit"); |
---|
941 | 1107 | screenfitButton.addActionListener(this); |
---|
942 | 1108 | |
---|
943 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
944 | 1110 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
945 | 1111 | restoreCameraButton.addActionListener(this); |
---|
946 | 1112 | |
---|
947 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
948 | 1114 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
949 | 1115 | saveVersionButton.addActionListener(this); |
---|
950 | 1116 | |
---|
951 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
952 | 1118 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
953 | 1119 | deleteVersionButton.addActionListener(this); |
---|
| 1120 | + deleteVersionButton.setEnabled(false); |
---|
954 | 1121 | |
---|
955 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1122 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
956 | 1123 | previousVersionButton.setToolTipText("Previous version"); |
---|
957 | 1124 | previousVersionButton.addActionListener(this); |
---|
958 | 1125 | previousVersionButton.setEnabled(false); |
---|
959 | 1126 | |
---|
960 | 1127 | cGridBag updown = new cGridBag().setVertical(true); |
---|
961 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
962 | 1129 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
963 | 1130 | restoreButton.addActionListener(this); |
---|
964 | | - //restoreButton.setEnabled(false); |
---|
| 1131 | + restoreButton.setEnabled(false); |
---|
965 | 1132 | |
---|
966 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
967 | 1134 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
968 | 1135 | replaceButton.addActionListener(this); |
---|
969 | | - //replaceButton.setEnabled(false); |
---|
| 1136 | + replaceButton.setEnabled(false); |
---|
970 | 1137 | |
---|
971 | | - copyOptionsPanel.add(updown); |
---|
| 1138 | + versionManagerPanel.add(updown); |
---|
972 | 1139 | |
---|
973 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
974 | 1141 | nextVersionButton.setToolTipText("Next version"); |
---|
975 | 1142 | nextVersionButton.addActionListener(this); |
---|
976 | 1143 | nextVersionButton.setEnabled(false); |
---|
| 1144 | + |
---|
| 1145 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1147 | + oneStepButton.addActionListener(this); |
---|
977 | 1148 | |
---|
978 | 1149 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
979 | 1150 | liveCB.setToolTipText("Enable animation"); |
---|
980 | 1151 | liveCB.addItemListener(this); |
---|
981 | 1152 | |
---|
982 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
983 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
984 | | - oneStepButton.addActionListener(this); |
---|
985 | | - |
---|
986 | 1153 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
987 | 1154 | fastCB.setToolTipText("Fast mode"); |
---|
988 | 1155 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
998 | 1165 | |
---|
999 | 1166 | if (Globals.ADVANCED) |
---|
1000 | 1167 | { |
---|
1001 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1002 | 1169 | snapobjectButton.addActionListener(this); |
---|
1003 | 1170 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1004 | 1171 | |
---|
1005 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1172 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1006 | 1173 | fourButton.addActionListener(this); |
---|
1007 | 1174 | fourButton.setToolTipText("Show control panel only"); |
---|
1008 | 1175 | } |
---|
1009 | 1176 | |
---|
1010 | 1177 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1011 | 1178 | |
---|
1012 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1013 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
1014 | | - twoButton.addActionListener(this); |
---|
1015 | | - this.fullscreenLayout = twoButton; |
---|
1016 | | - |
---|
1017 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1018 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1019 | | - threeButton.addActionListener(this); |
---|
1020 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1021 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1022 | | - sixButton.addActionListener(this); |
---|
1023 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1024 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1025 | | -// sevenButton.addActionListener(this); |
---|
1026 | | - // |
---|
1027 | 1179 | |
---|
1028 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1181 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1030 | 1182 | rootButton.addActionListener(this); |
---|
1031 | 1183 | |
---|
1032 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1033 | 1185 | closeButton.setToolTipText("Close tab"); |
---|
1034 | 1186 | closeButton.addActionListener(this); |
---|
1035 | 1187 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1038 | 1190 | cGridBag row1 = new cGridBag(); |
---|
1039 | 1191 | |
---|
1040 | 1192 | // INSERT |
---|
1041 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1042 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1193 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + gridButton.setToolTipText("Create ground"); |
---|
1043 | 1195 | gridButton.addActionListener(this); |
---|
1044 | 1196 | |
---|
1045 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1046 | 1198 | boxButton.setToolTipText("Create box"); |
---|
1047 | 1199 | boxButton.addActionListener(this); |
---|
1048 | 1200 | |
---|
1049 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1050 | | - sphereButton.setToolTipText("Create sphere"); |
---|
1051 | | - sphereButton.addActionListener(this); |
---|
1052 | | - |
---|
1053 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1054 | | - coneButton.setToolTipText("Create cone"); |
---|
1055 | | - coneButton.addActionListener(this); |
---|
1056 | | - |
---|
1057 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1058 | | - torusButton.setToolTipText("Create torus"); |
---|
1059 | | - torusButton.addActionListener(this); |
---|
1060 | | - |
---|
1061 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1201 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1062 | 1202 | superButton.setToolTipText("Create superellipsoid"); |
---|
1063 | 1203 | superButton.addActionListener(this); |
---|
1064 | 1204 | |
---|
1065 | | - if (Globals.ADVANCED) |
---|
| 1205 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1207 | + sphereButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + coneButton.setToolTipText("Create cone"); |
---|
| 1211 | + coneButton.addActionListener(this); |
---|
| 1212 | + |
---|
| 1213 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + torusButton.setToolTipText("Create torus"); |
---|
| 1215 | + torusButton.addActionListener(this); |
---|
| 1216 | + |
---|
| 1217 | + if (false) //Globals.ADVANCED) |
---|
1066 | 1218 | { |
---|
1067 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1220 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1069 | 1221 | kleinButton.addActionListener(this); |
---|
1070 | 1222 | } |
---|
1071 | 1223 | |
---|
1072 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1073 | 1225 | particlesButton.setToolTipText("Create particle system"); |
---|
1074 | 1226 | particlesButton.addActionListener(this); |
---|
1075 | 1227 | |
---|
.. | .. |
---|
1077 | 1229 | |
---|
1078 | 1230 | cGridBag row2 = new cGridBag(); |
---|
1079 | 1231 | |
---|
1080 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1233 | groupButton.setToolTipText("Create group"); |
---|
1082 | 1234 | groupButton.addActionListener(this); |
---|
1083 | 1235 | |
---|
1084 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1237 | compositeButton.setToolTipText("Create composite"); |
---|
1086 | 1238 | compositeButton.addActionListener(this); |
---|
1087 | 1239 | |
---|
1088 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1241 | switchButton.setToolTipText("Create item switcher"); |
---|
1090 | 1242 | switchButton.addActionListener(this); |
---|
1091 | 1243 | |
---|
1092 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1245 | loopButton.setToolTipText("Create loop"); |
---|
1094 | 1246 | loopButton.addActionListener(this); |
---|
1095 | 1247 | |
---|
1096 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1249 | textureButton.setToolTipText("Create texture"); |
---|
1098 | 1250 | textureButton.addActionListener(this); |
---|
1099 | 1251 | |
---|
1100 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1101 | 1253 | overlayButton.setToolTipText("Create overlay"); |
---|
1102 | 1254 | overlayButton.addActionListener(this); |
---|
1103 | 1255 | |
---|
1104 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1256 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1105 | 1257 | lightButton.setToolTipText("Create light"); |
---|
1106 | 1258 | lightButton.addActionListener(this); |
---|
1107 | 1259 | |
---|
1108 | 1260 | oe.toolboxPanel.add(row2); |
---|
1109 | 1261 | |
---|
1110 | | - // ENVYMAPS |
---|
1111 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1112 | | - skyboxpane.preferredHeight = 100; |
---|
| 1262 | + cGridBag textures = new cGridBag(); |
---|
1113 | 1263 | |
---|
1114 | | - oe.skyboxPanel.add(skyboxpane); |
---|
| 1264 | + CreateTexturePanel(textures); |
---|
1115 | 1265 | |
---|
1116 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1117 | | - skyboxpane.add(skyboxpanel); |
---|
| 1266 | + int tabCount = resourcecontainer.getTabCount(); |
---|
1118 | 1267 | |
---|
1119 | | - AddSkyboxTab0(skyboxpanel); |
---|
1120 | | - AddSkyboxTab1(skyboxpanel); |
---|
1121 | | - AddSkyboxTab2(skyboxpanel); |
---|
1122 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1268 | + if (tabCount > 0) |
---|
| 1269 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1270 | + |
---|
| 1271 | + oe.toolboxPanel.add(textures); |
---|
| 1272 | + |
---|
| 1273 | + textures.preferredHeight = 100; |
---|
| 1274 | + |
---|
| 1275 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1123 | 1276 | |
---|
1124 | 1277 | // EDIT panel |
---|
1125 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1126 | 1279 | editButton.setToolTipText("Pin selection controls"); |
---|
1127 | 1280 | editButton.addActionListener(this); |
---|
1128 | 1281 | |
---|
1129 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1282 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1283 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1131 | 1284 | uneditButton.addActionListener(this); |
---|
1132 | 1285 | |
---|
1133 | 1286 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1134 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1287 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1135 | 1288 | allParamsButton.addActionListener(this); |
---|
1136 | 1289 | |
---|
1137 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1138 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1290 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1139 | 1292 | clearPanelButton.addActionListener(this); |
---|
1140 | 1293 | |
---|
1141 | 1294 | //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | 1295 | //unselectButton.setToolTipText("Unselect"); |
---|
1143 | 1296 | //unselectButton.addActionListener(this); |
---|
1144 | 1297 | |
---|
1145 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1298 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1146 | 1299 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1147 | 1300 | flashSelectionButton.addActionListener(this); |
---|
1148 | 1301 | |
---|
.. | .. |
---|
1165 | 1318 | |
---|
1166 | 1319 | cGridBag jSPPanel = new cGridBag(); |
---|
1167 | 1320 | |
---|
| 1321 | + jSPPanel.preferredHeight = 20; |
---|
| 1322 | + |
---|
1168 | 1323 | JScrollPane jSP; |
---|
1169 | 1324 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1170 | 1325 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1173 | 1328 | oe.treePanel.add(jSPPanel); |
---|
1174 | 1329 | oe.treePanel.Return(); |
---|
1175 | 1330 | |
---|
1176 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1331 | + oe.treePanel.add(versionManagerPanel); |
---|
1177 | 1332 | oe.treePanel.Return(); |
---|
1178 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1179 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1180 | | - sliderPane.preferredHeight = 1; |
---|
| 1333 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1334 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1335 | + versionSliderPane.preferredHeight = 3; |
---|
1181 | 1336 | |
---|
1182 | 1337 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1183 | 1338 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1335 | 1490 | |
---|
1336 | 1491 | void EditObject(Object3D obj) |
---|
1337 | 1492 | { |
---|
| 1493 | + //assert(obj instanceof Composite); |
---|
| 1494 | + |
---|
| 1495 | +// if (obj.versionlist == null) |
---|
| 1496 | +// { |
---|
| 1497 | +// obj.versionlist = new Object3D[100]; |
---|
| 1498 | +// obj.versionindex = -1; |
---|
| 1499 | +// } |
---|
| 1500 | + |
---|
1338 | 1501 | cRadio radioButton = new cRadio(obj.name); |
---|
1339 | 1502 | |
---|
1340 | 1503 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1359 | 1522 | |
---|
1360 | 1523 | oe.SetupViews(); |
---|
1361 | 1524 | |
---|
| 1525 | + if (Globals.DEBUG) |
---|
1362 | 1526 | System.out.println("SetupViews"); |
---|
1363 | 1527 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1364 | 1528 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1725 | 1889 | TreePath path; |
---|
1726 | 1890 | |
---|
1727 | 1891 | public TransferableTreePath(TreePath tp) { |
---|
1728 | | - path = tp; |
---|
| 1892 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1893 | + for (int i=0; i<objs.length; i++) |
---|
| 1894 | + { |
---|
| 1895 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1896 | + } |
---|
| 1897 | + path = new TreePath(objs); |
---|
1729 | 1898 | } |
---|
1730 | 1899 | |
---|
1731 | 1900 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1957 | 2126 | switch(axis) |
---|
1958 | 2127 | { |
---|
1959 | 2128 | case 0 : |
---|
1960 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1961 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
1962 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1963 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2129 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2130 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2131 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2132 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1964 | 2133 | norm = cVector.X; |
---|
1965 | 2134 | break; |
---|
1966 | 2135 | case 1 : |
---|
1967 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1968 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1969 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1970 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2136 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2137 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2138 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2139 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1971 | 2140 | norm = cVector.Y; |
---|
1972 | 2141 | break; |
---|
1973 | 2142 | case 2 : |
---|
1974 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1975 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1976 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
1977 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2143 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2144 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2145 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2146 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1978 | 2147 | norm = cVector.Z; |
---|
1979 | 2148 | break; |
---|
1980 | 2149 | } |
---|
.. | .. |
---|
2015 | 2184 | shadow.material = new cMaterial(obj.material); |
---|
2016 | 2185 | shadow.material.diffuse = 0.0001f; |
---|
2017 | 2186 | shadow.material.specular = 0.0001f; |
---|
2018 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2187 | + shadow.material.opacity = 0.75f; |
---|
| 2188 | + |
---|
| 2189 | + AllocProjectedVertices(shadow); |
---|
| 2190 | + |
---|
| 2191 | + shadow.projectedVertices[1].x = 300; |
---|
2019 | 2192 | |
---|
2020 | 2193 | makeSomething(shadow); |
---|
2021 | 2194 | } |
---|
.. | .. |
---|
2536 | 2709 | } else |
---|
2537 | 2710 | if (source == loopItem || source == loopButton) |
---|
2538 | 2711 | { |
---|
| 2712 | + if (!group.selection.isEmpty()) |
---|
| 2713 | + { |
---|
2539 | 2714 | Composite csg = new GroupLeaf(); |
---|
2540 | | - csg.count = 5; |
---|
2541 | 2715 | group(csg); |
---|
| 2716 | + csg.count = 5; |
---|
2542 | 2717 | Composite child = new cGroup("Branch"); |
---|
2543 | 2718 | csg.addChild(child); |
---|
2544 | 2719 | child.addChild(csg); |
---|
| 2720 | + } |
---|
2545 | 2721 | } else |
---|
2546 | 2722 | if (source == doubleItem) |
---|
2547 | 2723 | { |
---|
| 2724 | + if (!group.selection.isEmpty()) |
---|
| 2725 | + { |
---|
2548 | 2726 | Composite csg = new GroupLeaf("Fork"); |
---|
2549 | | - csg.count = 5; |
---|
2550 | 2727 | group(csg); |
---|
| 2728 | + csg.count = 5; |
---|
2551 | 2729 | Composite child = new cGroup("Branch A"); |
---|
2552 | 2730 | csg.addChild(child); |
---|
2553 | 2731 | child.addChild(csg); |
---|
2554 | 2732 | child = new cGroup("Branch B"); |
---|
2555 | 2733 | csg.addChild(child); |
---|
2556 | 2734 | child.addChild(csg); |
---|
| 2735 | + } |
---|
2557 | 2736 | } else |
---|
2558 | 2737 | if (source == tripleItem) |
---|
2559 | 2738 | { |
---|
| 2739 | + if (!group.selection.isEmpty()) |
---|
| 2740 | + { |
---|
2560 | 2741 | Composite csg = new GroupLeaf("Trident"); |
---|
2561 | 2742 | csg.count = 4; |
---|
2562 | 2743 | group(csg); |
---|
.. | .. |
---|
2569 | 2750 | child = new cGroup(); |
---|
2570 | 2751 | csg.addChild(child); |
---|
2571 | 2752 | child.addChild(csg); |
---|
| 2753 | + } |
---|
2572 | 2754 | } else |
---|
2573 | 2755 | if (source == computeAOItem) |
---|
2574 | 2756 | { |
---|
.. | .. |
---|
2615 | 2797 | { |
---|
2616 | 2798 | Maximize(); |
---|
2617 | 2799 | } else |
---|
2618 | | - if (source == fullButton) |
---|
| 2800 | + if (source == fullScreenButton) |
---|
2619 | 2801 | { |
---|
2620 | 2802 | ToggleFullScreen(); |
---|
2621 | 2803 | } else |
---|
| 2804 | + if (source == collapseButton) |
---|
| 2805 | + { |
---|
| 2806 | + this.expandedLayout = radio.layout; |
---|
| 2807 | + CollapseToolbar(); |
---|
| 2808 | + } else |
---|
| 2809 | +// if (source == maximize3DButton) |
---|
| 2810 | +// { |
---|
| 2811 | +// this.expandedLayout = radio.layout; |
---|
| 2812 | +// radio.layout = twoButton; |
---|
| 2813 | +// CollapseToolbar(); |
---|
| 2814 | +// Show3DView(); |
---|
| 2815 | +// } else |
---|
2622 | 2816 | if (source == previousVersionButton) |
---|
2623 | 2817 | { |
---|
2624 | 2818 | // Go to previous version |
---|
.. | .. |
---|
3192 | 3386 | } else |
---|
3193 | 3387 | if (source == ungroupItem || source == ungroupButton) |
---|
3194 | 3388 | { |
---|
3195 | | - boolean hasRoot = false; |
---|
| 3389 | + boolean canUngroup = true; |
---|
3196 | 3390 | |
---|
3197 | 3391 | for (int i=0; i<group.selection.size(); i++) |
---|
3198 | 3392 | { |
---|
3199 | | - if (group.selection.get(i) == group) |
---|
| 3393 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem.Size() == 0) |
---|
3200 | 3396 | { |
---|
3201 | | - hasRoot = true; |
---|
| 3397 | + // Cannot ungroup leaves |
---|
| 3398 | + canUngroup = false; |
---|
| 3399 | + break; |
---|
| 3400 | + } |
---|
| 3401 | + |
---|
| 3402 | + if (selectedItem == group) |
---|
| 3403 | + { |
---|
| 3404 | + // Cannot ungroup root |
---|
| 3405 | + canUngroup = false; |
---|
3202 | 3406 | break; |
---|
3203 | 3407 | } |
---|
3204 | 3408 | } |
---|
3205 | 3409 | |
---|
3206 | | - if (!hasRoot) |
---|
| 3410 | + if (canUngroup) |
---|
3207 | 3411 | { |
---|
3208 | 3412 | for (int i=0; i<group.selection.size(); i++) |
---|
3209 | 3413 | { |
---|
3210 | | - Ungroup(group.selection.get(i)); |
---|
| 3414 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3415 | + |
---|
| 3416 | + Ungroup(selectedItem); |
---|
3211 | 3417 | } |
---|
3212 | 3418 | |
---|
3213 | 3419 | ClearSelection(false); |
---|
.. | .. |
---|
3258 | 3464 | if (source == clearMaterialsItem) |
---|
3259 | 3465 | { |
---|
3260 | 3466 | ClearMaterials(); |
---|
| 3467 | + } else |
---|
| 3468 | + if (source == clearVersionsItem) |
---|
| 3469 | + { |
---|
| 3470 | + ClearVersions(); |
---|
3261 | 3471 | } else |
---|
3262 | 3472 | if (source == liveleavesItem) |
---|
3263 | 3473 | { |
---|
.. | .. |
---|
3398 | 3608 | if (source == transformChildrenItem) |
---|
3399 | 3609 | { |
---|
3400 | 3610 | TransformChildren(); |
---|
| 3611 | + } else |
---|
| 3612 | + if (source == textureRatioRItem) |
---|
| 3613 | + { |
---|
| 3614 | + TextureRatio(0); |
---|
| 3615 | + } else |
---|
| 3616 | + if (source == textureRatioGItem) |
---|
| 3617 | + { |
---|
| 3618 | + TextureRatio(1); |
---|
| 3619 | + } else |
---|
| 3620 | + if (source == textureRatioBItem) |
---|
| 3621 | + { |
---|
| 3622 | + TextureRatio(2); |
---|
3401 | 3623 | } else |
---|
3402 | 3624 | if (source == resetTransformItem) |
---|
3403 | 3625 | { |
---|
.. | .. |
---|
3570 | 3792 | if (CameraPane.FULLSCREEN) |
---|
3571 | 3793 | fullscreenLayout = radio.layout; |
---|
3572 | 3794 | |
---|
3573 | | - // bug |
---|
3574 | | - //gridPanel.setDividerLocation(1.0); |
---|
3575 | | - //bigPanel.setDividerLocation(0.0); |
---|
3576 | | -// bigThree.remove(scenePanel); |
---|
3577 | | -// bigThree.remove(centralPanel); |
---|
3578 | | -// bigThree.remove(XYZPanel); |
---|
3579 | | -// aWindowConstraints.gridx = 0; |
---|
3580 | | -// aWindowConstraints.gridy = 0; |
---|
3581 | | -// aWindowConstraints.gridwidth = 1; |
---|
3582 | | -// // aConstraints.gridheight = 3; |
---|
3583 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3584 | | -// aWindowConstraints.weightx = 0; |
---|
3585 | | -// aWindowConstraints.weighty = 1; |
---|
3586 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3587 | | -// aWindowConstraints.weightx = 1; |
---|
3588 | | -// aWindowConstraints.gridwidth = 3; |
---|
3589 | | -// // aConstraints.gridheight = 3; |
---|
3590 | | -// aWindowConstraints.gridx = 1; |
---|
3591 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3592 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3593 | | -// aWindowConstraints.weightx = 0; |
---|
3594 | | -// aWindowConstraints.gridx = 4; |
---|
3595 | | -// aWindowConstraints.gridwidth = 1; |
---|
3596 | | -// // aConstraints.gridheight = 3; |
---|
3597 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3598 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3599 | | -// scenePanel.setVisible(false); |
---|
3600 | | -// centralPanel.setVisible(true); |
---|
3601 | | -// XYZPanel.setVisible(false); |
---|
3602 | | - bigThree.ClearUI(); |
---|
3603 | | - bigThree.add(centralPanel); |
---|
3604 | | - bigThree.FlushUI(); |
---|
| 3795 | + Show3DView(); |
---|
3605 | 3796 | |
---|
3606 | 3797 | cameraView.requestFocusInWindow(); |
---|
3607 | 3798 | |
---|
.. | .. |
---|
3787 | 3978 | } else |
---|
3788 | 3979 | if (source == rootButton) |
---|
3789 | 3980 | { |
---|
| 3981 | + Replace(); |
---|
3790 | 3982 | Object3D obj; |
---|
3791 | 3983 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3792 | 3984 | { |
---|
.. | .. |
---|
3801 | 3993 | if (source == closeButton) |
---|
3802 | 3994 | { |
---|
3803 | 3995 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3996 | + if (copy.versionlist != null) |
---|
| 3997 | + Replace(); |
---|
| 3998 | + |
---|
3804 | 3999 | cRadio ab; |
---|
3805 | 4000 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3806 | 4001 | { |
---|
.. | .. |
---|
3899 | 4094 | } else |
---|
3900 | 4095 | if(source instanceof cRadio) |
---|
3901 | 4096 | { |
---|
| 4097 | + if (copy.versionlist != null) |
---|
| 4098 | + Replace(); |
---|
| 4099 | + |
---|
3902 | 4100 | group.parent = keepparent; |
---|
3903 | 4101 | group.attributes = 0; |
---|
3904 | 4102 | //group.editWindow = null; |
---|
.. | .. |
---|
3923 | 4121 | |
---|
3924 | 4122 | copy = group; |
---|
3925 | 4123 | |
---|
3926 | | - SetUndoStates(); |
---|
3927 | | - |
---|
3928 | 4124 | //Globals.theRenderer.object = group; |
---|
3929 | 4125 | if(!useclient) |
---|
3930 | 4126 | { |
---|
.. | .. |
---|
3952 | 4148 | */ |
---|
3953 | 4149 | radio.layout.doClick(); |
---|
3954 | 4150 | |
---|
| 4151 | + //assert(copy instanceof Composite); |
---|
| 4152 | + |
---|
| 4153 | + if (copy.versionlist == null) |
---|
| 4154 | + { |
---|
| 4155 | + copy.versionindex = -1; |
---|
| 4156 | + |
---|
| 4157 | + // Cannot work with loops |
---|
| 4158 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4159 | + // and check if any of these nodes are reachable below the root. |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4161 | + |
---|
| 4162 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4163 | + { |
---|
| 4164 | + if (copy.versionlist == null) |
---|
| 4165 | + copy.versionlist = new Object3D[100]; |
---|
| 4166 | + |
---|
| 4167 | + //Save(true); |
---|
| 4168 | + } |
---|
| 4169 | + else |
---|
| 4170 | + copy.versionindex = -2; |
---|
| 4171 | + |
---|
| 4172 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4173 | + } |
---|
| 4174 | + |
---|
| 4175 | + SetVersionStates(); |
---|
| 4176 | + |
---|
3955 | 4177 | ClearUnpinned(); |
---|
3956 | 4178 | |
---|
3957 | 4179 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
4065 | 4287 | refreshContents(); |
---|
4066 | 4288 | } |
---|
4067 | 4289 | |
---|
| 4290 | + void TextureRatio(int axis) |
---|
| 4291 | + { |
---|
| 4292 | + Object3D obj; |
---|
| 4293 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4294 | + { |
---|
| 4295 | + obj = (Object3D)e.nextElement(); |
---|
| 4296 | + obj.TextureRatio(axis); |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + refreshContents(); |
---|
| 4300 | + } |
---|
| 4301 | + |
---|
4068 | 4302 | void ResetTransform() |
---|
4069 | 4303 | { |
---|
4070 | 4304 | ResetTransform(-1); |
---|
.. | .. |
---|
4080 | 4314 | if (obj.toParent == null) |
---|
4081 | 4315 | continue; |
---|
4082 | 4316 | |
---|
4083 | | - if (mask == -1) |
---|
4084 | | - { |
---|
4085 | | - if (obj instanceof Camera) // jan 2014 |
---|
4086 | | - { |
---|
4087 | | - LA.matIdentity(obj.toParent); |
---|
4088 | | - LA.matIdentity(obj.fromParent); |
---|
4089 | | - } |
---|
4090 | | - else |
---|
4091 | | - { |
---|
4092 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
4093 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
4094 | | - } |
---|
4095 | | - TouchTransform(obj); |
---|
4096 | | - continue; |
---|
4097 | | - } |
---|
4098 | | - if ((mask&2) != 0) // Scale |
---|
4099 | | - { |
---|
4100 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4101 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
4102 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
4103 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4104 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4105 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4106 | | - } |
---|
4107 | | - if ((mask&4) != 0) // Rotation |
---|
4108 | | - { |
---|
4109 | | - // ? |
---|
4110 | | - } |
---|
4111 | | - if ((mask&1) != 0) // Translation |
---|
4112 | | - { |
---|
4113 | | - if (obj.toParent != null) |
---|
4114 | | - { |
---|
4115 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4116 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4117 | | - } |
---|
4118 | | - } |
---|
| 4317 | + obj.ResetTransform(mask); |
---|
| 4318 | + |
---|
4119 | 4319 | if (obj.parent == null) |
---|
4120 | 4320 | { |
---|
4121 | 4321 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4624 | 4824 | { |
---|
4625 | 4825 | Object3D obj = group.selection.get(i); |
---|
4626 | 4826 | |
---|
| 4827 | + if (obj.toParent == null) |
---|
| 4828 | + { |
---|
| 4829 | + obj.toParent = LA.newMatrix(); |
---|
| 4830 | + obj.fromParent = LA.newMatrix(); |
---|
| 4831 | + } |
---|
| 4832 | + |
---|
4627 | 4833 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4628 | 4834 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4629 | 4835 | } |
---|
.. | .. |
---|
4915 | 5121 | refreshContents(); |
---|
4916 | 5122 | } |
---|
4917 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
4918 | 5130 | void FlipV(boolean flip) |
---|
4919 | 5131 | { |
---|
4920 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5153 | 5365 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5154 | 5366 | // a camera |
---|
5155 | 5367 | { |
---|
5156 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5368 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5157 | 5369 | { |
---|
5158 | 5370 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5159 | 5371 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
5186 | 5398 | flashSelectionButton.setEnabled(enabled); |
---|
5187 | 5399 | |
---|
5188 | 5400 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5401 | + |
---|
| 5402 | + boolean allComposites = true; |
---|
| 5403 | + |
---|
| 5404 | + if (group.selection != null) |
---|
| 5405 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5406 | + { |
---|
| 5407 | + Object next = e.nextElement(); |
---|
| 5408 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5409 | + { |
---|
| 5410 | + allComposites = false; |
---|
| 5411 | + break; |
---|
| 5412 | + } |
---|
| 5413 | + } |
---|
| 5414 | + |
---|
| 5415 | + rootButton.setEnabled(true); // allComposites); |
---|
5189 | 5416 | } |
---|
5190 | 5417 | |
---|
5191 | 5418 | void refreshContents(boolean cp) |
---|
5192 | 5419 | { |
---|
| 5420 | + if (Globals.SHOWINFO) |
---|
5193 | 5421 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5194 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5195 | 5423 | { |
---|
.. | .. |
---|
5200 | 5428 | Object3D child = (Object3D) group.selection.get(i); |
---|
5201 | 5429 | |
---|
5202 | 5430 | objEditor.AddInfo(child, this, true); |
---|
5203 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5431 | +// System.err.println("info : " + child.GetPath()); |
---|
5204 | 5432 | } |
---|
5205 | 5433 | |
---|
5206 | 5434 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6083 | 6311 | private MenuItem lookAtItem; |
---|
6084 | 6312 | private MenuItem lookFromItem; |
---|
6085 | 6313 | private MenuItem switchViewItem; |
---|
6086 | | - private MenuItem cutItem; |
---|
| 6314 | + private JMenuItem cutItem; |
---|
6087 | 6315 | private MenuItem undoItem; |
---|
6088 | 6316 | private MenuItem redoItem; |
---|
6089 | 6317 | private JMenuItem duplicateItem; |
---|
6090 | | - private MenuItem cloneItem; |
---|
| 6318 | + private JMenuItem cloneItem; |
---|
6091 | 6319 | private MenuItem cloneSupportItem; |
---|
6092 | 6320 | private MenuItem overwriteGeoItem; |
---|
6093 | 6321 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6108 | 6336 | private MenuItem cloneGeometriesItem; |
---|
6109 | 6337 | private MenuItem shareGeometriesItem; |
---|
6110 | 6338 | private MenuItem mergeGeometriesItem; |
---|
6111 | | - private MenuItem copyItem; |
---|
| 6339 | + private JMenuItem copyItem; |
---|
6112 | 6340 | private MenuItem pasteItem; |
---|
6113 | | - private MenuItem pasteIntoItem; |
---|
6114 | | - private MenuItem pasteLinkItem; |
---|
6115 | | - private MenuItem pasteCloneItem; |
---|
6116 | | - private MenuItem pasteExpandItem; |
---|
6117 | | - private MenuItem deleteItem; |
---|
| 6341 | + private JMenuItem pasteIntoItem; |
---|
| 6342 | + private JMenuItem pasteLinkItem; |
---|
| 6343 | + private JMenuItem pasteCloneItem; |
---|
| 6344 | + private JMenuItem pasteExpandItem; |
---|
| 6345 | + private JMenuItem deleteItem; |
---|
6118 | 6346 | private MenuItem clearAllItem; |
---|
6119 | 6347 | private MenuItem genUVItem; |
---|
6120 | 6348 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6140 | 6368 | private MenuItem clipMeshItem; |
---|
6141 | 6369 | private MenuItem smoothMeshItem; |
---|
6142 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
6143 | 6372 | |
---|
6144 | 6373 | private MenuItem liveleavesItem; |
---|
6145 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6163 | 6392 | private MenuItem maxTexturesItem; |
---|
6164 | 6393 | private MenuItem panoTexturesItem; |
---|
6165 | 6394 | |
---|
| 6395 | + private MenuItem textureRatioRItem; |
---|
| 6396 | + private MenuItem textureRatioGItem; |
---|
| 6397 | + private MenuItem textureRatioBItem; |
---|
6166 | 6398 | private MenuItem resetCentroidItem; |
---|
6167 | 6399 | private MenuItem resetCentroidXZItem; |
---|
6168 | 6400 | private MenuItem resetTransformItem; |
---|
6169 | 6401 | private MenuItem transformGeometryItem; |
---|
6170 | 6402 | private MenuItem transformChildrenItem; |
---|
6171 | 6403 | private MenuItem hideItem; |
---|
6172 | | - private MenuItem grabItem; |
---|
| 6404 | + private JMenuItem grabItem; |
---|
6173 | 6405 | private MenuItem backItem; |
---|
6174 | 6406 | private MenuItem frontItem; |
---|
6175 | 6407 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6182 | 6414 | private MenuItem switchTransfoItem; |
---|
6183 | 6415 | private MenuItem morphItem; |
---|
6184 | 6416 | private MenuItem linkerItem; |
---|
6185 | | - private MenuItem ungroupItem; |
---|
| 6417 | + private JMenuItem ungroupItem; |
---|
6186 | 6418 | private MenuItem editItem; |
---|
6187 | 6419 | private MenuItem openWindowItem; |
---|
6188 | 6420 | private MenuItem editLeafItem; |
---|