.. | .. |
---|
356 | 356 | this.copy = this.group = group; |
---|
357 | 357 | //selectees = this.group.selectees; |
---|
358 | 358 | |
---|
359 | | - if (copy.versions == null) |
---|
| 359 | + if (copy.versionlist == null) |
---|
360 | 360 | { |
---|
361 | | - copy.versions = new byte[100][]; |
---|
| 361 | + copy.versionlist = new Object3D[100]; |
---|
362 | 362 | copy.versionindex = -1; |
---|
363 | 363 | } |
---|
364 | 364 | |
---|
.. | .. |
---|
383 | 383 | |
---|
384 | 384 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
385 | 385 | |
---|
386 | | - if (copy.versions == null) |
---|
| 386 | + if (copy.versionlist == null) |
---|
387 | 387 | { |
---|
388 | | - copy.versions = new byte[100][]; |
---|
| 388 | + copy.versionlist = new Object3D[100]; |
---|
389 | 389 | copy.versionindex = -1; |
---|
390 | 390 | |
---|
391 | 391 | Save(true); |
---|
.. | .. |
---|
931 | 931 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
932 | 932 | restoreCameraButton.addActionListener(this); |
---|
933 | 933 | |
---|
934 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
935 | | - saveButton.setToolTipText("New version"); |
---|
936 | | - saveButton.addActionListener(this); |
---|
| 934 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 936 | + saveVersionButton.addActionListener(this); |
---|
937 | 937 | |
---|
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); |
---|
| 938 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 940 | + deleteVersionButton.addActionListener(this); |
---|
| 941 | + |
---|
| 942 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 943 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 944 | + previousVersionButton.addActionListener(this); |
---|
| 945 | + previousVersionButton.setEnabled(false); |
---|
942 | 946 | |
---|
943 | 947 | cGridBag updown = new cGridBag().setVertical(true); |
---|
944 | 948 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
945 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 949 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
946 | 950 | restoreButton.addActionListener(this); |
---|
947 | | - restoreButton.setEnabled(false); |
---|
| 951 | + //restoreButton.setEnabled(false); |
---|
948 | 952 | |
---|
949 | 953 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
950 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 954 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
951 | 955 | replaceButton.addActionListener(this); |
---|
952 | | - replaceButton.setEnabled(false); |
---|
| 956 | + //replaceButton.setEnabled(false); |
---|
953 | 957 | |
---|
954 | 958 | copyOptionsPanel.add(updown); |
---|
955 | 959 | |
---|
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); |
---|
| 960 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 961 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 962 | + nextVersionButton.addActionListener(this); |
---|
| 963 | + nextVersionButton.setEnabled(false); |
---|
960 | 964 | |
---|
961 | 965 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
962 | 966 | liveCB.setToolTipText("Enable animation"); |
---|
.. | .. |
---|
1110 | 1114 | editButton.addActionListener(this); |
---|
1111 | 1115 | |
---|
1112 | 1116 | editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1113 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1117 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1114 | 1118 | uneditButton.addActionListener(this); |
---|
1115 | 1119 | |
---|
1116 | 1120 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1117 | 1121 | allParamsButton.setToolTipText("Show all controle"); |
---|
1118 | 1122 | allParamsButton.addActionListener(this); |
---|
1119 | 1123 | |
---|
1120 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1121 | 1125 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
1122 | 1126 | clearPanelButton.addActionListener(this); |
---|
1123 | 1127 | |
---|
.. | .. |
---|
1183 | 1187 | dgr.addDragGestureListener(this); |
---|
1184 | 1188 | }catch(Exception e) {} |
---|
1185 | 1189 | */ |
---|
1186 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1190 | + radio.layout = threeButton; // sixButton; |
---|
1187 | 1191 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1188 | 1192 | } |
---|
1189 | 1193 | |
---|
.. | .. |
---|
1234 | 1238 | smoothCB.setToolTipText("Snapping delay"); |
---|
1235 | 1239 | smoothCB.addItemListener(this); |
---|
1236 | 1240 | |
---|
1237 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1238 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1239 | | - slowCB.addItemListener(this); |
---|
| 1241 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1242 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1243 | +// slowCB.addItemListener(this); |
---|
| 1244 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1245 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1246 | + minshaderCB.addItemListener(this); |
---|
1240 | 1247 | |
---|
1241 | 1248 | // constraints.gridy += 1; |
---|
1242 | 1249 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1325 | 1332 | } |
---|
1326 | 1333 | |
---|
1327 | 1334 | radioButton.SetObject(obj); |
---|
1328 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1335 | + radioButton.layout = threeButton; // sixButton; |
---|
1329 | 1336 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1330 | 1337 | radioButton.addActionListener(this); |
---|
1331 | 1338 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1350 | 1357 | cCheckBox localCB; |
---|
1351 | 1358 | cCheckBox crowdCB; |
---|
1352 | 1359 | cCheckBox smoothCB; |
---|
| 1360 | + cCheckBox minshaderCB; |
---|
| 1361 | + |
---|
1353 | 1362 | cToggleButton fastCB; |
---|
1354 | 1363 | cCheckBox slowCB; |
---|
1355 | 1364 | cCheckBox boxCB; |
---|
.. | .. |
---|
1420 | 1429 | { |
---|
1421 | 1430 | cameraView.ToggleInertia(); |
---|
1422 | 1431 | cameraView.repaint(); |
---|
| 1432 | + } |
---|
| 1433 | + else if(e.getSource() == minshaderCB) |
---|
| 1434 | + { |
---|
| 1435 | + Globals.MINSHADER ^= true; |
---|
| 1436 | + cameraView.programInitialized = false; |
---|
| 1437 | + cameraView.repaint(); |
---|
1423 | 1438 | } |
---|
1424 | 1439 | else if(e.getSource() == localCB) |
---|
1425 | 1440 | { |
---|
.. | .. |
---|
2560 | 2575 | if (source == invariantsItem) |
---|
2561 | 2576 | { |
---|
2562 | 2577 | System.out.println("Invariants:"); |
---|
2563 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2578 | + Grafreed.grafreed.universe.invariants(); |
---|
2564 | 2579 | } else |
---|
2565 | 2580 | if (source == memoryItem) |
---|
2566 | 2581 | { |
---|
.. | .. |
---|
2591 | 2606 | { |
---|
2592 | 2607 | ToggleFullScreen(); |
---|
2593 | 2608 | } else |
---|
2594 | | - if (source == undoButton) |
---|
| 2609 | + if (source == previousVersionButton) |
---|
2595 | 2610 | { |
---|
2596 | 2611 | // Go to previous version |
---|
2597 | 2612 | //if (!Undo()) |
---|
2598 | 2613 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2599 | | - Undo(); |
---|
| 2614 | + PreviousVersion(); |
---|
2600 | 2615 | } else |
---|
2601 | 2616 | if (source == restoreButton) |
---|
2602 | 2617 | { |
---|
2603 | 2618 | // Restore current version |
---|
2604 | 2619 | Restore(); |
---|
| 2620 | + //restoreButton.setEnabled(false); |
---|
2605 | 2621 | } else |
---|
2606 | 2622 | if (source == replaceButton) |
---|
2607 | 2623 | { |
---|
2608 | 2624 | // Overwrite current version |
---|
2609 | 2625 | Replace(); |
---|
| 2626 | + //replaceButton.setEnabled(false); |
---|
2610 | 2627 | } else |
---|
2611 | | - if (source == redoButton) |
---|
| 2628 | + if (source == nextVersionButton) |
---|
2612 | 2629 | { |
---|
2613 | 2630 | // Go to next version |
---|
2614 | | - Redo(); |
---|
| 2631 | + NextVersion(); |
---|
2615 | 2632 | } else |
---|
2616 | | - if (source == saveButton) |
---|
| 2633 | + if (source == saveVersionButton) |
---|
2617 | 2634 | { |
---|
2618 | 2635 | // Save a new version |
---|
2619 | 2636 | if (!Save(true)) |
---|
2620 | 2637 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2638 | + } else |
---|
| 2639 | + if (source == deleteVersionButton) |
---|
| 2640 | + { |
---|
| 2641 | + // Delete a new version |
---|
| 2642 | + DeleteVersion(); |
---|
2621 | 2643 | } else |
---|
2622 | 2644 | if (source == oneStepButton) |
---|
2623 | 2645 | { |
---|
.. | .. |
---|
2672 | 2694 | } else |
---|
2673 | 2695 | if (source == undoItem) |
---|
2674 | 2696 | { |
---|
2675 | | - Undo(); |
---|
| 2697 | + PreviousVersion(); |
---|
2676 | 2698 | } else |
---|
2677 | 2699 | if (source == redoItem) |
---|
2678 | 2700 | { |
---|
2679 | | - Redo(); |
---|
| 2701 | + NextVersion(); |
---|
2680 | 2702 | } else |
---|
2681 | 2703 | if (source == duplicateItem) |
---|
2682 | 2704 | { |
---|
.. | .. |
---|
3809 | 3831 | { |
---|
3810 | 3832 | Object3D child = (Object3D)e.nextElement(); |
---|
3811 | 3833 | if(child.editWindow != null) |
---|
3812 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3813 | 3834 | child.pinned = false; |
---|
3814 | 3835 | child.CloseUI(); |
---|
3815 | 3836 | listUI.remove(child); |
---|
| 3837 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3816 | 3838 | |
---|
3817 | 3839 | //child.editWindow = null; // ??????????? |
---|
3818 | 3840 | } |
---|
.. | .. |
---|
3831 | 3853 | obj.CloseUI(); |
---|
3832 | 3854 | } |
---|
3833 | 3855 | listUI.clear(); |
---|
| 3856 | + SetPinStates(group.selection.size() > 0); |
---|
3834 | 3857 | refreshContents(true); |
---|
3835 | 3858 | } else |
---|
3836 | 3859 | if (source == allParamsButton) |
---|
.. | .. |
---|
3917 | 3940 | radio.layout.doClick(); |
---|
3918 | 3941 | |
---|
3919 | 3942 | ClearUnpinned(); |
---|
| 3943 | + |
---|
3920 | 3944 | //Grafreed.Assert(group != null); |
---|
3921 | 3945 | //Grafreed.Assert(group.selection != null); |
---|
3922 | 3946 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3933 | 3957 | } else if (event.getSource() == editCameraItem) |
---|
3934 | 3958 | { |
---|
3935 | 3959 | cameraView.ProtectCamera(); |
---|
| 3960 | + cameraView.requestFocusInWindow(); |
---|
3936 | 3961 | cameraView.repaint(); |
---|
3937 | 3962 | return; |
---|
3938 | 3963 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3939 | 3964 | { |
---|
3940 | 3965 | cameraView.RevertCamera(); |
---|
| 3966 | + cameraView.requestFocusInWindow(); |
---|
3941 | 3967 | cameraView.repaint(); |
---|
3942 | 3968 | return; |
---|
3943 | 3969 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
5070 | 5096 | |
---|
5071 | 5097 | freezemodel = false; |
---|
5072 | 5098 | } |
---|
5073 | | - |
---|
5074 | | - boolean flashIt = true; |
---|
5075 | | - |
---|
| 5099 | + |
---|
5076 | 5100 | public void valueChanged(TreeSelectionEvent e) |
---|
5077 | 5101 | //public boolean handleEvent(Event event) |
---|
5078 | 5102 | { |
---|
.. | .. |
---|
5147 | 5171 | uneditButton.setEnabled(enabled); |
---|
5148 | 5172 | unselectButton.setEnabled(enabled); |
---|
5149 | 5173 | flashSelectionButton.setEnabled(enabled); |
---|
| 5174 | + |
---|
| 5175 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
5150 | 5176 | } |
---|
5151 | 5177 | |
---|
5152 | 5178 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
5987 | 6013 | |
---|
5988 | 6014 | cButton restoreCameraButton; |
---|
5989 | 6015 | |
---|
5990 | | - cButton saveButton; |
---|
5991 | 6016 | cButton oneStepButton; |
---|
5992 | 6017 | |
---|
5993 | 6018 | cButton groupButton; |
---|