Normand Briere
2019-06-16 b33ef80d78f01a6a61f4248b1bb7deaade42d503
GroupEditor.java
....@@ -154,11 +154,12 @@
154154 oe.menuBar.add(menu = new Menu("Edit"));
155155 //editItem = menu.add(new MenuItem("Edit"));
156156 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
162163 duplicateItem = menu.add(new MenuItem("Duplicate"));
163164 duplicateItem.addActionListener(this);
164165 cloneItem = menu.add(new MenuItem("Clone"));
....@@ -202,7 +203,7 @@
202203 //zBufferItem.addActionListener(this);
203204 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204205 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206207 revertCameraItem.addActionListener(this);
207208
208209 cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
....@@ -266,7 +267,7 @@
266267 // animationItem.addItemListener(this);
267268 // animationItem.setState(CameraPane.ANIMATION);
268269 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270271 editCameraItem.addActionListener(this);
271272
272273 if (Globals.ADVANCED)
....@@ -555,6 +556,18 @@
555556 oe.buttonGroup.add(dummyButton);
556557 */
557558 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
559
+
560
+ oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ undoButton.setToolTipText("Undo changes");
562
+ undoButton.addActionListener(this);
563
+
564
+ oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ redoButton.setToolTipText("Redo changes");
566
+ redoButton.addActionListener(this);
567
+
568
+ oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569
+ saveButton.setToolTipText("Save changes");
570
+ saveButton.addActionListener(this);
558571
559572 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
560573 liveCB.setToolTipText("Enable animation");
....@@ -1956,6 +1969,18 @@
19561969 {
19571970 DumpObject();
19581971 } else
1972
+ if (source == undoButton)
1973
+ {
1974
+ Undo();
1975
+ } else
1976
+ if (source == redoButton)
1977
+ {
1978
+ Redo();
1979
+ } else
1980
+ if (source == saveButton)
1981
+ {
1982
+ Save();
1983
+ } else
19591984 if (source == oneStepButton)
19601985 {
19611986 Globals.ONESTEP = true;
....@@ -2517,7 +2542,7 @@
25172542 } else
25182543 if (source == genNormalsMESHItem)
25192544 {
2520
- GenNormals(true); // TODO
2545
+ GenNormalsMESH();
25212546 } else
25222547 if (source == genNormalsORGANItem)
25232548 {
....@@ -3128,7 +3153,8 @@
31283153 sideView.object = group;
31293154 }
31303155
3131
-// fix "+" issue group.editWindow = this;
3156
+// fix "+" issue
3157
+ group.editWindow = this;
31323158
31333159 /*
31343160 currentLayout = radio.layout;
....@@ -3403,7 +3429,8 @@
34033429
34043430 int size = obj.MemorySize();
34053431
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3432
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073434 }
34083435 }
34093436 catch (Exception e)
....@@ -3484,6 +3511,13 @@
34843511 void GenNormals(boolean crease)
34853512 {
34863513 group.GenNormalsS(crease);
3514
+
3515
+ refreshContents();
3516
+ }
3517
+
3518
+ void GenNormalsMESH()
3519
+ {
3520
+ group.GenNormalsMeshS();
34873521
34883522 refreshContents();
34893523 }
....@@ -4404,6 +4438,7 @@
44044438 {
44054439 if (group.selection.isEmpty())
44064440 return;
4441
+
44074442 Grafreed.clipboardIsTempGroup = false;
44084443 Composite tGroup = null;
44094444 if (group.selection.size() > 0) // 1)
....@@ -4414,6 +4449,7 @@
44144449
44154450 if (cut)
44164451 {
4452
+ Save();
44174453 //int indices[] = jList.getSelectedIndices();
44184454 //for (int i = indices.length - 1; i >= 0; i--)
44194455 //jList.remove(indices[i]);
....@@ -4503,8 +4539,10 @@
45034539 }
45044540
45054541 }
4542
+
45064543 if (Grafreed.clipboardIsTempGroup)
45074544 Grafreed.clipboard = tGroup;
4545
+
45084546 if (cut)
45094547 {
45104548 ResetModel();
....@@ -5129,6 +5167,9 @@
51295167 cButton clearpanelButton;
51305168 cButton unselectButton;
51315169
5170
+ cButton saveButton;
5171
+ cButton undoButton;
5172
+ cButton redoButton;
51325173 cButton oneStepButton;
51335174
51345175 cButton screenfitButton;