.. | .. |
---|
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 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
| 379 | + } |
---|
| 380 | + |
---|
335 | 381 | //ObjEditor objEditor; |
---|
336 | 382 | public void closeUI2() |
---|
337 | 383 | { |
---|
.. | .. |
---|
369 | 415 | this.copy = this.group = group; |
---|
370 | 416 | //selectees = this.group.selectees; |
---|
371 | 417 | |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
372 | 420 | if (copy.versionlist == null) |
---|
373 | 421 | { |
---|
374 | 422 | copy.versionlist = new Object3D[100]; |
---|
375 | 423 | copy.versionindex = -1; |
---|
| 424 | + |
---|
| 425 | + //Save(true); |
---|
376 | 426 | } |
---|
377 | 427 | |
---|
378 | 428 | if(ui) |
---|
.. | .. |
---|
401 | 451 | copy.versionlist = new Object3D[100]; |
---|
402 | 452 | copy.versionindex = -1; |
---|
403 | 453 | |
---|
404 | | - Save(true); |
---|
| 454 | + //Save(true); |
---|
405 | 455 | } |
---|
406 | 456 | } |
---|
407 | 457 | |
---|
.. | .. |
---|
492 | 542 | // menu.add("-"); |
---|
493 | 543 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
494 | 544 | duplicateItem.addActionListener(this); |
---|
495 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 545 | + |
---|
| 546 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
496 | 547 | cloneItem.addActionListener(this); |
---|
497 | | - if (Globals.ADVANCED) |
---|
| 548 | + //if (Globals.ADVANCED) |
---|
498 | 549 | { |
---|
499 | 550 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
500 | 551 | cloneSupportItem.addActionListener(this); |
---|
501 | 552 | } |
---|
| 553 | + oe.jTree.popup.addSeparator(); |
---|
502 | 554 | menu.add("-"); |
---|
503 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 555 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
504 | 556 | cutItem.addActionListener(this); |
---|
505 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 557 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
506 | 558 | copyItem.addActionListener(this); |
---|
507 | 559 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
508 | 560 | pasteItem.addActionListener(this); |
---|
509 | 561 | |
---|
510 | | - menu.add("-"); |
---|
511 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 562 | + oe.jTree.popup.addSeparator(); |
---|
| 563 | + //menu.add("-"); |
---|
| 564 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
512 | 565 | pasteIntoItem.addActionListener(this); |
---|
513 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 566 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
514 | 567 | pasteLinkItem.addActionListener(this); |
---|
515 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 568 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
516 | 569 | pasteCloneItem.addActionListener(this); |
---|
517 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 570 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
518 | 571 | // pasteExpandItem.addActionListener(this); |
---|
519 | | - menu.add("-"); |
---|
520 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
521 | | - deleteItem.addActionListener(this); |
---|
| 572 | + //menu.add("-"); |
---|
| 573 | + oe.jTree.popup.addSeparator(); |
---|
522 | 574 | |
---|
523 | 575 | if (Globals.ADVANCED) |
---|
524 | 576 | { |
---|
.. | .. |
---|
604 | 656 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
605 | 657 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
606 | 658 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
607 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
608 | 659 | oe.cameraMenu.add("-"); |
---|
609 | 660 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
610 | 661 | openWindowItem.addActionListener(this); |
---|
611 | | - editLeafItem.addActionListener(this); |
---|
612 | 662 | lookAtItem.addActionListener(this); |
---|
613 | 663 | //lookFromItem.addActinoListener(this); |
---|
614 | 664 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
655 | 705 | setMasterItem.addActionListener(this); |
---|
656 | 706 | } |
---|
657 | 707 | |
---|
658 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
659 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
660 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
661 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
662 | 711 | backItem.addActionListener(this); |
---|
663 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
665 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
666 | 715 | // compositeItem.addActionListener(this); |
---|
667 | 716 | |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
| 719 | + |
---|
668 | 720 | if (Globals.ADVANCED) |
---|
669 | 721 | { |
---|
670 | 722 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
671 | 723 | hideItem.addActionListener(this); |
---|
672 | 724 | } |
---|
673 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 725 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
674 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
675 | 732 | |
---|
676 | 733 | // menu.add("-"); |
---|
677 | 734 | // |
---|
.. | .. |
---|
800 | 857 | hideleavesItem.addActionListener(this); |
---|
801 | 858 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
802 | 859 | showleavesItem.addActionListener(this); |
---|
803 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 860 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
804 | 861 | markleavesItem.addActionListener(this); |
---|
805 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 862 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
806 | 863 | unmarkleavesItem.addActionListener(this); |
---|
807 | 864 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
808 | 865 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
856 | 913 | shareGeometriesItem.addActionListener(this); |
---|
857 | 914 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
858 | 915 | mergeGeometriesItem.addActionListener(this); |
---|
| 916 | + menu.add("-"); |
---|
| 917 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 918 | + editLeafItem.addActionListener(this); |
---|
859 | 919 | if (Globals.ADVANCED) |
---|
860 | 920 | { |
---|
861 | 921 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
872 | 932 | buildToolsMenu(menu); |
---|
873 | 933 | } |
---|
874 | 934 | |
---|
| 935 | + JTabbedPane resourcecontainer; |
---|
| 936 | + cGridBag currenttab; |
---|
| 937 | + //boolean added; // patch for jar |
---|
| 938 | + |
---|
| 939 | + int tabcount = 0; |
---|
| 940 | + int colcount = 0; |
---|
| 941 | + int rowcount = 0; |
---|
| 942 | + int texturecount = 0; |
---|
| 943 | + |
---|
| 944 | + int columns = 5; |
---|
| 945 | + int rows = 7; |
---|
| 946 | + |
---|
| 947 | + public void ResourceCallBack(String[] path) |
---|
| 948 | + { |
---|
| 949 | +// for (int i = 0; i < path.length; i++) |
---|
| 950 | +// System.out.print(path[i] + "/"); |
---|
| 951 | +// System.out.println(); |
---|
| 952 | + |
---|
| 953 | + if (//rowcount == 0 || |
---|
| 954 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 955 | + { |
---|
| 956 | + currenttab = new cGridBag(); |
---|
| 957 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 958 | + currenttab.setName(tabname); |
---|
| 959 | + //added = false; |
---|
| 960 | + resourcecontainer.add(currenttab); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 962 | + rowcount = 1; |
---|
| 963 | + colcount = 0; |
---|
| 964 | + texturecount = 0; |
---|
| 965 | + } |
---|
| 966 | + |
---|
| 967 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 968 | + { |
---|
| 969 | + //if (!added) |
---|
| 970 | + { |
---|
| 971 | + //added = true; |
---|
| 972 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 973 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 974 | + } |
---|
| 975 | + |
---|
| 976 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 977 | + |
---|
| 978 | + if (++colcount >= columns) |
---|
| 979 | + { |
---|
| 980 | + colcount = 0; |
---|
| 981 | + currenttab.Return(); |
---|
| 982 | + |
---|
| 983 | + if (rowcount++ >= rows) |
---|
| 984 | + { |
---|
| 985 | + rowcount = 0; |
---|
| 986 | + } |
---|
| 987 | + } |
---|
| 988 | + } |
---|
| 989 | + else |
---|
| 990 | + { |
---|
| 991 | +// if (!path[path.length-1].equals("icons")) |
---|
| 992 | +// resourcecontainer.Return(); |
---|
| 993 | + } |
---|
| 994 | + } |
---|
| 995 | + |
---|
| 996 | + void CreateTexturePanel(cGridBag container) |
---|
| 997 | + { |
---|
| 998 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 999 | + container.add(resourcecontainer); |
---|
| 1000 | + |
---|
| 1001 | + Grafreed.ParseResources("textures", this); |
---|
| 1002 | + } |
---|
875 | 1003 | |
---|
876 | 1004 | void SetupUI2(ObjEditor oe) |
---|
877 | 1005 | { |
---|
.. | .. |
---|
890 | 1018 | //new Exception().printStackTrace(); |
---|
891 | 1019 | |
---|
892 | 1020 | 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 | 1021 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
899 | 1022 | |
---|
900 | 1023 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
915 | 1038 | oe.radioPanel.add(dummyButton); |
---|
916 | 1039 | oe.buttonGroup.add(dummyButton); |
---|
917 | 1040 | */ |
---|
918 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1041 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
919 | 1042 | |
---|
920 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1043 | + versionManagerPanel.preferredHeight = 4; |
---|
921 | 1044 | |
---|
922 | 1045 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
923 | 1046 | |
---|
.. | .. |
---|
927 | 1050 | |
---|
928 | 1051 | if (Globals.ADVANCED) |
---|
929 | 1052 | { |
---|
930 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | | - maxButton.setToolTipText("Maximize window"); |
---|
932 | | - maxButton.addActionListener(this); |
---|
| 1053 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1054 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1055 | +// maxButton.addActionListener(this); |
---|
933 | 1056 | } |
---|
934 | 1057 | |
---|
935 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | + cButton gcButton; |
---|
| 1059 | + |
---|
| 1060 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1062 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1063 | +// { |
---|
| 1064 | +// public void actionPerformed(ActionEvent e) |
---|
| 1065 | +// { |
---|
| 1066 | +// System.gc(); |
---|
| 1067 | +// } |
---|
| 1068 | +// }); |
---|
| 1069 | + |
---|
| 1070 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1071 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1072 | + collapseButton.addActionListener(this); |
---|
| 1073 | + |
---|
| 1074 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1076 | + maximize3DButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1080 | + twoButton.addActionListener(this); |
---|
| 1081 | + this.fullscreenLayout = twoButton; |
---|
| 1082 | + |
---|
| 1083 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1085 | + threeButton.addActionListener(this); |
---|
| 1086 | + if (Globals.ADVANCED) |
---|
| 1087 | + { |
---|
| 1088 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1089 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1090 | + sixButton.addActionListener(this); |
---|
| 1091 | + } |
---|
| 1092 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1094 | +// sevenButton.addActionListener(this); |
---|
| 1095 | + // |
---|
| 1096 | + |
---|
| 1097 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
936 | 1098 | fullButton.setToolTipText("Full-screen window"); |
---|
937 | 1099 | fullButton.addActionListener(this); |
---|
938 | 1100 | |
---|
939 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
940 | 1102 | screenfitButton.setToolTipText("Screen fit"); |
---|
941 | 1103 | screenfitButton.addActionListener(this); |
---|
942 | 1104 | |
---|
943 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
944 | 1106 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
945 | 1107 | restoreCameraButton.addActionListener(this); |
---|
946 | 1108 | |
---|
947 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
948 | 1110 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
949 | 1111 | saveVersionButton.addActionListener(this); |
---|
950 | 1112 | |
---|
951 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
952 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
953 | 1115 | deleteVersionButton.addActionListener(this); |
---|
| 1116 | + deleteVersionButton.setEnabled(false); |
---|
954 | 1117 | |
---|
955 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
956 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
957 | 1120 | previousVersionButton.addActionListener(this); |
---|
958 | 1121 | previousVersionButton.setEnabled(false); |
---|
959 | 1122 | |
---|
960 | 1123 | cGridBag updown = new cGridBag().setVertical(true); |
---|
961 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
962 | 1125 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
963 | 1126 | restoreButton.addActionListener(this); |
---|
964 | | - //restoreButton.setEnabled(false); |
---|
| 1127 | + restoreButton.setEnabled(false); |
---|
965 | 1128 | |
---|
966 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
967 | 1130 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
968 | 1131 | replaceButton.addActionListener(this); |
---|
969 | | - //replaceButton.setEnabled(false); |
---|
| 1132 | + replaceButton.setEnabled(false); |
---|
970 | 1133 | |
---|
971 | | - copyOptionsPanel.add(updown); |
---|
| 1134 | + versionManagerPanel.add(updown); |
---|
972 | 1135 | |
---|
973 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
974 | 1137 | nextVersionButton.setToolTipText("Next version"); |
---|
975 | 1138 | nextVersionButton.addActionListener(this); |
---|
976 | 1139 | nextVersionButton.setEnabled(false); |
---|
| 1140 | + |
---|
| 1141 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1142 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1143 | + oneStepButton.addActionListener(this); |
---|
977 | 1144 | |
---|
978 | 1145 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
979 | 1146 | liveCB.setToolTipText("Enable animation"); |
---|
980 | 1147 | liveCB.addItemListener(this); |
---|
981 | 1148 | |
---|
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 | 1149 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
987 | 1150 | fastCB.setToolTipText("Fast mode"); |
---|
988 | 1151 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
998 | 1161 | |
---|
999 | 1162 | if (Globals.ADVANCED) |
---|
1000 | 1163 | { |
---|
1001 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1164 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1002 | 1165 | snapobjectButton.addActionListener(this); |
---|
1003 | 1166 | snapobjectButton.setToolTipText("Snap Object"); |
---|
1004 | 1167 | |
---|
1005 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1006 | 1169 | fourButton.addActionListener(this); |
---|
1007 | 1170 | fourButton.setToolTipText("Show control panel only"); |
---|
1008 | 1171 | } |
---|
1009 | 1172 | |
---|
1010 | 1173 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1011 | 1174 | |
---|
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 | 1175 | |
---|
1028 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1176 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1177 | rootButton.setToolTipText("Open selection in new tab"); |
---|
1030 | 1178 | rootButton.addActionListener(this); |
---|
1031 | 1179 | |
---|
1032 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1033 | 1181 | closeButton.setToolTipText("Close tab"); |
---|
1034 | 1182 | closeButton.addActionListener(this); |
---|
1035 | 1183 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
1038 | 1186 | cGridBag row1 = new cGridBag(); |
---|
1039 | 1187 | |
---|
1040 | 1188 | // INSERT |
---|
1041 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1042 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1189 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1190 | + gridButton.setToolTipText("Create ground"); |
---|
1043 | 1191 | gridButton.addActionListener(this); |
---|
1044 | 1192 | |
---|
1045 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1193 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1046 | 1194 | boxButton.setToolTipText("Create box"); |
---|
1047 | 1195 | boxButton.addActionListener(this); |
---|
1048 | 1196 | |
---|
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); |
---|
| 1197 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1062 | 1198 | superButton.setToolTipText("Create superellipsoid"); |
---|
1063 | 1199 | superButton.addActionListener(this); |
---|
1064 | 1200 | |
---|
| 1201 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1202 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1203 | + sphereButton.addActionListener(this); |
---|
| 1204 | + |
---|
| 1205 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + coneButton.setToolTipText("Create cone"); |
---|
| 1207 | + coneButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + torusButton.setToolTipText("Create torus"); |
---|
| 1211 | + torusButton.addActionListener(this); |
---|
| 1212 | + |
---|
1065 | 1213 | if (Globals.ADVANCED) |
---|
1066 | 1214 | { |
---|
1067 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1215 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1068 | 1216 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
1069 | 1217 | kleinButton.addActionListener(this); |
---|
1070 | 1218 | } |
---|
1071 | 1219 | |
---|
1072 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1073 | 1221 | particlesButton.setToolTipText("Create particle system"); |
---|
1074 | 1222 | particlesButton.addActionListener(this); |
---|
1075 | 1223 | |
---|
.. | .. |
---|
1077 | 1225 | |
---|
1078 | 1226 | cGridBag row2 = new cGridBag(); |
---|
1079 | 1227 | |
---|
1080 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1228 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1081 | 1229 | groupButton.setToolTipText("Create group"); |
---|
1082 | 1230 | groupButton.addActionListener(this); |
---|
1083 | 1231 | |
---|
1084 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1085 | 1233 | compositeButton.setToolTipText("Create composite"); |
---|
1086 | 1234 | compositeButton.addActionListener(this); |
---|
1087 | 1235 | |
---|
1088 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1089 | 1237 | switchButton.setToolTipText("Create item switcher"); |
---|
1090 | 1238 | switchButton.addActionListener(this); |
---|
1091 | 1239 | |
---|
1092 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1093 | 1241 | loopButton.setToolTipText("Create loop"); |
---|
1094 | 1242 | loopButton.addActionListener(this); |
---|
1095 | 1243 | |
---|
1096 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1097 | 1245 | textureButton.setToolTipText("Create texture"); |
---|
1098 | 1246 | textureButton.addActionListener(this); |
---|
1099 | 1247 | |
---|
1100 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1101 | 1249 | overlayButton.setToolTipText("Create overlay"); |
---|
1102 | 1250 | overlayButton.addActionListener(this); |
---|
1103 | 1251 | |
---|
1104 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1105 | 1253 | lightButton.setToolTipText("Create light"); |
---|
1106 | 1254 | lightButton.addActionListener(this); |
---|
1107 | 1255 | |
---|
1108 | 1256 | oe.toolboxPanel.add(row2); |
---|
1109 | 1257 | |
---|
1110 | | - // ENVYMAPS |
---|
1111 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1112 | | - skyboxpane.preferredHeight = 100; |
---|
| 1258 | + cGridBag textures = new cGridBag(); |
---|
1113 | 1259 | |
---|
1114 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1260 | + CreateTexturePanel(textures); |
---|
1115 | 1261 | |
---|
1116 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1117 | | - skyboxpane.add(skyboxpanel); |
---|
| 1262 | + resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
1118 | 1263 | |
---|
1119 | | - AddSkyboxTab0(skyboxpanel); |
---|
1120 | | - AddSkyboxTab1(skyboxpanel); |
---|
1121 | | - AddSkyboxTab2(skyboxpanel); |
---|
1122 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1264 | + oe.toolboxPanel.add(textures); |
---|
| 1265 | + |
---|
| 1266 | + textures.preferredHeight = 100; |
---|
| 1267 | + |
---|
| 1268 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1123 | 1269 | |
---|
1124 | 1270 | // EDIT panel |
---|
1125 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1271 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1126 | 1272 | editButton.setToolTipText("Pin selection controls"); |
---|
1127 | 1273 | editButton.addActionListener(this); |
---|
1128 | 1274 | |
---|
1129 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1275 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1130 | 1276 | uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1131 | 1277 | uneditButton.addActionListener(this); |
---|
1132 | 1278 | |
---|
1133 | 1279 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1134 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1280 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1135 | 1281 | allParamsButton.addActionListener(this); |
---|
1136 | 1282 | |
---|
1137 | | - editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1138 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1283 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1284 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1139 | 1285 | clearPanelButton.addActionListener(this); |
---|
1140 | 1286 | |
---|
1141 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1142 | | - unselectButton.setToolTipText("Unselect"); |
---|
1143 | | - unselectButton.addActionListener(this); |
---|
| 1287 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1288 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1289 | + //unselectButton.addActionListener(this); |
---|
1144 | 1290 | |
---|
1145 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1146 | 1292 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1147 | 1293 | flashSelectionButton.addActionListener(this); |
---|
1148 | 1294 | |
---|
.. | .. |
---|
1165 | 1311 | |
---|
1166 | 1312 | cGridBag jSPPanel = new cGridBag(); |
---|
1167 | 1313 | |
---|
| 1314 | + jSPPanel.preferredHeight = 20; |
---|
| 1315 | + |
---|
1168 | 1316 | JScrollPane jSP; |
---|
1169 | 1317 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1170 | 1318 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1173 | 1321 | oe.treePanel.add(jSPPanel); |
---|
1174 | 1322 | oe.treePanel.Return(); |
---|
1175 | 1323 | |
---|
1176 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1324 | + oe.treePanel.add(versionManagerPanel); |
---|
1177 | 1325 | oe.treePanel.Return(); |
---|
1178 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1179 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1180 | | - sliderPane.preferredHeight = 1; |
---|
| 1326 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1327 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1328 | + versionSliderPane.preferredHeight = 3; |
---|
1181 | 1329 | |
---|
1182 | 1330 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1183 | 1331 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1335 | 1483 | |
---|
1336 | 1484 | void EditObject(Object3D obj) |
---|
1337 | 1485 | { |
---|
| 1486 | + assert(obj instanceof Composite); |
---|
| 1487 | + |
---|
| 1488 | +// if (obj.versionlist == null) |
---|
| 1489 | +// { |
---|
| 1490 | +// obj.versionlist = new Object3D[100]; |
---|
| 1491 | +// obj.versionindex = -1; |
---|
| 1492 | +// } |
---|
| 1493 | + |
---|
1338 | 1494 | cRadio radioButton = new cRadio(obj.name); |
---|
1339 | 1495 | |
---|
1340 | 1496 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1359 | 1515 | |
---|
1360 | 1516 | oe.SetupViews(); |
---|
1361 | 1517 | |
---|
| 1518 | + if (Globals.DEBUG) |
---|
1362 | 1519 | System.out.println("SetupViews"); |
---|
1363 | 1520 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1364 | 1521 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1725 | 1882 | TreePath path; |
---|
1726 | 1883 | |
---|
1727 | 1884 | public TransferableTreePath(TreePath tp) { |
---|
1728 | | - path = tp; |
---|
| 1885 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1886 | + for (int i=0; i<objs.length; i++) |
---|
| 1887 | + { |
---|
| 1888 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1889 | + } |
---|
| 1890 | + path = new TreePath(objs); |
---|
1729 | 1891 | } |
---|
1730 | 1892 | |
---|
1731 | 1893 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2015 | 2177 | shadow.material = new cMaterial(obj.material); |
---|
2016 | 2178 | shadow.material.diffuse = 0.0001f; |
---|
2017 | 2179 | shadow.material.specular = 0.0001f; |
---|
2018 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2180 | + shadow.material.opacity = 0.75f; |
---|
| 2181 | + |
---|
| 2182 | + AllocProjectedVertices(shadow); |
---|
| 2183 | + |
---|
| 2184 | + shadow.projectedVertices[1].x = 300; |
---|
2019 | 2185 | |
---|
2020 | 2186 | makeSomething(shadow); |
---|
2021 | 2187 | } |
---|
.. | .. |
---|
2536 | 2702 | } else |
---|
2537 | 2703 | if (source == loopItem || source == loopButton) |
---|
2538 | 2704 | { |
---|
| 2705 | + if (!group.selection.isEmpty()) |
---|
| 2706 | + { |
---|
2539 | 2707 | Composite csg = new GroupLeaf(); |
---|
2540 | 2708 | csg.count = 5; |
---|
2541 | | - group(csg); |
---|
2542 | 2709 | Composite child = new cGroup("Branch"); |
---|
2543 | 2710 | csg.addChild(child); |
---|
2544 | 2711 | child.addChild(csg); |
---|
| 2712 | + group(csg); |
---|
| 2713 | + } |
---|
2545 | 2714 | } else |
---|
2546 | 2715 | if (source == doubleItem) |
---|
2547 | 2716 | { |
---|
| 2717 | + if (!group.selection.isEmpty()) |
---|
| 2718 | + { |
---|
2548 | 2719 | Composite csg = new GroupLeaf("Fork"); |
---|
2549 | 2720 | csg.count = 5; |
---|
2550 | | - group(csg); |
---|
2551 | 2721 | Composite child = new cGroup("Branch A"); |
---|
2552 | 2722 | csg.addChild(child); |
---|
2553 | 2723 | child.addChild(csg); |
---|
2554 | 2724 | child = new cGroup("Branch B"); |
---|
2555 | 2725 | csg.addChild(child); |
---|
2556 | 2726 | child.addChild(csg); |
---|
| 2727 | + group(csg); |
---|
| 2728 | + } |
---|
2557 | 2729 | } else |
---|
2558 | 2730 | if (source == tripleItem) |
---|
2559 | 2731 | { |
---|
| 2732 | + if (!group.selection.isEmpty()) |
---|
| 2733 | + { |
---|
2560 | 2734 | Composite csg = new GroupLeaf("Trident"); |
---|
2561 | 2735 | csg.count = 4; |
---|
2562 | 2736 | group(csg); |
---|
.. | .. |
---|
2569 | 2743 | child = new cGroup(); |
---|
2570 | 2744 | csg.addChild(child); |
---|
2571 | 2745 | child.addChild(csg); |
---|
| 2746 | + } |
---|
2572 | 2747 | } else |
---|
2573 | 2748 | if (source == computeAOItem) |
---|
2574 | 2749 | { |
---|
.. | .. |
---|
2618 | 2793 | if (source == fullButton) |
---|
2619 | 2794 | { |
---|
2620 | 2795 | ToggleFullScreen(); |
---|
| 2796 | + } else |
---|
| 2797 | + if (source == collapseButton) |
---|
| 2798 | + { |
---|
| 2799 | + this.expandedLayout = radio.layout; |
---|
| 2800 | + CollapseToolbar(); |
---|
| 2801 | + } else |
---|
| 2802 | + if (source == maximize3DButton) |
---|
| 2803 | + { |
---|
| 2804 | + this.expandedLayout = radio.layout; |
---|
| 2805 | + radio.layout = twoButton; |
---|
| 2806 | + Show3DView(); |
---|
| 2807 | + CollapseToolbar(); |
---|
2621 | 2808 | } else |
---|
2622 | 2809 | if (source == previousVersionButton) |
---|
2623 | 2810 | { |
---|
.. | .. |
---|
3192 | 3379 | } else |
---|
3193 | 3380 | if (source == ungroupItem || source == ungroupButton) |
---|
3194 | 3381 | { |
---|
3195 | | - boolean hasRoot = false; |
---|
| 3382 | + boolean canUngroup = true; |
---|
3196 | 3383 | |
---|
3197 | 3384 | for (int i=0; i<group.selection.size(); i++) |
---|
3198 | 3385 | { |
---|
3199 | | - if (group.selection.get(i) == group) |
---|
| 3386 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3387 | + |
---|
| 3388 | + if (selectedItem.Size() == 0) |
---|
3200 | 3389 | { |
---|
3201 | | - hasRoot = true; |
---|
| 3390 | + // Cannot ungroup leaves |
---|
| 3391 | + canUngroup = false; |
---|
| 3392 | + break; |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem == group) |
---|
| 3396 | + { |
---|
| 3397 | + // Cannot ungroup root |
---|
| 3398 | + canUngroup = false; |
---|
3202 | 3399 | break; |
---|
3203 | 3400 | } |
---|
3204 | 3401 | } |
---|
3205 | 3402 | |
---|
3206 | | - if (!hasRoot) |
---|
| 3403 | + if (canUngroup) |
---|
3207 | 3404 | { |
---|
3208 | 3405 | for (int i=0; i<group.selection.size(); i++) |
---|
3209 | 3406 | { |
---|
3210 | | - Ungroup(group.selection.get(i)); |
---|
| 3407 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3408 | + |
---|
| 3409 | + Ungroup(selectedItem); |
---|
3211 | 3410 | } |
---|
3212 | 3411 | |
---|
3213 | 3412 | ClearSelection(false); |
---|
.. | .. |
---|
3570 | 3769 | if (CameraPane.FULLSCREEN) |
---|
3571 | 3770 | fullscreenLayout = radio.layout; |
---|
3572 | 3771 | |
---|
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(); |
---|
| 3772 | + Show3DView(); |
---|
3605 | 3773 | |
---|
3606 | 3774 | cameraView.requestFocusInWindow(); |
---|
3607 | 3775 | |
---|
.. | .. |
---|
3787 | 3955 | } else |
---|
3788 | 3956 | if (source == rootButton) |
---|
3789 | 3957 | { |
---|
| 3958 | + Replace(); |
---|
3790 | 3959 | Object3D obj; |
---|
3791 | 3960 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3792 | 3961 | { |
---|
.. | .. |
---|
3801 | 3970 | if (source == closeButton) |
---|
3802 | 3971 | { |
---|
3803 | 3972 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3973 | + Replace(); |
---|
| 3974 | + |
---|
3804 | 3975 | cRadio ab; |
---|
3805 | 3976 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3806 | 3977 | { |
---|
.. | .. |
---|
3899 | 4070 | } else |
---|
3900 | 4071 | if(source instanceof cRadio) |
---|
3901 | 4072 | { |
---|
| 4073 | + Replace(); |
---|
| 4074 | + |
---|
3902 | 4075 | group.parent = keepparent; |
---|
3903 | 4076 | group.attributes = 0; |
---|
3904 | 4077 | //group.editWindow = null; |
---|
.. | .. |
---|
3923 | 4096 | |
---|
3924 | 4097 | copy = group; |
---|
3925 | 4098 | |
---|
3926 | | - SetUndoStates(); |
---|
3927 | | - |
---|
3928 | 4099 | //Globals.theRenderer.object = group; |
---|
3929 | 4100 | if(!useclient) |
---|
3930 | 4101 | { |
---|
.. | .. |
---|
3952 | 4123 | */ |
---|
3953 | 4124 | radio.layout.doClick(); |
---|
3954 | 4125 | |
---|
| 4126 | + assert(copy instanceof Composite); |
---|
| 4127 | + |
---|
| 4128 | + if (copy.versionlist == null) |
---|
| 4129 | + { |
---|
| 4130 | + copy.versionindex = -1; |
---|
| 4131 | + |
---|
| 4132 | + // Cannot work with loops |
---|
| 4133 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4134 | + // and check if any of these nodes are reachable below the root. |
---|
| 4135 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4136 | + |
---|
| 4137 | + if (!copy.HasTags()) |
---|
| 4138 | + { |
---|
| 4139 | + copy.versionlist = new Object3D[100]; |
---|
| 4140 | + |
---|
| 4141 | + Save(true); |
---|
| 4142 | + } |
---|
| 4143 | + |
---|
| 4144 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4145 | + } |
---|
| 4146 | + |
---|
| 4147 | + SetVersionStates(); |
---|
| 4148 | + |
---|
3955 | 4149 | ClearUnpinned(); |
---|
3956 | 4150 | |
---|
3957 | 4151 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
4095 | 4289 | TouchTransform(obj); |
---|
4096 | 4290 | continue; |
---|
4097 | 4291 | } |
---|
4098 | | - if ((mask&2) != 0) // Scale |
---|
| 4292 | + if ((mask&2) != 0) // Scale/rotation |
---|
4099 | 4293 | { |
---|
4100 | 4294 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4101 | 4295 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4103 | 4297 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4104 | 4298 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4105 | 4299 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4106 | | - } |
---|
4107 | | - if ((mask&4) != 0) // Rotation |
---|
4108 | | - { |
---|
4109 | | - // ? |
---|
4110 | 4300 | } |
---|
4111 | 4301 | if ((mask&1) != 0) // Translation |
---|
4112 | 4302 | { |
---|
.. | .. |
---|
5182 | 5372 | { |
---|
5183 | 5373 | editButton.setEnabled(enabled); |
---|
5184 | 5374 | uneditButton.setEnabled(enabled); |
---|
5185 | | - unselectButton.setEnabled(enabled); |
---|
| 5375 | + //unselectButton.setEnabled(enabled); |
---|
5186 | 5376 | flashSelectionButton.setEnabled(enabled); |
---|
5187 | 5377 | |
---|
5188 | 5378 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5379 | + |
---|
| 5380 | + boolean allComposites = true; |
---|
| 5381 | + |
---|
| 5382 | + if (group.selection != null) |
---|
| 5383 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5384 | + { |
---|
| 5385 | + Object next = e.nextElement(); |
---|
| 5386 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5387 | + { |
---|
| 5388 | + allComposites = false; |
---|
| 5389 | + break; |
---|
| 5390 | + } |
---|
| 5391 | + } |
---|
| 5392 | + |
---|
| 5393 | + rootButton.setEnabled(allComposites); |
---|
5189 | 5394 | } |
---|
5190 | 5395 | |
---|
5191 | 5396 | void refreshContents(boolean cp) |
---|
5192 | 5397 | { |
---|
5193 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5398 | + if (Globals.ADVANCED) |
---|
| 5399 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5194 | 5400 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5195 | 5401 | { |
---|
5196 | 5402 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5200 | 5406 | Object3D child = (Object3D) group.selection.get(i); |
---|
5201 | 5407 | |
---|
5202 | 5408 | objEditor.AddInfo(child, this, true); |
---|
5203 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5409 | +// System.err.println("info : " + child.GetPath()); |
---|
5204 | 5410 | } |
---|
5205 | 5411 | |
---|
5206 | 5412 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6083 | 6289 | private MenuItem lookAtItem; |
---|
6084 | 6290 | private MenuItem lookFromItem; |
---|
6085 | 6291 | private MenuItem switchViewItem; |
---|
6086 | | - private MenuItem cutItem; |
---|
| 6292 | + private JMenuItem cutItem; |
---|
6087 | 6293 | private MenuItem undoItem; |
---|
6088 | 6294 | private MenuItem redoItem; |
---|
6089 | 6295 | private JMenuItem duplicateItem; |
---|
6090 | | - private MenuItem cloneItem; |
---|
| 6296 | + private JMenuItem cloneItem; |
---|
6091 | 6297 | private MenuItem cloneSupportItem; |
---|
6092 | 6298 | private MenuItem overwriteGeoItem; |
---|
6093 | 6299 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6108 | 6314 | private MenuItem cloneGeometriesItem; |
---|
6109 | 6315 | private MenuItem shareGeometriesItem; |
---|
6110 | 6316 | private MenuItem mergeGeometriesItem; |
---|
6111 | | - private MenuItem copyItem; |
---|
| 6317 | + private JMenuItem copyItem; |
---|
6112 | 6318 | private MenuItem pasteItem; |
---|
6113 | | - private MenuItem pasteIntoItem; |
---|
6114 | | - private MenuItem pasteLinkItem; |
---|
6115 | | - private MenuItem pasteCloneItem; |
---|
6116 | | - private MenuItem pasteExpandItem; |
---|
6117 | | - private MenuItem deleteItem; |
---|
| 6319 | + private JMenuItem pasteIntoItem; |
---|
| 6320 | + private JMenuItem pasteLinkItem; |
---|
| 6321 | + private JMenuItem pasteCloneItem; |
---|
| 6322 | + private JMenuItem pasteExpandItem; |
---|
| 6323 | + private JMenuItem deleteItem; |
---|
6118 | 6324 | private MenuItem clearAllItem; |
---|
6119 | 6325 | private MenuItem genUVItem; |
---|
6120 | 6326 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6169 | 6375 | private MenuItem transformGeometryItem; |
---|
6170 | 6376 | private MenuItem transformChildrenItem; |
---|
6171 | 6377 | private MenuItem hideItem; |
---|
6172 | | - private MenuItem grabItem; |
---|
| 6378 | + private JMenuItem grabItem; |
---|
6173 | 6379 | private MenuItem backItem; |
---|
6174 | 6380 | private MenuItem frontItem; |
---|
6175 | 6381 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6182 | 6388 | private MenuItem switchTransfoItem; |
---|
6183 | 6389 | private MenuItem morphItem; |
---|
6184 | 6390 | private MenuItem linkerItem; |
---|
6185 | | - private MenuItem ungroupItem; |
---|
| 6391 | + private JMenuItem ungroupItem; |
---|
6186 | 6392 | private MenuItem editItem; |
---|
6187 | 6393 | private MenuItem openWindowItem; |
---|
6188 | 6394 | private MenuItem editLeafItem; |
---|