.. | .. |
---|
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, |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
311 | 328 | } |
---|
312 | 329 | } |
---|
313 | 330 | |
---|
314 | | - public void ChangeSkybox(String name) |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
315 | 332 | { |
---|
316 | 333 | //cameraView.envyoff = false; |
---|
317 | | - group.skyboxname = name; |
---|
| 334 | + group.skyboxname = skybox; |
---|
318 | 335 | group.skyboxext = "jpg"; |
---|
319 | 336 | cameraView.repaint(); |
---|
320 | 337 | } |
---|
| 338 | + |
---|
| 339 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 340 | + { |
---|
| 341 | + JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 342 | + |
---|
| 343 | + AddSkyboxTab0(skyboxpane); |
---|
| 344 | + AddSkyboxTab1(skyboxpane); |
---|
| 345 | + AddSkyboxTab2(skyboxpane); |
---|
| 346 | + AddSkyboxTab3(skyboxpane); |
---|
| 347 | + |
---|
| 348 | + skyboxPanel.add(skyboxpane); |
---|
| 349 | + } |
---|
321 | 350 | |
---|
| 351 | + public void ChangeTexture(String texture) |
---|
| 352 | + { |
---|
| 353 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 354 | + { |
---|
| 355 | + Object3D obj = group.selection.get(i); |
---|
| 356 | + obj.SetPigmentTexture("@" + texture); |
---|
| 357 | + } |
---|
| 358 | + |
---|
| 359 | + refreshContents(); |
---|
| 360 | + } |
---|
| 361 | + |
---|
| 362 | + public void Show3DView() |
---|
| 363 | + { |
---|
| 364 | + // bug |
---|
| 365 | + //gridPanel.setDividerLocation(1.0); |
---|
| 366 | + //bigPanel.setDividerLocation(0.0); |
---|
| 367 | + bigThree.ClearUI(); |
---|
| 368 | + bigThree.add(centralPanel); |
---|
| 369 | + bigThree.FlushUI(); |
---|
| 370 | + } |
---|
| 371 | + |
---|
322 | 372 | //ObjEditor objEditor; |
---|
323 | 373 | public void closeUI2() |
---|
324 | 374 | { |
---|
.. | .. |
---|
356 | 406 | this.copy = this.group = group; |
---|
357 | 407 | //selectees = this.group.selectees; |
---|
358 | 408 | |
---|
359 | | - if (copy.versions == null) |
---|
| 409 | + if (copy.versionlist == null) |
---|
360 | 410 | { |
---|
361 | | - copy.versions = new byte[100][]; |
---|
| 411 | + copy.versionlist = new Object3D[100]; |
---|
362 | 412 | copy.versionindex = -1; |
---|
363 | 413 | } |
---|
364 | 414 | |
---|
.. | .. |
---|
383 | 433 | |
---|
384 | 434 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
385 | 435 | |
---|
386 | | - if (copy.versions == null) |
---|
| 436 | + if (copy.versionlist == null) |
---|
387 | 437 | { |
---|
388 | | - copy.versions = new byte[100][]; |
---|
| 438 | + copy.versionlist = new Object3D[100]; |
---|
389 | 439 | copy.versionindex = -1; |
---|
390 | 440 | |
---|
391 | 441 | Save(true); |
---|
.. | .. |
---|
859 | 909 | buildToolsMenu(menu); |
---|
860 | 910 | } |
---|
861 | 911 | |
---|
| 912 | + JTabbedPane resourcecontainer; |
---|
| 913 | + cGridBag currenttab; |
---|
| 914 | + boolean added; // patch for jar |
---|
| 915 | + |
---|
| 916 | + int tabcount = 0; |
---|
| 917 | + int colcount = 0; |
---|
| 918 | + int rowcount = 0; |
---|
| 919 | + int texturecount = 0; |
---|
| 920 | + |
---|
| 921 | + int columns = 5; |
---|
| 922 | + int rows = 7; |
---|
| 923 | + |
---|
| 924 | + public void ResourceCallBack(String[] path) |
---|
| 925 | + { |
---|
| 926 | +// for (int i = 0; i < path.length; i++) |
---|
| 927 | +// System.out.print(path[i] + "/"); |
---|
| 928 | +// System.out.println(); |
---|
| 929 | + |
---|
| 930 | + if (//rowcount == 0 || |
---|
| 931 | + path.length == 1) |
---|
| 932 | + { |
---|
| 933 | + currenttab = new cGridBag(); |
---|
| 934 | + added = false; |
---|
| 935 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 936 | + currenttab.setName(tabname); |
---|
| 937 | + rowcount = 1; |
---|
| 938 | + colcount = 0; |
---|
| 939 | + texturecount = 0; |
---|
| 940 | + } |
---|
| 941 | + |
---|
| 942 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 943 | + { |
---|
| 944 | + if (!added) |
---|
| 945 | + { |
---|
| 946 | + added = true; |
---|
| 947 | + resourcecontainer.add(currenttab); |
---|
| 948 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 949 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 950 | + } |
---|
| 951 | + |
---|
| 952 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 953 | + |
---|
| 954 | + if (++colcount >= columns) |
---|
| 955 | + { |
---|
| 956 | + colcount = 0; |
---|
| 957 | + currenttab.Return(); |
---|
| 958 | + |
---|
| 959 | + if (rowcount++ >= rows) |
---|
| 960 | + { |
---|
| 961 | + rowcount = 0; |
---|
| 962 | + } |
---|
| 963 | + } |
---|
| 964 | + } |
---|
| 965 | + else |
---|
| 966 | + { |
---|
| 967 | +// if (!path[path.length-1].equals("icons")) |
---|
| 968 | +// resourcecontainer.Return(); |
---|
| 969 | + } |
---|
| 970 | + } |
---|
| 971 | + |
---|
| 972 | + void CreateTexturePanel(cGridBag container) |
---|
| 973 | + { |
---|
| 974 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 975 | + container.add(resourcecontainer); |
---|
| 976 | + |
---|
| 977 | + Grafreed.ParseResources("textures", this); |
---|
| 978 | + } |
---|
862 | 979 | |
---|
863 | 980 | void SetupUI2(ObjEditor oe) |
---|
864 | 981 | { |
---|
.. | .. |
---|
877 | 994 | //new Exception().printStackTrace(); |
---|
878 | 995 | |
---|
879 | 996 | 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 | 997 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
886 | 998 | |
---|
887 | 999 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
919 | 1031 | maxButton.addActionListener(this); |
---|
920 | 1032 | } |
---|
921 | 1033 | |
---|
| 1034 | + cButton gcButton; |
---|
| 1035 | + |
---|
| 1036 | + oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + gcButton.setToolTipText("Garbage collect"); |
---|
| 1038 | + gcButton.addActionListener(new ActionListener() |
---|
| 1039 | + { |
---|
| 1040 | + public void actionPerformed(ActionEvent e) |
---|
| 1041 | + { |
---|
| 1042 | + System.gc(); |
---|
| 1043 | + } |
---|
| 1044 | + }); |
---|
| 1045 | + |
---|
| 1046 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1047 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1048 | + collapseButton.addActionListener(this); |
---|
| 1049 | + |
---|
| 1050 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1051 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1052 | + maximize3DButton.addActionListener(this); |
---|
| 1053 | + |
---|
| 1054 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1055 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1056 | + twoButton.addActionListener(this); |
---|
| 1057 | + this.fullscreenLayout = twoButton; |
---|
| 1058 | + |
---|
| 1059 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1060 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1061 | + threeButton.addActionListener(this); |
---|
| 1062 | + if (Globals.ADVANCED) |
---|
| 1063 | + { |
---|
| 1064 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1066 | + sixButton.addActionListener(this); |
---|
| 1067 | + } |
---|
| 1068 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1069 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1070 | +// sevenButton.addActionListener(this); |
---|
| 1071 | + // |
---|
| 1072 | + |
---|
922 | 1073 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
923 | 1074 | fullButton.setToolTipText("Full-screen window"); |
---|
924 | 1075 | fullButton.addActionListener(this); |
---|
.. | .. |
---|
931 | 1082 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 1083 | restoreCameraButton.addActionListener(this); |
---|
933 | 1084 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("New version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 1085 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1086 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1087 | + saveVersionButton.addActionListener(this); |
---|
937 | 1088 | |
---|
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); |
---|
| 1089 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1090 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1091 | + deleteVersionButton.addActionListener(this); |
---|
| 1092 | + |
---|
| 1093 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1094 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1095 | + previousVersionButton.addActionListener(this); |
---|
| 1096 | + previousVersionButton.setEnabled(false); |
---|
942 | 1097 | |
---|
943 | 1098 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | 1099 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 1100 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 1101 | restoreButton.addActionListener(this); |
---|
947 | | - restoreButton.setEnabled(false); |
---|
| 1102 | + //restoreButton.setEnabled(false); |
---|
948 | 1103 | |
---|
949 | 1104 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 1105 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 1106 | replaceButton.addActionListener(this); |
---|
952 | | - replaceButton.setEnabled(false); |
---|
| 1107 | + //replaceButton.setEnabled(false); |
---|
953 | 1108 | |
---|
954 | 1109 | copyOptionsPanel.add(updown); |
---|
955 | 1110 | |
---|
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); |
---|
| 1111 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1112 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1113 | + nextVersionButton.addActionListener(this); |
---|
| 1114 | + nextVersionButton.setEnabled(false); |
---|
| 1115 | + |
---|
| 1116 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1118 | + oneStepButton.addActionListener(this); |
---|
960 | 1119 | |
---|
961 | 1120 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 1121 | liveCB.setToolTipText("Enable animation"); |
---|
963 | 1122 | liveCB.addItemListener(this); |
---|
964 | 1123 | |
---|
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 | 1124 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
970 | 1125 | fastCB.setToolTipText("Fast mode"); |
---|
971 | 1126 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
992 | 1147 | |
---|
993 | 1148 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
994 | 1149 | |
---|
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 | 1150 | |
---|
1011 | 1151 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1012 | 1152 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1090 | 1230 | |
---|
1091 | 1231 | oe.toolboxPanel.add(row2); |
---|
1092 | 1232 | |
---|
1093 | | - // ENVYMAPS |
---|
1094 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1095 | | - skyboxpane.preferredHeight = 100; |
---|
| 1233 | + cGridBag textures = new cGridBag(); |
---|
1096 | 1234 | |
---|
1097 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1235 | + CreateTexturePanel(textures); |
---|
1098 | 1236 | |
---|
1099 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1100 | | - skyboxpane.add(skyboxpanel); |
---|
| 1237 | + oe.toolboxPanel.add(textures); |
---|
1101 | 1238 | |
---|
1102 | | - AddSkyboxTab0(skyboxpanel); |
---|
1103 | | - AddSkyboxTab1(skyboxpanel); |
---|
1104 | | - AddSkyboxTab2(skyboxpanel); |
---|
1105 | | - AddSkyboxTab3(skyboxpanel); |
---|
| 1239 | + textures.preferredHeight = 100; |
---|
| 1240 | + |
---|
| 1241 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1106 | 1242 | |
---|
1107 | 1243 | // EDIT panel |
---|
1108 | 1244 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1110 | 1246 | editButton.addActionListener(this); |
---|
1111 | 1247 | |
---|
1112 | 1248 | editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1113 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1249 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1114 | 1250 | uneditButton.addActionListener(this); |
---|
1115 | 1251 | |
---|
1116 | 1252 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1253 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1118 | 1254 | allParamsButton.addActionListener(this); |
---|
1119 | 1255 | |
---|
1120 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1256 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1257 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1122 | 1258 | clearPanelButton.addActionListener(this); |
---|
1123 | 1259 | |
---|
1124 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - unselectButton.setToolTipText("Unselect"); |
---|
1126 | | - unselectButton.addActionListener(this); |
---|
| 1260 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1261 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1262 | + //unselectButton.addActionListener(this); |
---|
1127 | 1263 | |
---|
1128 | 1264 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | 1265 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
1183 | 1319 | dgr.addDragGestureListener(this); |
---|
1184 | 1320 | }catch(Exception e) {} |
---|
1185 | 1321 | */ |
---|
1186 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1322 | + radio.layout = threeButton; // sixButton; |
---|
1187 | 1323 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1188 | 1324 | } |
---|
1189 | 1325 | |
---|
.. | .. |
---|
1328 | 1464 | } |
---|
1329 | 1465 | |
---|
1330 | 1466 | radioButton.SetObject(obj); |
---|
1331 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1467 | + radioButton.layout = threeButton; // sixButton; |
---|
1332 | 1468 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1333 | 1469 | radioButton.addActionListener(this); |
---|
1334 | 1470 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1708 | 1844 | TreePath path; |
---|
1709 | 1845 | |
---|
1710 | 1846 | public TransferableTreePath(TreePath tp) { |
---|
1711 | | - path = tp; |
---|
| 1847 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1848 | + for (int i=0; i<objs.length; i++) |
---|
| 1849 | + { |
---|
| 1850 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1851 | + } |
---|
| 1852 | + path = new TreePath(objs); |
---|
1712 | 1853 | } |
---|
1713 | 1854 | |
---|
1714 | 1855 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2571 | 2712 | if (source == invariantsItem) |
---|
2572 | 2713 | { |
---|
2573 | 2714 | System.out.println("Invariants:"); |
---|
2574 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2715 | + Grafreed.grafreed.universe.invariants(); |
---|
2575 | 2716 | } else |
---|
2576 | 2717 | if (source == memoryItem) |
---|
2577 | 2718 | { |
---|
.. | .. |
---|
2602 | 2743 | { |
---|
2603 | 2744 | ToggleFullScreen(); |
---|
2604 | 2745 | } else |
---|
2605 | | - if (source == undoButton) |
---|
| 2746 | + if (source == collapseButton) |
---|
| 2747 | + { |
---|
| 2748 | + this.expandedLayout = radio.layout; |
---|
| 2749 | + CollapseToolbar(); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == maximize3DButton) |
---|
| 2752 | + { |
---|
| 2753 | + this.expandedLayout = radio.layout; |
---|
| 2754 | + radio.layout = twoButton; |
---|
| 2755 | + Show3DView(); |
---|
| 2756 | + CollapseToolbar(); |
---|
| 2757 | + } else |
---|
| 2758 | + if (source == previousVersionButton) |
---|
2606 | 2759 | { |
---|
2607 | 2760 | // Go to previous version |
---|
2608 | 2761 | //if (!Undo()) |
---|
2609 | 2762 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2610 | | - Undo(); |
---|
| 2763 | + PreviousVersion(); |
---|
2611 | 2764 | } else |
---|
2612 | 2765 | if (source == restoreButton) |
---|
2613 | 2766 | { |
---|
2614 | 2767 | // Restore current version |
---|
2615 | 2768 | Restore(); |
---|
| 2769 | + //restoreButton.setEnabled(false); |
---|
2616 | 2770 | } else |
---|
2617 | 2771 | if (source == replaceButton) |
---|
2618 | 2772 | { |
---|
2619 | 2773 | // Overwrite current version |
---|
2620 | 2774 | Replace(); |
---|
| 2775 | + //replaceButton.setEnabled(false); |
---|
2621 | 2776 | } else |
---|
2622 | | - if (source == redoButton) |
---|
| 2777 | + if (source == nextVersionButton) |
---|
2623 | 2778 | { |
---|
2624 | 2779 | // Go to next version |
---|
2625 | | - Redo(); |
---|
| 2780 | + NextVersion(); |
---|
2626 | 2781 | } else |
---|
2627 | | - if (source == saveButton) |
---|
| 2782 | + if (source == saveVersionButton) |
---|
2628 | 2783 | { |
---|
2629 | 2784 | // Save a new version |
---|
2630 | 2785 | if (!Save(true)) |
---|
2631 | 2786 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2787 | + } else |
---|
| 2788 | + if (source == deleteVersionButton) |
---|
| 2789 | + { |
---|
| 2790 | + // Delete a new version |
---|
| 2791 | + DeleteVersion(); |
---|
2632 | 2792 | } else |
---|
2633 | 2793 | if (source == oneStepButton) |
---|
2634 | 2794 | { |
---|
.. | .. |
---|
2683 | 2843 | } else |
---|
2684 | 2844 | if (source == undoItem) |
---|
2685 | 2845 | { |
---|
2686 | | - Undo(); |
---|
| 2846 | + PreviousVersion(); |
---|
2687 | 2847 | } else |
---|
2688 | 2848 | if (source == redoItem) |
---|
2689 | 2849 | { |
---|
2690 | | - Redo(); |
---|
| 2850 | + NextVersion(); |
---|
2691 | 2851 | } else |
---|
2692 | 2852 | if (source == duplicateItem) |
---|
2693 | 2853 | { |
---|
.. | .. |
---|
3546 | 3706 | if (CameraPane.FULLSCREEN) |
---|
3547 | 3707 | fullscreenLayout = radio.layout; |
---|
3548 | 3708 | |
---|
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(); |
---|
| 3709 | + Show3DView(); |
---|
3581 | 3710 | |
---|
3582 | 3711 | cameraView.requestFocusInWindow(); |
---|
3583 | 3712 | |
---|
.. | .. |
---|
3820 | 3949 | { |
---|
3821 | 3950 | Object3D child = (Object3D)e.nextElement(); |
---|
3822 | 3951 | if(child.editWindow != null) |
---|
3823 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3824 | 3952 | child.pinned = false; |
---|
3825 | 3953 | child.CloseUI(); |
---|
3826 | 3954 | listUI.remove(child); |
---|
| 3955 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3827 | 3956 | |
---|
3828 | 3957 | //child.editWindow = null; // ??????????? |
---|
3829 | 3958 | } |
---|
.. | .. |
---|
3842 | 3971 | obj.CloseUI(); |
---|
3843 | 3972 | } |
---|
3844 | 3973 | listUI.clear(); |
---|
| 3974 | + SetPinStates(group.selection.size() > 0); |
---|
3845 | 3975 | refreshContents(true); |
---|
3846 | 3976 | } else |
---|
3847 | 3977 | if (source == allParamsButton) |
---|
.. | .. |
---|
3928 | 4058 | radio.layout.doClick(); |
---|
3929 | 4059 | |
---|
3930 | 4060 | ClearUnpinned(); |
---|
| 4061 | + |
---|
3931 | 4062 | //Grafreed.Assert(group != null); |
---|
3932 | 4063 | //Grafreed.Assert(group.selection != null); |
---|
3933 | 4064 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3944 | 4075 | } else if (event.getSource() == editCameraItem) |
---|
3945 | 4076 | { |
---|
3946 | 4077 | cameraView.ProtectCamera(); |
---|
| 4078 | + cameraView.requestFocusInWindow(); |
---|
3947 | 4079 | cameraView.repaint(); |
---|
3948 | 4080 | return; |
---|
3949 | 4081 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3950 | 4082 | { |
---|
3951 | 4083 | cameraView.RevertCamera(); |
---|
| 4084 | + cameraView.requestFocusInWindow(); |
---|
3952 | 4085 | cameraView.repaint(); |
---|
3953 | 4086 | return; |
---|
3954 | 4087 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
5081 | 5214 | |
---|
5082 | 5215 | freezemodel = false; |
---|
5083 | 5216 | } |
---|
5084 | | - |
---|
5085 | | - boolean flashIt = true; |
---|
5086 | | - |
---|
| 5217 | + |
---|
5087 | 5218 | public void valueChanged(TreeSelectionEvent e) |
---|
5088 | 5219 | //public boolean handleEvent(Event event) |
---|
5089 | 5220 | { |
---|
.. | .. |
---|
5156 | 5287 | { |
---|
5157 | 5288 | editButton.setEnabled(enabled); |
---|
5158 | 5289 | uneditButton.setEnabled(enabled); |
---|
5159 | | - unselectButton.setEnabled(enabled); |
---|
| 5290 | + //unselectButton.setEnabled(enabled); |
---|
5160 | 5291 | flashSelectionButton.setEnabled(enabled); |
---|
| 5292 | + |
---|
| 5293 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
5161 | 5294 | } |
---|
5162 | 5295 | |
---|
5163 | 5296 | void refreshContents(boolean cp) |
---|
5164 | 5297 | { |
---|
5165 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5298 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5166 | 5299 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5167 | 5300 | { |
---|
5168 | 5301 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5172 | 5305 | Object3D child = (Object3D) group.selection.get(i); |
---|
5173 | 5306 | |
---|
5174 | 5307 | objEditor.AddInfo(child, this, true); |
---|
5175 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5308 | +// System.err.println("info : " + child.GetPath()); |
---|
5176 | 5309 | } |
---|
5177 | 5310 | |
---|
5178 | 5311 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5998 | 6131 | |
---|
5999 | 6132 | cButton restoreCameraButton; |
---|
6000 | 6133 | |
---|
6001 | | - cButton saveButton; |
---|
6002 | 6134 | cButton oneStepButton; |
---|
6003 | 6135 | |
---|
6004 | 6136 | cButton groupButton; |
---|