.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.SAVEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 90 | + Globals.SAVEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.SAVEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
380 | 385 | shadowYItem.addActionListener(this); |
---|
381 | 386 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
383 | 391 | if (Globals.ADVANCED) |
---|
384 | 392 | { |
---|
385 | 393 | menu.add("-"); |
---|
386 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 395 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 397 | templateItem.addActionListener(this); |
---|
392 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
601 | 607 | fullButton.setToolTipText("Full-screen window"); |
---|
602 | 608 | fullButton.addActionListener(this); |
---|
603 | 609 | |
---|
| 610 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 612 | + screenfitButton.addActionListener(this); |
---|
| 613 | + |
---|
604 | 614 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | 615 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
606 | 616 | restoreCameraButton.addActionListener(this); |
---|
.. | .. |
---|
633 | 643 | |
---|
634 | 644 | //oe.toolboxPanel.Return(); |
---|
635 | 645 | |
---|
636 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
638 | | - screenfitButton.addActionListener(this); |
---|
639 | | - |
---|
640 | 646 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
641 | 647 | // trackCB.setToolTipText("Enable tracking"); |
---|
642 | 648 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
970 | 976 | { |
---|
971 | 977 | cRadio radioButton = new cRadio(obj.name); |
---|
972 | 978 | |
---|
973 | | - // Patch to avoid bug with transparency. |
---|
| 979 | + // June 2019. Patch to avoid bug with transparency. |
---|
974 | 980 | radioButton.hadMaterial = obj.material != null; |
---|
975 | 981 | if (!radioButton.hadMaterial) |
---|
976 | 982 | { |
---|
.. | .. |
---|
1214 | 1220 | } |
---|
1215 | 1221 | } |
---|
1216 | 1222 | |
---|
1217 | | - String string = (String) object; |
---|
1218 | | - |
---|
1219 | 1223 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1220 | 1224 | // if( object instanceof java.io.File[]) |
---|
1221 | 1225 | // { |
---|
.. | .. |
---|
1223 | 1227 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1224 | 1228 | // return; |
---|
1225 | 1229 | // } |
---|
| 1230 | + |
---|
| 1231 | + String string = object.toString(); |
---|
1226 | 1232 | |
---|
1227 | 1233 | // File path for Mac and Windows |
---|
1228 | 1234 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1472 | 1478 | animationItem.addItemListener(this); |
---|
1473 | 1479 | animationItem.setState(Globals.ANIMATION); |
---|
1474 | 1480 | |
---|
1475 | | - menu.add(archiveItem = new CheckboxMenuItem("Archive3D...")); |
---|
1476 | | - archiveItem.addItemListener(this); |
---|
| 1481 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1482 | + archiveItem.addActionListener(this); |
---|
1477 | 1483 | |
---|
1478 | 1484 | menu.add("-"); |
---|
1479 | 1485 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
.. | .. |
---|
1487 | 1493 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1488 | 1494 | reduce34MorphItem.addActionListener(this); |
---|
1489 | 1495 | menu.add("-"); |
---|
| 1496 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1497 | + memoryItem.addActionListener(this); |
---|
1490 | 1498 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1491 | 1499 | computeAOItem.addActionListener(this); |
---|
1492 | 1500 | |
---|
.. | .. |
---|
1495 | 1503 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1496 | 1504 | mirrorItem.addActionListener(this); |
---|
1497 | 1505 | menu.add("-"); |
---|
1498 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1499 | | - memoryItem.addActionListener(this); |
---|
1500 | 1506 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1501 | 1507 | analyzeItem.addActionListener(this); |
---|
1502 | 1508 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
2219 | 2225 | } else |
---|
2220 | 2226 | if (source == undoButton) |
---|
2221 | 2227 | { |
---|
2222 | | - Undo(); |
---|
| 2228 | + if (!Undo()) |
---|
| 2229 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2223 | 2230 | } else |
---|
2224 | 2231 | if (source == redoButton) |
---|
2225 | 2232 | { |
---|
.. | .. |
---|
2227 | 2234 | } else |
---|
2228 | 2235 | if (source == saveButton) |
---|
2229 | 2236 | { |
---|
2230 | | - Save(); |
---|
| 2237 | + if (!Save(true)) |
---|
| 2238 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2231 | 2239 | } else |
---|
2232 | 2240 | if (source == oneStepButton) |
---|
2233 | 2241 | { |
---|
.. | .. |
---|
2236 | 2244 | } else |
---|
2237 | 2245 | if (source == screenfitButton) |
---|
2238 | 2246 | { |
---|
2239 | | - //Reload(lastConverter, lastFilename, true); |
---|
2240 | 2247 | ScreenFit(); |
---|
2241 | 2248 | } else |
---|
2242 | 2249 | if (source == screenfitpointButton) |
---|
2243 | 2250 | { |
---|
2244 | | - //Reload(lastConverter, lastFilename, true); |
---|
2245 | 2251 | ScreenFitPoint(); |
---|
2246 | 2252 | } else |
---|
2247 | 2253 | if (source == snapobjectButton) |
---|
2248 | 2254 | { |
---|
2249 | | - //Reload(lastConverter, lastFilename, true); |
---|
2250 | 2255 | SnapObject(); |
---|
2251 | 2256 | } else |
---|
2252 | 2257 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
4734 | 4739 | void refreshContents(boolean cp) |
---|
4735 | 4740 | { |
---|
4736 | 4741 | if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4737 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4742 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4738 | 4743 | { |
---|
4739 | 4744 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4740 | 4745 | |
---|
.. | .. |
---|
4833 | 4838 | |
---|
4834 | 4839 | if (cut) |
---|
4835 | 4840 | { |
---|
4836 | | - if (Globals.SAVEONMAKE) |
---|
4837 | | - Save(); |
---|
| 4841 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4842 | +// Save(); |
---|
4838 | 4843 | //int indices[] = jList.getSelectedIndices(); |
---|
4839 | 4844 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4840 | 4845 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4937 | 4942 | |
---|
4938 | 4943 | void paste(boolean expand) |
---|
4939 | 4944 | { |
---|
| 4945 | + if (Globals.SAVEONMAKE) |
---|
| 4946 | + Save(); |
---|
| 4947 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 4948 | + Globals.SAVEONMAKE = false; |
---|
4940 | 4949 | // if (GrafreeD.clipboard == null) |
---|
4941 | 4950 | // return; |
---|
4942 | 4951 | boolean first = true; |
---|
.. | .. |
---|
4996 | 5005 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4997 | 5006 | } |
---|
4998 | 5007 | |
---|
| 5008 | + Globals.SAVEONMAKE = keep; |
---|
4999 | 5009 | ResetModel(); |
---|
5000 | 5010 | refreshContents(); |
---|
5001 | 5011 | } |
---|
.. | .. |
---|
5131 | 5141 | |
---|
5132 | 5142 | void group(Object3D csg, boolean grab) |
---|
5133 | 5143 | { |
---|
| 5144 | + if (Globals.SAVEONMAKE) |
---|
| 5145 | + Save(); |
---|
| 5146 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5147 | + Globals.SAVEONMAKE = false; |
---|
5134 | 5148 | if (//false) // why?? |
---|
5135 | 5149 | !group.selection.isEmpty()) |
---|
5136 | 5150 | { |
---|
.. | .. |
---|
5244 | 5258 | //node.add(csg); |
---|
5245 | 5259 | //makeSomething(node); |
---|
5246 | 5260 | makeSomething(csg); |
---|
| 5261 | + Globals.SAVEONMAKE = keep; |
---|
5247 | 5262 | } |
---|
5248 | 5263 | |
---|
5249 | 5264 | void Ungroup(Object3D g) |
---|
5250 | 5265 | { |
---|
| 5266 | + if (Globals.SAVEONMAKE) |
---|
| 5267 | + Save(); |
---|
| 5268 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5269 | + Globals.SAVEONMAKE = false; |
---|
5251 | 5270 | if (g instanceof HiddenObject) |
---|
5252 | 5271 | { |
---|
5253 | 5272 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5264 | 5283 | objEditor.makeSomething(g.get(i), false); |
---|
5265 | 5284 | } |
---|
5266 | 5285 | } |
---|
| 5286 | + Globals.SAVEONMAKE = keep; |
---|
5267 | 5287 | } |
---|
5268 | 5288 | |
---|
5269 | 5289 | void ungroup() |
---|