.. | .. |
---|
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, |
---|
.. | .. |
---|
311 | 312 | } |
---|
312 | 313 | } |
---|
313 | 314 | |
---|
314 | | - public void ChangeSkybox(String name) |
---|
| 315 | + public void CallBack(String[] path) |
---|
| 316 | + { |
---|
| 317 | + for (int i = 0; i < path.length; i++) |
---|
| 318 | + { |
---|
| 319 | + System.out.print(path[i] + "/"); |
---|
| 320 | + } |
---|
| 321 | + |
---|
| 322 | + System.out.println(); |
---|
| 323 | + } |
---|
| 324 | + |
---|
| 325 | + public void ChangeSkybox(String skybox) |
---|
315 | 326 | { |
---|
316 | 327 | //cameraView.envyoff = false; |
---|
317 | | - group.skyboxname = name; |
---|
| 328 | + group.skyboxname = skybox; |
---|
318 | 329 | group.skyboxext = "jpg"; |
---|
319 | 330 | cameraView.repaint(); |
---|
| 331 | + |
---|
| 332 | + Grafreed.ParseResources("textures", this); |
---|
320 | 333 | } |
---|
321 | 334 | |
---|
322 | 335 | //ObjEditor objEditor; |
---|
.. | .. |
---|
356 | 369 | this.copy = this.group = group; |
---|
357 | 370 | //selectees = this.group.selectees; |
---|
358 | 371 | |
---|
359 | | - if (copy.versions == null) |
---|
| 372 | + if (copy.versionlist == null) |
---|
360 | 373 | { |
---|
361 | | - copy.versions = new byte[100][]; |
---|
| 374 | + copy.versionlist = new Object3D[100]; |
---|
362 | 375 | copy.versionindex = -1; |
---|
363 | 376 | } |
---|
364 | 377 | |
---|
.. | .. |
---|
383 | 396 | |
---|
384 | 397 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
385 | 398 | |
---|
386 | | - if (copy.versions == null) |
---|
| 399 | + if (copy.versionlist == null) |
---|
387 | 400 | { |
---|
388 | | - copy.versions = new byte[100][]; |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
389 | 402 | copy.versionindex = -1; |
---|
390 | 403 | |
---|
391 | 404 | Save(true); |
---|
.. | .. |
---|
931 | 944 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 945 | restoreCameraButton.addActionListener(this); |
---|
933 | 946 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("New version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 947 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 948 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 949 | + saveVersionButton.addActionListener(this); |
---|
937 | 950 | |
---|
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); |
---|
| 951 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 952 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 953 | + deleteVersionButton.addActionListener(this); |
---|
| 954 | + |
---|
| 955 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 956 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 957 | + previousVersionButton.addActionListener(this); |
---|
| 958 | + previousVersionButton.setEnabled(false); |
---|
942 | 959 | |
---|
943 | 960 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | 961 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 962 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 963 | restoreButton.addActionListener(this); |
---|
947 | | - restoreButton.setEnabled(false); |
---|
| 964 | + //restoreButton.setEnabled(false); |
---|
948 | 965 | |
---|
949 | 966 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 967 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 968 | replaceButton.addActionListener(this); |
---|
952 | | - replaceButton.setEnabled(false); |
---|
| 969 | + //replaceButton.setEnabled(false); |
---|
953 | 970 | |
---|
954 | 971 | copyOptionsPanel.add(updown); |
---|
955 | 972 | |
---|
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); |
---|
| 973 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 974 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 975 | + nextVersionButton.addActionListener(this); |
---|
| 976 | + nextVersionButton.setEnabled(false); |
---|
960 | 977 | |
---|
961 | 978 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 979 | liveCB.setToolTipText("Enable animation"); |
---|
.. | .. |
---|
1094 | 1111 | cGridBag skyboxpane = new cGridBag(); |
---|
1095 | 1112 | skyboxpane.preferredHeight = 100; |
---|
1096 | 1113 | |
---|
1097 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1114 | + oe.skyboxPanel.add(skyboxpane); |
---|
1098 | 1115 | |
---|
1099 | 1116 | JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1100 | 1117 | skyboxpane.add(skyboxpanel); |
---|
.. | .. |
---|
1110 | 1127 | editButton.addActionListener(this); |
---|
1111 | 1128 | |
---|
1112 | 1129 | editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1113 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1130 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1114 | 1131 | uneditButton.addActionListener(this); |
---|
1115 | 1132 | |
---|
1116 | 1133 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | 1134 | allParamsButton.setToolTipText("Show all controle"); |
---|
1118 | 1135 | allParamsButton.addActionListener(this); |
---|
1119 | 1136 | |
---|
1120 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1137 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | 1138 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
1122 | 1139 | clearPanelButton.addActionListener(this); |
---|
1123 | 1140 | |
---|
1124 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1125 | | - unselectButton.setToolTipText("Unselect"); |
---|
1126 | | - unselectButton.addActionListener(this); |
---|
| 1141 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1142 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1143 | + //unselectButton.addActionListener(this); |
---|
1127 | 1144 | |
---|
1128 | 1145 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1129 | 1146 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
1183 | 1200 | dgr.addDragGestureListener(this); |
---|
1184 | 1201 | }catch(Exception e) {} |
---|
1185 | 1202 | */ |
---|
1186 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1203 | + radio.layout = threeButton; // sixButton; |
---|
1187 | 1204 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1188 | 1205 | } |
---|
1189 | 1206 | |
---|
.. | .. |
---|
1234 | 1251 | smoothCB.setToolTipText("Snapping delay"); |
---|
1235 | 1252 | smoothCB.addItemListener(this); |
---|
1236 | 1253 | |
---|
1237 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1238 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1239 | | - slowCB.addItemListener(this); |
---|
| 1254 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1255 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1256 | +// slowCB.addItemListener(this); |
---|
| 1257 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1258 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1259 | + minshaderCB.addItemListener(this); |
---|
1240 | 1260 | |
---|
1241 | 1261 | // constraints.gridy += 1; |
---|
1242 | 1262 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1325 | 1345 | } |
---|
1326 | 1346 | |
---|
1327 | 1347 | radioButton.SetObject(obj); |
---|
1328 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1348 | + radioButton.layout = threeButton; // sixButton; |
---|
1329 | 1349 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1330 | 1350 | radioButton.addActionListener(this); |
---|
1331 | 1351 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1350 | 1370 | cCheckBox localCB; |
---|
1351 | 1371 | cCheckBox crowdCB; |
---|
1352 | 1372 | cCheckBox smoothCB; |
---|
| 1373 | + cCheckBox minshaderCB; |
---|
| 1374 | + |
---|
1353 | 1375 | cToggleButton fastCB; |
---|
1354 | 1376 | cCheckBox slowCB; |
---|
1355 | 1377 | cCheckBox boxCB; |
---|
.. | .. |
---|
1420 | 1442 | { |
---|
1421 | 1443 | cameraView.ToggleInertia(); |
---|
1422 | 1444 | cameraView.repaint(); |
---|
| 1445 | + } |
---|
| 1446 | + else if(e.getSource() == minshaderCB) |
---|
| 1447 | + { |
---|
| 1448 | + Globals.MINSHADER ^= true; |
---|
| 1449 | + cameraView.programInitialized = false; |
---|
| 1450 | + cameraView.repaint(); |
---|
1423 | 1451 | } |
---|
1424 | 1452 | else if(e.getSource() == localCB) |
---|
1425 | 1453 | { |
---|
.. | .. |
---|
2560 | 2588 | if (source == invariantsItem) |
---|
2561 | 2589 | { |
---|
2562 | 2590 | System.out.println("Invariants:"); |
---|
2563 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2591 | + Grafreed.grafreed.universe.invariants(); |
---|
2564 | 2592 | } else |
---|
2565 | 2593 | if (source == memoryItem) |
---|
2566 | 2594 | { |
---|
.. | .. |
---|
2591 | 2619 | { |
---|
2592 | 2620 | ToggleFullScreen(); |
---|
2593 | 2621 | } else |
---|
2594 | | - if (source == undoButton) |
---|
| 2622 | + if (source == previousVersionButton) |
---|
2595 | 2623 | { |
---|
2596 | 2624 | // Go to previous version |
---|
2597 | 2625 | //if (!Undo()) |
---|
2598 | 2626 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2599 | | - Undo(); |
---|
| 2627 | + PreviousVersion(); |
---|
2600 | 2628 | } else |
---|
2601 | 2629 | if (source == restoreButton) |
---|
2602 | 2630 | { |
---|
2603 | 2631 | // Restore current version |
---|
2604 | 2632 | Restore(); |
---|
| 2633 | + //restoreButton.setEnabled(false); |
---|
2605 | 2634 | } else |
---|
2606 | 2635 | if (source == replaceButton) |
---|
2607 | 2636 | { |
---|
2608 | 2637 | // Overwrite current version |
---|
2609 | 2638 | Replace(); |
---|
| 2639 | + //replaceButton.setEnabled(false); |
---|
2610 | 2640 | } else |
---|
2611 | | - if (source == redoButton) |
---|
| 2641 | + if (source == nextVersionButton) |
---|
2612 | 2642 | { |
---|
2613 | 2643 | // Go to next version |
---|
2614 | | - Redo(); |
---|
| 2644 | + NextVersion(); |
---|
2615 | 2645 | } else |
---|
2616 | | - if (source == saveButton) |
---|
| 2646 | + if (source == saveVersionButton) |
---|
2617 | 2647 | { |
---|
2618 | 2648 | // Save a new version |
---|
2619 | 2649 | if (!Save(true)) |
---|
2620 | 2650 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2651 | + } else |
---|
| 2652 | + if (source == deleteVersionButton) |
---|
| 2653 | + { |
---|
| 2654 | + // Delete a new version |
---|
| 2655 | + DeleteVersion(); |
---|
2621 | 2656 | } else |
---|
2622 | 2657 | if (source == oneStepButton) |
---|
2623 | 2658 | { |
---|
.. | .. |
---|
2672 | 2707 | } else |
---|
2673 | 2708 | if (source == undoItem) |
---|
2674 | 2709 | { |
---|
2675 | | - Undo(); |
---|
| 2710 | + PreviousVersion(); |
---|
2676 | 2711 | } else |
---|
2677 | 2712 | if (source == redoItem) |
---|
2678 | 2713 | { |
---|
2679 | | - Redo(); |
---|
| 2714 | + NextVersion(); |
---|
2680 | 2715 | } else |
---|
2681 | 2716 | if (source == duplicateItem) |
---|
2682 | 2717 | { |
---|
.. | .. |
---|
3809 | 3844 | { |
---|
3810 | 3845 | Object3D child = (Object3D)e.nextElement(); |
---|
3811 | 3846 | if(child.editWindow != null) |
---|
3812 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3813 | 3847 | child.pinned = false; |
---|
3814 | 3848 | child.CloseUI(); |
---|
3815 | 3849 | listUI.remove(child); |
---|
| 3850 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3816 | 3851 | |
---|
3817 | 3852 | //child.editWindow = null; // ??????????? |
---|
3818 | 3853 | } |
---|
.. | .. |
---|
3831 | 3866 | obj.CloseUI(); |
---|
3832 | 3867 | } |
---|
3833 | 3868 | listUI.clear(); |
---|
| 3869 | + SetPinStates(group.selection.size() > 0); |
---|
3834 | 3870 | refreshContents(true); |
---|
3835 | 3871 | } else |
---|
3836 | 3872 | if (source == allParamsButton) |
---|
.. | .. |
---|
3917 | 3953 | radio.layout.doClick(); |
---|
3918 | 3954 | |
---|
3919 | 3955 | ClearUnpinned(); |
---|
| 3956 | + |
---|
3920 | 3957 | //Grafreed.Assert(group != null); |
---|
3921 | 3958 | //Grafreed.Assert(group.selection != null); |
---|
3922 | 3959 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3933 | 3970 | } else if (event.getSource() == editCameraItem) |
---|
3934 | 3971 | { |
---|
3935 | 3972 | cameraView.ProtectCamera(); |
---|
| 3973 | + cameraView.requestFocusInWindow(); |
---|
3936 | 3974 | cameraView.repaint(); |
---|
3937 | 3975 | return; |
---|
3938 | 3976 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3939 | 3977 | { |
---|
3940 | 3978 | cameraView.RevertCamera(); |
---|
| 3979 | + cameraView.requestFocusInWindow(); |
---|
3941 | 3980 | cameraView.repaint(); |
---|
3942 | 3981 | return; |
---|
3943 | 3982 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
5070 | 5109 | |
---|
5071 | 5110 | freezemodel = false; |
---|
5072 | 5111 | } |
---|
5073 | | - |
---|
5074 | | - boolean flashIt = true; |
---|
5075 | | - |
---|
| 5112 | + |
---|
5076 | 5113 | public void valueChanged(TreeSelectionEvent e) |
---|
5077 | 5114 | //public boolean handleEvent(Event event) |
---|
5078 | 5115 | { |
---|
.. | .. |
---|
5145 | 5182 | { |
---|
5146 | 5183 | editButton.setEnabled(enabled); |
---|
5147 | 5184 | uneditButton.setEnabled(enabled); |
---|
5148 | | - unselectButton.setEnabled(enabled); |
---|
| 5185 | + //unselectButton.setEnabled(enabled); |
---|
5149 | 5186 | flashSelectionButton.setEnabled(enabled); |
---|
| 5187 | + |
---|
| 5188 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
5150 | 5189 | } |
---|
5151 | 5190 | |
---|
5152 | 5191 | void refreshContents(boolean cp) |
---|
5153 | 5192 | { |
---|
5154 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5193 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5155 | 5194 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5156 | 5195 | { |
---|
5157 | 5196 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5987 | 6026 | |
---|
5988 | 6027 | cButton restoreCameraButton; |
---|
5989 | 6028 | |
---|
5990 | | - cButton saveButton; |
---|
5991 | 6029 | cButton oneStepButton; |
---|
5992 | 6030 | |
---|
5993 | 6031 | cButton groupButton; |
---|