Normand Briere
2019-06-17 13e9febe94aaeebad9c97f6d3e2aa4d73b2495c8
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");
....@@ -858,6 +871,7 @@
858871 } else if(e.getSource() == liveCB)
859872 {
860873 cameraView.ToggleLive();
874
+ refreshContents(false);
861875 }
862876 else if(e.getSource() == supportCB)
863877 {
....@@ -1265,7 +1279,7 @@
12651279 memoryItem.addActionListener(this);
12661280 menu.add(analyzeItem = new MenuItem("Analyze"));
12671281 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1282
+ menu.add(dumpItem = new MenuItem("Print"));
12691283 dumpItem.addActionListener(this);
12701284 // menu.add(pathItem = new MenuItem("From-to path"));
12711285 // pathItem.addActionListener(this);
....@@ -1956,6 +1970,18 @@
19561970 {
19571971 DumpObject();
19581972 } else
1973
+ if (source == undoButton)
1974
+ {
1975
+ Undo();
1976
+ } else
1977
+ if (source == redoButton)
1978
+ {
1979
+ Redo();
1980
+ } else
1981
+ if (source == saveButton)
1982
+ {
1983
+ Save();
1984
+ } else
19591985 if (source == oneStepButton)
19601986 {
19611987 Globals.ONESTEP = true;
....@@ -2517,7 +2543,7 @@
25172543 } else
25182544 if (source == genNormalsMESHItem)
25192545 {
2520
- GenNormals(true); // TODO
2546
+ GenNormalsMESH();
25212547 } else
25222548 if (source == genNormalsORGANItem)
25232549 {
....@@ -3128,7 +3154,8 @@
31283154 sideView.object = group;
31293155 }
31303156
3131
-// fix "+" issue group.editWindow = this;
3157
+// fix "+" issue
3158
+ group.editWindow = this;
31323159
31333160 /*
31343161 currentLayout = radio.layout;
....@@ -3403,7 +3430,8 @@
34033430
34043431 int size = obj.MemorySize();
34053432
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3433
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3434
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073435 }
34083436 }
34093437 catch (Exception e)
....@@ -3484,6 +3512,13 @@
34843512 void GenNormals(boolean crease)
34853513 {
34863514 group.GenNormalsS(crease);
3515
+
3516
+ refreshContents();
3517
+ }
3518
+
3519
+ void GenNormalsMESH()
3520
+ {
3521
+ group.GenNormalsMeshS();
34873522
34883523 refreshContents();
34893524 }
....@@ -4286,7 +4321,6 @@
42864321 //case 702: // Event.LIST_DESELECT
42874322 group.deselectAll();
42884323 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42904324 if (tps != null)
42914325 {
42924326 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +4329,8 @@
42954329
42964330 //if (child.parent != null)
42974331 //child.parent.addSelectee(child);
4332
+ objEditor.SetMaterial(child);
42984333 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43024334 }
43034335 }
43044336 // else
....@@ -4308,8 +4340,6 @@
43084340 // System.err.println("info : " + group.GetPath());
43094341 // }
43104342
4311
- objEditor.SetText(); // jan 2014
4312
-
43134343 if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43144344 CameraPane.flash = true;
43154345
....@@ -4333,6 +4363,26 @@
43334363
43344364 freezemodel = false;
43354365 }
4366
+
4367
+ void refreshContents(boolean cp)
4368
+ {
4369
+ if (!Globals.MOUSEDRAGGED)
4370
+ {
4371
+ objEditor.ClearInfo(); // .GetMaterial());
4372
+
4373
+ for (int i=0; i < group.selection.Size(); i++)
4374
+ {
4375
+ Object3D child = (Object3D) group.selection.get(i);
4376
+
4377
+ objEditor.AddInfo(child, this, true);
4378
+ System.err.println("info : " + child.GetPath());
4379
+ }
4380
+
4381
+ objEditor.SetText(); // jan 2014
4382
+ }
4383
+
4384
+ super.refreshContents(cp);
4385
+ }
43364386
43374387 void linkSomething(Object3D thing)
43384388 {
....@@ -4404,6 +4454,7 @@
44044454 {
44054455 if (group.selection.isEmpty())
44064456 return;
4457
+
44074458 Grafreed.clipboardIsTempGroup = false;
44084459 Composite tGroup = null;
44094460 if (group.selection.size() > 0) // 1)
....@@ -4414,6 +4465,7 @@
44144465
44154466 if (cut)
44164467 {
4468
+ Save();
44174469 //int indices[] = jList.getSelectedIndices();
44184470 //for (int i = indices.length - 1; i >= 0; i--)
44194471 //jList.remove(indices[i]);
....@@ -4503,8 +4555,10 @@
45034555 }
45044556
45054557 }
4558
+
45064559 if (Grafreed.clipboardIsTempGroup)
45074560 Grafreed.clipboard = tGroup;
4561
+
45084562 if (cut)
45094563 {
45104564 ResetModel();
....@@ -5129,6 +5183,9 @@
51295183 cButton clearpanelButton;
51305184 cButton unselectButton;
51315185
5186
+ cButton saveButton;
5187
+ cButton undoButton;
5188
+ cButton redoButton;
51325189 cButton oneStepButton;
51335190
51345191 cButton screenfitButton;