.. | .. |
---|
410 | 410 | { |
---|
411 | 411 | copy.versionlist = new Object3D[100]; |
---|
412 | 412 | copy.versionindex = -1; |
---|
| 413 | + |
---|
| 414 | + Save(true); |
---|
413 | 415 | } |
---|
414 | 416 | |
---|
415 | 417 | if(ui) |
---|
.. | .. |
---|
641 | 643 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
642 | 644 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
643 | 645 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
644 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
645 | 646 | oe.cameraMenu.add("-"); |
---|
646 | 647 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
647 | 648 | openWindowItem.addActionListener(this); |
---|
648 | | - editLeafItem.addActionListener(this); |
---|
649 | 649 | lookAtItem.addActionListener(this); |
---|
650 | 650 | //lookFromItem.addActinoListener(this); |
---|
651 | 651 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
893 | 893 | shareGeometriesItem.addActionListener(this); |
---|
894 | 894 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
895 | 895 | mergeGeometriesItem.addActionListener(this); |
---|
| 896 | + menu.add("-"); |
---|
| 897 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 898 | + editLeafItem.addActionListener(this); |
---|
896 | 899 | if (Globals.ADVANCED) |
---|
897 | 900 | { |
---|
898 | 901 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
1026 | 1029 | |
---|
1027 | 1030 | if (Globals.ADVANCED) |
---|
1028 | 1031 | { |
---|
1029 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1030 | | - maxButton.setToolTipText("Maximize window"); |
---|
1031 | | - maxButton.addActionListener(this); |
---|
| 1032 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1034 | +// maxButton.addActionListener(this); |
---|
1032 | 1035 | } |
---|
1033 | 1036 | |
---|
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 | | - }); |
---|
| 1037 | +// cButton gcButton; |
---|
| 1038 | +// |
---|
| 1039 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1040 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1041 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1042 | +// { |
---|
| 1043 | +// public void actionPerformed(ActionEvent e) |
---|
| 1044 | +// { |
---|
| 1045 | +// System.gc(); |
---|
| 1046 | +// } |
---|
| 1047 | +// }); |
---|
1045 | 1048 | |
---|
1046 | 1049 | oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1047 | 1050 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
.. | .. |
---|
1162 | 1165 | |
---|
1163 | 1166 | // INSERT |
---|
1164 | 1167 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1165 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1168 | + gridButton.setToolTipText("Create ground"); |
---|
1166 | 1169 | gridButton.addActionListener(this); |
---|
1167 | 1170 | |
---|
1168 | 1171 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1454 | 1457 | |
---|
1455 | 1458 | void EditObject(Object3D obj) |
---|
1456 | 1459 | { |
---|
| 1460 | + assert(obj instanceof Composite); |
---|
| 1461 | + |
---|
| 1462 | + if (obj.versionlist == null) |
---|
| 1463 | + { |
---|
| 1464 | + obj.versionlist = new Object3D[100]; |
---|
| 1465 | + obj.versionindex = -1; |
---|
| 1466 | + } |
---|
| 1467 | + |
---|
1457 | 1468 | cRadio radioButton = new cRadio(obj.name); |
---|
1458 | 1469 | |
---|
1459 | 1470 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
3892 | 3903 | } else |
---|
3893 | 3904 | if (source == rootButton) |
---|
3894 | 3905 | { |
---|
| 3906 | + Replace(); |
---|
3895 | 3907 | Object3D obj; |
---|
3896 | 3908 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3897 | 3909 | { |
---|
.. | .. |
---|
4028 | 4040 | |
---|
4029 | 4041 | copy = group; |
---|
4030 | 4042 | |
---|
4031 | | - SetUndoStates(); |
---|
4032 | | - |
---|
4033 | 4043 | //Globals.theRenderer.object = group; |
---|
4034 | 4044 | if(!useclient) |
---|
4035 | 4045 | { |
---|
.. | .. |
---|
4057 | 4067 | */ |
---|
4058 | 4068 | radio.layout.doClick(); |
---|
4059 | 4069 | |
---|
| 4070 | + SetUndoStates(); |
---|
| 4071 | + |
---|
4060 | 4072 | ClearUnpinned(); |
---|
4061 | 4073 | |
---|
4062 | 4074 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5291 | 5303 | flashSelectionButton.setEnabled(enabled); |
---|
5292 | 5304 | |
---|
5293 | 5305 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5306 | + |
---|
| 5307 | + boolean allComposites = true; |
---|
| 5308 | + |
---|
| 5309 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5310 | + { |
---|
| 5311 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5312 | + { |
---|
| 5313 | + allComposites = false; |
---|
| 5314 | + break; |
---|
| 5315 | + } |
---|
| 5316 | + } |
---|
| 5317 | + |
---|
| 5318 | + rootButton.setEnabled(allComposites); |
---|
5294 | 5319 | } |
---|
5295 | 5320 | |
---|
5296 | 5321 | void refreshContents(boolean cp) |
---|