.. | .. |
---|
316 | 316 | objEditor.ctrlPanel.remove(setupPanel2); |
---|
317 | 317 | objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
318 | 318 | objEditor.ctrlPanel.remove(pushPanel); |
---|
| 319 | + if (versionPanel != null) |
---|
| 320 | + objEditor.ctrlPanel.remove(versionPanel); |
---|
319 | 321 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
320 | 322 | |
---|
321 | 323 | //Remove(normalpushField); |
---|
.. | .. |
---|
383 | 385 | client = inClient; |
---|
384 | 386 | copy = client; |
---|
385 | 387 | |
---|
386 | | - if (copy.versionlist == null) |
---|
387 | | - { |
---|
388 | | - copy.versionlist = new Object3D[100]; |
---|
389 | | - copy.versionindex = -1; |
---|
390 | | - |
---|
391 | | -// Save(true); |
---|
392 | | - } |
---|
393 | | - |
---|
394 | 388 | SetupUI2(callee.GetEditor()); |
---|
395 | 389 | } |
---|
396 | 390 | |
---|
.. | .. |
---|
1171 | 1165 | cGridBag setupPanel2; |
---|
1172 | 1166 | cGridBag objectCommandsPanel; |
---|
1173 | 1167 | cGridBag pushPanel; |
---|
| 1168 | + cGridBag versionPanel; |
---|
1174 | 1169 | cGridBag fillPanel; |
---|
1175 | 1170 | |
---|
1176 | 1171 | JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
.. | .. |
---|
1417 | 1412 | oe.ctrlPanel.add(objectCommandsPanel); |
---|
1418 | 1413 | oe.ctrlPanel.Return(); |
---|
1419 | 1414 | |
---|
1420 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1415 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons |
---|
1421 | 1416 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1422 | | - //Return(); |
---|
| 1417 | + if (false && copy.versionlist != null && copy.versionindex != -1) |
---|
| 1418 | + { |
---|
| 1419 | + oe.ctrlPanel.Return(); |
---|
| 1420 | + versionPanel = AddSlider(oe.ctrlPanel, "Version", 0, copy.VersionCount() - 1, copy.versionindex); |
---|
| 1421 | + versionField = (cNumberSlider)versionPanel.getComponent(1); |
---|
| 1422 | + } |
---|
1423 | 1423 | |
---|
1424 | 1424 | oe.ctrlPanel.Return(); |
---|
1425 | 1425 | |
---|
.. | .. |
---|
1775 | 1775 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1776 | 1776 | |
---|
1777 | 1777 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1778 | | - scenePanel.preferredWidth = 6; |
---|
| 1778 | + scenePanel.preferredWidth = 5; |
---|
1779 | 1779 | |
---|
1780 | 1780 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1781 | 1781 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1884 | 1884 | |
---|
1885 | 1885 | if (Globals.ADVANCED) |
---|
1886 | 1886 | { |
---|
1887 | | - tabbedPane.add(infoPanel); |
---|
1888 | | - tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
1889 | | - tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1887 | + objectPanel.add(infoPanel); |
---|
| 1888 | + objectPanel.setIconAt(5, GetIcon("icons/info.png")); |
---|
| 1889 | + objectPanel.setToolTipTextAt(4, "Information"); |
---|
1890 | 1890 | } |
---|
1891 | 1891 | |
---|
1892 | 1892 | /* |
---|
.. | .. |
---|
2429 | 2429 | cameraField.setFloat(0.001); |
---|
2430 | 2430 | specularField.setFloat(0.001); |
---|
2431 | 2431 | fakedepthField.setFloat(0.001); |
---|
2432 | | - opacityField.setFloat(0.6); |
---|
| 2432 | + opacityField.setFloat(0.4); |
---|
2433 | 2433 | |
---|
2434 | 2434 | materialtouched = true; |
---|
2435 | 2435 | applySelf(); |
---|
.. | .. |
---|
4075 | 4075 | } else if (event.getSource() == link2masterCB) |
---|
4076 | 4076 | { |
---|
4077 | 4077 | copy.link2master ^= true; |
---|
| 4078 | + objEditor.refreshContents(); |
---|
4078 | 4079 | return; |
---|
4079 | 4080 | } |
---|
4080 | 4081 | if (event.getSource() == randomCB) |
---|
.. | .. |
---|
4465 | 4466 | copy.versionindex -= 1; |
---|
4466 | 4467 | |
---|
4467 | 4468 | if (copy.versionindex != -1) |
---|
4468 | | - CopyChanged(); |
---|
| 4469 | + CopyChanged(copy); |
---|
4469 | 4470 | |
---|
4470 | 4471 | SetVersionStates(); |
---|
4471 | 4472 | } |
---|
.. | .. |
---|
4475 | 4476 | System.err.println("Save"); |
---|
4476 | 4477 | Replace(); |
---|
4477 | 4478 | |
---|
4478 | | - //cRadio tab = GetCurrentTab(); |
---|
| 4479 | + if (copy.versionlist == null) |
---|
| 4480 | + { |
---|
| 4481 | + copy.versionlist = new Object3D[100]; |
---|
| 4482 | + copy.versionindex = -1; |
---|
| 4483 | + } |
---|
4479 | 4484 | |
---|
4480 | 4485 | Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4481 | 4486 | |
---|
.. | .. |
---|
4543 | 4548 | { |
---|
4544 | 4549 | Object3D selection = new Object3D(); |
---|
4545 | 4550 | |
---|
4546 | | - for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4551 | + for (int i = 0; i < objEditor.copy.selection.size(); i++) |
---|
4547 | 4552 | { |
---|
4548 | | - Object3D elem = copy.selection.elementAt(i); |
---|
| 4553 | + Object3D elem = objEditor.copy.selection.elementAt(i); |
---|
4549 | 4554 | |
---|
4550 | | - Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4555 | + Object3D obj = objEditor.copy.GetObject(elem.GetUUID()); |
---|
4551 | 4556 | |
---|
4552 | 4557 | if (obj == null) |
---|
4553 | 4558 | { |
---|
4554 | | - copy.selection.remove(i--); |
---|
| 4559 | + objEditor.copy.selection.remove(i--); |
---|
4555 | 4560 | } |
---|
4556 | 4561 | else |
---|
4557 | 4562 | { |
---|
4558 | 4563 | selection.add(obj); |
---|
4559 | | - copy.selection.setElementAt(obj, i); |
---|
| 4564 | + objEditor.copy.selection.setElementAt(obj, i); |
---|
4560 | 4565 | } |
---|
4561 | 4566 | } |
---|
4562 | 4567 | |
---|
.. | .. |
---|
4569 | 4574 | //refreshContents(false); |
---|
4570 | 4575 | } |
---|
4571 | 4576 | |
---|
4572 | | - void CopyChanged() |
---|
| 4577 | + void CopyChanged(Object3D changed) |
---|
4573 | 4578 | { |
---|
4574 | | - Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4575 | | - |
---|
4576 | | - SetVersionStates(); |
---|
| 4579 | + Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]); |
---|
4577 | 4580 | |
---|
4578 | 4581 | boolean temp = CameraPane.SWITCH; |
---|
4579 | 4582 | CameraPane.SWITCH = false; |
---|
4580 | 4583 | |
---|
4581 | | - copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4584 | + changed.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4582 | 4585 | |
---|
4583 | | - copy.clear(); |
---|
| 4586 | + changed.clear(); |
---|
4584 | 4587 | |
---|
4585 | | - copy.skyboxname = obj.skyboxname; |
---|
4586 | | - copy.skyboxext = obj.skyboxext; |
---|
| 4588 | + changed.skyboxname = obj.skyboxname; |
---|
| 4589 | + changed.skyboxext = obj.skyboxext; |
---|
4587 | 4590 | |
---|
4588 | 4591 | for (int i=0; i<obj.Size(); i++) |
---|
4589 | 4592 | { |
---|
4590 | | - copy.add(obj.get(i)); |
---|
| 4593 | + changed.add(obj.get(i)); |
---|
4591 | 4594 | } |
---|
4592 | 4595 | |
---|
4593 | | - copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4596 | + changed.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4594 | 4597 | |
---|
4595 | 4598 | CameraPane.SWITCH = temp; |
---|
4596 | 4599 | |
---|
4597 | | - RefreshSelection(); |
---|
| 4600 | + if (objEditor == this) |
---|
| 4601 | + RefreshSelection(); |
---|
4598 | 4602 | //assert(hashtable.isEmpty()); |
---|
4599 | 4603 | |
---|
4600 | | - copy.Touch(); |
---|
| 4604 | + objEditor.copy.Touch(); |
---|
4601 | 4605 | |
---|
4602 | 4606 | ResetModel(); |
---|
4603 | | - copy.HardTouch(); // recompile? |
---|
| 4607 | + objEditor.copy.HardTouch(); // recompile? |
---|
4604 | 4608 | |
---|
4605 | 4609 | cRadio ab; |
---|
4606 | | - for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4610 | + for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();) |
---|
4607 | 4611 | { |
---|
4608 | 4612 | ab = (cRadio)e.nextElement(); |
---|
4609 | | - Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4613 | + Object3D test = objEditor.copy.GetObject(ab.object.GetUUID()); |
---|
4610 | 4614 | //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
4611 | 4615 | if (test != null) |
---|
4612 | 4616 | { |
---|
.. | .. |
---|
4615 | 4619 | } |
---|
4616 | 4620 | } |
---|
4617 | 4621 | |
---|
4618 | | - refreshContents(true); |
---|
| 4622 | + objEditor.refreshContents(true); |
---|
4619 | 4623 | } |
---|
4620 | 4624 | |
---|
4621 | 4625 | cButton previousVersionButton; |
---|
.. | .. |
---|
4629 | 4633 | |
---|
4630 | 4634 | int VersionCount() |
---|
4631 | 4635 | { |
---|
4632 | | - int count = 0; |
---|
4633 | | - |
---|
4634 | | - for (int i = copy.versionlist.length; --i >= 0;) |
---|
4635 | | - { |
---|
4636 | | - if (copy.versionlist[i] != null) |
---|
4637 | | - count++; |
---|
4638 | | - } |
---|
4639 | | - |
---|
4640 | | - return count; |
---|
| 4636 | + return copy.VersionCount(); |
---|
4641 | 4637 | } |
---|
4642 | 4638 | |
---|
4643 | 4639 | public cGridBag versionSliderPane; |
---|
.. | .. |
---|
4649 | 4645 | |
---|
4650 | 4646 | //cRadio tab = GetCurrentTab(); |
---|
4651 | 4647 | |
---|
4652 | | - if (copy.versionlist == null) |
---|
| 4648 | + if (copy.versionindex == -2) |
---|
4653 | 4649 | { |
---|
4654 | 4650 | saveVersionButton.setEnabled(false); |
---|
4655 | 4651 | restoreButton.setEnabled(false); |
---|
.. | .. |
---|
4711 | 4707 | |
---|
4712 | 4708 | copy.versionindex -= 1; |
---|
4713 | 4709 | |
---|
4714 | | - CopyChanged(); |
---|
| 4710 | + CopyChanged(copy); |
---|
| 4711 | + |
---|
| 4712 | + SetVersionStates(); |
---|
4715 | 4713 | |
---|
4716 | 4714 | return true; |
---|
4717 | 4715 | } |
---|
.. | .. |
---|
4729 | 4727 | } |
---|
4730 | 4728 | |
---|
4731 | 4729 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
4732 | | - CopyChanged(); |
---|
| 4730 | + CopyChanged(copy); |
---|
| 4731 | + |
---|
| 4732 | + SetVersionStates(); |
---|
4733 | 4733 | |
---|
4734 | 4734 | return true; |
---|
4735 | 4735 | } |
---|
.. | .. |
---|
4766 | 4766 | |
---|
4767 | 4767 | copy.versionindex += 1; |
---|
4768 | 4768 | |
---|
4769 | | - CopyChanged(); |
---|
| 4769 | + CopyChanged(copy); |
---|
4770 | 4770 | |
---|
4771 | 4771 | //if (!tab.user[tab.versionindex]) |
---|
4772 | 4772 | // tab.graphs[tab.versionindex] = null; |
---|
| 4773 | + |
---|
| 4774 | + SetVersionStates(); |
---|
4773 | 4775 | } |
---|
4774 | 4776 | |
---|
4775 | 4777 | void ImportGFD() |
---|
.. | .. |
---|
5098 | 5100 | } |
---|
5099 | 5101 | |
---|
5100 | 5102 | cNumberSlider versionSlider; |
---|
| 5103 | + cNumberSlider versionField; |
---|
5101 | 5104 | |
---|
5102 | 5105 | public void stateChanged(ChangeEvent e) |
---|
5103 | 5106 | { |
---|
.. | .. |
---|
5114 | 5117 | if (version != -1 && copy.versionlist[version] != null) |
---|
5115 | 5118 | { |
---|
5116 | 5119 | copy.versionindex = version; |
---|
5117 | | - CopyChanged(); |
---|
| 5120 | + CopyChanged(copy); |
---|
| 5121 | + SetVersionStates(); |
---|
5118 | 5122 | } |
---|
5119 | 5123 | |
---|
5120 | 5124 | return; |
---|
5121 | 5125 | } |
---|
5122 | 5126 | |
---|
| 5127 | + if (e.getSource() == versionField) |
---|
| 5128 | + { |
---|
| 5129 | + int version = versionField.getInteger(); |
---|
| 5130 | + |
---|
| 5131 | + if (version != -1 && copy.versionindex != version && copy.versionlist[version] != null) |
---|
| 5132 | + { |
---|
| 5133 | + copy.versionindex = version; |
---|
| 5134 | + CopyChanged(copy); |
---|
| 5135 | + } |
---|
| 5136 | + |
---|
| 5137 | + return; |
---|
| 5138 | + } |
---|
| 5139 | + |
---|
5123 | 5140 | if (freezematerial) |
---|
5124 | 5141 | { |
---|
5125 | 5142 | return; |
---|
.. | .. |
---|
5209 | 5226 | } |
---|
5210 | 5227 | |
---|
5211 | 5228 | if (normalpushField != null) |
---|
5212 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
| 5229 | + copy.NORMALPUSH = (float)normalpushField.getFloat() / 100; |
---|
5213 | 5230 | } |
---|
5214 | 5231 | |
---|
5215 | 5232 | void SnapObject() |
---|
.. | .. |
---|
5583 | 5600 | void ResetModel() |
---|
5584 | 5601 | { |
---|
5585 | 5602 | //assert(copy instanceof Composite); |
---|
5586 | | - Object3D /*Composite*/ group = (Object3D /*Composite*/) copy; |
---|
| 5603 | + Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy; |
---|
5587 | 5604 | |
---|
5588 | 5605 | // necessary? group.selection = new Object3D(); // java.util.Vector(); |
---|
5589 | 5606 | |
---|
.. | .. |
---|
5594 | 5611 | //group.refreshEditWindow(); |
---|
5595 | 5612 | //refreshContents(); |
---|
5596 | 5613 | |
---|
5597 | | - if (copy.selection == null) |
---|
| 5614 | + if (objEditor.copy.selection == null) |
---|
5598 | 5615 | { |
---|
5599 | | - copy.selection = new Object3D(); |
---|
| 5616 | + objEditor.copy.selection = new Object3D(); |
---|
5600 | 5617 | } |
---|
5601 | 5618 | |
---|
5602 | | - for (int j = 0; j < copy.selection.size(); j++) |
---|
| 5619 | + for (int j = 0; j < objEditor.copy.selection.size(); j++) |
---|
5603 | 5620 | { |
---|
5604 | | - Object3D item = copy.selection.get(j); |
---|
| 5621 | + Object3D item = objEditor.copy.selection.get(j); |
---|
5605 | 5622 | |
---|
5606 | 5623 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5607 | 5624 | { |
---|
.. | .. |
---|
5610 | 5627 | |
---|
5611 | 5628 | if (item.count <= 1) // ??? == 0) |
---|
5612 | 5629 | { |
---|
5613 | | - copy.selection.remove(item); |
---|
| 5630 | + objEditor.copy.selection.remove(item); |
---|
5614 | 5631 | } |
---|
5615 | 5632 | } |
---|
5616 | 5633 | |
---|
5617 | 5634 | boolean first = true; |
---|
5618 | 5635 | |
---|
5619 | | - for (int i = copy.selection.size(); --i >= 0;) |
---|
| 5636 | + for (int i = objEditor.copy.selection.size(); --i >= 0;) |
---|
5620 | 5637 | { |
---|
5621 | | - Object3D item = copy.selection.get(i); |
---|
| 5638 | + Object3D item = objEditor.copy.selection.get(i); |
---|
5622 | 5639 | |
---|
5623 | 5640 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5624 | 5641 | { |
---|