.. | .. |
---|
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 | { |
---|
.. | .. |
---|
360 | 419 | { |
---|
361 | 420 | copy.versionlist = new Object3D[100]; |
---|
362 | 421 | copy.versionindex = -1; |
---|
| 422 | + |
---|
| 423 | + Save(true); |
---|
363 | 424 | } |
---|
364 | 425 | |
---|
365 | 426 | if(ui) |
---|
.. | .. |
---|
591 | 652 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
592 | 653 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
593 | 654 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
594 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
595 | 655 | oe.cameraMenu.add("-"); |
---|
596 | 656 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
597 | 657 | openWindowItem.addActionListener(this); |
---|
598 | | - editLeafItem.addActionListener(this); |
---|
599 | 658 | lookAtItem.addActionListener(this); |
---|
600 | 659 | //lookFromItem.addActinoListener(this); |
---|
601 | 660 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
843 | 902 | shareGeometriesItem.addActionListener(this); |
---|
844 | 903 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
845 | 904 | mergeGeometriesItem.addActionListener(this); |
---|
| 905 | + menu.add("-"); |
---|
| 906 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 907 | + editLeafItem.addActionListener(this); |
---|
846 | 908 | if (Globals.ADVANCED) |
---|
847 | 909 | { |
---|
848 | 910 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
859 | 921 | buildToolsMenu(menu); |
---|
860 | 922 | } |
---|
861 | 923 | |
---|
| 924 | + JTabbedPane resourcecontainer; |
---|
| 925 | + cGridBag currenttab; |
---|
| 926 | + boolean added; // patch for jar |
---|
| 927 | + |
---|
| 928 | + int tabcount = 0; |
---|
| 929 | + int colcount = 0; |
---|
| 930 | + int rowcount = 0; |
---|
| 931 | + int texturecount = 0; |
---|
| 932 | + |
---|
| 933 | + int columns = 5; |
---|
| 934 | + int rows = 7; |
---|
| 935 | + |
---|
| 936 | + public void ResourceCallBack(String[] path) |
---|
| 937 | + { |
---|
| 938 | +// for (int i = 0; i < path.length; i++) |
---|
| 939 | +// System.out.print(path[i] + "/"); |
---|
| 940 | +// System.out.println(); |
---|
| 941 | + |
---|
| 942 | + if (//rowcount == 0 || |
---|
| 943 | + path.length == 1) |
---|
| 944 | + { |
---|
| 945 | + currenttab = new cGridBag(); |
---|
| 946 | + added = false; |
---|
| 947 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 948 | + currenttab.setName(tabname); |
---|
| 949 | + rowcount = 1; |
---|
| 950 | + colcount = 0; |
---|
| 951 | + texturecount = 0; |
---|
| 952 | + } |
---|
| 953 | + |
---|
| 954 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 955 | + { |
---|
| 956 | + if (!added) |
---|
| 957 | + { |
---|
| 958 | + added = true; |
---|
| 959 | + resourcecontainer.add(currenttab); |
---|
| 960 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 961 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 962 | + } |
---|
| 963 | + |
---|
| 964 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 965 | + |
---|
| 966 | + if (++colcount >= columns) |
---|
| 967 | + { |
---|
| 968 | + colcount = 0; |
---|
| 969 | + currenttab.Return(); |
---|
| 970 | + |
---|
| 971 | + if (rowcount++ >= rows) |
---|
| 972 | + { |
---|
| 973 | + rowcount = 0; |
---|
| 974 | + } |
---|
| 975 | + } |
---|
| 976 | + } |
---|
| 977 | + else |
---|
| 978 | + { |
---|
| 979 | +// if (!path[path.length-1].equals("icons")) |
---|
| 980 | +// resourcecontainer.Return(); |
---|
| 981 | + } |
---|
| 982 | + } |
---|
| 983 | + |
---|
| 984 | + void CreateTexturePanel(cGridBag container) |
---|
| 985 | + { |
---|
| 986 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 987 | + container.add(resourcecontainer); |
---|
| 988 | + |
---|
| 989 | + Grafreed.ParseResources("textures", this); |
---|
| 990 | + } |
---|
862 | 991 | |
---|
863 | 992 | void SetupUI2(ObjEditor oe) |
---|
864 | 993 | { |
---|
.. | .. |
---|
877 | 1006 | //new Exception().printStackTrace(); |
---|
878 | 1007 | |
---|
879 | 1008 | 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 | 1009 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
886 | 1010 | |
---|
887 | 1011 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
914 | 1038 | |
---|
915 | 1039 | if (Globals.ADVANCED) |
---|
916 | 1040 | { |
---|
917 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
918 | | - maxButton.setToolTipText("Maximize window"); |
---|
919 | | - maxButton.addActionListener(this); |
---|
| 1041 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1043 | +// maxButton.addActionListener(this); |
---|
920 | 1044 | } |
---|
| 1045 | + |
---|
| 1046 | + cButton gcButton; |
---|
| 1047 | + |
---|
| 1048 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1050 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1051 | +// { |
---|
| 1052 | +// public void actionPerformed(ActionEvent e) |
---|
| 1053 | +// { |
---|
| 1054 | +// System.gc(); |
---|
| 1055 | +// } |
---|
| 1056 | +// }); |
---|
| 1057 | + |
---|
| 1058 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1059 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1060 | + collapseButton.addActionListener(this); |
---|
| 1061 | + |
---|
| 1062 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1063 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1064 | + maximize3DButton.addActionListener(this); |
---|
| 1065 | + |
---|
| 1066 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1067 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1068 | + twoButton.addActionListener(this); |
---|
| 1069 | + this.fullscreenLayout = twoButton; |
---|
| 1070 | + |
---|
| 1071 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1073 | + threeButton.addActionListener(this); |
---|
| 1074 | + if (Globals.ADVANCED) |
---|
| 1075 | + { |
---|
| 1076 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1078 | + sixButton.addActionListener(this); |
---|
| 1079 | + } |
---|
| 1080 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1082 | +// sevenButton.addActionListener(this); |
---|
| 1083 | + // |
---|
921 | 1084 | |
---|
922 | 1085 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
923 | 1086 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
931 | 1094 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 1095 | restoreCameraButton.addActionListener(this); |
---|
933 | 1096 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("Duplicate current version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 1097 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1098 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1099 | + saveVersionButton.addActionListener(this); |
---|
937 | 1100 | |
---|
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); |
---|
| 1101 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1102 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1103 | + deleteVersionButton.addActionListener(this); |
---|
| 1104 | + |
---|
| 1105 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1106 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1107 | + previousVersionButton.addActionListener(this); |
---|
| 1108 | + previousVersionButton.setEnabled(false); |
---|
942 | 1109 | |
---|
943 | 1110 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | 1111 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | 1112 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 1113 | restoreButton.addActionListener(this); |
---|
947 | | - restoreButton.setEnabled(false); |
---|
| 1114 | + //restoreButton.setEnabled(false); |
---|
948 | 1115 | |
---|
949 | 1116 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | 1117 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 1118 | replaceButton.addActionListener(this); |
---|
952 | | - replaceButton.setEnabled(false); |
---|
| 1119 | + //replaceButton.setEnabled(false); |
---|
953 | 1120 | |
---|
954 | 1121 | copyOptionsPanel.add(updown); |
---|
955 | 1122 | |
---|
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); |
---|
| 1123 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1125 | + nextVersionButton.addActionListener(this); |
---|
| 1126 | + nextVersionButton.setEnabled(false); |
---|
| 1127 | + |
---|
| 1128 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1130 | + oneStepButton.addActionListener(this); |
---|
960 | 1131 | |
---|
961 | 1132 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 1133 | liveCB.setToolTipText("Enable animation"); |
---|
963 | 1134 | liveCB.addItemListener(this); |
---|
964 | 1135 | |
---|
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 | 1136 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
970 | 1137 | fastCB.setToolTipText("Fast mode"); |
---|
971 | 1138 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
992 | 1159 | |
---|
993 | 1160 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
994 | 1161 | |
---|
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 | 1162 | |
---|
1011 | 1163 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1012 | 1164 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1022 | 1174 | |
---|
1023 | 1175 | // INSERT |
---|
1024 | 1176 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1177 | + gridButton.setToolTipText("Create ground"); |
---|
1026 | 1178 | gridButton.addActionListener(this); |
---|
1027 | 1179 | |
---|
1028 | 1180 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1090 | 1242 | |
---|
1091 | 1243 | oe.toolboxPanel.add(row2); |
---|
1092 | 1244 | |
---|
1093 | | - // ENVYMAPS |
---|
1094 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1095 | | - skyboxpane.preferredHeight = 100; |
---|
| 1245 | + cGridBag textures = new cGridBag(); |
---|
1096 | 1246 | |
---|
1097 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1247 | + CreateTexturePanel(textures); |
---|
1098 | 1248 | |
---|
1099 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1100 | | - skyboxpane.add(skyboxpanel); |
---|
| 1249 | + oe.toolboxPanel.add(textures); |
---|
1101 | 1250 | |
---|
1102 | | - AddSkyboxTab0(skyboxpanel); |
---|
1103 | | - AddSkyboxTab1(skyboxpanel); |
---|
1104 | | - AddSkyboxTab2(skyboxpanel); |
---|
1105 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1251 | + textures.preferredHeight = 100; |
---|
| 1252 | + |
---|
| 1253 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1106 | 1254 | |
---|
1107 | 1255 | // EDIT panel |
---|
1108 | 1256 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1114 | 1262 | uneditButton.addActionListener(this); |
---|
1115 | 1263 | |
---|
1116 | 1264 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1265 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1118 | 1266 | allParamsButton.addActionListener(this); |
---|
1119 | 1267 | |
---|
1120 | 1268 | editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1269 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1122 | 1270 | clearPanelButton.addActionListener(this); |
---|
1123 | 1271 | |
---|
1124 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - unselectButton.setToolTipText("Unselect"); |
---|
1126 | | - unselectButton.addActionListener(this); |
---|
| 1272 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1273 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1274 | + //unselectButton.addActionListener(this); |
---|
1127 | 1275 | |
---|
1128 | 1276 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | 1277 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
1318 | 1466 | |
---|
1319 | 1467 | void EditObject(Object3D obj) |
---|
1320 | 1468 | { |
---|
| 1469 | + assert(obj instanceof Composite); |
---|
| 1470 | + |
---|
| 1471 | +// if (obj.versionlist == null) |
---|
| 1472 | +// { |
---|
| 1473 | +// obj.versionlist = new Object3D[100]; |
---|
| 1474 | +// obj.versionindex = -1; |
---|
| 1475 | +// } |
---|
| 1476 | + |
---|
1321 | 1477 | cRadio radioButton = new cRadio(obj.name); |
---|
1322 | 1478 | |
---|
1323 | 1479 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1708 | 1864 | TreePath path; |
---|
1709 | 1865 | |
---|
1710 | 1866 | public TransferableTreePath(TreePath tp) { |
---|
1711 | | - path = tp; |
---|
| 1867 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1868 | + for (int i=0; i<objs.length; i++) |
---|
| 1869 | + { |
---|
| 1870 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1871 | + } |
---|
| 1872 | + path = new TreePath(objs); |
---|
1712 | 1873 | } |
---|
1713 | 1874 | |
---|
1714 | 1875 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2571 | 2732 | if (source == invariantsItem) |
---|
2572 | 2733 | { |
---|
2573 | 2734 | System.out.println("Invariants:"); |
---|
2574 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2735 | + Grafreed.grafreed.universe.invariants(); |
---|
2575 | 2736 | } else |
---|
2576 | 2737 | if (source == memoryItem) |
---|
2577 | 2738 | { |
---|
.. | .. |
---|
2602 | 2763 | { |
---|
2603 | 2764 | ToggleFullScreen(); |
---|
2604 | 2765 | } else |
---|
2605 | | - if (source == undoButton) |
---|
| 2766 | + if (source == collapseButton) |
---|
| 2767 | + { |
---|
| 2768 | + this.expandedLayout = radio.layout; |
---|
| 2769 | + CollapseToolbar(); |
---|
| 2770 | + } else |
---|
| 2771 | + if (source == maximize3DButton) |
---|
| 2772 | + { |
---|
| 2773 | + this.expandedLayout = radio.layout; |
---|
| 2774 | + radio.layout = twoButton; |
---|
| 2775 | + Show3DView(); |
---|
| 2776 | + CollapseToolbar(); |
---|
| 2777 | + } else |
---|
| 2778 | + if (source == previousVersionButton) |
---|
2606 | 2779 | { |
---|
2607 | 2780 | // Go to previous version |
---|
2608 | 2781 | //if (!Undo()) |
---|
2609 | 2782 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2610 | | - Undo(); |
---|
| 2783 | + PreviousVersion(); |
---|
2611 | 2784 | } else |
---|
2612 | 2785 | if (source == restoreButton) |
---|
2613 | 2786 | { |
---|
2614 | 2787 | // Restore current version |
---|
2615 | 2788 | Restore(); |
---|
2616 | | - restoreButton.setEnabled(false); |
---|
| 2789 | + //restoreButton.setEnabled(false); |
---|
2617 | 2790 | } else |
---|
2618 | 2791 | if (source == replaceButton) |
---|
2619 | 2792 | { |
---|
2620 | 2793 | // Overwrite current version |
---|
2621 | 2794 | Replace(); |
---|
2622 | | - replaceButton.setEnabled(false); |
---|
| 2795 | + //replaceButton.setEnabled(false); |
---|
2623 | 2796 | } else |
---|
2624 | | - if (source == redoButton) |
---|
| 2797 | + if (source == nextVersionButton) |
---|
2625 | 2798 | { |
---|
2626 | 2799 | // Go to next version |
---|
2627 | | - Redo(); |
---|
| 2800 | + NextVersion(); |
---|
2628 | 2801 | } else |
---|
2629 | | - if (source == saveButton) |
---|
| 2802 | + if (source == saveVersionButton) |
---|
2630 | 2803 | { |
---|
2631 | 2804 | // Save a new version |
---|
2632 | 2805 | if (!Save(true)) |
---|
2633 | 2806 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2807 | + } else |
---|
| 2808 | + if (source == deleteVersionButton) |
---|
| 2809 | + { |
---|
| 2810 | + // Delete a new version |
---|
| 2811 | + DeleteVersion(); |
---|
2634 | 2812 | } else |
---|
2635 | 2813 | if (source == oneStepButton) |
---|
2636 | 2814 | { |
---|
.. | .. |
---|
2685 | 2863 | } else |
---|
2686 | 2864 | if (source == undoItem) |
---|
2687 | 2865 | { |
---|
2688 | | - Undo(); |
---|
| 2866 | + PreviousVersion(); |
---|
2689 | 2867 | } else |
---|
2690 | 2868 | if (source == redoItem) |
---|
2691 | 2869 | { |
---|
2692 | | - Redo(); |
---|
| 2870 | + NextVersion(); |
---|
2693 | 2871 | } else |
---|
2694 | 2872 | if (source == duplicateItem) |
---|
2695 | 2873 | { |
---|
.. | .. |
---|
3548 | 3726 | if (CameraPane.FULLSCREEN) |
---|
3549 | 3727 | fullscreenLayout = radio.layout; |
---|
3550 | 3728 | |
---|
3551 | | - // bug |
---|
3552 | | - //gridPanel.setDividerLocation(1.0); |
---|
3553 | | - //bigPanel.setDividerLocation(0.0); |
---|
3554 | | -// bigThree.remove(scenePanel); |
---|
3555 | | -// bigThree.remove(centralPanel); |
---|
3556 | | -// bigThree.remove(XYZPanel); |
---|
3557 | | -// aWindowConstraints.gridx = 0; |
---|
3558 | | -// aWindowConstraints.gridy = 0; |
---|
3559 | | -// aWindowConstraints.gridwidth = 1; |
---|
3560 | | -// // aConstraints.gridheight = 3; |
---|
3561 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3562 | | -// aWindowConstraints.weightx = 0; |
---|
3563 | | -// aWindowConstraints.weighty = 1; |
---|
3564 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3565 | | -// aWindowConstraints.weightx = 1; |
---|
3566 | | -// aWindowConstraints.gridwidth = 3; |
---|
3567 | | -// // aConstraints.gridheight = 3; |
---|
3568 | | -// aWindowConstraints.gridx = 1; |
---|
3569 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3570 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3571 | | -// aWindowConstraints.weightx = 0; |
---|
3572 | | -// aWindowConstraints.gridx = 4; |
---|
3573 | | -// aWindowConstraints.gridwidth = 1; |
---|
3574 | | -// // aConstraints.gridheight = 3; |
---|
3575 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3576 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3577 | | -// scenePanel.setVisible(false); |
---|
3578 | | -// centralPanel.setVisible(true); |
---|
3579 | | -// XYZPanel.setVisible(false); |
---|
3580 | | - bigThree.ClearUI(); |
---|
3581 | | - bigThree.add(centralPanel); |
---|
3582 | | - bigThree.FlushUI(); |
---|
| 3729 | + Show3DView(); |
---|
3583 | 3730 | |
---|
3584 | 3731 | cameraView.requestFocusInWindow(); |
---|
3585 | 3732 | |
---|
.. | .. |
---|
3765 | 3912 | } else |
---|
3766 | 3913 | if (source == rootButton) |
---|
3767 | 3914 | { |
---|
| 3915 | + Replace(); |
---|
3768 | 3916 | Object3D obj; |
---|
3769 | 3917 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3770 | 3918 | { |
---|
.. | .. |
---|
3901 | 4049 | |
---|
3902 | 4050 | copy = group; |
---|
3903 | 4051 | |
---|
3904 | | - SetUndoStates(); |
---|
3905 | | - |
---|
3906 | 4052 | //Globals.theRenderer.object = group; |
---|
3907 | 4053 | if(!useclient) |
---|
3908 | 4054 | { |
---|
.. | .. |
---|
3930 | 4076 | */ |
---|
3931 | 4077 | radio.layout.doClick(); |
---|
3932 | 4078 | |
---|
| 4079 | + assert(copy instanceof Composite); |
---|
| 4080 | + |
---|
| 4081 | + if (copy.versionlist == null) |
---|
| 4082 | + { |
---|
| 4083 | + copy.versionlist = new Object3D[100]; |
---|
| 4084 | + copy.versionindex = -1; |
---|
| 4085 | + |
---|
| 4086 | + Save(true); |
---|
| 4087 | + } |
---|
| 4088 | + |
---|
| 4089 | + SetVersionStates(); |
---|
| 4090 | + |
---|
3933 | 4091 | ClearUnpinned(); |
---|
3934 | 4092 | |
---|
3935 | 4093 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5160 | 5318 | { |
---|
5161 | 5319 | editButton.setEnabled(enabled); |
---|
5162 | 5320 | uneditButton.setEnabled(enabled); |
---|
5163 | | - unselectButton.setEnabled(enabled); |
---|
| 5321 | + //unselectButton.setEnabled(enabled); |
---|
5164 | 5322 | flashSelectionButton.setEnabled(enabled); |
---|
5165 | 5323 | |
---|
5166 | 5324 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5325 | + |
---|
| 5326 | + boolean allComposites = true; |
---|
| 5327 | + |
---|
| 5328 | + if (group.selection != null) |
---|
| 5329 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5330 | + { |
---|
| 5331 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5332 | + { |
---|
| 5333 | + allComposites = false; |
---|
| 5334 | + break; |
---|
| 5335 | + } |
---|
| 5336 | + } |
---|
| 5337 | + |
---|
| 5338 | + rootButton.setEnabled(allComposites); |
---|
5167 | 5339 | } |
---|
5168 | 5340 | |
---|
5169 | 5341 | void refreshContents(boolean cp) |
---|
5170 | 5342 | { |
---|
5171 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5343 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5172 | 5344 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5173 | 5345 | { |
---|
5174 | 5346 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5178 | 5350 | Object3D child = (Object3D) group.selection.get(i); |
---|
5179 | 5351 | |
---|
5180 | 5352 | objEditor.AddInfo(child, this, true); |
---|
5181 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5353 | +// System.err.println("info : " + child.GetPath()); |
---|
5182 | 5354 | } |
---|
5183 | 5355 | |
---|
5184 | 5356 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
6004 | 6176 | |
---|
6005 | 6177 | cButton restoreCameraButton; |
---|
6006 | 6178 | |
---|
6007 | | - cButton saveButton; |
---|
6008 | 6179 | cButton oneStepButton; |
---|
6009 | 6180 | |
---|
6010 | 6181 | cButton groupButton; |
---|