.. | .. |
---|
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) |
---|
.. | .. |
---|
443 | 483 | |
---|
444 | 484 | Object3D parent = obj.parent; |
---|
445 | 485 | obj.parent = null; |
---|
| 486 | + |
---|
446 | 487 | // Object3D support = obj.support; |
---|
447 | 488 | // obj.support = null; |
---|
448 | 489 | if (!supports) |
---|
449 | 490 | obj.SaveSupports(); |
---|
| 491 | + |
---|
450 | 492 | Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
| 493 | + |
---|
| 494 | + clone.ResetUUIDs(); |
---|
| 495 | + |
---|
451 | 496 | obj.parent = parent; |
---|
452 | 497 | // obj.support = support; |
---|
453 | 498 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
492 | 537 | // menu.add("-"); |
---|
493 | 538 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
494 | 539 | duplicateItem.addActionListener(this); |
---|
495 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 540 | + |
---|
| 541 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
496 | 542 | cloneItem.addActionListener(this); |
---|
497 | | - if (Globals.ADVANCED) |
---|
| 543 | + //if (Globals.ADVANCED) |
---|
498 | 544 | { |
---|
499 | 545 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
500 | 546 | cloneSupportItem.addActionListener(this); |
---|
501 | 547 | } |
---|
| 548 | + oe.jTree.popup.addSeparator(); |
---|
502 | 549 | menu.add("-"); |
---|
503 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 550 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
504 | 551 | cutItem.addActionListener(this); |
---|
505 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 552 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
506 | 553 | copyItem.addActionListener(this); |
---|
507 | 554 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
508 | 555 | pasteItem.addActionListener(this); |
---|
509 | 556 | |
---|
510 | | - menu.add("-"); |
---|
511 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 557 | + oe.jTree.popup.addSeparator(); |
---|
| 558 | + //menu.add("-"); |
---|
| 559 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
512 | 560 | pasteIntoItem.addActionListener(this); |
---|
513 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 561 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
514 | 562 | pasteLinkItem.addActionListener(this); |
---|
515 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 563 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
516 | 564 | pasteCloneItem.addActionListener(this); |
---|
517 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
518 | | -// pasteExpandItem.addActionListener(this); |
---|
519 | | - menu.add("-"); |
---|
520 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
521 | | - deleteItem.addActionListener(this); |
---|
| 565 | +// CRASH |
---|
| 566 | + pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
| 567 | +// |
---|
| 568 | + pasteExpandItem.addActionListener(this); |
---|
| 569 | + //menu.add("-"); |
---|
| 570 | + oe.jTree.popup.addSeparator(); |
---|
522 | 571 | |
---|
523 | 572 | if (Globals.ADVANCED) |
---|
524 | 573 | { |
---|
.. | .. |
---|
604 | 653 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
605 | 654 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
606 | 655 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
607 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
608 | 656 | oe.cameraMenu.add("-"); |
---|
609 | 657 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
610 | 658 | openWindowItem.addActionListener(this); |
---|
611 | | - editLeafItem.addActionListener(this); |
---|
612 | 659 | lookAtItem.addActionListener(this); |
---|
613 | 660 | //lookFromItem.addActinoListener(this); |
---|
614 | 661 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
655 | 702 | setMasterItem.addActionListener(this); |
---|
656 | 703 | } |
---|
657 | 704 | |
---|
658 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
659 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
660 | | -// grabItem.addActionListener(this); |
---|
| 705 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 706 | + |
---|
661 | 707 | backItem = menu.add(new MenuItem("Back")); |
---|
662 | 708 | backItem.addActionListener(this); |
---|
663 | 709 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
665 | 711 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
666 | 712 | // compositeItem.addActionListener(this); |
---|
667 | 713 | |
---|
| 714 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 715 | + grabItem.addActionListener(this); |
---|
| 716 | + |
---|
668 | 717 | if (Globals.ADVANCED) |
---|
669 | 718 | { |
---|
670 | 719 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
671 | 720 | hideItem.addActionListener(this); |
---|
672 | 721 | } |
---|
673 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 722 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
674 | 723 | ungroupItem.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.jTree.popup.addSeparator(); |
---|
| 726 | + |
---|
| 727 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 728 | + deleteItem.addActionListener(this); |
---|
675 | 729 | |
---|
676 | 730 | // menu.add("-"); |
---|
677 | 731 | // |
---|
.. | .. |
---|
708 | 762 | shadowYItem.addActionListener(this); |
---|
709 | 763 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
710 | 764 | shadowZItem.addActionListener(this); |
---|
| 765 | + |
---|
711 | 766 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
712 | 767 | attributeItem.addActionListener(this); |
---|
713 | | - |
---|
714 | 768 | if (Globals.ADVANCED) |
---|
715 | 769 | { |
---|
716 | 770 | menu.add("-"); |
---|
.. | .. |
---|
722 | 776 | pointflowItem.addActionListener(this); |
---|
723 | 777 | } |
---|
724 | 778 | menu.add("-"); |
---|
| 779 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 780 | + textureRatioRItem.addActionListener(this); |
---|
| 781 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 782 | + textureRatioGItem.addActionListener(this); |
---|
| 783 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 784 | + textureRatioBItem.addActionListener(this); |
---|
| 785 | + menu.add("-"); |
---|
725 | 786 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
726 | 787 | resetTransformItem.addActionListener(this); |
---|
727 | 788 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
728 | 789 | resetCentroidItem.addActionListener(this); |
---|
729 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 790 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
730 | 791 | resetCentroidXZItem.addActionListener(this); |
---|
731 | 792 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
732 | 793 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
742 | 803 | genNormalsCADItem.addActionListener(this); |
---|
743 | 804 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
744 | 805 | genNormalsMESHItem.addActionListener(this); |
---|
745 | | - if (Globals.ADVANCED) |
---|
| 806 | + //if (Globals.ADVANCED) |
---|
746 | 807 | { |
---|
747 | 808 | genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
748 | 809 | genNormalsMINEItem.addActionListener(this); |
---|
.. | .. |
---|
778 | 839 | } |
---|
779 | 840 | |
---|
780 | 841 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 842 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 843 | + clearVersionsItem.addActionListener(this); |
---|
781 | 844 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
782 | 845 | clearMaterialsItem.addActionListener(this); |
---|
783 | 846 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
800 | 863 | hideleavesItem.addActionListener(this); |
---|
801 | 864 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
802 | 865 | showleavesItem.addActionListener(this); |
---|
803 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 866 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
804 | 867 | markleavesItem.addActionListener(this); |
---|
805 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 868 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
806 | 869 | unmarkleavesItem.addActionListener(this); |
---|
807 | 870 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
808 | 871 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
856 | 919 | shareGeometriesItem.addActionListener(this); |
---|
857 | 920 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
858 | 921 | mergeGeometriesItem.addActionListener(this); |
---|
| 922 | + menu.add("-"); |
---|
| 923 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 924 | + editLeafItem.addActionListener(this); |
---|
859 | 925 | if (Globals.ADVANCED) |
---|
860 | 926 | { |
---|
861 | 927 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
872 | 938 | buildToolsMenu(menu); |
---|
873 | 939 | } |
---|
874 | 940 | |
---|
| 941 | + JTabbedPane resourcecontainer; |
---|
| 942 | + cGridBag currenttab; |
---|
| 943 | + //boolean added; // patch for jar |
---|
| 944 | + |
---|
| 945 | + int totalcount = 0; |
---|
| 946 | + |
---|
| 947 | + int tabcount = 0; |
---|
| 948 | + int colcount = 0; |
---|
| 949 | + int rowcount = 0; |
---|
| 950 | + int texturecount = 0; |
---|
| 951 | + |
---|
| 952 | + int columns = 5; |
---|
| 953 | + int rows = 7; |
---|
| 954 | + |
---|
| 955 | + public void ResourceCallBack(String[] path) |
---|
| 956 | + { |
---|
| 957 | +// for (int i = 0; i < path.length; i++) |
---|
| 958 | +// System.out.print(path[i] + "/"); |
---|
| 959 | +// System.out.println(); |
---|
| 960 | + |
---|
| 961 | + if (//rowcount == 0 || |
---|
| 962 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 963 | + { |
---|
| 964 | + currenttab = new cGridBag(); |
---|
| 965 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 966 | + currenttab.setName(tabname); |
---|
| 967 | + //added = false; |
---|
| 968 | + resourcecontainer.add(currenttab); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
| 970 | + rowcount = 1; |
---|
| 971 | + colcount = 0; |
---|
| 972 | + texturecount = 0; |
---|
| 973 | + } |
---|
| 974 | + |
---|
| 975 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 976 | + { |
---|
| 977 | + //if (!added) |
---|
| 978 | + { |
---|
| 979 | + //added = true; |
---|
| 980 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 981 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 982 | + } |
---|
| 983 | + |
---|
| 984 | + columns = 5; |
---|
| 985 | + |
---|
| 986 | + if (path[0].contains("D&R") || path[0].contains("Paint")) |
---|
| 987 | + columns = 4; |
---|
| 988 | + |
---|
| 989 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 990 | + totalcount++; |
---|
| 991 | + |
---|
| 992 | + if (++colcount >= columns) |
---|
| 993 | + { |
---|
| 994 | + colcount = 0; |
---|
| 995 | + currenttab.Return(); |
---|
| 996 | + |
---|
| 997 | + if (rowcount++ >= rows) |
---|
| 998 | + { |
---|
| 999 | + rowcount = 0; |
---|
| 1000 | + } |
---|
| 1001 | + } |
---|
| 1002 | + } |
---|
| 1003 | + else |
---|
| 1004 | + { |
---|
| 1005 | +// if (!path[path.length-1].equals("icons")) |
---|
| 1006 | +// resourcecontainer.Return(); |
---|
| 1007 | + } |
---|
| 1008 | + } |
---|
| 1009 | + |
---|
| 1010 | + void CreateTexturePanel(cGridBag container) |
---|
| 1011 | + { |
---|
| 1012 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1013 | + container.add(resourcecontainer); |
---|
| 1014 | + |
---|
| 1015 | + Grafreed.ParseResources("textures", this); |
---|
| 1016 | + |
---|
| 1017 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1018 | + } |
---|
875 | 1019 | |
---|
876 | 1020 | void SetupUI2(ObjEditor oe) |
---|
877 | 1021 | { |
---|
.. | .. |
---|
890 | 1034 | //new Exception().printStackTrace(); |
---|
891 | 1035 | |
---|
892 | 1036 | 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 | 1037 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
899 | 1038 | |
---|
900 | 1039 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
915 | 1054 | oe.radioPanel.add(dummyButton); |
---|
916 | 1055 | oe.buttonGroup.add(dummyButton); |
---|
917 | 1056 | */ |
---|
918 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1057 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
919 | 1058 | |
---|
920 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1059 | + versionManagerPanel.preferredHeight = 4; |
---|
921 | 1060 | |
---|
922 | 1061 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
923 | 1062 | |
---|
.. | .. |
---|
927 | 1066 | |
---|
928 | 1067 | if (Globals.ADVANCED) |
---|
929 | 1068 | { |
---|
930 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | | - maxButton.setToolTipText("Maximize window"); |
---|
932 | | - maxButton.addActionListener(this); |
---|
| 1069 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1070 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1071 | +// maxButton.addActionListener(this); |
---|
933 | 1072 | } |
---|
934 | 1073 | |
---|
935 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
936 | | - fullButton.setToolTipText("Full-screen window"); |
---|
937 | | - fullButton.addActionListener(this); |
---|
| 1074 | + cButton gcButton; |
---|
938 | 1075 | |
---|
939 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1078 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1079 | +// { |
---|
| 1080 | +// public void actionPerformed(ActionEvent e) |
---|
| 1081 | +// { |
---|
| 1082 | +// System.gc(); |
---|
| 1083 | +// } |
---|
| 1084 | +// }); |
---|
| 1085 | + |
---|
| 1086 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1088 | + fullScreenButton.addActionListener(this); |
---|
| 1089 | + |
---|
| 1090 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1092 | + collapseButton.addActionListener(this); |
---|
| 1093 | + |
---|
| 1094 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1096 | +// maximize3DButton.addActionListener(this); |
---|
| 1097 | + |
---|
| 1098 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1099 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1100 | + twoButton.addActionListener(this); |
---|
| 1101 | + this.fullscreenLayout = twoButton; |
---|
| 1102 | + |
---|
| 1103 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1104 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1105 | + threeButton.addActionListener(this); |
---|
| 1106 | + if (Globals.ADVANCED) |
---|
| 1107 | + { |
---|
| 1108 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1110 | + sixButton.addActionListener(this); |
---|
| 1111 | + } |
---|
| 1112 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1114 | +// sevenButton.addActionListener(this); |
---|
| 1115 | + // |
---|
| 1116 | + |
---|
| 1117 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
940 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
941 | 1119 | screenfitButton.addActionListener(this); |
---|
942 | 1120 | |
---|
943 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1121 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
944 | 1122 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
945 | 1123 | restoreCameraButton.addActionListener(this); |
---|
946 | 1124 | |
---|
947 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
948 | 1126 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
949 | 1127 | saveVersionButton.addActionListener(this); |
---|
950 | 1128 | |
---|
951 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
952 | 1130 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
953 | 1131 | deleteVersionButton.addActionListener(this); |
---|
| 1132 | + deleteVersionButton.setEnabled(false); |
---|
954 | 1133 | |
---|
955 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
956 | 1135 | previousVersionButton.setToolTipText("Previous version"); |
---|
957 | 1136 | previousVersionButton.addActionListener(this); |
---|
958 | 1137 | previousVersionButton.setEnabled(false); |
---|
959 | 1138 | |
---|
960 | 1139 | cGridBag updown = new cGridBag().setVertical(true); |
---|
961 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
962 | 1141 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
963 | 1142 | restoreButton.addActionListener(this); |
---|
964 | | - //restoreButton.setEnabled(false); |
---|
| 1143 | + restoreButton.setEnabled(false); |
---|
965 | 1144 | |
---|
966 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1145 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
967 | 1146 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
968 | 1147 | replaceButton.addActionListener(this); |
---|
969 | | - //replaceButton.setEnabled(false); |
---|
| 1148 | + replaceButton.setEnabled(false); |
---|
970 | 1149 | |
---|
971 | | - copyOptionsPanel.add(updown); |
---|
| 1150 | + versionManagerPanel.add(updown); |
---|
972 | 1151 | |
---|
973 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1152 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
974 | 1153 | nextVersionButton.setToolTipText("Next version"); |
---|
975 | 1154 | nextVersionButton.addActionListener(this); |
---|
976 | 1155 | nextVersionButton.setEnabled(false); |
---|
| 1156 | + |
---|
| 1157 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1158 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1159 | + oneStepButton.addActionListener(this); |
---|
977 | 1160 | |
---|
978 | 1161 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
979 | 1162 | liveCB.setToolTipText("Enable animation"); |
---|
980 | 1163 | liveCB.addItemListener(this); |
---|
981 | 1164 | |
---|
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 | 1165 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
987 | 1166 | fastCB.setToolTipText("Fast mode"); |
---|
988 | 1167 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
998 | 1177 | |
---|
999 | 1178 | if (Globals.ADVANCED) |
---|
1000 | 1179 | { |
---|
1001 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1002 | 1181 | snapobjectButton.addActionListener(this); |
---|
1003 | 1182 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1004 | 1183 | |
---|
1005 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1006 | 1185 | fourButton.addActionListener(this); |
---|
1007 | 1186 | fourButton.setToolTipText("Show control panel only"); |
---|
1008 | 1187 | } |
---|
1009 | 1188 | |
---|
1010 | 1189 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1011 | 1190 | |
---|
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 | 1191 | |
---|
1028 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1192 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1193 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1030 | 1194 | rootButton.addActionListener(this); |
---|
1031 | 1195 | |
---|
1032 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1033 | 1197 | closeButton.setToolTipText("Close tab"); |
---|
1034 | 1198 | closeButton.addActionListener(this); |
---|
1035 | 1199 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
1036 | 1200 | //clearButton.addActionListener(this); |
---|
1037 | 1201 | |
---|
1038 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
1039 | 1204 | |
---|
1040 | 1205 | // INSERT |
---|
1041 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1042 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1206 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1207 | + gridButton.setToolTipText("Create ground"); |
---|
1043 | 1208 | gridButton.addActionListener(this); |
---|
1044 | 1209 | |
---|
1045 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1046 | 1211 | boxButton.setToolTipText("Create box"); |
---|
1047 | 1212 | boxButton.addActionListener(this); |
---|
1048 | 1213 | |
---|
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); |
---|
| 1214 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1062 | 1215 | superButton.setToolTipText("Create superellipsoid"); |
---|
1063 | 1216 | superButton.addActionListener(this); |
---|
1064 | 1217 | |
---|
1065 | | - if (Globals.ADVANCED) |
---|
| 1218 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1220 | + sphereButton.addActionListener(this); |
---|
| 1221 | + |
---|
| 1222 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1223 | + coneButton.setToolTipText("Create cone"); |
---|
| 1224 | + coneButton.addActionListener(this); |
---|
| 1225 | + |
---|
| 1226 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1227 | + torusButton.setToolTipText("Create torus"); |
---|
| 1228 | + torusButton.addActionListener(this); |
---|
| 1229 | + |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
1066 | 1231 | { |
---|
1067 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1069 | 1234 | kleinButton.addActionListener(this); |
---|
1070 | 1235 | } |
---|
1071 | 1236 | |
---|
1072 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1073 | 1238 | particlesButton.setToolTipText("Create particle system"); |
---|
1074 | 1239 | particlesButton.addActionListener(this); |
---|
1075 | 1240 | |
---|
1076 | 1241 | oe.toolboxPanel.add(row1); |
---|
1077 | 1242 | |
---|
1078 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
1079 | 1245 | |
---|
1080 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1247 | groupButton.setToolTipText("Create group"); |
---|
1082 | 1248 | groupButton.addActionListener(this); |
---|
1083 | 1249 | |
---|
1084 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1251 | compositeButton.setToolTipText("Create composite"); |
---|
1086 | 1252 | compositeButton.addActionListener(this); |
---|
1087 | 1253 | |
---|
1088 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1255 | switchButton.setToolTipText("Create item switcher"); |
---|
1090 | 1256 | switchButton.addActionListener(this); |
---|
1091 | 1257 | |
---|
1092 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1259 | loopButton.setToolTipText("Create loop"); |
---|
1094 | 1260 | loopButton.addActionListener(this); |
---|
1095 | 1261 | |
---|
1096 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1263 | textureButton.setToolTipText("Create texture"); |
---|
1098 | 1264 | textureButton.addActionListener(this); |
---|
1099 | 1265 | |
---|
1100 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1101 | 1267 | overlayButton.setToolTipText("Create overlay"); |
---|
1102 | 1268 | overlayButton.addActionListener(this); |
---|
1103 | 1269 | |
---|
1104 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1270 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1105 | 1271 | lightButton.setToolTipText("Create light"); |
---|
1106 | 1272 | lightButton.addActionListener(this); |
---|
1107 | 1273 | |
---|
1108 | 1274 | oe.toolboxPanel.add(row2); |
---|
1109 | 1275 | |
---|
1110 | | - // ENVYMAPS |
---|
1111 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1112 | | - skyboxpane.preferredHeight = 100; |
---|
| 1276 | + cGridBag textures = new cGridBag(); |
---|
1113 | 1277 | |
---|
1114 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1278 | + CreateTexturePanel(textures); |
---|
1115 | 1279 | |
---|
1116 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1117 | | - skyboxpane.add(skyboxpanel); |
---|
| 1280 | + int tabCount = resourcecontainer.getTabCount(); |
---|
1118 | 1281 | |
---|
1119 | | - AddSkyboxTab0(skyboxpanel); |
---|
1120 | | - AddSkyboxTab1(skyboxpanel); |
---|
1121 | | - AddSkyboxTab2(skyboxpanel); |
---|
1122 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1282 | + if (tabCount > 0) |
---|
| 1283 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1284 | + |
---|
| 1285 | + oe.toolboxPanel.add(textures); |
---|
| 1286 | + |
---|
| 1287 | + textures.preferredHeight = 100; |
---|
| 1288 | + |
---|
| 1289 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1123 | 1290 | |
---|
1124 | 1291 | // EDIT panel |
---|
1125 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1292 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1126 | 1293 | editButton.setToolTipText("Pin selection controls"); |
---|
1127 | 1294 | editButton.addActionListener(this); |
---|
1128 | 1295 | |
---|
1129 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1296 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1297 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1131 | 1298 | uneditButton.addActionListener(this); |
---|
1132 | 1299 | |
---|
1133 | 1300 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1134 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1301 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1135 | 1302 | allParamsButton.addActionListener(this); |
---|
1136 | 1303 | |
---|
1137 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1138 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1304 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1305 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1139 | 1306 | clearPanelButton.addActionListener(this); |
---|
1140 | 1307 | |
---|
1141 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | | - unselectButton.setToolTipText("Unselect"); |
---|
1143 | | - unselectButton.addActionListener(this); |
---|
| 1308 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1309 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1310 | + //unselectButton.addActionListener(this); |
---|
1144 | 1311 | |
---|
1145 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1312 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1146 | 1313 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1147 | 1314 | flashSelectionButton.addActionListener(this); |
---|
1148 | 1315 | |
---|
.. | .. |
---|
1165 | 1332 | |
---|
1166 | 1333 | cGridBag jSPPanel = new cGridBag(); |
---|
1167 | 1334 | |
---|
| 1335 | + jSPPanel.preferredHeight = 20; |
---|
| 1336 | + |
---|
1168 | 1337 | JScrollPane jSP; |
---|
1169 | 1338 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1170 | 1339 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1173 | 1342 | oe.treePanel.add(jSPPanel); |
---|
1174 | 1343 | oe.treePanel.Return(); |
---|
1175 | 1344 | |
---|
1176 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1345 | + oe.treePanel.add(versionManagerPanel); |
---|
1177 | 1346 | oe.treePanel.Return(); |
---|
1178 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1179 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1180 | | - sliderPane.preferredHeight = 1; |
---|
| 1347 | + |
---|
| 1348 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1349 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1350 | + versionSliderPane.preferredHeight = 3; |
---|
1181 | 1351 | |
---|
1182 | 1352 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1183 | 1353 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1234 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1235 | 1405 | // supportCB.addItemListener(this); |
---|
1236 | 1406 | |
---|
1237 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1238 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1239 | 1409 | freezeCB.addItemListener(this); |
---|
1240 | 1410 | |
---|
.. | .. |
---|
1243 | 1413 | |
---|
1244 | 1414 | panel.Return(); |
---|
1245 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1246 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1247 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1248 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1249 | 1422 | |
---|
1250 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1251 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
.. | .. |
---|
1258 | 1431 | minshaderCB.setToolTipText("Minimal fast shader"); |
---|
1259 | 1432 | minshaderCB.addItemListener(this); |
---|
1260 | 1433 | |
---|
1261 | | -// constraints.gridy += 1; |
---|
1262 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1263 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1264 | 1436 | |
---|
1265 | | - panel.Return(); |
---|
1266 | | - |
---|
1267 | 1437 | if (false) |
---|
1268 | 1438 | { |
---|
1269 | 1439 | // handled in scripts |
---|
1270 | | - //constraints.gridy += 1; |
---|
1271 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1272 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1273 | 1442 | |
---|
1274 | | - //constraints.gridy += 1; |
---|
1275 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1276 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1277 | 1445 | |
---|
1278 | | - //constraints.gridy += 1; |
---|
1279 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1280 | | - smoothfocusCB.addItemListener(this); |
---|
1281 | 1446 | panel.Return(); |
---|
1282 | 1447 | } |
---|
1283 | 1448 | |
---|
1284 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1285 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1286 | 1455 | // debugCB.addItemListener(this); |
---|
1287 | 1456 | |
---|
.. | .. |
---|
1335 | 1504 | |
---|
1336 | 1505 | void EditObject(Object3D obj) |
---|
1337 | 1506 | { |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
| 1508 | + |
---|
| 1509 | +// if (obj.versionlist == null) |
---|
| 1510 | +// { |
---|
| 1511 | +// obj.versionlist = new Object3D[100]; |
---|
| 1512 | +// obj.versionindex = -1; |
---|
| 1513 | +// } |
---|
| 1514 | + |
---|
1338 | 1515 | cRadio radioButton = new cRadio(obj.name); |
---|
1339 | 1516 | |
---|
1340 | 1517 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1359 | 1536 | |
---|
1360 | 1537 | oe.SetupViews(); |
---|
1361 | 1538 | |
---|
| 1539 | + if (Globals.DEBUG) |
---|
1362 | 1540 | System.out.println("SetupViews"); |
---|
1363 | 1541 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1364 | 1542 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1725 | 1903 | TreePath path; |
---|
1726 | 1904 | |
---|
1727 | 1905 | public TransferableTreePath(TreePath tp) { |
---|
1728 | | - path = tp; |
---|
| 1906 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1907 | + for (int i=0; i<objs.length; i++) |
---|
| 1908 | + { |
---|
| 1909 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1910 | + } |
---|
| 1911 | + path = new TreePath(objs); |
---|
1729 | 1912 | } |
---|
1730 | 1913 | |
---|
1731 | 1914 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1906 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
1907 | 2090 | objEditor.ScreenFit(obj, false); |
---|
1908 | 2091 | |
---|
1909 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
1910 | 2093 | refreshContents(); |
---|
1911 | 2094 | } |
---|
1912 | 2095 | |
---|
.. | .. |
---|
1943 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
1944 | 2127 | } |
---|
1945 | 2128 | |
---|
1946 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
1947 | 2130 | |
---|
1948 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
1949 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1957 | 2140 | switch(axis) |
---|
1958 | 2141 | { |
---|
1959 | 2142 | 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; |
---|
| 2143 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2144 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2145 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2146 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1964 | 2147 | norm = cVector.X; |
---|
1965 | 2148 | break; |
---|
1966 | 2149 | 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; |
---|
| 2150 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2151 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2152 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2153 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1971 | 2154 | norm = cVector.Y; |
---|
1972 | 2155 | break; |
---|
1973 | 2156 | 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; |
---|
| 2157 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2158 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2159 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2160 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1978 | 2161 | norm = cVector.Z; |
---|
1979 | 2162 | break; |
---|
1980 | 2163 | } |
---|
.. | .. |
---|
2015 | 2198 | shadow.material = new cMaterial(obj.material); |
---|
2016 | 2199 | shadow.material.diffuse = 0.0001f; |
---|
2017 | 2200 | shadow.material.specular = 0.0001f; |
---|
2018 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2201 | + shadow.material.opacity = 0.75f; |
---|
| 2202 | + |
---|
| 2203 | + AllocProjectedVertices(shadow); |
---|
| 2204 | + |
---|
| 2205 | + shadow.projectedVertices[1].x = 300; |
---|
2019 | 2206 | |
---|
2020 | 2207 | makeSomething(shadow); |
---|
2021 | 2208 | } |
---|
.. | .. |
---|
2536 | 2723 | } else |
---|
2537 | 2724 | if (source == loopItem || source == loopButton) |
---|
2538 | 2725 | { |
---|
| 2726 | + if (!group.selection.isEmpty()) |
---|
| 2727 | + { |
---|
2539 | 2728 | Composite csg = new GroupLeaf(); |
---|
2540 | | - csg.count = 5; |
---|
2541 | 2729 | group(csg); |
---|
| 2730 | + csg.count = 5; |
---|
2542 | 2731 | Composite child = new cGroup("Branch"); |
---|
2543 | 2732 | csg.addChild(child); |
---|
2544 | 2733 | child.addChild(csg); |
---|
| 2734 | + } |
---|
2545 | 2735 | } else |
---|
2546 | 2736 | if (source == doubleItem) |
---|
2547 | 2737 | { |
---|
| 2738 | + if (!group.selection.isEmpty()) |
---|
| 2739 | + { |
---|
2548 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
2549 | | - csg.count = 5; |
---|
2550 | 2741 | group(csg); |
---|
| 2742 | + csg.count = 5; |
---|
2551 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2552 | 2744 | csg.addChild(child); |
---|
2553 | 2745 | child.addChild(csg); |
---|
2554 | 2746 | child = new cGroup("Branch B"); |
---|
2555 | 2747 | csg.addChild(child); |
---|
2556 | 2748 | child.addChild(csg); |
---|
| 2749 | + } |
---|
2557 | 2750 | } else |
---|
2558 | 2751 | if (source == tripleItem) |
---|
2559 | 2752 | { |
---|
| 2753 | + if (!group.selection.isEmpty()) |
---|
| 2754 | + { |
---|
2560 | 2755 | Composite csg = new GroupLeaf("Trident"); |
---|
2561 | 2756 | csg.count = 4; |
---|
2562 | 2757 | group(csg); |
---|
.. | .. |
---|
2569 | 2764 | child = new cGroup(); |
---|
2570 | 2765 | csg.addChild(child); |
---|
2571 | 2766 | child.addChild(csg); |
---|
| 2767 | + } |
---|
2572 | 2768 | } else |
---|
2573 | 2769 | if (source == computeAOItem) |
---|
2574 | 2770 | { |
---|
.. | .. |
---|
2615 | 2811 | { |
---|
2616 | 2812 | Maximize(); |
---|
2617 | 2813 | } else |
---|
2618 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2619 | 2815 | { |
---|
2620 | 2816 | ToggleFullScreen(); |
---|
2621 | 2817 | } else |
---|
| 2818 | + if (source == collapseButton) |
---|
| 2819 | + { |
---|
| 2820 | + this.expandedLayout = radio.layout; |
---|
| 2821 | + CollapseToolbar(); |
---|
| 2822 | + } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
2622 | 2830 | if (source == previousVersionButton) |
---|
2623 | 2831 | { |
---|
2624 | 2832 | // Go to previous version |
---|
.. | .. |
---|
2646 | 2854 | if (source == saveVersionButton) |
---|
2647 | 2855 | { |
---|
2648 | 2856 | // Save a new version |
---|
2649 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2650 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2651 | 2859 | } else |
---|
2652 | 2860 | if (source == deleteVersionButton) |
---|
.. | .. |
---|
3192 | 3400 | } else |
---|
3193 | 3401 | if (source == ungroupItem || source == ungroupButton) |
---|
3194 | 3402 | { |
---|
3195 | | - boolean hasRoot = false; |
---|
| 3403 | + boolean canUngroup = true; |
---|
3196 | 3404 | |
---|
3197 | 3405 | for (int i=0; i<group.selection.size(); i++) |
---|
3198 | 3406 | { |
---|
3199 | | - if (group.selection.get(i) == group) |
---|
| 3407 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3408 | + |
---|
| 3409 | + if (selectedItem.Size() == 0) |
---|
3200 | 3410 | { |
---|
3201 | | - hasRoot = true; |
---|
| 3411 | + // Cannot ungroup leaves |
---|
| 3412 | + canUngroup = false; |
---|
| 3413 | + break; |
---|
| 3414 | + } |
---|
| 3415 | + |
---|
| 3416 | + if (selectedItem == group) |
---|
| 3417 | + { |
---|
| 3418 | + // Cannot ungroup root |
---|
| 3419 | + canUngroup = false; |
---|
3202 | 3420 | break; |
---|
3203 | 3421 | } |
---|
3204 | 3422 | } |
---|
3205 | 3423 | |
---|
3206 | | - if (!hasRoot) |
---|
| 3424 | + if (canUngroup) |
---|
3207 | 3425 | { |
---|
3208 | 3426 | for (int i=0; i<group.selection.size(); i++) |
---|
3209 | 3427 | { |
---|
3210 | | - Ungroup(group.selection.get(i)); |
---|
| 3428 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3429 | + |
---|
| 3430 | + Ungroup(selectedItem); |
---|
3211 | 3431 | } |
---|
3212 | 3432 | |
---|
3213 | 3433 | ClearSelection(false); |
---|
.. | .. |
---|
3258 | 3478 | if (source == clearMaterialsItem) |
---|
3259 | 3479 | { |
---|
3260 | 3480 | ClearMaterials(); |
---|
| 3481 | + } else |
---|
| 3482 | + if (source == clearVersionsItem) |
---|
| 3483 | + { |
---|
| 3484 | + ClearVersions(); |
---|
3261 | 3485 | } else |
---|
3262 | 3486 | if (source == liveleavesItem) |
---|
3263 | 3487 | { |
---|
.. | .. |
---|
3398 | 3622 | if (source == transformChildrenItem) |
---|
3399 | 3623 | { |
---|
3400 | 3624 | TransformChildren(); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioRItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(0); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioGItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(1); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == textureRatioBItem) |
---|
| 3635 | + { |
---|
| 3636 | + TextureRatio(2); |
---|
3401 | 3637 | } else |
---|
3402 | 3638 | if (source == resetTransformItem) |
---|
3403 | 3639 | { |
---|
.. | .. |
---|
3570 | 3806 | if (CameraPane.FULLSCREEN) |
---|
3571 | 3807 | fullscreenLayout = radio.layout; |
---|
3572 | 3808 | |
---|
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(); |
---|
| 3809 | + Show3DView(); |
---|
3605 | 3810 | |
---|
3606 | 3811 | cameraView.requestFocusInWindow(); |
---|
3607 | 3812 | |
---|
.. | .. |
---|
3787 | 3992 | } else |
---|
3788 | 3993 | if (source == rootButton) |
---|
3789 | 3994 | { |
---|
| 3995 | + Replace(); |
---|
3790 | 3996 | Object3D obj; |
---|
3791 | 3997 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3792 | 3998 | { |
---|
.. | .. |
---|
3801 | 4007 | if (source == closeButton) |
---|
3802 | 4008 | { |
---|
3803 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
| 4012 | + |
---|
3804 | 4013 | cRadio ab; |
---|
3805 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3806 | 4015 | { |
---|
.. | .. |
---|
3899 | 4108 | } else |
---|
3900 | 4109 | if(source instanceof cRadio) |
---|
3901 | 4110 | { |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
| 4113 | + |
---|
3902 | 4114 | group.parent = keepparent; |
---|
3903 | 4115 | group.attributes = 0; |
---|
3904 | 4116 | //group.editWindow = null; |
---|
.. | .. |
---|
3923 | 4135 | |
---|
3924 | 4136 | copy = group; |
---|
3925 | 4137 | |
---|
3926 | | - SetUndoStates(); |
---|
3927 | | - |
---|
3928 | 4138 | //Globals.theRenderer.object = group; |
---|
3929 | 4139 | if(!useclient) |
---|
3930 | 4140 | { |
---|
.. | .. |
---|
3952 | 4162 | */ |
---|
3953 | 4163 | radio.layout.doClick(); |
---|
3954 | 4164 | |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
| 4166 | + |
---|
| 4167 | + if (copy.versionlist == null) |
---|
| 4168 | + { |
---|
| 4169 | + copy.versionindex = -1; |
---|
| 4170 | + |
---|
| 4171 | + // Cannot work with loops |
---|
| 4172 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4173 | + // and check if any of these nodes are reachable below the root. |
---|
| 4174 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4175 | + |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4177 | + { |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
| 4180 | + |
---|
| 4181 | + //Save(true); |
---|
| 4182 | + } |
---|
| 4183 | + else |
---|
| 4184 | + copy.versionindex = -2; |
---|
| 4185 | + |
---|
| 4186 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4187 | + } |
---|
| 4188 | + |
---|
| 4189 | + SetVersionStates(); |
---|
| 4190 | + |
---|
3955 | 4191 | ClearUnpinned(); |
---|
3956 | 4192 | |
---|
3957 | 4193 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
4065 | 4301 | refreshContents(); |
---|
4066 | 4302 | } |
---|
4067 | 4303 | |
---|
| 4304 | + void TextureRatio(int axis) |
---|
| 4305 | + { |
---|
| 4306 | + Object3D obj; |
---|
| 4307 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4308 | + { |
---|
| 4309 | + obj = (Object3D)e.nextElement(); |
---|
| 4310 | + obj.TextureRatio(axis); |
---|
| 4311 | + } |
---|
| 4312 | + |
---|
| 4313 | + refreshContents(); |
---|
| 4314 | + } |
---|
| 4315 | + |
---|
4068 | 4316 | void ResetTransform() |
---|
4069 | 4317 | { |
---|
4070 | 4318 | ResetTransform(-1); |
---|
| 4319 | + } |
---|
| 4320 | + |
---|
| 4321 | + void ScaleSelection(int scale) |
---|
| 4322 | + { |
---|
| 4323 | + Object3D obj; |
---|
| 4324 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4325 | + { |
---|
| 4326 | + obj = (Object3D)e.nextElement(); |
---|
| 4327 | + |
---|
| 4328 | + if (obj.toParent == null) |
---|
| 4329 | + continue; |
---|
| 4330 | + |
---|
| 4331 | + obj.Scale(scale); |
---|
| 4332 | + |
---|
| 4333 | + if (obj.parent == null) |
---|
| 4334 | + { |
---|
| 4335 | + System.out.println("NULL PARENT!"); |
---|
| 4336 | + // new Exception().printStackTrace(); |
---|
| 4337 | + } |
---|
| 4338 | + else |
---|
| 4339 | + TouchTransform(obj); |
---|
| 4340 | + //obj.parent.Touch(); |
---|
| 4341 | + } |
---|
| 4342 | + |
---|
| 4343 | + refreshContents(); |
---|
4071 | 4344 | } |
---|
4072 | 4345 | |
---|
4073 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
4080 | 4353 | if (obj.toParent == null) |
---|
4081 | 4354 | continue; |
---|
4082 | 4355 | |
---|
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 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4119 | 4358 | if (obj.parent == null) |
---|
4120 | 4359 | { |
---|
4121 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4624 | 4863 | { |
---|
4625 | 4864 | Object3D obj = group.selection.get(i); |
---|
4626 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4627 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4628 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4629 | 4874 | } |
---|
4630 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4631 | 4877 | refreshContents(); |
---|
4632 | 4878 | } |
---|
4633 | 4879 | |
---|
.. | .. |
---|
4915 | 5161 | refreshContents(); |
---|
4916 | 5162 | } |
---|
4917 | 5163 | |
---|
| 5164 | + void ClearVersions() |
---|
| 5165 | + { |
---|
| 5166 | + group.selection.ClearVersions(); |
---|
| 5167 | + refreshContents(); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
4918 | 5170 | void FlipV(boolean flip) |
---|
4919 | 5171 | { |
---|
4920 | 5172 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5153 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5154 | 5406 | // a camera |
---|
5155 | 5407 | { |
---|
5156 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5408 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5157 | 5409 | { |
---|
5158 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5159 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5160 | 5412 | } |
---|
5161 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5162 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5182 | 5434 | { |
---|
5183 | 5435 | editButton.setEnabled(enabled); |
---|
5184 | 5436 | uneditButton.setEnabled(enabled); |
---|
5185 | | - unselectButton.setEnabled(enabled); |
---|
| 5437 | + //unselectButton.setEnabled(enabled); |
---|
5186 | 5438 | flashSelectionButton.setEnabled(enabled); |
---|
5187 | 5439 | |
---|
5188 | 5440 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5441 | + |
---|
| 5442 | + boolean allComposites = true; |
---|
| 5443 | + |
---|
| 5444 | + if (group.selection != null) |
---|
| 5445 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5446 | + { |
---|
| 5447 | + Object next = e.nextElement(); |
---|
| 5448 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5449 | + { |
---|
| 5450 | + allComposites = false; |
---|
| 5451 | + break; |
---|
| 5452 | + } |
---|
| 5453 | + } |
---|
| 5454 | + |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5189 | 5456 | } |
---|
5190 | 5457 | |
---|
5191 | 5458 | void refreshContents(boolean cp) |
---|
5192 | 5459 | { |
---|
5193 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
| 5461 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5194 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5195 | 5463 | { |
---|
5196 | 5464 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5200 | 5468 | Object3D child = (Object3D) group.selection.get(i); |
---|
5201 | 5469 | |
---|
5202 | 5470 | objEditor.AddInfo(child, this, true); |
---|
5203 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5471 | +// System.err.println("info : " + child.GetPath()); |
---|
5204 | 5472 | } |
---|
5205 | 5473 | |
---|
5206 | 5474 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6083 | 6351 | private MenuItem lookAtItem; |
---|
6084 | 6352 | private MenuItem lookFromItem; |
---|
6085 | 6353 | private MenuItem switchViewItem; |
---|
6086 | | - private MenuItem cutItem; |
---|
| 6354 | + private JMenuItem cutItem; |
---|
6087 | 6355 | private MenuItem undoItem; |
---|
6088 | 6356 | private MenuItem redoItem; |
---|
6089 | 6357 | private JMenuItem duplicateItem; |
---|
6090 | | - private MenuItem cloneItem; |
---|
| 6358 | + private JMenuItem cloneItem; |
---|
6091 | 6359 | private MenuItem cloneSupportItem; |
---|
6092 | 6360 | private MenuItem overwriteGeoItem; |
---|
6093 | 6361 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6108 | 6376 | private MenuItem cloneGeometriesItem; |
---|
6109 | 6377 | private MenuItem shareGeometriesItem; |
---|
6110 | 6378 | private MenuItem mergeGeometriesItem; |
---|
6111 | | - private MenuItem copyItem; |
---|
| 6379 | + private JMenuItem copyItem; |
---|
6112 | 6380 | private MenuItem pasteItem; |
---|
6113 | | - private MenuItem pasteIntoItem; |
---|
6114 | | - private MenuItem pasteLinkItem; |
---|
6115 | | - private MenuItem pasteCloneItem; |
---|
6116 | | - private MenuItem pasteExpandItem; |
---|
6117 | | - private MenuItem deleteItem; |
---|
| 6381 | + private JMenuItem pasteIntoItem; |
---|
| 6382 | + private JMenuItem pasteLinkItem; |
---|
| 6383 | + private JMenuItem pasteCloneItem; |
---|
| 6384 | + private JMenuItem pasteExpandItem; |
---|
| 6385 | + private JMenuItem deleteItem; |
---|
6118 | 6386 | private MenuItem clearAllItem; |
---|
6119 | 6387 | private MenuItem genUVItem; |
---|
6120 | 6388 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6140 | 6408 | private MenuItem clipMeshItem; |
---|
6141 | 6409 | private MenuItem smoothMeshItem; |
---|
6142 | 6410 | private MenuItem clearMaterialsItem; |
---|
| 6411 | + private MenuItem clearVersionsItem; |
---|
6143 | 6412 | |
---|
6144 | 6413 | private MenuItem liveleavesItem; |
---|
6145 | 6414 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6163 | 6432 | private MenuItem maxTexturesItem; |
---|
6164 | 6433 | private MenuItem panoTexturesItem; |
---|
6165 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6166 | 6438 | private MenuItem resetCentroidItem; |
---|
6167 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6168 | 6440 | private MenuItem resetTransformItem; |
---|
6169 | 6441 | private MenuItem transformGeometryItem; |
---|
6170 | 6442 | private MenuItem transformChildrenItem; |
---|
6171 | 6443 | private MenuItem hideItem; |
---|
6172 | | - private MenuItem grabItem; |
---|
| 6444 | + private JMenuItem grabItem; |
---|
6173 | 6445 | private MenuItem backItem; |
---|
6174 | 6446 | private MenuItem frontItem; |
---|
6175 | 6447 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6182 | 6454 | private MenuItem switchTransfoItem; |
---|
6183 | 6455 | private MenuItem morphItem; |
---|
6184 | 6456 | private MenuItem linkerItem; |
---|
6185 | | - private MenuItem ungroupItem; |
---|
| 6457 | + private JMenuItem ungroupItem; |
---|
6186 | 6458 | private MenuItem editItem; |
---|
6187 | 6459 | private MenuItem openWindowItem; |
---|
6188 | 6460 | private MenuItem editLeafItem; |
---|