.. | .. |
---|
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("Duplicate current 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 version (undo latest change)"); |
---|
| 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 version (save latest change)"); |
---|
| 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"); |
---|
.. | .. |
---|
2571 | 2588 | if (source == invariantsItem) |
---|
2572 | 2589 | { |
---|
2573 | 2590 | System.out.println("Invariants:"); |
---|
2574 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2591 | + Grafreed.grafreed.universe.invariants(); |
---|
2575 | 2592 | } else |
---|
2576 | 2593 | if (source == memoryItem) |
---|
2577 | 2594 | { |
---|
.. | .. |
---|
2602 | 2619 | { |
---|
2603 | 2620 | ToggleFullScreen(); |
---|
2604 | 2621 | } else |
---|
2605 | | - if (source == undoButton) |
---|
| 2622 | + if (source == previousVersionButton) |
---|
2606 | 2623 | { |
---|
2607 | 2624 | // Go to previous version |
---|
2608 | 2625 | //if (!Undo()) |
---|
2609 | 2626 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2610 | | - Undo(); |
---|
| 2627 | + PreviousVersion(); |
---|
2611 | 2628 | } else |
---|
2612 | 2629 | if (source == restoreButton) |
---|
2613 | 2630 | { |
---|
2614 | 2631 | // Restore current version |
---|
2615 | 2632 | Restore(); |
---|
| 2633 | + //restoreButton.setEnabled(false); |
---|
2616 | 2634 | } else |
---|
2617 | 2635 | if (source == replaceButton) |
---|
2618 | 2636 | { |
---|
2619 | 2637 | // Overwrite current version |
---|
2620 | 2638 | Replace(); |
---|
| 2639 | + //replaceButton.setEnabled(false); |
---|
2621 | 2640 | } else |
---|
2622 | | - if (source == redoButton) |
---|
| 2641 | + if (source == nextVersionButton) |
---|
2623 | 2642 | { |
---|
2624 | 2643 | // Go to next version |
---|
2625 | | - Redo(); |
---|
| 2644 | + NextVersion(); |
---|
2626 | 2645 | } else |
---|
2627 | | - if (source == saveButton) |
---|
| 2646 | + if (source == saveVersionButton) |
---|
2628 | 2647 | { |
---|
2629 | 2648 | // Save a new version |
---|
2630 | 2649 | if (!Save(true)) |
---|
2631 | 2650 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2651 | + } else |
---|
| 2652 | + if (source == deleteVersionButton) |
---|
| 2653 | + { |
---|
| 2654 | + // Delete a new version |
---|
| 2655 | + DeleteVersion(); |
---|
2632 | 2656 | } else |
---|
2633 | 2657 | if (source == oneStepButton) |
---|
2634 | 2658 | { |
---|
.. | .. |
---|
2683 | 2707 | } else |
---|
2684 | 2708 | if (source == undoItem) |
---|
2685 | 2709 | { |
---|
2686 | | - Undo(); |
---|
| 2710 | + PreviousVersion(); |
---|
2687 | 2711 | } else |
---|
2688 | 2712 | if (source == redoItem) |
---|
2689 | 2713 | { |
---|
2690 | | - Redo(); |
---|
| 2714 | + NextVersion(); |
---|
2691 | 2715 | } else |
---|
2692 | 2716 | if (source == duplicateItem) |
---|
2693 | 2717 | { |
---|
.. | .. |
---|
3820 | 3844 | { |
---|
3821 | 3845 | Object3D child = (Object3D)e.nextElement(); |
---|
3822 | 3846 | if(child.editWindow != null) |
---|
3823 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3824 | 3847 | child.pinned = false; |
---|
3825 | 3848 | child.CloseUI(); |
---|
3826 | 3849 | listUI.remove(child); |
---|
| 3850 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3827 | 3851 | |
---|
3828 | 3852 | //child.editWindow = null; // ??????????? |
---|
3829 | 3853 | } |
---|
.. | .. |
---|
3842 | 3866 | obj.CloseUI(); |
---|
3843 | 3867 | } |
---|
3844 | 3868 | listUI.clear(); |
---|
| 3869 | + SetPinStates(group.selection.size() > 0); |
---|
3845 | 3870 | refreshContents(true); |
---|
3846 | 3871 | } else |
---|
3847 | 3872 | if (source == allParamsButton) |
---|
.. | .. |
---|
3928 | 3953 | radio.layout.doClick(); |
---|
3929 | 3954 | |
---|
3930 | 3955 | ClearUnpinned(); |
---|
| 3956 | + |
---|
3931 | 3957 | //Grafreed.Assert(group != null); |
---|
3932 | 3958 | //Grafreed.Assert(group.selection != null); |
---|
3933 | 3959 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
5083 | 5109 | |
---|
5084 | 5110 | freezemodel = false; |
---|
5085 | 5111 | } |
---|
5086 | | - |
---|
5087 | | - boolean flashIt = true; |
---|
5088 | | - |
---|
| 5112 | + |
---|
5089 | 5113 | public void valueChanged(TreeSelectionEvent e) |
---|
5090 | 5114 | //public boolean handleEvent(Event event) |
---|
5091 | 5115 | { |
---|
.. | .. |
---|
5158 | 5182 | { |
---|
5159 | 5183 | editButton.setEnabled(enabled); |
---|
5160 | 5184 | uneditButton.setEnabled(enabled); |
---|
5161 | | - unselectButton.setEnabled(enabled); |
---|
| 5185 | + //unselectButton.setEnabled(enabled); |
---|
5162 | 5186 | flashSelectionButton.setEnabled(enabled); |
---|
| 5187 | + |
---|
| 5188 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
5163 | 5189 | } |
---|
5164 | 5190 | |
---|
5165 | 5191 | void refreshContents(boolean cp) |
---|
5166 | 5192 | { |
---|
5167 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5193 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5168 | 5194 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5169 | 5195 | { |
---|
5170 | 5196 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
6000 | 6026 | |
---|
6001 | 6027 | cButton restoreCameraButton; |
---|
6002 | 6028 | |
---|
6003 | | - cButton saveButton; |
---|
6004 | 6029 | cButton oneStepButton; |
---|
6005 | 6030 | |
---|
6006 | 6031 | cButton groupButton; |
---|