.. | .. |
---|
1038 | 1038 | oe.radioPanel.add(dummyButton); |
---|
1039 | 1039 | oe.buttonGroup.add(dummyButton); |
---|
1040 | 1040 | */ |
---|
1041 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1041 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
1042 | 1042 | |
---|
1043 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1043 | + versionManagerPanel.preferredHeight = 4; |
---|
1044 | 1044 | |
---|
1045 | 1045 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
1046 | 1046 | |
---|
.. | .. |
---|
1071 | 1071 | collapseButton.setToolTipText("Collapse toolbar"); |
---|
1072 | 1072 | collapseButton.addActionListener(this); |
---|
1073 | 1073 | |
---|
1074 | | - 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); |
---|
1075 | 1075 | maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
1076 | 1076 | maximize3DButton.addActionListener(this); |
---|
1077 | 1077 | |
---|
.. | .. |
---|
1106 | 1106 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
1107 | 1107 | restoreCameraButton.addActionListener(this); |
---|
1108 | 1108 | |
---|
1109 | | - 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); |
---|
1110 | 1110 | saveVersionButton.setToolTipText("Duplicate current version"); |
---|
1111 | 1111 | saveVersionButton.addActionListener(this); |
---|
1112 | 1112 | |
---|
1113 | | - copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1114 | 1114 | deleteVersionButton.setToolTipText("Delete current version"); |
---|
1115 | 1115 | deleteVersionButton.addActionListener(this); |
---|
1116 | 1116 | deleteVersionButton.setEnabled(false); |
---|
1117 | 1117 | |
---|
1118 | | - copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1119 | 1119 | previousVersionButton.setToolTipText("Previous version"); |
---|
1120 | 1120 | previousVersionButton.addActionListener(this); |
---|
1121 | 1121 | previousVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1131 | 1131 | replaceButton.addActionListener(this); |
---|
1132 | 1132 | replaceButton.setEnabled(false); |
---|
1133 | 1133 | |
---|
1134 | | - copyOptionsPanel.add(updown); |
---|
| 1134 | + versionManagerPanel.add(updown); |
---|
1135 | 1135 | |
---|
1136 | | - copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1137 | 1137 | nextVersionButton.setToolTipText("Next version"); |
---|
1138 | 1138 | nextVersionButton.addActionListener(this); |
---|
1139 | 1139 | nextVersionButton.setEnabled(false); |
---|
.. | .. |
---|
1259 | 1259 | |
---|
1260 | 1260 | CreateTexturePanel(textures); |
---|
1261 | 1261 | |
---|
| 1262 | + resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
| 1263 | + |
---|
1262 | 1264 | oe.toolboxPanel.add(textures); |
---|
1263 | 1265 | |
---|
1264 | 1266 | textures.preferredHeight = 100; |
---|
.. | .. |
---|
1309 | 1311 | |
---|
1310 | 1312 | cGridBag jSPPanel = new cGridBag(); |
---|
1311 | 1313 | |
---|
| 1314 | + jSPPanel.preferredHeight = 20; |
---|
| 1315 | + |
---|
1312 | 1316 | JScrollPane jSP; |
---|
1313 | 1317 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1314 | 1318 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1317 | 1321 | oe.treePanel.add(jSPPanel); |
---|
1318 | 1322 | oe.treePanel.Return(); |
---|
1319 | 1323 | |
---|
1320 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1324 | + oe.treePanel.add(versionManagerPanel); |
---|
1321 | 1325 | oe.treePanel.Return(); |
---|
1322 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1323 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1324 | | - sliderPane.preferredHeight = 1; |
---|
| 1326 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1327 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1328 | + versionSliderPane.preferredHeight = 3; |
---|
1325 | 1329 | |
---|
1326 | 1330 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1327 | 1331 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
3966 | 3970 | if (source == closeButton) |
---|
3967 | 3971 | { |
---|
3968 | 3972 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3973 | + Replace(); |
---|
| 3974 | + |
---|
3969 | 3975 | cRadio ab; |
---|
3970 | 3976 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3971 | 3977 | { |
---|
.. | .. |
---|
4064 | 4070 | } else |
---|
4065 | 4071 | if(source instanceof cRadio) |
---|
4066 | 4072 | { |
---|
| 4073 | + Replace(); |
---|
| 4074 | + |
---|
4067 | 4075 | group.parent = keepparent; |
---|
4068 | 4076 | group.attributes = 0; |
---|
4069 | 4077 | //group.editWindow = null; |
---|
.. | .. |
---|
4119 | 4127 | |
---|
4120 | 4128 | if (copy.versionlist == null) |
---|
4121 | 4129 | { |
---|
4122 | | - copy.versionlist = new Object3D[100]; |
---|
4123 | 4130 | copy.versionindex = -1; |
---|
4124 | 4131 | |
---|
4125 | 4132 | // Cannot work with loops |
---|
4126 | | - // To fix this issue, first mark all nodes above the root, |
---|
| 4133 | + // To fix this issue, we first mark all nodes above the root, |
---|
4127 | 4134 | // and check if any of these nodes are reachable below the root. |
---|
4128 | | - //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); |
---|
4129 | 4145 | } |
---|
4130 | 4146 | |
---|
4131 | 4147 | SetVersionStates(); |
---|
.. | .. |
---|
4273 | 4289 | TouchTransform(obj); |
---|
4274 | 4290 | continue; |
---|
4275 | 4291 | } |
---|
4276 | | - if ((mask&2) != 0) // Scale |
---|
| 4292 | + if ((mask&2) != 0) // Scale/rotation |
---|
4277 | 4293 | { |
---|
4278 | 4294 | obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
4279 | 4295 | obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
.. | .. |
---|
4281 | 4297 | obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
4282 | 4298 | obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4283 | 4299 | obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4284 | | - } |
---|
4285 | | - if ((mask&4) != 0) // Rotation |
---|
4286 | | - { |
---|
4287 | | - // ? |
---|
4288 | 4300 | } |
---|
4289 | 4301 | if ((mask&1) != 0) // Translation |
---|
4290 | 4302 | { |
---|
.. | .. |
---|
5383 | 5395 | |
---|
5384 | 5396 | void refreshContents(boolean cp) |
---|
5385 | 5397 | { |
---|
| 5398 | + if (false) |
---|
5386 | 5399 | //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5387 | 5400 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5388 | 5401 | { |
---|