Normand Briere
2019-07-21 5a546232b84ce65d8779d29e9171e7e2df013614
GroupEditor.java
....@@ -80,18 +80,20 @@
8080 this.copy = this.group = copy;
8181 //selectees = this.group.selectees;
8282
83
- if (copy.versions == null)
84
- {
85
- copy.versions = new byte[100][];
86
- copy.versionindex = -1;
87
- }
88
-
8983 SetupMenu2(this); //objEditor);
9084 SetupUI2(objEditor);
9185 objEditor.SetupUI(true);
9286 SetupViews(objEditor);
9387
9488 ((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
+ }
9597 }
9698
9799 void CloneSelection(boolean supports)
....@@ -206,8 +208,8 @@
206208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
207209 // pasteExpandItem.addActionListener(this);
208210 menu.add("-");
209
- clearItem = menu.add(new MenuItem("Clear"));
210
- clearItem.addActionListener(this);
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
211213
212214 if (Globals.ADVANCED)
213215 {
....@@ -433,7 +435,7 @@
433435 genNormalsMESHItem.addActionListener(this);
434436 if (Globals.ADVANCED)
435437 {
436
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437439 genNormalsMINEItem.addActionListener(this);
438440 }
439441 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -685,27 +687,28 @@
685687
686688 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
687689
688
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
- twoButton.setToolTipText("Show center view only");
690
- twoButton.addActionListener(this);
691
- this.fullscreenLayout = twoButton;
692
-
693690 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694691 fourButton.addActionListener(this);
695692 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
+
696699 oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
- sixButton.setToolTipText("2-column layout left");
700
+ sixButton.setToolTipText("Show left and right");
698701 sixButton.addActionListener(this);
699
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- threeButton.setToolTipText("2-column layout right");
701
- threeButton.addActionListener(this);
702
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
- sevenButton.setToolTipText("3-column layout");
704
- 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);
705708 //
706709
707
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
- 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");
709712 rootButton.addActionListener(this);
710713
711714 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -871,7 +874,7 @@
871874 dgr.addDragGestureListener(this);
872875 }catch(Exception e) {}
873876 */
874
- radio.layout = sevenButton;
877
+ radio.layout = sixButton; // sevenButton;
875878 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
876879 }
877880
....@@ -1013,7 +1016,7 @@
10131016 }
10141017
10151018 radioButton.SetObject(obj);
1016
- radioButton.layout = sevenButton;
1019
+ radioButton.layout = sixButton; // sevenButton;
10171020 radioButton.SetCamera(cameraView.renderCamera, false);
10181021 radioButton.addActionListener(this);
10191022 radioPanel.add(radioButton);
....@@ -1692,6 +1695,16 @@
16921695 listUI.remove(i);
16931696 }
16941697 }
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
16951708 }
16961709
16971710 /**
....@@ -2658,7 +2671,7 @@
26582671 {
26592672 StepAll();
26602673 } else
2661
- if (source == clearItem) // || event.getSource() == clearButton)
2674
+ if (source == deleteItem) // || event.getSource() == clearButton)
26622675 {
26632676 //int indices[] = jList.getSelectedIndices();
26642677 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3553,10 +3566,10 @@
35533566 radio.layout.doClick();
35543567
35553568 ClearUnpinned();
3556
- Grafreed.Assert(group != null);
3557
- Grafreed.Assert(group.selection != null);
3558
- SetPinStates(group.selection.size() > 0);
3559
- 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)
35603573 EditSelection(false);
35613574 keepparent = group.parent;
35623575 // PARENT = NULL or not???
....@@ -4627,6 +4640,12 @@
46274640
46284641 void EditSelection(boolean newWindow)
46294642 {
4643
+ if (group.selection == null)
4644
+ {
4645
+ EditElement(group, newWindow); // ? new
4646
+ return;
4647
+ }
4648
+
46304649 // aConstraints.gridy = 0;
46314650 for (int i=0; i<group.selection.size(); i++)
46324651 {
....@@ -4637,12 +4656,7 @@
46374656 Object3D elem = (Object3D)group.selection.elementAt(i);
46384657 if(elem != group || !newWindow)
46394658 {
4640
- // if (!(elem instanceof Composite))
4641
- // newWindow = false;
4642
- listUI.add(elem);
4643
- elem.openEditWindow(this, newWindow); //, false);
4644
- System.out.println("edit : " + elem);
4645
- elem.editWindow.refreshContents(true); // ? new
4659
+ EditElement(elem, newWindow); // ? new
46464660 }
46474661 }
46484662 }
....@@ -4786,7 +4800,7 @@
47864800
47874801 void refreshContents(boolean cp)
47884802 {
4789
- if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4803
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
47904804 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
47914805 {
47924806 objEditor.ClearInfo(); // .GetMaterial());
....@@ -5695,7 +5709,7 @@
56955709 private MenuItem pasteLinkItem;
56965710 private MenuItem pasteCloneItem;
56975711 private MenuItem pasteExpandItem;
5698
- private MenuItem clearItem;
5712
+ private MenuItem deleteItem;
56995713 private MenuItem clearAllItem;
57005714 private MenuItem genUVItem;
57015715 private MenuItem genNormalsMESHItem;