.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
30 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
31 | 32 | row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
32 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
34 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
35 | 36 | { |
---|
36 | 37 | @Override |
---|
.. | .. |
---|
41 | 42 | }); |
---|
42 | 43 | } |
---|
43 | 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, !Grafreed.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 | + |
---|
44 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
45 | 62 | { |
---|
46 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
56 | 73 | cGridBag row5 = new cGridBag(); |
---|
57 | 74 | cGridBag row6 = new cGridBag(); |
---|
58 | 75 | |
---|
59 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
60 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
61 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
62 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
311 | 328 | } |
---|
312 | 329 | } |
---|
313 | 330 | |
---|
314 | | - public void ChangeSkybox(String name) |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
315 | 332 | { |
---|
316 | | - //cameraView.envyoff = false; |
---|
317 | | - group.skyboxname = name; |
---|
318 | | - group.skyboxext = "jpg"; |
---|
319 | | - 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 | + } |
---|
| 347 | + |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
320 | 358 | } |
---|
321 | 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 | + |
---|
322 | 381 | //ObjEditor objEditor; |
---|
323 | 382 | public void closeUI2() |
---|
324 | 383 | { |
---|
.. | .. |
---|
356 | 415 | this.copy = this.group = group; |
---|
357 | 416 | //selectees = this.group.selectees; |
---|
358 | 417 | |
---|
359 | | - if (copy.versions == null) |
---|
| 418 | + if (copy.versionlist == null) |
---|
360 | 419 | { |
---|
361 | | - copy.versions = new Object3D[100]; |
---|
| 420 | + copy.versionlist = new Object3D[100]; |
---|
362 | 421 | copy.versionindex = -1; |
---|
| 422 | + |
---|
| 423 | + Save(true); |
---|
363 | 424 | } |
---|
364 | 425 | |
---|
365 | 426 | if(ui) |
---|
.. | .. |
---|
383 | 444 | |
---|
384 | 445 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
385 | 446 | |
---|
386 | | - if (copy.versions == null) |
---|
| 447 | + if (copy.versionlist == null) |
---|
387 | 448 | { |
---|
388 | | - copy.versions = new Object3D[100]; |
---|
| 449 | + copy.versionlist = new Object3D[100]; |
---|
389 | 450 | copy.versionindex = -1; |
---|
390 | 451 | |
---|
391 | 452 | Save(true); |
---|
.. | .. |
---|
479 | 540 | // menu.add("-"); |
---|
480 | 541 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
481 | 542 | duplicateItem.addActionListener(this); |
---|
482 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 543 | + |
---|
| 544 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
483 | 545 | cloneItem.addActionListener(this); |
---|
484 | | - if (Globals.ADVANCED) |
---|
| 546 | + //if (Globals.ADVANCED) |
---|
485 | 547 | { |
---|
486 | 548 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
487 | 549 | cloneSupportItem.addActionListener(this); |
---|
488 | 550 | } |
---|
| 551 | + oe.jTree.popup.addSeparator(); |
---|
489 | 552 | menu.add("-"); |
---|
490 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 553 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
491 | 554 | cutItem.addActionListener(this); |
---|
492 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 555 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
493 | 556 | copyItem.addActionListener(this); |
---|
494 | 557 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
495 | 558 | pasteItem.addActionListener(this); |
---|
496 | 559 | |
---|
497 | | - menu.add("-"); |
---|
498 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 560 | + oe.jTree.popup.addSeparator(); |
---|
| 561 | + //menu.add("-"); |
---|
| 562 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
499 | 563 | pasteIntoItem.addActionListener(this); |
---|
500 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 564 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
501 | 565 | pasteLinkItem.addActionListener(this); |
---|
502 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 566 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
503 | 567 | pasteCloneItem.addActionListener(this); |
---|
504 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 568 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
505 | 569 | // pasteExpandItem.addActionListener(this); |
---|
506 | | - menu.add("-"); |
---|
507 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
508 | | - deleteItem.addActionListener(this); |
---|
| 570 | + //menu.add("-"); |
---|
| 571 | + oe.jTree.popup.addSeparator(); |
---|
509 | 572 | |
---|
510 | 573 | if (Globals.ADVANCED) |
---|
511 | 574 | { |
---|
.. | .. |
---|
591 | 654 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
592 | 655 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
593 | 656 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
594 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
595 | 657 | oe.cameraMenu.add("-"); |
---|
596 | 658 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
597 | 659 | openWindowItem.addActionListener(this); |
---|
598 | | - editLeafItem.addActionListener(this); |
---|
599 | 660 | lookAtItem.addActionListener(this); |
---|
600 | 661 | //lookFromItem.addActinoListener(this); |
---|
601 | 662 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
642 | 703 | setMasterItem.addActionListener(this); |
---|
643 | 704 | } |
---|
644 | 705 | |
---|
645 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
646 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
647 | | -// grabItem.addActionListener(this); |
---|
| 706 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 707 | + |
---|
648 | 708 | backItem = menu.add(new MenuItem("Back")); |
---|
649 | 709 | backItem.addActionListener(this); |
---|
650 | 710 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
652 | 712 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
653 | 713 | // compositeItem.addActionListener(this); |
---|
654 | 714 | |
---|
| 715 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 716 | + grabItem.addActionListener(this); |
---|
| 717 | + |
---|
655 | 718 | if (Globals.ADVANCED) |
---|
656 | 719 | { |
---|
657 | 720 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
658 | 721 | hideItem.addActionListener(this); |
---|
659 | 722 | } |
---|
660 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 723 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
661 | 724 | ungroupItem.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.jTree.popup.addSeparator(); |
---|
| 727 | + |
---|
| 728 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 729 | + deleteItem.addActionListener(this); |
---|
662 | 730 | |
---|
663 | 731 | // menu.add("-"); |
---|
664 | 732 | // |
---|
.. | .. |
---|
843 | 911 | shareGeometriesItem.addActionListener(this); |
---|
844 | 912 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
845 | 913 | mergeGeometriesItem.addActionListener(this); |
---|
| 914 | + menu.add("-"); |
---|
| 915 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 916 | + editLeafItem.addActionListener(this); |
---|
846 | 917 | if (Globals.ADVANCED) |
---|
847 | 918 | { |
---|
848 | 919 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
859 | 930 | buildToolsMenu(menu); |
---|
860 | 931 | } |
---|
861 | 932 | |
---|
| 933 | + JTabbedPane resourcecontainer; |
---|
| 934 | + cGridBag currenttab; |
---|
| 935 | + //boolean added; // patch for jar |
---|
| 936 | + |
---|
| 937 | + int tabcount = 0; |
---|
| 938 | + int colcount = 0; |
---|
| 939 | + int rowcount = 0; |
---|
| 940 | + int texturecount = 0; |
---|
| 941 | + |
---|
| 942 | + int columns = 5; |
---|
| 943 | + int rows = 7; |
---|
| 944 | + |
---|
| 945 | + public void ResourceCallBack(String[] path) |
---|
| 946 | + { |
---|
| 947 | +// for (int i = 0; i < path.length; i++) |
---|
| 948 | +// System.out.print(path[i] + "/"); |
---|
| 949 | +// System.out.println(); |
---|
| 950 | + |
---|
| 951 | + if (//rowcount == 0 || |
---|
| 952 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 953 | + { |
---|
| 954 | + currenttab = new cGridBag(); |
---|
| 955 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 956 | + currenttab.setName(tabname); |
---|
| 957 | + //added = false; |
---|
| 958 | + resourcecontainer.add(currenttab); |
---|
| 959 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 960 | + rowcount = 1; |
---|
| 961 | + colcount = 0; |
---|
| 962 | + texturecount = 0; |
---|
| 963 | + } |
---|
| 964 | + |
---|
| 965 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 966 | + { |
---|
| 967 | + //if (!added) |
---|
| 968 | + { |
---|
| 969 | + //added = true; |
---|
| 970 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 971 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 972 | + } |
---|
| 973 | + |
---|
| 974 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 975 | + |
---|
| 976 | + if (++colcount >= columns) |
---|
| 977 | + { |
---|
| 978 | + colcount = 0; |
---|
| 979 | + currenttab.Return(); |
---|
| 980 | + |
---|
| 981 | + if (rowcount++ >= rows) |
---|
| 982 | + { |
---|
| 983 | + rowcount = 0; |
---|
| 984 | + } |
---|
| 985 | + } |
---|
| 986 | + } |
---|
| 987 | + else |
---|
| 988 | + { |
---|
| 989 | +// if (!path[path.length-1].equals("icons")) |
---|
| 990 | +// resourcecontainer.Return(); |
---|
| 991 | + } |
---|
| 992 | + } |
---|
| 993 | + |
---|
| 994 | + void CreateTexturePanel(cGridBag container) |
---|
| 995 | + { |
---|
| 996 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 997 | + container.add(resourcecontainer); |
---|
| 998 | + |
---|
| 999 | + Grafreed.ParseResources("textures", this); |
---|
| 1000 | + } |
---|
862 | 1001 | |
---|
863 | 1002 | void SetupUI2(ObjEditor oe) |
---|
864 | 1003 | { |
---|
.. | .. |
---|
877 | 1016 | //new Exception().printStackTrace(); |
---|
878 | 1017 | |
---|
879 | 1018 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
880 | | - oe.aConstraints.weightx = 1; |
---|
881 | | - oe.aConstraints.weighty = 0; |
---|
882 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
883 | | - oe.aConstraints.gridwidth = 100; |
---|
884 | | - oe.aConstraints.gridheight = 1; |
---|
885 | 1019 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
886 | 1020 | |
---|
887 | 1021 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
914 | 1048 | |
---|
915 | 1049 | if (Globals.ADVANCED) |
---|
916 | 1050 | { |
---|
917 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
918 | | - maxButton.setToolTipText("Maximize window"); |
---|
919 | | - maxButton.addActionListener(this); |
---|
| 1051 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1052 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1053 | +// maxButton.addActionListener(this); |
---|
920 | 1054 | } |
---|
| 1055 | + |
---|
| 1056 | + cButton gcButton; |
---|
| 1057 | + |
---|
| 1058 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1059 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1060 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1061 | +// { |
---|
| 1062 | +// public void actionPerformed(ActionEvent e) |
---|
| 1063 | +// { |
---|
| 1064 | +// System.gc(); |
---|
| 1065 | +// } |
---|
| 1066 | +// }); |
---|
| 1067 | + |
---|
| 1068 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1069 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1070 | + collapseButton.addActionListener(this); |
---|
| 1071 | + |
---|
| 1072 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1073 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1074 | + maximize3DButton.addActionListener(this); |
---|
| 1075 | + |
---|
| 1076 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1078 | + twoButton.addActionListener(this); |
---|
| 1079 | + this.fullscreenLayout = twoButton; |
---|
| 1080 | + |
---|
| 1081 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1082 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1083 | + threeButton.addActionListener(this); |
---|
| 1084 | + if (Globals.ADVANCED) |
---|
| 1085 | + { |
---|
| 1086 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1088 | + sixButton.addActionListener(this); |
---|
| 1089 | + } |
---|
| 1090 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1092 | +// sevenButton.addActionListener(this); |
---|
| 1093 | + // |
---|
921 | 1094 | |
---|
922 | 1095 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
923 | 1096 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
931 | 1104 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 1105 | restoreCameraButton.addActionListener(this); |
---|
933 | 1106 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("Duplicate current version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 1107 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1108 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1109 | + saveVersionButton.addActionListener(this); |
---|
937 | 1110 | |
---|
938 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
939 | | - undoButton.setToolTipText("Previous version"); |
---|
940 | | - undoButton.addActionListener(this); |
---|
941 | | - undoButton.setEnabled(false); |
---|
| 1111 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1112 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1113 | + deleteVersionButton.addActionListener(this); |
---|
| 1114 | + |
---|
| 1115 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1116 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1117 | + previousVersionButton.addActionListener(this); |
---|
| 1118 | + previousVersionButton.setEnabled(false); |
---|
942 | 1119 | |
---|
943 | 1120 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | 1121 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | | - restoreButton.setToolTipText("Restore current version (undo latest change)"); |
---|
| 1122 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 1123 | restoreButton.addActionListener(this); |
---|
947 | | - restoreButton.setEnabled(false); |
---|
| 1124 | + //restoreButton.setEnabled(false); |
---|
948 | 1125 | |
---|
949 | 1126 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | | - replaceButton.setToolTipText("Replace current version (save latest change)"); |
---|
| 1127 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 1128 | replaceButton.addActionListener(this); |
---|
952 | | - replaceButton.setEnabled(false); |
---|
| 1129 | + //replaceButton.setEnabled(false); |
---|
953 | 1130 | |
---|
954 | 1131 | copyOptionsPanel.add(updown); |
---|
955 | 1132 | |
---|
956 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
957 | | - redoButton.setToolTipText("Next version"); |
---|
958 | | - redoButton.addActionListener(this); |
---|
959 | | - redoButton.setEnabled(false); |
---|
| 1133 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1135 | + nextVersionButton.addActionListener(this); |
---|
| 1136 | + nextVersionButton.setEnabled(false); |
---|
| 1137 | + |
---|
| 1138 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1139 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1140 | + oneStepButton.addActionListener(this); |
---|
960 | 1141 | |
---|
961 | 1142 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 1143 | liveCB.setToolTipText("Enable animation"); |
---|
963 | 1144 | liveCB.addItemListener(this); |
---|
964 | 1145 | |
---|
965 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
966 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
967 | | - oneStepButton.addActionListener(this); |
---|
968 | | - |
---|
969 | 1146 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
970 | 1147 | fastCB.setToolTipText("Fast mode"); |
---|
971 | 1148 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
992 | 1169 | |
---|
993 | 1170 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
994 | 1171 | |
---|
995 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
996 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
997 | | - twoButton.addActionListener(this); |
---|
998 | | - this.fullscreenLayout = twoButton; |
---|
999 | | - |
---|
1000 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1001 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1002 | | - threeButton.addActionListener(this); |
---|
1003 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1004 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1005 | | - sixButton.addActionListener(this); |
---|
1006 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1007 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1008 | | -// sevenButton.addActionListener(this); |
---|
1009 | | - // |
---|
1010 | 1172 | |
---|
1011 | 1173 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1012 | 1174 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1022 | 1184 | |
---|
1023 | 1185 | // INSERT |
---|
1024 | 1186 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1187 | + gridButton.setToolTipText("Create ground"); |
---|
1026 | 1188 | gridButton.addActionListener(this); |
---|
1027 | 1189 | |
---|
1028 | 1190 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1029 | 1191 | boxButton.setToolTipText("Create box"); |
---|
1030 | 1192 | boxButton.addActionListener(this); |
---|
| 1193 | + |
---|
| 1194 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1195 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1196 | + superButton.addActionListener(this); |
---|
1031 | 1197 | |
---|
1032 | 1198 | row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1033 | 1199 | sphereButton.setToolTipText("Create sphere"); |
---|
.. | .. |
---|
1040 | 1206 | row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1041 | 1207 | torusButton.setToolTipText("Create torus"); |
---|
1042 | 1208 | torusButton.addActionListener(this); |
---|
1043 | | - |
---|
1044 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1045 | | - superButton.setToolTipText("Create superellipsoid"); |
---|
1046 | | - superButton.addActionListener(this); |
---|
1047 | 1209 | |
---|
1048 | 1210 | if (Globals.ADVANCED) |
---|
1049 | 1211 | { |
---|
.. | .. |
---|
1090 | 1252 | |
---|
1091 | 1253 | oe.toolboxPanel.add(row2); |
---|
1092 | 1254 | |
---|
1093 | | - // ENVYMAPS |
---|
1094 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1095 | | - skyboxpane.preferredHeight = 100; |
---|
| 1255 | + cGridBag textures = new cGridBag(); |
---|
1096 | 1256 | |
---|
1097 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1257 | + CreateTexturePanel(textures); |
---|
1098 | 1258 | |
---|
1099 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1100 | | - skyboxpane.add(skyboxpanel); |
---|
| 1259 | + oe.toolboxPanel.add(textures); |
---|
1101 | 1260 | |
---|
1102 | | - AddSkyboxTab0(skyboxpanel); |
---|
1103 | | - AddSkyboxTab1(skyboxpanel); |
---|
1104 | | - AddSkyboxTab2(skyboxpanel); |
---|
1105 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1261 | + textures.preferredHeight = 100; |
---|
| 1262 | + |
---|
| 1263 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1106 | 1264 | |
---|
1107 | 1265 | // EDIT panel |
---|
1108 | 1266 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1110 | 1268 | editButton.addActionListener(this); |
---|
1111 | 1269 | |
---|
1112 | 1270 | editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1113 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1271 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1114 | 1272 | uneditButton.addActionListener(this); |
---|
1115 | 1273 | |
---|
1116 | 1274 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1275 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1118 | 1276 | allParamsButton.addActionListener(this); |
---|
1119 | 1277 | |
---|
1120 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1278 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1279 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1122 | 1280 | clearPanelButton.addActionListener(this); |
---|
1123 | 1281 | |
---|
1124 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - unselectButton.setToolTipText("Unselect"); |
---|
1126 | | - unselectButton.addActionListener(this); |
---|
| 1282 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1283 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1284 | + //unselectButton.addActionListener(this); |
---|
1127 | 1285 | |
---|
1128 | 1286 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | 1287 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
1318 | 1476 | |
---|
1319 | 1477 | void EditObject(Object3D obj) |
---|
1320 | 1478 | { |
---|
| 1479 | + assert(obj instanceof Composite); |
---|
| 1480 | + |
---|
| 1481 | +// if (obj.versionlist == null) |
---|
| 1482 | +// { |
---|
| 1483 | +// obj.versionlist = new Object3D[100]; |
---|
| 1484 | +// obj.versionindex = -1; |
---|
| 1485 | +// } |
---|
| 1486 | + |
---|
1321 | 1487 | cRadio radioButton = new cRadio(obj.name); |
---|
1322 | 1488 | |
---|
1323 | 1489 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1342 | 1508 | |
---|
1343 | 1509 | oe.SetupViews(); |
---|
1344 | 1510 | |
---|
| 1511 | + if (Globals.DEBUG) |
---|
1345 | 1512 | System.out.println("SetupViews"); |
---|
1346 | 1513 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1347 | 1514 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1708 | 1875 | TreePath path; |
---|
1709 | 1876 | |
---|
1710 | 1877 | public TransferableTreePath(TreePath tp) { |
---|
1711 | | - path = tp; |
---|
| 1878 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1879 | + for (int i=0; i<objs.length; i++) |
---|
| 1880 | + { |
---|
| 1881 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1882 | + } |
---|
| 1883 | + path = new TreePath(objs); |
---|
1712 | 1884 | } |
---|
1713 | 1885 | |
---|
1714 | 1886 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1998 | 2170 | shadow.material = new cMaterial(obj.material); |
---|
1999 | 2171 | shadow.material.diffuse = 0.0001f; |
---|
2000 | 2172 | shadow.material.specular = 0.0001f; |
---|
2001 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2173 | + shadow.material.opacity = 0.75f; |
---|
| 2174 | + |
---|
| 2175 | + AllocProjectedVertices(shadow); |
---|
| 2176 | + |
---|
| 2177 | + shadow.projectedVertices[1].x = 300; |
---|
2002 | 2178 | |
---|
2003 | 2179 | makeSomething(shadow); |
---|
2004 | 2180 | } |
---|
.. | .. |
---|
2519 | 2695 | } else |
---|
2520 | 2696 | if (source == loopItem || source == loopButton) |
---|
2521 | 2697 | { |
---|
| 2698 | + if (!group.selection.isEmpty()) |
---|
| 2699 | + { |
---|
2522 | 2700 | Composite csg = new GroupLeaf(); |
---|
2523 | 2701 | csg.count = 5; |
---|
2524 | | - group(csg); |
---|
2525 | 2702 | Composite child = new cGroup("Branch"); |
---|
2526 | 2703 | csg.addChild(child); |
---|
2527 | 2704 | child.addChild(csg); |
---|
| 2705 | + group(csg); |
---|
| 2706 | + } |
---|
2528 | 2707 | } else |
---|
2529 | 2708 | if (source == doubleItem) |
---|
2530 | 2709 | { |
---|
| 2710 | + if (!group.selection.isEmpty()) |
---|
| 2711 | + { |
---|
2531 | 2712 | Composite csg = new GroupLeaf("Fork"); |
---|
2532 | 2713 | csg.count = 5; |
---|
2533 | | - group(csg); |
---|
2534 | 2714 | Composite child = new cGroup("Branch A"); |
---|
2535 | 2715 | csg.addChild(child); |
---|
2536 | 2716 | child.addChild(csg); |
---|
2537 | 2717 | child = new cGroup("Branch B"); |
---|
2538 | 2718 | csg.addChild(child); |
---|
2539 | 2719 | child.addChild(csg); |
---|
| 2720 | + group(csg); |
---|
| 2721 | + } |
---|
2540 | 2722 | } else |
---|
2541 | 2723 | if (source == tripleItem) |
---|
2542 | 2724 | { |
---|
| 2725 | + if (!group.selection.isEmpty()) |
---|
| 2726 | + { |
---|
2543 | 2727 | Composite csg = new GroupLeaf("Trident"); |
---|
2544 | 2728 | csg.count = 4; |
---|
2545 | 2729 | group(csg); |
---|
.. | .. |
---|
2552 | 2736 | child = new cGroup(); |
---|
2553 | 2737 | csg.addChild(child); |
---|
2554 | 2738 | child.addChild(csg); |
---|
| 2739 | + } |
---|
2555 | 2740 | } else |
---|
2556 | 2741 | if (source == computeAOItem) |
---|
2557 | 2742 | { |
---|
.. | .. |
---|
2571 | 2756 | if (source == invariantsItem) |
---|
2572 | 2757 | { |
---|
2573 | 2758 | System.out.println("Invariants:"); |
---|
2574 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2759 | + Grafreed.grafreed.universe.invariants(); |
---|
2575 | 2760 | } else |
---|
2576 | 2761 | if (source == memoryItem) |
---|
2577 | 2762 | { |
---|
.. | .. |
---|
2602 | 2787 | { |
---|
2603 | 2788 | ToggleFullScreen(); |
---|
2604 | 2789 | } else |
---|
2605 | | - if (source == undoButton) |
---|
| 2790 | + if (source == collapseButton) |
---|
| 2791 | + { |
---|
| 2792 | + this.expandedLayout = radio.layout; |
---|
| 2793 | + CollapseToolbar(); |
---|
| 2794 | + } else |
---|
| 2795 | + if (source == maximize3DButton) |
---|
| 2796 | + { |
---|
| 2797 | + this.expandedLayout = radio.layout; |
---|
| 2798 | + radio.layout = twoButton; |
---|
| 2799 | + Show3DView(); |
---|
| 2800 | + CollapseToolbar(); |
---|
| 2801 | + } else |
---|
| 2802 | + if (source == previousVersionButton) |
---|
2606 | 2803 | { |
---|
2607 | 2804 | // Go to previous version |
---|
2608 | 2805 | //if (!Undo()) |
---|
2609 | 2806 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2610 | | - Undo(); |
---|
| 2807 | + PreviousVersion(); |
---|
2611 | 2808 | } else |
---|
2612 | 2809 | if (source == restoreButton) |
---|
2613 | 2810 | { |
---|
2614 | 2811 | // Restore current version |
---|
2615 | 2812 | Restore(); |
---|
| 2813 | + //restoreButton.setEnabled(false); |
---|
2616 | 2814 | } else |
---|
2617 | 2815 | if (source == replaceButton) |
---|
2618 | 2816 | { |
---|
2619 | 2817 | // Overwrite current version |
---|
2620 | 2818 | Replace(); |
---|
| 2819 | + //replaceButton.setEnabled(false); |
---|
2621 | 2820 | } else |
---|
2622 | | - if (source == redoButton) |
---|
| 2821 | + if (source == nextVersionButton) |
---|
2623 | 2822 | { |
---|
2624 | 2823 | // Go to next version |
---|
2625 | | - Redo(); |
---|
| 2824 | + NextVersion(); |
---|
2626 | 2825 | } else |
---|
2627 | | - if (source == saveButton) |
---|
| 2826 | + if (source == saveVersionButton) |
---|
2628 | 2827 | { |
---|
2629 | 2828 | // Save a new version |
---|
2630 | 2829 | if (!Save(true)) |
---|
2631 | 2830 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2831 | + } else |
---|
| 2832 | + if (source == deleteVersionButton) |
---|
| 2833 | + { |
---|
| 2834 | + // Delete a new version |
---|
| 2835 | + DeleteVersion(); |
---|
2632 | 2836 | } else |
---|
2633 | 2837 | if (source == oneStepButton) |
---|
2634 | 2838 | { |
---|
.. | .. |
---|
2683 | 2887 | } else |
---|
2684 | 2888 | if (source == undoItem) |
---|
2685 | 2889 | { |
---|
2686 | | - Undo(); |
---|
| 2890 | + PreviousVersion(); |
---|
2687 | 2891 | } else |
---|
2688 | 2892 | if (source == redoItem) |
---|
2689 | 2893 | { |
---|
2690 | | - Redo(); |
---|
| 2894 | + NextVersion(); |
---|
2691 | 2895 | } else |
---|
2692 | 2896 | if (source == duplicateItem) |
---|
2693 | 2897 | { |
---|
.. | .. |
---|
3168 | 3372 | } else |
---|
3169 | 3373 | if (source == ungroupItem || source == ungroupButton) |
---|
3170 | 3374 | { |
---|
3171 | | - boolean hasRoot = false; |
---|
| 3375 | + boolean canUngroup = true; |
---|
3172 | 3376 | |
---|
3173 | 3377 | for (int i=0; i<group.selection.size(); i++) |
---|
3174 | 3378 | { |
---|
3175 | | - if (group.selection.get(i) == group) |
---|
| 3379 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3380 | + |
---|
| 3381 | + if (selectedItem.Size() == 0) |
---|
3176 | 3382 | { |
---|
3177 | | - hasRoot = true; |
---|
| 3383 | + // Cannot ungroup leaves |
---|
| 3384 | + canUngroup = false; |
---|
| 3385 | + break; |
---|
| 3386 | + } |
---|
| 3387 | + |
---|
| 3388 | + if (selectedItem == group) |
---|
| 3389 | + { |
---|
| 3390 | + // Cannot ungroup root |
---|
| 3391 | + canUngroup = false; |
---|
3178 | 3392 | break; |
---|
3179 | 3393 | } |
---|
3180 | 3394 | } |
---|
3181 | 3395 | |
---|
3182 | | - if (!hasRoot) |
---|
| 3396 | + if (canUngroup) |
---|
3183 | 3397 | { |
---|
3184 | 3398 | for (int i=0; i<group.selection.size(); i++) |
---|
3185 | 3399 | { |
---|
3186 | | - Ungroup(group.selection.get(i)); |
---|
| 3400 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3401 | + |
---|
| 3402 | + Ungroup(selectedItem); |
---|
3187 | 3403 | } |
---|
3188 | 3404 | |
---|
3189 | 3405 | ClearSelection(false); |
---|
.. | .. |
---|
3546 | 3762 | if (CameraPane.FULLSCREEN) |
---|
3547 | 3763 | fullscreenLayout = radio.layout; |
---|
3548 | 3764 | |
---|
3549 | | - // bug |
---|
3550 | | - //gridPanel.setDividerLocation(1.0); |
---|
3551 | | - //bigPanel.setDividerLocation(0.0); |
---|
3552 | | -// bigThree.remove(scenePanel); |
---|
3553 | | -// bigThree.remove(centralPanel); |
---|
3554 | | -// bigThree.remove(XYZPanel); |
---|
3555 | | -// aWindowConstraints.gridx = 0; |
---|
3556 | | -// aWindowConstraints.gridy = 0; |
---|
3557 | | -// aWindowConstraints.gridwidth = 1; |
---|
3558 | | -// // aConstraints.gridheight = 3; |
---|
3559 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3560 | | -// aWindowConstraints.weightx = 0; |
---|
3561 | | -// aWindowConstraints.weighty = 1; |
---|
3562 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3563 | | -// aWindowConstraints.weightx = 1; |
---|
3564 | | -// aWindowConstraints.gridwidth = 3; |
---|
3565 | | -// // aConstraints.gridheight = 3; |
---|
3566 | | -// aWindowConstraints.gridx = 1; |
---|
3567 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3568 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3569 | | -// aWindowConstraints.weightx = 0; |
---|
3570 | | -// aWindowConstraints.gridx = 4; |
---|
3571 | | -// aWindowConstraints.gridwidth = 1; |
---|
3572 | | -// // aConstraints.gridheight = 3; |
---|
3573 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3574 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3575 | | -// scenePanel.setVisible(false); |
---|
3576 | | -// centralPanel.setVisible(true); |
---|
3577 | | -// XYZPanel.setVisible(false); |
---|
3578 | | - bigThree.ClearUI(); |
---|
3579 | | - bigThree.add(centralPanel); |
---|
3580 | | - bigThree.FlushUI(); |
---|
| 3765 | + Show3DView(); |
---|
3581 | 3766 | |
---|
3582 | 3767 | cameraView.requestFocusInWindow(); |
---|
3583 | 3768 | |
---|
.. | .. |
---|
3763 | 3948 | } else |
---|
3764 | 3949 | if (source == rootButton) |
---|
3765 | 3950 | { |
---|
| 3951 | + Replace(); |
---|
3766 | 3952 | Object3D obj; |
---|
3767 | 3953 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3768 | 3954 | { |
---|
.. | .. |
---|
3820 | 4006 | { |
---|
3821 | 4007 | Object3D child = (Object3D)e.nextElement(); |
---|
3822 | 4008 | if(child.editWindow != null) |
---|
3823 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3824 | 4009 | child.pinned = false; |
---|
3825 | 4010 | child.CloseUI(); |
---|
3826 | 4011 | listUI.remove(child); |
---|
| 4012 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3827 | 4013 | |
---|
3828 | 4014 | //child.editWindow = null; // ??????????? |
---|
3829 | 4015 | } |
---|
.. | .. |
---|
3842 | 4028 | obj.CloseUI(); |
---|
3843 | 4029 | } |
---|
3844 | 4030 | listUI.clear(); |
---|
| 4031 | + SetPinStates(group.selection.size() > 0); |
---|
3845 | 4032 | refreshContents(true); |
---|
3846 | 4033 | } else |
---|
3847 | 4034 | if (source == allParamsButton) |
---|
.. | .. |
---|
3898 | 4085 | |
---|
3899 | 4086 | copy = group; |
---|
3900 | 4087 | |
---|
3901 | | - SetUndoStates(); |
---|
3902 | | - |
---|
3903 | 4088 | //Globals.theRenderer.object = group; |
---|
3904 | 4089 | if(!useclient) |
---|
3905 | 4090 | { |
---|
.. | .. |
---|
3927 | 4112 | */ |
---|
3928 | 4113 | radio.layout.doClick(); |
---|
3929 | 4114 | |
---|
| 4115 | + assert(copy instanceof Composite); |
---|
| 4116 | + |
---|
| 4117 | + if (copy.versionlist == null) |
---|
| 4118 | + { |
---|
| 4119 | + copy.versionlist = new Object3D[100]; |
---|
| 4120 | + copy.versionindex = -1; |
---|
| 4121 | + |
---|
| 4122 | + // Cannot work with loops |
---|
| 4123 | + // To fix this issue, first mark all nodes above the root, |
---|
| 4124 | + // and check if any of these nodes are reachable below the root. |
---|
| 4125 | + //Save(true); |
---|
| 4126 | + } |
---|
| 4127 | + |
---|
| 4128 | + SetVersionStates(); |
---|
| 4129 | + |
---|
3930 | 4130 | ClearUnpinned(); |
---|
| 4131 | + |
---|
3931 | 4132 | //Grafreed.Assert(group != null); |
---|
3932 | 4133 | //Grafreed.Assert(group.selection != null); |
---|
3933 | 4134 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
5083 | 5284 | |
---|
5084 | 5285 | freezemodel = false; |
---|
5085 | 5286 | } |
---|
5086 | | - |
---|
5087 | | - boolean flashIt = true; |
---|
5088 | | - |
---|
| 5287 | + |
---|
5089 | 5288 | public void valueChanged(TreeSelectionEvent e) |
---|
5090 | 5289 | //public boolean handleEvent(Event event) |
---|
5091 | 5290 | { |
---|
.. | .. |
---|
5158 | 5357 | { |
---|
5159 | 5358 | editButton.setEnabled(enabled); |
---|
5160 | 5359 | uneditButton.setEnabled(enabled); |
---|
5161 | | - unselectButton.setEnabled(enabled); |
---|
| 5360 | + //unselectButton.setEnabled(enabled); |
---|
5162 | 5361 | flashSelectionButton.setEnabled(enabled); |
---|
| 5362 | + |
---|
| 5363 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5364 | + |
---|
| 5365 | + boolean allComposites = true; |
---|
| 5366 | + |
---|
| 5367 | + if (group.selection != null) |
---|
| 5368 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5369 | + { |
---|
| 5370 | + Object next = e.nextElement(); |
---|
| 5371 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5372 | + { |
---|
| 5373 | + allComposites = false; |
---|
| 5374 | + break; |
---|
| 5375 | + } |
---|
| 5376 | + } |
---|
| 5377 | + |
---|
| 5378 | + rootButton.setEnabled(allComposites); |
---|
5163 | 5379 | } |
---|
5164 | 5380 | |
---|
5165 | 5381 | void refreshContents(boolean cp) |
---|
5166 | 5382 | { |
---|
5167 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5383 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5168 | 5384 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5169 | 5385 | { |
---|
5170 | 5386 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5174 | 5390 | Object3D child = (Object3D) group.selection.get(i); |
---|
5175 | 5391 | |
---|
5176 | 5392 | objEditor.AddInfo(child, this, true); |
---|
5177 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5393 | +// System.err.println("info : " + child.GetPath()); |
---|
5178 | 5394 | } |
---|
5179 | 5395 | |
---|
5180 | 5396 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6000 | 6216 | |
---|
6001 | 6217 | cButton restoreCameraButton; |
---|
6002 | 6218 | |
---|
6003 | | - cButton saveButton; |
---|
6004 | 6219 | cButton oneStepButton; |
---|
6005 | 6220 | |
---|
6006 | 6221 | cButton groupButton; |
---|
.. | .. |
---|
6058 | 6273 | private MenuItem lookAtItem; |
---|
6059 | 6274 | private MenuItem lookFromItem; |
---|
6060 | 6275 | private MenuItem switchViewItem; |
---|
6061 | | - private MenuItem cutItem; |
---|
| 6276 | + private JMenuItem cutItem; |
---|
6062 | 6277 | private MenuItem undoItem; |
---|
6063 | 6278 | private MenuItem redoItem; |
---|
6064 | 6279 | private JMenuItem duplicateItem; |
---|
6065 | | - private MenuItem cloneItem; |
---|
| 6280 | + private JMenuItem cloneItem; |
---|
6066 | 6281 | private MenuItem cloneSupportItem; |
---|
6067 | 6282 | private MenuItem overwriteGeoItem; |
---|
6068 | 6283 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6083 | 6298 | private MenuItem cloneGeometriesItem; |
---|
6084 | 6299 | private MenuItem shareGeometriesItem; |
---|
6085 | 6300 | private MenuItem mergeGeometriesItem; |
---|
6086 | | - private MenuItem copyItem; |
---|
| 6301 | + private JMenuItem copyItem; |
---|
6087 | 6302 | private MenuItem pasteItem; |
---|
6088 | | - private MenuItem pasteIntoItem; |
---|
6089 | | - private MenuItem pasteLinkItem; |
---|
6090 | | - private MenuItem pasteCloneItem; |
---|
6091 | | - private MenuItem pasteExpandItem; |
---|
6092 | | - private MenuItem deleteItem; |
---|
| 6303 | + private JMenuItem pasteIntoItem; |
---|
| 6304 | + private JMenuItem pasteLinkItem; |
---|
| 6305 | + private JMenuItem pasteCloneItem; |
---|
| 6306 | + private JMenuItem pasteExpandItem; |
---|
| 6307 | + private JMenuItem deleteItem; |
---|
6093 | 6308 | private MenuItem clearAllItem; |
---|
6094 | 6309 | private MenuItem genUVItem; |
---|
6095 | 6310 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6144 | 6359 | private MenuItem transformGeometryItem; |
---|
6145 | 6360 | private MenuItem transformChildrenItem; |
---|
6146 | 6361 | private MenuItem hideItem; |
---|
6147 | | - private MenuItem grabItem; |
---|
| 6362 | + private JMenuItem grabItem; |
---|
6148 | 6363 | private MenuItem backItem; |
---|
6149 | 6364 | private MenuItem frontItem; |
---|
6150 | 6365 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6157 | 6372 | private MenuItem switchTransfoItem; |
---|
6158 | 6373 | private MenuItem morphItem; |
---|
6159 | 6374 | private MenuItem linkerItem; |
---|
6160 | | - private MenuItem ungroupItem; |
---|
| 6375 | + private JMenuItem ungroupItem; |
---|
6161 | 6376 | private MenuItem editItem; |
---|
6162 | 6377 | private MenuItem openWindowItem; |
---|
6163 | 6378 | private MenuItem editLeafItem; |
---|