.. | .. |
---|
415 | 415 | this.copy = this.group = group; |
---|
416 | 416 | //selectees = this.group.selectees; |
---|
417 | 417 | |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
418 | 420 | if (copy.versionlist == null) |
---|
419 | 421 | { |
---|
420 | 422 | copy.versionlist = new Object3D[100]; |
---|
421 | 423 | copy.versionindex = -1; |
---|
422 | 424 | |
---|
423 | | - Save(true); |
---|
| 425 | + //Save(true); |
---|
424 | 426 | } |
---|
425 | 427 | |
---|
426 | 428 | if(ui) |
---|
.. | .. |
---|
449 | 451 | copy.versionlist = new Object3D[100]; |
---|
450 | 452 | copy.versionindex = -1; |
---|
451 | 453 | |
---|
452 | | - Save(true); |
---|
| 454 | + //Save(true); |
---|
453 | 455 | } |
---|
454 | 456 | } |
---|
455 | 457 | |
---|
.. | .. |
---|
1036 | 1038 | oe.radioPanel.add(dummyButton); |
---|
1037 | 1039 | oe.buttonGroup.add(dummyButton); |
---|
1038 | 1040 | */ |
---|
1039 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1041 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1040 | 1042 | |
---|
1041 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1043 | + versionManagerPanel.preferredHeight = 4; |
---|
1042 | 1044 | |
---|
1043 | 1045 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1044 | 1046 | |
---|
.. | .. |
---|
1069 | 1071 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1070 | 1072 | collapseButton.addActionListener(this); |
---|
1071 | 1073 | |
---|
1072 | | - oe.toolbarPanel.add(maximize3DButton = GetButton("icons/empty.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1074 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1073 | 1075 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1074 | 1076 | maximize3DButton.addActionListener(this); |
---|
1075 | 1077 | |
---|
.. | .. |
---|
1104 | 1106 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1105 | 1107 | restoreCameraButton.addActionListener(this); |
---|
1106 | 1108 | |
---|
1107 | | - copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1108 | 1110 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1109 | 1111 | saveVersionButton.addActionListener(this); |
---|
1110 | 1112 | |
---|
1111 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1113 | 1115 | deleteVersionButton.addActionListener(this); |
---|
| 1116 | + deleteVersionButton.setEnabled(false); |
---|
1114 | 1117 | |
---|
1115 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1116 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
1117 | 1120 | previousVersionButton.addActionListener(this); |
---|
1118 | 1121 | previousVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1121 | 1124 | updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1122 | 1125 | restoreButton.setToolTipText("Undo (restore current version)"); |
---|
1123 | 1126 | restoreButton.addActionListener(this); |
---|
1124 | | - //restoreButton.setEnabled(false); |
---|
| 1127 | + restoreButton.setEnabled(false); |
---|
1125 | 1128 | |
---|
1126 | 1129 | updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1127 | 1130 | replaceButton.setToolTipText("Save (replace current version)"); |
---|
1128 | 1131 | replaceButton.addActionListener(this); |
---|
1129 | | - //replaceButton.setEnabled(false); |
---|
| 1132 | + replaceButton.setEnabled(false); |
---|
1130 | 1133 | |
---|
1131 | | - copyOptionsPanel.add(updown); |
---|
| 1134 | + versionManagerPanel.add(updown); |
---|
1132 | 1135 | |
---|
1133 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1134 | 1137 | nextVersionButton.setToolTipText("Next version"); |
---|
1135 | 1138 | nextVersionButton.addActionListener(this); |
---|
1136 | 1139 | nextVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1256 | 1259 | |
---|
1257 | 1260 | CreateTexturePanel(textures); |
---|
1258 | 1261 | |
---|
| 1262 | + resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
| 1263 | + |
---|
1259 | 1264 | oe.toolboxPanel.add(textures); |
---|
1260 | 1265 | |
---|
1261 | 1266 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1306 | 1311 | |
---|
1307 | 1312 | cGridBag jSPPanel = new cGridBag(); |
---|
1308 | 1313 | |
---|
| 1314 | + jSPPanel.preferredHeight = 20; |
---|
| 1315 | + |
---|
1309 | 1316 | JScrollPane jSP; |
---|
1310 | 1317 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1311 | 1318 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1314 | 1321 | oe.treePanel.add(jSPPanel); |
---|
1315 | 1322 | oe.treePanel.Return(); |
---|
1316 | 1323 | |
---|
1317 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1324 | + oe.treePanel.add(versionManagerPanel); |
---|
1318 | 1325 | oe.treePanel.Return(); |
---|
1319 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1320 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1321 | | - sliderPane.preferredHeight = 1; |
---|
| 1326 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1327 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1328 | + versionSliderPane.preferredHeight = 3; |
---|
1322 | 1329 | |
---|
1323 | 1330 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1324 | 1331 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
3963 | 3970 | if (source == closeButton) |
---|
3964 | 3971 | { |
---|
3965 | 3972 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3973 | + Replace(); |
---|
| 3974 | + |
---|
3966 | 3975 | cRadio ab; |
---|
3967 | 3976 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3968 | 3977 | { |
---|
.. | .. |
---|
4061 | 4070 | } else |
---|
4062 | 4071 | if(source instanceof cRadio) |
---|
4063 | 4072 | { |
---|
| 4073 | + Replace(); |
---|
| 4074 | + |
---|
4064 | 4075 | group.parent = keepparent; |
---|
4065 | 4076 | group.attributes = 0; |
---|
4066 | 4077 | //group.editWindow = null; |
---|
.. | .. |
---|
4116 | 4127 | |
---|
4117 | 4128 | if (copy.versionlist == null) |
---|
4118 | 4129 | { |
---|
4119 | | - copy.versionlist = new Object3D[100]; |
---|
4120 | 4130 | copy.versionindex = -1; |
---|
4121 | 4131 | |
---|
4122 | 4132 | // Cannot work with loops |
---|
4123 | | - // To fix this issue, first mark all nodes above the root, |
---|
| 4133 | + // To fix this issue, we first mark all nodes above the root, |
---|
4124 | 4134 | // and check if any of these nodes are reachable below the root. |
---|
4125 | | - //Save(true); |
---|
| 4135 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4136 | + |
---|
| 4137 | + if (!copy.HasTags()) |
---|
| 4138 | + { |
---|
| 4139 | + copy.versionlist = new Object3D[100]; |
---|
| 4140 | + |
---|
| 4141 | + Save(true); |
---|
| 4142 | + } |
---|
| 4143 | + |
---|
| 4144 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
4126 | 4145 | } |
---|
4127 | 4146 | |
---|
4128 | 4147 | SetVersionStates(); |
---|
.. | .. |
---|
4270 | 4289 | TouchTransform(obj); |
---|
4271 | 4290 | continue; |
---|
4272 | 4291 | } |
---|
4273 | | - if ((mask&2) != 0) // Scale |
---|
| 4292 | + if ((mask&2) != 0) // Scale/rotation |
---|
4274 | 4293 | { |
---|
4275 | 4294 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4276 | 4295 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4278 | 4297 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4279 | 4298 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4280 | 4299 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4281 | | - } |
---|
4282 | | - if ((mask&4) != 0) // Rotation |
---|
4283 | | - { |
---|
4284 | | - // ? |
---|
4285 | 4300 | } |
---|
4286 | 4301 | if ((mask&1) != 0) // Translation |
---|
4287 | 4302 | { |
---|
.. | .. |
---|
5380 | 5395 | |
---|
5381 | 5396 | void refreshContents(boolean cp) |
---|
5382 | 5397 | { |
---|
| 5398 | + if (false) |
---|
5383 | 5399 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5384 | 5400 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5385 | 5401 | { |
---|