Normand Briere
2019-08-17 d5d6485126da83b06645e90e3e4ce66659a56009
GroupEditor.java
....@@ -1038,9 +1038,9 @@
10381038 oe.radioPanel.add(dummyButton);
10391039 oe.buttonGroup.add(dummyButton);
10401040 */
1041
- cGridBag copyOptionsPanel = new cGridBag();
1041
+ cGridBag versionManagerPanel = new cGridBag();
10421042
1043
- copyOptionsPanel.preferredHeight = 3;
1043
+ versionManagerPanel.preferredHeight = 4;
10441044
10451045 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
10461046
....@@ -1071,7 +1071,7 @@
10711071 collapseButton.setToolTipText("Collapse toolbar");
10721072 collapseButton.addActionListener(this);
10731073
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);
10751075 maximize3DButton.setToolTipText("Maximize 3D view");
10761076 maximize3DButton.addActionListener(this);
10771077
....@@ -1106,16 +1106,16 @@
11061106 restoreCameraButton.setToolTipText("Restore viewpoint");
11071107 restoreCameraButton.addActionListener(this);
11081108
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);
11101110 saveVersionButton.setToolTipText("Duplicate current version");
11111111 saveVersionButton.addActionListener(this);
11121112
1113
- copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11141114 deleteVersionButton.setToolTipText("Delete current version");
11151115 deleteVersionButton.addActionListener(this);
11161116 deleteVersionButton.setEnabled(false);
11171117
1118
- copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1118
+ versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11191119 previousVersionButton.setToolTipText("Previous version");
11201120 previousVersionButton.addActionListener(this);
11211121 previousVersionButton.setEnabled(false);
....@@ -1131,9 +1131,9 @@
11311131 replaceButton.addActionListener(this);
11321132 replaceButton.setEnabled(false);
11331133
1134
- copyOptionsPanel.add(updown);
1134
+ versionManagerPanel.add(updown);
11351135
1136
- copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11371137 nextVersionButton.setToolTipText("Next version");
11381138 nextVersionButton.addActionListener(this);
11391139 nextVersionButton.setEnabled(false);
....@@ -1311,6 +1311,8 @@
13111311
13121312 cGridBag jSPPanel = new cGridBag();
13131313
1314
+ jSPPanel.preferredHeight = 20;
1315
+
13141316 JScrollPane jSP;
13151317 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
13161318 jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
....@@ -1319,11 +1321,11 @@
13191321 oe.treePanel.add(jSPPanel);
13201322 oe.treePanel.Return();
13211323
1322
- oe.treePanel.add(copyOptionsPanel);
1324
+ oe.treePanel.add(versionManagerPanel);
13231325 oe.treePanel.Return();
1324
- cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1325
- versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1326
- sliderPane.preferredHeight = 2;
1326
+ versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1327
+ versionSlider = (cNumberSlider)versionSliderPane.getComponent(1);
1328
+ versionSliderPane.preferredHeight = 3;
13271329
13281330 // mainPanel.setDividerLocation(0.1); //1.0);
13291331 mainPanel.setResizeWeight(0.4);
....@@ -3968,6 +3970,8 @@
39683970 if (source == closeButton)
39693971 {
39703972 //System.out.println("CLOSE: " + buttonGroup.getSelection());
3973
+ Replace();
3974
+
39713975 cRadio ab;
39723976 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
39733977 {
....@@ -4066,6 +4070,8 @@
40664070 } else
40674071 if(source instanceof cRadio)
40684072 {
4073
+ Replace();
4074
+
40694075 group.parent = keepparent;
40704076 group.attributes = 0;
40714077 //group.editWindow = null;
....@@ -4121,13 +4127,21 @@
41214127
41224128 if (copy.versionlist == null)
41234129 {
4124
- copy.versionlist = new Object3D[100];
41254130 copy.versionindex = -1;
41264131
41274132 // Cannot work with loops
4128
- // To fix this issue, first mark all nodes above the root,
4133
+ // To fix this issue, we first mark all nodes above the root,
41294134 // and check if any of these nodes are reachable below the root.
4130
- //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);
41314145 }
41324146
41334147 SetVersionStates();
....@@ -4275,7 +4289,7 @@
42754289 TouchTransform(obj);
42764290 continue;
42774291 }
4278
- if ((mask&2) != 0) // Scale
4292
+ if ((mask&2) != 0) // Scale/rotation
42794293 {
42804294 obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1;
42814295 obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0;
....@@ -4283,10 +4297,6 @@
42834297 obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1;
42844298 obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0;
42854299 obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0;
4286
- }
4287
- if ((mask&4) != 0) // Rotation
4288
- {
4289
- // ?
42904300 }
42914301 if ((mask&1) != 0) // Translation
42924302 {
....@@ -5385,6 +5395,7 @@
53855395
53865396 void refreshContents(boolean cp)
53875397 {
5398
+ if (false)
53885399 //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
53895400 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
53905401 {