.. | .. |
---|
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); |
---|
.. | .. |
---|
1163 | 1165 | cGridBag setupPanel2; |
---|
1164 | 1166 | cGridBag objectCommandsPanel; |
---|
1165 | 1167 | cGridBag pushPanel; |
---|
| 1168 | + cGridBag versionPanel; |
---|
1166 | 1169 | cGridBag fillPanel; |
---|
1167 | 1170 | |
---|
1168 | 1171 | JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
.. | .. |
---|
1409 | 1412 | oe.ctrlPanel.add(objectCommandsPanel); |
---|
1410 | 1413 | oe.ctrlPanel.Return(); |
---|
1411 | 1414 | |
---|
1412 | | - 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 |
---|
1413 | 1416 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1414 | | - //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 | + } |
---|
1415 | 1423 | |
---|
1416 | 1424 | oe.ctrlPanel.Return(); |
---|
1417 | 1425 | |
---|
.. | .. |
---|
2421 | 2429 | cameraField.setFloat(0.001); |
---|
2422 | 2430 | specularField.setFloat(0.001); |
---|
2423 | 2431 | fakedepthField.setFloat(0.001); |
---|
2424 | | - opacityField.setFloat(0.6); |
---|
| 2432 | + opacityField.setFloat(0.4); |
---|
2425 | 2433 | |
---|
2426 | 2434 | materialtouched = true; |
---|
2427 | 2435 | applySelf(); |
---|
.. | .. |
---|
4067 | 4075 | } else if (event.getSource() == link2masterCB) |
---|
4068 | 4076 | { |
---|
4069 | 4077 | copy.link2master ^= true; |
---|
| 4078 | + objEditor.refreshContents(); |
---|
4070 | 4079 | return; |
---|
4071 | 4080 | } |
---|
4072 | 4081 | if (event.getSource() == randomCB) |
---|
.. | .. |
---|
4457 | 4466 | copy.versionindex -= 1; |
---|
4458 | 4467 | |
---|
4459 | 4468 | if (copy.versionindex != -1) |
---|
4460 | | - CopyChanged(); |
---|
| 4469 | + CopyChanged(copy); |
---|
4461 | 4470 | |
---|
4462 | 4471 | SetVersionStates(); |
---|
4463 | 4472 | } |
---|
.. | .. |
---|
4539 | 4548 | { |
---|
4540 | 4549 | Object3D selection = new Object3D(); |
---|
4541 | 4550 | |
---|
4542 | | - for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4551 | + for (int i = 0; i < objEditor.copy.selection.size(); i++) |
---|
4543 | 4552 | { |
---|
4544 | | - Object3D elem = copy.selection.elementAt(i); |
---|
| 4553 | + Object3D elem = objEditor.copy.selection.elementAt(i); |
---|
4545 | 4554 | |
---|
4546 | | - Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4555 | + Object3D obj = objEditor.copy.GetObject(elem.GetUUID()); |
---|
4547 | 4556 | |
---|
4548 | 4557 | if (obj == null) |
---|
4549 | 4558 | { |
---|
4550 | | - copy.selection.remove(i--); |
---|
| 4559 | + objEditor.copy.selection.remove(i--); |
---|
4551 | 4560 | } |
---|
4552 | 4561 | else |
---|
4553 | 4562 | { |
---|
4554 | 4563 | selection.add(obj); |
---|
4555 | | - copy.selection.setElementAt(obj, i); |
---|
| 4564 | + objEditor.copy.selection.setElementAt(obj, i); |
---|
4556 | 4565 | } |
---|
4557 | 4566 | } |
---|
4558 | 4567 | |
---|
.. | .. |
---|
4565 | 4574 | //refreshContents(false); |
---|
4566 | 4575 | } |
---|
4567 | 4576 | |
---|
4568 | | - void CopyChanged() |
---|
| 4577 | + void CopyChanged(Object3D changed) |
---|
4569 | 4578 | { |
---|
4570 | | - Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4571 | | - |
---|
4572 | | - SetVersionStates(); |
---|
| 4579 | + Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]); |
---|
4573 | 4580 | |
---|
4574 | 4581 | boolean temp = CameraPane.SWITCH; |
---|
4575 | 4582 | CameraPane.SWITCH = false; |
---|
4576 | 4583 | |
---|
4577 | | - copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4584 | + changed.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4578 | 4585 | |
---|
4579 | | - copy.clear(); |
---|
| 4586 | + changed.clear(); |
---|
4580 | 4587 | |
---|
4581 | | - copy.skyboxname = obj.skyboxname; |
---|
4582 | | - copy.skyboxext = obj.skyboxext; |
---|
| 4588 | + changed.skyboxname = obj.skyboxname; |
---|
| 4589 | + changed.skyboxext = obj.skyboxext; |
---|
4583 | 4590 | |
---|
4584 | 4591 | for (int i=0; i<obj.Size(); i++) |
---|
4585 | 4592 | { |
---|
4586 | | - copy.add(obj.get(i)); |
---|
| 4593 | + changed.add(obj.get(i)); |
---|
4587 | 4594 | } |
---|
4588 | 4595 | |
---|
4589 | | - copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4596 | + changed.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4590 | 4597 | |
---|
4591 | 4598 | CameraPane.SWITCH = temp; |
---|
4592 | 4599 | |
---|
4593 | | - RefreshSelection(); |
---|
| 4600 | + if (objEditor == this) |
---|
| 4601 | + RefreshSelection(); |
---|
4594 | 4602 | //assert(hashtable.isEmpty()); |
---|
4595 | 4603 | |
---|
4596 | | - copy.Touch(); |
---|
| 4604 | + objEditor.copy.Touch(); |
---|
4597 | 4605 | |
---|
4598 | 4606 | ResetModel(); |
---|
4599 | | - copy.HardTouch(); // recompile? |
---|
| 4607 | + objEditor.copy.HardTouch(); // recompile? |
---|
4600 | 4608 | |
---|
4601 | 4609 | cRadio ab; |
---|
4602 | | - for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4610 | + for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();) |
---|
4603 | 4611 | { |
---|
4604 | 4612 | ab = (cRadio)e.nextElement(); |
---|
4605 | | - Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4613 | + Object3D test = objEditor.copy.GetObject(ab.object.GetUUID()); |
---|
4606 | 4614 | //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
4607 | 4615 | if (test != null) |
---|
4608 | 4616 | { |
---|
.. | .. |
---|
4611 | 4619 | } |
---|
4612 | 4620 | } |
---|
4613 | 4621 | |
---|
4614 | | - refreshContents(true); |
---|
| 4622 | + objEditor.refreshContents(true); |
---|
4615 | 4623 | } |
---|
4616 | 4624 | |
---|
4617 | 4625 | cButton previousVersionButton; |
---|
.. | .. |
---|
4625 | 4633 | |
---|
4626 | 4634 | int VersionCount() |
---|
4627 | 4635 | { |
---|
4628 | | - int count = 0; |
---|
4629 | | - |
---|
4630 | | - for (int i = copy.versionlist.length; --i >= 0;) |
---|
4631 | | - { |
---|
4632 | | - if (copy.versionlist[i] != null) |
---|
4633 | | - count++; |
---|
4634 | | - } |
---|
4635 | | - |
---|
4636 | | - return count; |
---|
| 4636 | + return copy.VersionCount(); |
---|
4637 | 4637 | } |
---|
4638 | 4638 | |
---|
4639 | 4639 | public cGridBag versionSliderPane; |
---|
.. | .. |
---|
4707 | 4707 | |
---|
4708 | 4708 | copy.versionindex -= 1; |
---|
4709 | 4709 | |
---|
4710 | | - CopyChanged(); |
---|
| 4710 | + CopyChanged(copy); |
---|
| 4711 | + |
---|
| 4712 | + SetVersionStates(); |
---|
4711 | 4713 | |
---|
4712 | 4714 | return true; |
---|
4713 | 4715 | } |
---|
.. | .. |
---|
4725 | 4727 | } |
---|
4726 | 4728 | |
---|
4727 | 4729 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
4728 | | - CopyChanged(); |
---|
| 4730 | + CopyChanged(copy); |
---|
| 4731 | + |
---|
| 4732 | + SetVersionStates(); |
---|
4729 | 4733 | |
---|
4730 | 4734 | return true; |
---|
4731 | 4735 | } |
---|
.. | .. |
---|
4762 | 4766 | |
---|
4763 | 4767 | copy.versionindex += 1; |
---|
4764 | 4768 | |
---|
4765 | | - CopyChanged(); |
---|
| 4769 | + CopyChanged(copy); |
---|
4766 | 4770 | |
---|
4767 | 4771 | //if (!tab.user[tab.versionindex]) |
---|
4768 | 4772 | // tab.graphs[tab.versionindex] = null; |
---|
| 4773 | + |
---|
| 4774 | + SetVersionStates(); |
---|
4769 | 4775 | } |
---|
4770 | 4776 | |
---|
4771 | 4777 | void ImportGFD() |
---|
.. | .. |
---|
5094 | 5100 | } |
---|
5095 | 5101 | |
---|
5096 | 5102 | cNumberSlider versionSlider; |
---|
| 5103 | + cNumberSlider versionField; |
---|
5097 | 5104 | |
---|
5098 | 5105 | public void stateChanged(ChangeEvent e) |
---|
5099 | 5106 | { |
---|
.. | .. |
---|
5110 | 5117 | if (version != -1 && copy.versionlist[version] != null) |
---|
5111 | 5118 | { |
---|
5112 | 5119 | copy.versionindex = version; |
---|
5113 | | - CopyChanged(); |
---|
| 5120 | + CopyChanged(copy); |
---|
| 5121 | + SetVersionStates(); |
---|
5114 | 5122 | } |
---|
5115 | 5123 | |
---|
5116 | 5124 | return; |
---|
5117 | 5125 | } |
---|
5118 | 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 | + |
---|
5119 | 5140 | if (freezematerial) |
---|
5120 | 5141 | { |
---|
5121 | 5142 | return; |
---|
.. | .. |
---|
5205 | 5226 | } |
---|
5206 | 5227 | |
---|
5207 | 5228 | if (normalpushField != null) |
---|
5208 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
| 5229 | + copy.NORMALPUSH = (float)normalpushField.getFloat() / 100; |
---|
5209 | 5230 | } |
---|
5210 | 5231 | |
---|
5211 | 5232 | void SnapObject() |
---|
.. | .. |
---|
5579 | 5600 | void ResetModel() |
---|
5580 | 5601 | { |
---|
5581 | 5602 | //assert(copy instanceof Composite); |
---|
5582 | | - Object3D /*Composite*/ group = (Object3D /*Composite*/) copy; |
---|
| 5603 | + Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy; |
---|
5583 | 5604 | |
---|
5584 | 5605 | // necessary? group.selection = new Object3D(); // java.util.Vector(); |
---|
5585 | 5606 | |
---|
.. | .. |
---|
5590 | 5611 | //group.refreshEditWindow(); |
---|
5591 | 5612 | //refreshContents(); |
---|
5592 | 5613 | |
---|
5593 | | - if (copy.selection == null) |
---|
| 5614 | + if (objEditor.copy.selection == null) |
---|
5594 | 5615 | { |
---|
5595 | | - copy.selection = new Object3D(); |
---|
| 5616 | + objEditor.copy.selection = new Object3D(); |
---|
5596 | 5617 | } |
---|
5597 | 5618 | |
---|
5598 | | - for (int j = 0; j < copy.selection.size(); j++) |
---|
| 5619 | + for (int j = 0; j < objEditor.copy.selection.size(); j++) |
---|
5599 | 5620 | { |
---|
5600 | | - Object3D item = copy.selection.get(j); |
---|
| 5621 | + Object3D item = objEditor.copy.selection.get(j); |
---|
5601 | 5622 | |
---|
5602 | 5623 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5603 | 5624 | { |
---|
.. | .. |
---|
5606 | 5627 | |
---|
5607 | 5628 | if (item.count <= 1) // ??? == 0) |
---|
5608 | 5629 | { |
---|
5609 | | - copy.selection.remove(item); |
---|
| 5630 | + objEditor.copy.selection.remove(item); |
---|
5610 | 5631 | } |
---|
5611 | 5632 | } |
---|
5612 | 5633 | |
---|
5613 | 5634 | boolean first = true; |
---|
5614 | 5635 | |
---|
5615 | | - for (int i = copy.selection.size(); --i >= 0;) |
---|
| 5636 | + for (int i = objEditor.copy.selection.size(); --i >= 0;) |
---|
5616 | 5637 | { |
---|
5617 | | - Object3D item = copy.selection.get(i); |
---|
| 5638 | + Object3D item = objEditor.copy.selection.get(i); |
---|
5618 | 5639 | |
---|
5619 | 5640 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5620 | 5641 | { |
---|