.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
194 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
195 | 209 | // pasteExpandItem.addActionListener(this); |
---|
196 | 210 | menu.add("-"); |
---|
197 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
198 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
199 | 213 | |
---|
200 | 214 | if (Globals.ADVANCED) |
---|
201 | 215 | { |
---|
.. | .. |
---|
421 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
422 | 436 | if (Globals.ADVANCED) |
---|
423 | 437 | { |
---|
424 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
425 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
426 | 440 | } |
---|
427 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
673 | 687 | |
---|
674 | 688 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
675 | 689 | |
---|
676 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
677 | | - twoButton.setToolTipText("Show center view only"); |
---|
678 | | - twoButton.addActionListener(this); |
---|
679 | | - this.fullscreenLayout = twoButton; |
---|
680 | | - |
---|
681 | 690 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
682 | 691 | fourButton.addActionListener(this); |
---|
683 | 692 | fourButton.setToolTipText("Show left panel only"); |
---|
| 693 | + |
---|
| 694 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + twoButton.setToolTipText("Show right view only"); |
---|
| 696 | + twoButton.addActionListener(this); |
---|
| 697 | + this.fullscreenLayout = twoButton; |
---|
| 698 | + |
---|
684 | 699 | oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
685 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
686 | 701 | sixButton.addActionListener(this); |
---|
687 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
688 | | - threeButton.setToolTipText("2-column layout right"); |
---|
689 | | - threeButton.addActionListener(this); |
---|
690 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
691 | | - sevenButton.setToolTipText("3-column layout"); |
---|
692 | | - sevenButton.addActionListener(this); |
---|
| 702 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | +// threeButton.addActionListener(this); |
---|
| 705 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 706 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 707 | +// sevenButton.addActionListener(this); |
---|
693 | 708 | // |
---|
694 | 709 | |
---|
695 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
696 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 710 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
697 | 712 | rootButton.addActionListener(this); |
---|
698 | 713 | |
---|
699 | 714 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
834 | 849 | |
---|
835 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
836 | 851 | oe.treePanel.Return(); |
---|
837 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
838 | | - versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
839 | 854 | sliderPane.preferredHeight = 1; |
---|
840 | 855 | |
---|
841 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
.. | .. |
---|
859 | 874 | dgr.addDragGestureListener(this); |
---|
860 | 875 | }catch(Exception e) {} |
---|
861 | 876 | */ |
---|
862 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
863 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
864 | 879 | } |
---|
865 | 880 | |
---|
.. | .. |
---|
1001 | 1016 | } |
---|
1002 | 1017 | |
---|
1003 | 1018 | radioButton.SetObject(obj); |
---|
1004 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
1005 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1006 | 1021 | radioButton.addActionListener(this); |
---|
1007 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1680 | 1695 | listUI.remove(i); |
---|
1681 | 1696 | } |
---|
1682 | 1697 | } |
---|
| 1698 | + } |
---|
| 1699 | + |
---|
| 1700 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1701 | + { |
---|
| 1702 | + // if (!(elem instanceof Composite)) |
---|
| 1703 | + // newWindow = false; |
---|
| 1704 | + listUI.add(elem); |
---|
| 1705 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1706 | + System.out.println("edit : " + elem); |
---|
| 1707 | + elem.editWindow.refreshContents(true); // ? new |
---|
1683 | 1708 | } |
---|
1684 | 1709 | |
---|
1685 | 1710 | /** |
---|
.. | .. |
---|
2646 | 2671 | { |
---|
2647 | 2672 | StepAll(); |
---|
2648 | 2673 | } else |
---|
2649 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2650 | 2675 | { |
---|
2651 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2652 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3541 | 3566 | radio.layout.doClick(); |
---|
3542 | 3567 | |
---|
3543 | 3568 | ClearUnpinned(); |
---|
3544 | | - SetPinStates(group.selection.size() > 0); |
---|
3545 | | - if (group.selection.size() == 1) |
---|
| 3569 | + //Grafreed.Assert(group != null); |
---|
| 3570 | + //Grafreed.Assert(group.selection != null); |
---|
| 3571 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3572 | + if (group.selection == null || group.selection.size() == 1) |
---|
3546 | 3573 | EditSelection(false); |
---|
3547 | 3574 | keepparent = group.parent; |
---|
3548 | 3575 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4613 | 4640 | |
---|
4614 | 4641 | void EditSelection(boolean newWindow) |
---|
4615 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4616 | 4649 | // aConstraints.gridy = 0; |
---|
4617 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4618 | 4651 | { |
---|
.. | .. |
---|
4623 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4624 | 4657 | if(elem != group || !newWindow) |
---|
4625 | 4658 | { |
---|
4626 | | - // if (!(elem instanceof Composite)) |
---|
4627 | | - // newWindow = false; |
---|
4628 | | - listUI.add(elem); |
---|
4629 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4630 | | - System.out.println("edit : " + elem); |
---|
4631 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4632 | 4660 | } |
---|
4633 | 4661 | } |
---|
4634 | 4662 | } |
---|
.. | .. |
---|
4772 | 4800 | |
---|
4773 | 4801 | void refreshContents(boolean cp) |
---|
4774 | 4802 | { |
---|
4775 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4776 | 4804 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4777 | 4805 | { |
---|
4778 | 4806 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5681 | 5709 | private MenuItem pasteLinkItem; |
---|
5682 | 5710 | private MenuItem pasteCloneItem; |
---|
5683 | 5711 | private MenuItem pasteExpandItem; |
---|
5684 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5685 | 5713 | private MenuItem clearAllItem; |
---|
5686 | 5714 | private MenuItem genUVItem; |
---|
5687 | 5715 | private MenuItem genNormalsMESHItem; |
---|