Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
GroupEditor.java
....@@ -12,9 +12,11 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
19
+ Grafreed.iResourceCallBack,
1820 ObjectUI,
1921 Runnable,
2022 ActionListener,
....@@ -22,6 +24,314 @@
2224 DragGestureListener, DragSourceListener, DropTargetListener,
2325 ItemListener // ListSelectionListener
2426 {
27
+
28
+ public void AddSkyboxButton(String f, String s, cGridBag row)
29
+ {
30
+ cButton skyboxButton;
31
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
+ skyboxButton.setToolTipText(s);
35
+ skyboxButton.addActionListener(new ActionListener()
36
+ {
37
+ @Override
38
+ public void actionPerformed(ActionEvent e)
39
+ {
40
+ ChangeSkybox(path);
41
+ }
42
+ });
43
+ }
44
+
45
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
46
+ {
47
+ cGridBag tab0 = new cGridBag().setVertical(true);
48
+
49
+ tab0.setName("Urban");
50
+ skyboxpanel.add(tab0);
51
+
52
+ cGridBag row0 = new cGridBag();
53
+ cGridBag row1 = new cGridBag();
54
+ cGridBag row2 = new cGridBag();
55
+ cGridBag row3 = new cGridBag();
56
+ cGridBag row4 = new cGridBag();
57
+ cGridBag row5 = new cGridBag();
58
+ cGridBag row6 = new cGridBag();
59
+
60
+ AddSkyboxButton("default", "rgb", row0);
61
+ //AddSkyboxButton("default", "cornell", row0);
62
+ AddSkyboxButton("penguins", "dust", row0);
63
+ AddSkyboxButton("penguins", "tropic", row0);
64
+ AddSkyboxButton("penguins", "yonder", row0);
65
+
66
+ AddSkyboxButton("default", "uffizi", row1);
67
+ AddSkyboxButton("bridge", "Bridge", row1);
68
+ AddSkyboxButton("bridge", "Bridge2", row1);
69
+ AddSkyboxButton("urban", "GamlaStan2", row1);
70
+
71
+ AddSkyboxButton("urban", "Parliament", row2);
72
+ AddSkyboxButton("urban", "Roundabout", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
74
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
75
+
76
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
77
+ AddSkyboxButton("urban", "UnionSquare", row3);
78
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
79
+ AddSkyboxButton("park", "BerzeliiPark", row3);
80
+
81
+ AddSkyboxButton("park", "Buddha", row4);
82
+ AddSkyboxButton("park", "CNTower2", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
84
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
85
+
86
+ AddSkyboxButton("park", "Park", row5);
87
+ AddSkyboxButton("park", "Pond", row5);
88
+ AddSkyboxButton("park", "Skansen", row5);
89
+ AddSkyboxButton("park", "Skansen2", row5);
90
+
91
+ AddSkyboxButton("park", "Skansen3", row6);
92
+ AddSkyboxButton("park", "Skansen4", row6);
93
+ AddSkyboxButton("park", "Skansen5", row6);
94
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
95
+
96
+ tab0.add(row0);
97
+ tab0.add(row1);
98
+ tab0.add(row2);
99
+ tab0.add(row3);
100
+ tab0.add(row4);
101
+ tab0.add(row5);
102
+ tab0.add(row6);
103
+
104
+ for (int i=5; --i>=0;)
105
+ {
106
+ //oe.toolboxPanel.Return();
107
+ //tab0.add(new cGridBag());
108
+ }
109
+ }
110
+
111
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
112
+ {
113
+ cGridBag tab0 = new cGridBag().setVertical(true);
114
+
115
+ tab0.setName("Nature");
116
+ skyboxpanel.add(tab0);
117
+
118
+ cGridBag row0 = new cGridBag();
119
+ cGridBag row1 = new cGridBag();
120
+ cGridBag row2 = new cGridBag();
121
+ cGridBag row3 = new cGridBag();
122
+ cGridBag row4 = new cGridBag();
123
+ cGridBag row5 = new cGridBag();
124
+ cGridBag row6 = new cGridBag();
125
+
126
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
127
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
128
+ AddSkyboxButton("beach", "PalmTrees", row0);
129
+ AddSkyboxButton("beach", "Tenerife", row0);
130
+
131
+ AddSkyboxButton("beach", "Tenerife2", row1);
132
+ AddSkyboxButton("beach", "Tenerife3", row1);
133
+ AddSkyboxButton("field", "FishPond", row1);
134
+ AddSkyboxButton("field", "Footballfield", row1);
135
+
136
+ AddSkyboxButton("field", "Meadow", row2);
137
+ AddSkyboxButton("field", "Sorsele", row2);
138
+ AddSkyboxButton("field", "Sorsele2", row2);
139
+ AddSkyboxButton("field", "Sorsele3", row2);
140
+
141
+ AddSkyboxButton("forest", "Brudslojan", row3);
142
+ AddSkyboxButton("forest", "Langholmen2", row3);
143
+ AddSkyboxButton("forest", "Plants", row3);
144
+ AddSkyboxButton("mountain", "Maskonaive", row3);
145
+
146
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
147
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("park", "Stairs", row5);
152
+ AddSkyboxButton("default", "skycube", row6);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+
156
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "MountainTrail", row6);
160
+ /*
161
+Autumn
162
+Greenlands
163
+MountainTrail
164
+Oasis
165
+TheRock
166
+TopOfTheWorld
167
+Winter
168
+ */
169
+
170
+ tab0.add(row0);
171
+ tab0.add(row1);
172
+ tab0.add(row2);
173
+ tab0.add(row3);
174
+ tab0.add(row4);
175
+ tab0.add(row5);
176
+ tab0.add(row6);
177
+
178
+ for (int i=5; --i>=0;)
179
+ {
180
+ //oe.toolboxPanel.Return();
181
+ //tab0.add(new cGridBag());
182
+ }
183
+ }
184
+
185
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
186
+ {
187
+ cGridBag tab0 = new cGridBag().setVertical(true);
188
+
189
+ tab0.setName("Night");
190
+ skyboxpanel.add(tab0);
191
+
192
+ cGridBag row0 = new cGridBag();
193
+ cGridBag row1 = new cGridBag();
194
+ cGridBag row2 = new cGridBag();
195
+ cGridBag row3 = new cGridBag();
196
+ cGridBag row4 = new cGridBag();
197
+ cGridBag row5 = new cGridBag();
198
+ cGridBag row6 = new cGridBag();
199
+
200
+ AddSkyboxButton("night", "NightPath", row0);
201
+ AddSkyboxButton("night", "PondNight", row0);
202
+ AddSkyboxButton("night", "Powerlines", row0);
203
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
204
+
205
+ AddSkyboxButton("urban", "CNTower", row1);
206
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
207
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
208
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
209
+
210
+ AddSkyboxButton("penguins", "kenon_star", row2);
211
+ AddSkyboxButton("persson", "corona", row2);
212
+ AddSkyboxButton("persson", "spaceskybox", row2);
213
+ AddSkyboxButton("indoors", "Vasa", row2);
214
+
215
+ AddSkyboxButton("winter", "Backyard", row3);
216
+ AddSkyboxButton("winter", "Creek", row3);
217
+ AddSkyboxButton("winter", "FootballField3", row3);
218
+ AddSkyboxButton("winter", "Forest", row3);
219
+
220
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
221
+ AddSkyboxButton("winter", "House", row4);
222
+ AddSkyboxButton("winter", "IceLake", row4);
223
+ AddSkyboxButton("winter", "IceRiver", row4);
224
+
225
+ AddSkyboxButton("winter", "Park3", row5);
226
+ AddSkyboxButton("winter", "PondWinter", row5);
227
+ AddSkyboxButton("winter", "Tantolunden5", row5);
228
+ AddSkyboxButton("winter", "Vindelalven", row5);
229
+
230
+ AddSkyboxButton("daz", "TheRock", row6);
231
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
232
+ AddSkyboxButton("daz", "Winter", row6);
233
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
234
+
235
+ tab0.add(row0);
236
+ tab0.add(row1);
237
+ tab0.add(row2);
238
+ tab0.add(row3);
239
+ tab0.add(row4);
240
+ tab0.add(row5);
241
+ tab0.add(row6);
242
+
243
+ for (int i=5; --i>=0;)
244
+ {
245
+ //oe.toolboxPanel.Return();
246
+ //tab0.add(new cGridBag());
247
+ }
248
+ }
249
+
250
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
251
+ {
252
+ cGridBag tab0 = new cGridBag().setVertical(true);
253
+
254
+ tab0.setName("Others");
255
+ skyboxpanel.add(tab0);
256
+
257
+ cGridBag row0 = new cGridBag();
258
+ cGridBag row1 = new cGridBag();
259
+ cGridBag row2 = new cGridBag();
260
+ cGridBag row3 = new cGridBag();
261
+ cGridBag row4 = new cGridBag();
262
+ cGridBag row5 = new cGridBag();
263
+ cGridBag row6 = new cGridBag();
264
+
265
+ AddSkyboxButton("mayhem", "afterrain", row0);
266
+ AddSkyboxButton("mayhem", "aqua4", row0);
267
+ AddSkyboxButton("mayhem", "aqua9", row0);
268
+ AddSkyboxButton("mayhem", "flame", row0);
269
+
270
+ AddSkyboxButton("mayhem", "h2s", row1);
271
+ AddSkyboxButton("mayhem", "prehistoric", row1);
272
+ AddSkyboxButton("mayhem", "scorched", row1);
273
+ AddSkyboxButton("penguins", "desertdawn", row1);
274
+
275
+ AddSkyboxButton("persson", "Citadella", row2);
276
+ AddSkyboxButton("persson", "Citadella2", row2);
277
+ AddSkyboxButton("persson", "clouds1", row2);
278
+ AddSkyboxButton("penguins", "wrath", row2);
279
+
280
+ AddSkyboxButton("persson", "FishermansBastion", row3);
281
+ AddSkyboxButton("persson", "HeroesSquare", row3);
282
+ AddSkyboxButton("indoors", "DallasW", row3);
283
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
284
+
285
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
286
+ AddSkyboxButton("persson", "PereaBeach1", row4);
287
+ AddSkyboxButton("persson", "PereaBeach2", row4);
288
+ AddSkyboxButton("persson", "redeclipse", row4);
289
+
290
+ AddSkyboxButton("daz", "Greenlands", row5);
291
+ AddSkyboxButton("daz", "Oasis", row5);
292
+ AddSkyboxButton("elyvisions", "arch3", row5);
293
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
294
+
295
+ AddSkyboxButton("elyvisions", "rainbow", row6);
296
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
297
+ AddSkyboxButton("elyvisions", "heaven", row6);
298
+ AddSkyboxButton("elyvisions", "hot", row6);
299
+
300
+ tab0.add(row0);
301
+ tab0.add(row1);
302
+ tab0.add(row2);
303
+ tab0.add(row3);
304
+ tab0.add(row4);
305
+ tab0.add(row5);
306
+ tab0.add(row6);
307
+
308
+ for (int i=5; --i>=0;)
309
+ {
310
+ //oe.toolboxPanel.Return();
311
+ //tab0.add(new cGridBag());
312
+ }
313
+ }
314
+
315
+ public void CallBack(String[] path)
316
+ {
317
+ for (int i = 0; i < path.length; i++)
318
+ {
319
+ System.out.print(path[i] + "/");
320
+ }
321
+
322
+ System.out.println();
323
+ }
324
+
325
+ public void ChangeSkybox(String skybox)
326
+ {
327
+ //cameraView.envyoff = false;
328
+ group.skyboxname = skybox;
329
+ group.skyboxext = "jpg";
330
+ cameraView.repaint();
331
+
332
+ Grafreed.ParseResources("textures", this);
333
+ }
334
+
25335 //ObjEditor objEditor;
26336 public void closeUI2()
27337 {
....@@ -59,6 +369,12 @@
59369 this.copy = this.group = group;
60370 //selectees = this.group.selectees;
61371
372
+ if (copy.versionlist == null)
373
+ {
374
+ copy.versionlist = new Object3D[100];
375
+ copy.versionindex = -1;
376
+ }
377
+
62378 if(ui)
63379 SetupUI(objEditor);
64380 }
....@@ -73,16 +389,28 @@
73389 this.copy = this.group = copy;
74390 //selectees = this.group.selectees;
75391
76
- SetupMenu2(objEditor);
392
+ SetupMenu2(this); //objEditor);
77393 SetupUI2(objEditor);
78394 objEditor.SetupUI(true);
79395 SetupViews(objEditor);
80396
81397 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
398
+
399
+ if (copy.versionlist == null)
400
+ {
401
+ copy.versionlist = new Object3D[100];
402
+ copy.versionindex = -1;
403
+
404
+ Save(true);
405
+ }
82406 }
83407
84408 void CloneSelection(boolean supports)
85409 {
410
+ if (Globals.REPLACEONMAKE)
411
+ Save();
412
+ boolean keep = Globals.REPLACEONMAKE;
413
+ Globals.REPLACEONMAKE = false;
86414 // Object3D keep = GrafreeD.clipboard;
87415 //Object3D obj;
88416 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +421,19 @@
93421
94422 makeSomething(clone, i==group.selection.size()-1);
95423 }
424
+ Globals.REPLACEONMAKE = keep;
96425 }
97426
98427 void CloneClipboard(boolean supports)
99428 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
429
+ assert(Grafreed.clipboard.parent == null);
430
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
431
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
432
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
433
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105434 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
435
+ makeSomething(CloneObject(Grafreed.clipboard, false));
436
+ Grafreed.clipboard.get(0).parent = keepparent;
108437 }
109438
110439 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +447,7 @@
118447 // obj.support = null;
119448 if (!supports)
120449 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
450
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122451 obj.parent = parent;
123452 // obj.support = support;
124453 // clone.support = support; // aout 2013
....@@ -147,30 +476,29 @@
147476
148477 //JTextField nameField;
149478
150
- void SetupMenu2(ObjEditor oe)
479
+ void SetupMenu2(GroupEditor oe)
151480 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
481
+ oe.jTree = new cTree();
482
+
163483 Menu menu;
164484 oe.menuBar.add(menu = new Menu("Edit"));
165485 //editItem = menu.add(new MenuItem("Edit"));
166486 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
487
+
488
+// undoItem = menu.add(new MenuItem("Undo"));
489
+// undoItem.addActionListener(this);
490
+// redoItem = menu.add(new MenuItem("Redo"));
491
+// redoItem.addActionListener(this);
492
+// menu.add("-");
493
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168494 duplicateItem.addActionListener(this);
169
- menu.add("-");
170495 cloneItem = menu.add(new MenuItem("Clone"));
171496 cloneItem.addActionListener(this);
497
+ if (Globals.ADVANCED)
498
+ {
172499 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173500 cloneSupportItem.addActionListener(this);
501
+ }
174502 menu.add("-");
175503 cutItem = menu.add(new MenuItem("Cut"));
176504 cutItem.addActionListener(this);
....@@ -178,27 +506,123 @@
178506 copyItem.addActionListener(this);
179507 pasteItem = menu.add(new MenuItem("Paste"));
180508 pasteItem.addActionListener(this);
509
+
510
+ menu.add("-");
511
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
512
+ pasteIntoItem.addActionListener(this);
181513 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182514 pasteLinkItem.addActionListener(this);
183515 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184516 pasteCloneItem.addActionListener(this);
185517 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186518 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
519
+ menu.add("-");
520
+ deleteItem = menu.add(new MenuItem("Delete"));
521
+ deleteItem.addActionListener(this);
522
+
523
+ if (Globals.ADVANCED)
524
+ {
525
+ // Deletes the cameras...
189526 clearAllItem = menu.add(new MenuItem("Clear All"));
190527 clearAllItem.addActionListener(this);
528
+ }
529
+
530
+ menuBar.add(cameraMenu = new Menu("View"));
531
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
532
+ //zBufferItem.addActionListener(this);
533
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
534
+ //normalLensItem.addActionListener(this);
535
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
536
+ restoreCameraItem.addActionListener(this);
537
+
538
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
539
+// toggleFullScreenItem.addItemListener(this);
540
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
541
+// cameraMenu.add("-");
542
+//
543
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
544
+// toggleTextureItem.addItemListener(this);
545
+// toggleTextureItem.setState(CameraPane.textureon);
546
+//
547
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
548
+// toggleSwitchItem.addItemListener(this);
549
+// toggleSwitchItem.setState(CameraPane.SWITCH);
550
+
551
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
552
+ toggleHandleItem.addItemListener(this);
553
+ toggleHandleItem.setState(CameraPane.HANDLES);
554
+
555
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
556
+ togglePaintItem.addItemListener(this);
557
+ togglePaintItem.setState(CameraPane.PAINTMODE);
558
+
559
+ if (Globals.ADVANCED)
560
+ {
561
+ cameraMenu.add("-");
562
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
563
+ toggleLiveItem.addItemListener(this);
564
+ toggleLiveItem.setState(Globals.isLIVE());
191565
566
+ cameraMenu.add(stepItem = new MenuItem("Step"));
567
+ stepItem.addActionListener(this);
568
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
569
+ // toggleDLItem.addItemListener(this);
570
+ // toggleDLItem.setState(false);
571
+
572
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
573
+ toggleRenderItem.addItemListener(this);
574
+ toggleRenderItem.setState(!CameraPane.frozen);
575
+
576
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
577
+ toggleDebugItem.addItemListener(this);
578
+ toggleDebugItem.setState(Globals.DEBUG);
579
+
580
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
581
+ toggleFrustumItem.addItemListener(this);
582
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
583
+
584
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
585
+ toggleFootContactItem.addItemListener(this);
586
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
587
+
588
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
589
+ toggleTimelineItem.addItemListener(this);
590
+ }
591
+
592
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
593
+// toggleRootItem.addItemListener(this);
594
+// toggleRootItem.setState(false);
595
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
596
+// animationItem.addItemListener(this);
597
+// animationItem.setState(CameraPane.ANIMATION);
598
+ cameraMenu.add("-");
599
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
600
+ editCameraItem.addActionListener(this);
601
+
602
+ if (Globals.ADVANCED)
603
+ {
604
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
605
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
606
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
607
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
608
+ oe.cameraMenu.add("-");
609
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
610
+ openWindowItem.addActionListener(this);
611
+ editLeafItem.addActionListener(this);
612
+ lookAtItem.addActionListener(this);
613
+ //lookFromItem.addActinoListener(this);
614
+ //switchViewItem.addActionListener(this);
615
+ }
616
+
192617 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
618
+ if (Globals.ADVANCED)
619
+ {
197620 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198621 revertMeshItem.addActionListener(this);
199622 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200623 resetreferencesItem.addActionListener(this);
201624 menu.add("-");
625
+ }
202626 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203627 overwriteGeoItem.addActionListener(this);
204628 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +634,104 @@
210634 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211635 overwriteUVItem.addActionListener(this);
212636 menu.add("-");
637
+ if (Globals.ADVANCED)
638
+ {
213639 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214640 generateMeshItem.addActionListener(this);
215641 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216642 poseMeshItem.addActionListener(this);
217643 menu.add("-");
644
+ }
218645 resetsupportItem = menu.add(new MenuItem("Reset support"));
219646 resetsupportItem.addActionListener(this);
220647 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221648 linkverticesItem.addActionListener(this);
222649 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223650 relinkverticesItem.addActionListener(this);
651
+
652
+ if (Globals.ADVANCED)
653
+ {
224654 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225655 setMasterItem.addActionListener(this);
656
+ }
226657
227658 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
659
+// grabItem = menu.add(new MenuItem("Grab"));
660
+// grabItem.addActionListener(this);
230661 backItem = menu.add(new MenuItem("Back"));
231662 backItem.addActionListener(this);
232663 frontItem = menu.add(new MenuItem("Front"));
233664 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
665
+// compositeItem = menu.add(new MenuItem("Composite"));
666
+// compositeItem.addActionListener(this);
667
+
668
+ if (Globals.ADVANCED)
669
+ {
670
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237671 hideItem.addActionListener(this);
672
+ }
238673 ungroupItem = menu.add(new MenuItem("Ungroup"));
239674 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
675
+
676
+// menu.add("-");
677
+//
678
+// switchItem = menu.add(new MenuItem("Switch node"));
679
+// switchItem.addActionListener(this);
680
+ if (Globals.ADVANCED)
681
+ {
247682 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248683 switchGeoItem.addActionListener(this);
249684 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250685 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
686
+ morphItem = menu.add(new MenuItem("Morph Group"));
252687 morphItem.addActionListener(this);
688
+
689
+ menu.add("-");
690
+ physicsItem = menu.add(new MenuItem("Physics"));
691
+ physicsItem.addActionListener(this);
692
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
693
+ frameselectorItem.addActionListener(this);
253694 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254695 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
696
+ }
257697
258698 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
699
+// textureItem = menu.add(new MenuItem("Texture"));
700
+// textureItem.addActionListener(this);
261701 billboardItem = menu.add(new MenuItem("Billboard"));
262702 billboardItem.addActionListener(this);
263703 csgItem = menu.add(new MenuItem("CSG"));
264704 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
705
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266706 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
707
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268708 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
709
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270710 shadowZItem.addActionListener(this);
711
+ attributeItem = menu.add(new MenuItem("Attribute"));
712
+ attributeItem.addActionListener(this);
713
+
714
+ if (Globals.ADVANCED)
715
+ {
716
+ menu.add("-");
271717 linkerItem = menu.add(new MenuItem("Linker"));
272718 linkerItem.addActionListener(this);
273719 templateItem = menu.add(new MenuItem("Template"));
274720 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277721 pointflowItem = menu.add(new MenuItem("Point Flow"));
278722 pointflowItem.addActionListener(this);
723
+ }
279724 menu.add("-");
280725 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281726 resetTransformItem.addActionListener(this);
282727 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283728 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
729
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
730
+ resetCentroidXZItem.addActionListener(this);
731
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
732
+ transformGeometryItem.addActionListener(this);
733
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
734
+ transformChildrenItem.addActionListener(this);
286735
287736 oe.menuBar.add(menu = new Menu("Geometry"));
288737 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +742,11 @@
293742 genNormalsCADItem.addActionListener(this);
294743 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295744 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
745
+ if (Globals.ADVANCED)
746
+ {
747
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297748 genNormalsMINEItem.addActionListener(this);
749
+ }
298750 stripifyItem = menu.add(new MenuItem("Stripify"));
299751 stripifyItem.addActionListener(this);
300752 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +768,34 @@
316768 reduce34MeshItem.addActionListener(this);
317769 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318770 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321771 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322772 clipMeshItem.addActionListener(this);
773
+
774
+ if (Globals.ADVANCED)
775
+ {
776
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
777
+ smoothMeshItem.addActionListener(this);
778
+ }
323779
324780 oe.menuBar.add(menu = new Menu("Attributes"));
325781 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326782 clearMaterialsItem.addActionListener(this);
783
+ resetAllItem = menu.add(new MenuItem("Reset All"));
784
+ resetAllItem.addActionListener(this);
785
+ stepAllItem = menu.add(new MenuItem("Step All"));
786
+ stepAllItem.addActionListener(this);
327787 menu.add("-");
328788 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329789 liveleavesItem.addActionListener(this);
330790 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331791 unliveleavesItem.addActionListener(this);
792
+ if (Globals.ADVANCED)
793
+ {
332794 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333795 supportleavesItem.addActionListener(this);
334796 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335797 unsupportleavesItem.addActionListener(this);
798
+ }
336799 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337800 hideleavesItem.addActionListener(this);
338801 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +804,14 @@
341804 markleavesItem.addActionListener(this);
342805 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343806 unmarkleavesItem.addActionListener(this);
807
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
808
+ rewindleavesItem.addActionListener(this);
809
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
810
+ unrewindleavesItem.addActionListener(this);
811
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
812
+ randomleavesItem.addActionListener(this);
813
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
814
+ unrandomleavesItem.addActionListener(this);
344815 menu.add("-");
345816 flipVItem = menu.add(new MenuItem("Flip V"));
346817 flipVItem.addActionListener(this);
....@@ -366,45 +837,56 @@
366837 attachBumpItem.addActionListener(this);
367838 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368839 pigmentBumpItem.addActionListener(this);
840
+ //embedTexturesItem
369841 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370842 detachPigmentItem.addActionListener(this);
371843 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372844 detachBumpItem.addActionListener(this);
845
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
846
+ embedTexturesItem.addActionListener(this);
847
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
848
+ deEmbedTexturesItem.addActionListener(this);
373849 menu.add("-");
374850 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375851 sortbysizeItem.addActionListener(this);
376852 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377853 sortbynameItem.addActionListener(this);
378854 menu.add("-");
855
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
856
+ shareGeometriesItem.addActionListener(this);
857
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
858
+ mergeGeometriesItem.addActionListener(this);
859
+ if (Globals.ADVANCED)
860
+ {
861
+ // Pretty much the same as duplicate and clone.
379862 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380863 extractGeometriesItem.addActionListener(this);
381864 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382865 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
866
+ }
387867
388868 oe.menuBar.add(menu = new Menu("Insert"));
389869 buildCreateMenu(menu);
390870
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402871 oe.menuBar.add(menu = new Menu("Tools"));
403872 buildToolsMenu(menu);
404873 }
405874
875
+
406876 void SetupUI2(ObjEditor oe)
407877 {
878
+ // June 2019
879
+ if (oe == null)
880
+ {
881
+ //super.SetupUI2(this);
882
+ //return;
883
+ }
884
+
885
+ if (copy != group)
886
+ {
887
+ //super.SetupUI2(this);
888
+ }
889
+
408890 //new Exception().printStackTrace();
409891
410892 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +915,243 @@
433915 oe.radioPanel.add(dummyButton);
434916 oe.buttonGroup.add(dummyButton);
435917 */
436
- aConstraints.gridy += 1;
918
+ cGridBag copyOptionsPanel = new cGridBag();
919
+
920
+ copyOptionsPanel.preferredHeight = 2;
437921
438922 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439923
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
924
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
925
+ //minButton.setToolTipText("Minimize window");
926
+ //minButton.addActionListener(this);
442927
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
928
+ if (Globals.ADVANCED)
929
+ {
930
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ maxButton.setToolTipText("Maximize window");
932
+ maxButton.addActionListener(this);
933
+ }
934
+
935
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ fullButton.setToolTipText("Full-screen window");
937
+ fullButton.addActionListener(this);
938
+
939
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454940 screenfitButton.setToolTipText("Screen fit");
455941 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
942
+
943
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
944
+ restoreCameraButton.setToolTipText("Restore viewpoint");
945
+ restoreCameraButton.addActionListener(this);
946
+
947
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
948
+ saveVersionButton.setToolTipText("Duplicate current version");
949
+ saveVersionButton.addActionListener(this);
950
+
951
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
952
+ deleteVersionButton.setToolTipText("Delete current version");
953
+ deleteVersionButton.addActionListener(this);
954
+
955
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
956
+ previousVersionButton.setToolTipText("Previous version");
957
+ previousVersionButton.addActionListener(this);
958
+ previousVersionButton.setEnabled(false);
959
+
960
+ cGridBag updown = new cGridBag().setVertical(true);
961
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
962
+ restoreButton.setToolTipText("Undo (restore current version)");
963
+ restoreButton.addActionListener(this);
964
+ //restoreButton.setEnabled(false);
965
+
966
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ replaceButton.setToolTipText("Save (replace current version)");
968
+ replaceButton.addActionListener(this);
969
+ //replaceButton.setEnabled(false);
970
+
971
+ copyOptionsPanel.add(updown);
972
+
973
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
974
+ nextVersionButton.setToolTipText("Next version");
975
+ nextVersionButton.addActionListener(this);
976
+ nextVersionButton.setEnabled(false);
977
+
978
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
979
+ liveCB.setToolTipText("Enable animation");
980
+ liveCB.addItemListener(this);
981
+
982
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
+ oneStepButton.setToolTipText("Animate one step forward");
984
+ oneStepButton.addActionListener(this);
985
+
986
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
987
+ fastCB.setToolTipText("Fast mode");
988
+ fastCB.addItemListener(this);
989
+
990
+ //oe.toolboxPanel.Return();
991
+
992
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
993
+// trackCB.setToolTipText("Enable tracking");
994
+// trackCB.addItemListener(this);
995
+
457996 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458997 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464998
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
473
-
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
- twoButton.setToolTipText("Show center view only");
483
- twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
999
+ if (Globals.ADVANCED)
1000
+ {
1001
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ snapobjectButton.addActionListener(this);
1003
+ snapobjectButton.setToolTipText("Snap Object");
1004
+
1005
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
4851006 fourButton.addActionListener(this);
486
- fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
- sixButton.setToolTipText("2-column layout left");
489
- sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
- threeButton.setToolTipText("2-column layout right");
1007
+ fourButton.setToolTipText("Show control panel only");
1008
+ }
1009
+
1010
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
1011
+
1012
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ twoButton.setToolTipText("Show 3D view only");
1014
+ twoButton.addActionListener(this);
1015
+ this.fullscreenLayout = twoButton;
1016
+
1017
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ threeButton.setToolTipText("Show controls and 3D view");
4921019 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
- sevenButton.setToolTipText("3-column layout");
495
- sevenButton.addActionListener(this);
1020
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1021
+ sixButton.setToolTipText("Show 3D view and controls");
1022
+ sixButton.addActionListener(this);
1023
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1024
+// sevenButton.setToolTipText("3-column layout");
1025
+// sevenButton.addActionListener(this);
4961026 //
4971027
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
1028
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ rootButton.setToolTipText("Open selection in new tab");
5001030 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1031
+
1032
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5031033 closeButton.setToolTipText("Close tab");
5041034 closeButton.addActionListener(this);
5051035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5061036 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
5151037
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1038
+ cGridBag row1 = new cGridBag();
1039
+
1040
+ // INSERT
1041
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1042
+ gridButton.setToolTipText("Create grid");
1043
+ gridButton.addActionListener(this);
1044
+
1045
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ boxButton.setToolTipText("Create box");
1047
+ boxButton.addActionListener(this);
1048
+
1049
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ sphereButton.setToolTipText("Create sphere");
1051
+ sphereButton.addActionListener(this);
1052
+
1053
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1054
+ coneButton.setToolTipText("Create cone");
1055
+ coneButton.addActionListener(this);
1056
+
1057
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
+ torusButton.setToolTipText("Create torus");
1059
+ torusButton.addActionListener(this);
1060
+
1061
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
+ superButton.setToolTipText("Create superellipsoid");
1063
+ superButton.addActionListener(this);
1064
+
1065
+ if (Globals.ADVANCED)
1066
+ {
1067
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ kleinButton.setToolTipText("Create Klein bottle");
1069
+ kleinButton.addActionListener(this);
1070
+ }
1071
+
1072
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1073
+ particlesButton.setToolTipText("Create particle system");
1074
+ particlesButton.addActionListener(this);
1075
+
1076
+ oe.toolboxPanel.add(row1);
1077
+
1078
+ cGridBag row2 = new cGridBag();
1079
+
1080
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1081
+ groupButton.setToolTipText("Create group");
1082
+ groupButton.addActionListener(this);
1083
+
1084
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1085
+ compositeButton.setToolTipText("Create composite");
1086
+ compositeButton.addActionListener(this);
1087
+
1088
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1089
+ switchButton.setToolTipText("Create item switcher");
1090
+ switchButton.addActionListener(this);
1091
+
1092
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1093
+ loopButton.setToolTipText("Create loop");
1094
+ loopButton.addActionListener(this);
1095
+
1096
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1097
+ textureButton.setToolTipText("Create texture");
1098
+ textureButton.addActionListener(this);
1099
+
1100
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1101
+ overlayButton.setToolTipText("Create overlay");
1102
+ overlayButton.addActionListener(this);
1103
+
1104
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1105
+ lightButton.setToolTipText("Create light");
1106
+ lightButton.addActionListener(this);
1107
+
1108
+ oe.toolboxPanel.add(row2);
1109
+
1110
+ // ENVYMAPS
1111
+ cGridBag skyboxpane = new cGridBag();
1112
+ skyboxpane.preferredHeight = 100;
1113
+
1114
+ oe.skyboxPanel.add(skyboxpane);
1115
+
1116
+ JTabbedPane skyboxpanel = new JTabbedPane();
1117
+ skyboxpane.add(skyboxpanel);
1118
+
1119
+ AddSkyboxTab0(skyboxpanel);
1120
+ AddSkyboxTab1(skyboxpanel);
1121
+ AddSkyboxTab2(skyboxpanel);
1122
+ AddSkyboxTab3(skyboxpanel);
1123
+
1124
+ // EDIT panel
1125
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1126
+ editButton.setToolTipText("Pin selection controls");
1127
+ editButton.addActionListener(this);
1128
+
1129
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1130
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5171131 uneditButton.addActionListener(this);
5181132
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1133
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1134
+ allParamsButton.setToolTipText("Show all controle");
5311135 allParamsButton.addActionListener(this);
5321136
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
538
- unselectButton.addActionListener(this);
1137
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1138
+ clearPanelButton.setToolTipText("Clear edit panel");
1139
+ clearPanelButton.addActionListener(this);
5391140
1141
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1142
+ //unselectButton.setToolTipText("Unselect");
1143
+ //unselectButton.addActionListener(this);
1144
+
1145
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1146
+ flashSelectionButton.setToolTipText("Highlight selection");
1147
+ flashSelectionButton.addActionListener(this);
1148
+
1149
+ editCommandsPanel.preferredHeight = 1;
1150
+
1151
+ SetPinStates(false);
1152
+// oe.treePanel.add(commandsPanel);
1153
+// oe.treePanel.Return();
1154
+
5401155 // oe.aConstraints.gridx += 1;
5411156 // oe.aConstraints.weighty = 0;
5421157 // oe.aConstraints.gridwidth = 1;
....@@ -548,47 +1163,32 @@
5481163 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5491164 // gcButton.addActionListener(this);
5501165
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
1166
+ cGridBag jSPPanel = new cGridBag();
1167
+
1168
+ JScrollPane jSP;
5621169 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1170
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5641171 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
5841172
1173
+ oe.treePanel.add(jSPPanel);
1174
+ oe.treePanel.Return();
1175
+
1176
+ oe.treePanel.add(copyOptionsPanel);
1177
+ oe.treePanel.Return();
1178
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1179
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1180
+ sliderPane.preferredHeight = 1;
1181
+
1182
+// mainPanel.setDividerLocation(0.1); //1.0);
1183
+ mainPanel.setResizeWeight(0.4);
1184
+
5851185 //jList.addListSelectionListener(this);
5861186 oe.jTree.addTreeSelectionListener(this);
5871187 //jTree.setRootVisible(false);
5881188 //jTree.setEditable(true);
5891189 oe.jTree.setDragEnabled(true);
5901190 //jTree.setPreferredSize(new Dimension(10,10));
591
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
5921192
5931193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
5941194
....@@ -600,97 +1200,163 @@
6001200 dgr.addDragGestureListener(this);
6011201 }catch(Exception e) {}
6021202 */
603
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
6041204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6051205 }
6061206
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
1207
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6081208 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
1209
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1210
+ colorCB.setToolTipText("Copy color when dropped");
1211
+ colorCB.addItemListener(this);
6181212
619
- // constraints.gridy += 1;
1213
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1214
+ materialCB.setToolTipText("Copy material when dropped");
1215
+ materialCB.addItemListener(this);
1216
+
1217
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1218
+ textureCB.setToolTipText("Copy texture when dropped");
1219
+ textureCB.addItemListener(this);
1220
+
1221
+ panel.Return();
1222
+
1223
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1224
+ boxCB.setToolTipText("Display bounding boxes");
1225
+ boxCB.addItemListener(this);
1226
+
1227
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1228
+ zoomBoxCB.setToolTipText("Display only for wheel");
1229
+ zoomBoxCB.addItemListener(this);
1230
+
1231
+ if (true) // Globals.ADVANCED)
1232
+ {
1233
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1234
+// supportCB.setToolTipText("Enable rigging");
1235
+// supportCB.addItemListener(this);
1236
+
1237
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1238
+ freezeCB.setToolTipText("Fast moving camera");
1239
+ freezeCB.addItemListener(this);
1240
+
6201241 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6211242 // localCB.addItemListener(this);
6221243
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
1244
+ panel.Return();
1245
+
1246
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6251247 crowdCB.setToolTipText("Used for crowds");
6261248 crowdCB.addItemListener(this);
6271249
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
1250
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
6301251 smoothCB.setToolTipText("Snapping delay");
6311252 smoothCB.addItemListener(this);
6321253
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
1254
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1255
+// slowCB.setToolTipText("Smooth interpolation");
1256
+// slowCB.addItemListener(this);
1257
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1258
+ minshaderCB.setToolTipText("Minimal fast shader");
1259
+ minshaderCB.addItemListener(this);
1260
+
6461261 // constraints.gridy += 1;
6471262 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6481263 // speakerMocapCB.addItemListener(this);
6491264
1265
+ panel.Return();
1266
+
6501267 if (false)
6511268 {
6521269 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
1270
+ //constraints.gridy += 1;
1271
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
6551272 speakerCameraCB.addItemListener(this);
6561273
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
1274
+ //constraints.gridy += 1;
1275
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
6591276 speakerFocusCB.addItemListener(this);
6601277
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
1278
+ //constraints.gridy += 1;
1279
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6631280 smoothfocusCB.addItemListener(this);
1281
+ panel.Return();
6641282 }
6651283
6661284 //constraints.gridx += 1;
6671285 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6681286 // debugCB.addItemListener(this);
6691287
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
1288
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1289
+ trackCB.setToolTipText("Enable tracking target");
1290
+ trackCB.addItemListener(this);
1291
+
1292
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1293
+ oeilCB.setToolTipText("Move camera when tracking");
6721294 oeilCB.addItemListener(this);
6731295
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
1296
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1297
+ shadowCB.setToolTipText("When live compute shadows");
1298
+ shadowCB.addItemListener(this);
1299
+
1300
+ panel.Return();
1301
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1302
+ toggleTextureCB.setToolTipText("Load textures");
1303
+ toggleTextureCB.addItemListener(this);
1304
+
1305
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1306
+ toggleSwitchCB.setToolTipText("Choose a single item");
1307
+ toggleSwitchCB.addItemListener(this);
1308
+
1309
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1310
+ autokeepCB.setToolTipText("On structure change");
1311
+ autokeepCB.addItemListener(this);
1312
+
1313
+ panel.Return();
1314
+ if (Globals.ADVANCED)
1315
+ {
1316
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6761317 lookAtCB.setToolTipText("Look-at target");
6771318 lookAtCB.addItemListener(this);
1319
+ }
1320
+
1321
+ }
1322
+
1323
+ cGridBag fill = new cGridBag();
1324
+ fill.preferredHeight = 200;
1325
+ cGridBag fill2 = new cGridBag();
1326
+ fill2.preferredHeight = 200;
1327
+ cGridBag fill3 = new cGridBag();
1328
+ fill3.preferredHeight = 200;
1329
+
1330
+ panel.add(fill);
1331
+ panel.add(fill2);
1332
+ panel.add(fill3);
6781333
6791334 }
6801335
6811336 void EditObject(Object3D obj)
6821337 {
6831338 cRadio radioButton = new cRadio(obj.name);
1339
+
1340
+ // June 2019. Patch to avoid bug with transparency.
1341
+ radioButton.hadMaterial = obj.material != null;
1342
+ if (!radioButton.hadMaterial)
1343
+ {
1344
+ obj.material = new cMaterial();
1345
+ }
1346
+
6841347 radioButton.SetObject(obj);
685
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
6861349 radioButton.SetCamera(cameraView.renderCamera, false);
6871350 radioButton.addActionListener(this);
6881351 radioPanel.add(radioButton);
6891352 buttonGroup.add(radioButton);
6901353 radioButton.doClick();
6911354 }
1355
+
6921356 void SetupViews(ObjEditor oe)
6931357 {
1358
+ theFrame = this;
1359
+
6941360 oe.SetupViews();
6951361
6961362 System.out.println("SetupViews");
....@@ -699,23 +1365,30 @@
6991365 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001366 }
7011367
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1368
+ cToggleButton liveCB;
1369
+ cCheckBox supportCB;
1370
+ cCheckBox localCB;
1371
+ cCheckBox crowdCB;
1372
+ cCheckBox smoothCB;
1373
+ cCheckBox minshaderCB;
1374
+
1375
+ cToggleButton fastCB;
1376
+ cCheckBox slowCB;
1377
+ cCheckBox boxCB;
1378
+ cCheckBox zoomBoxCB;
1379
+ cCheckBox freezeCB;
1380
+ //cToggleButton trackCB;
1381
+ cCheckBox trackCB;
1382
+ cCheckBox smoothfocusCB;
7131383 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1384
+ cCheckBox speakerCameraCB;
1385
+ cCheckBox speakerFocusCB;
1386
+ cCheckBox debugCB;
1387
+
1388
+ cCheckBox oeilCB;
1389
+ cCheckBox shadowCB;
1390
+ cCheckBox autokeepCB;
1391
+ cCheckBox lookAtCB;
7191392
7201393 // static int COLOR = 1;
7211394 // static int MATERIAL = 2;
....@@ -723,9 +1396,9 @@
7231396
7241397 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251398
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1399
+ cCheckBox colorCB;
1400
+ cCheckBox materialCB;
1401
+ cCheckBox textureCB;
7291402
7301403 public void itemStateChanged(ItemEvent e)
7311404 {
....@@ -753,6 +1426,7 @@
7531426 } else if(e.getSource() == liveCB)
7541427 {
7551428 cameraView.ToggleLive();
1429
+ refreshContents(false);
7561430 }
7571431 else if(e.getSource() == supportCB)
7581432 {
....@@ -768,6 +1442,12 @@
7681442 {
7691443 cameraView.ToggleInertia();
7701444 cameraView.repaint();
1445
+ }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
7711451 }
7721452 else if(e.getSource() == localCB)
7731453 {
....@@ -817,6 +1497,18 @@
8171497 {
8181498 cameraView.ToggleOeil();
8191499 }
1500
+ else if(e.getSource() == shadowCB)
1501
+ {
1502
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1503
+ }
1504
+ else if(e.getSource() == freezeCB)
1505
+ {
1506
+ Globals.FREEZEONMOVE ^= true;
1507
+ }
1508
+ else if(e.getSource() == autokeepCB)
1509
+ {
1510
+ Globals.REPLACEONMAKE ^= true;
1511
+ }
8201512 else if(e.getSource() == lookAtCB)
8211513 {
8221514 cameraView.ToggleLookAt();
....@@ -833,7 +1525,8 @@
8331525
8341526 /**/
8351527 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1528
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1529
+ TreePath path = objEditor.jTree.getSelectionPath();
8371530 if ((path == null) || (path.getPathCount() <= 1)) {
8381531 // We can't move the root node or an empty selection
8391532 return;
....@@ -896,8 +1589,6 @@
8961589 }
8971590 }
8981591
899
- String string = (String) object;
900
-
9011592 System.out.println("Transfer = " + object + "; drop : " + target);
9021593 // if( object instanceof java.io.File[])
9031594 // {
....@@ -905,7 +1596,11 @@
9051596 // objEditor.DropFile((java.io.File[]) object, true);
9061597 // return;
9071598 // }
908
- if (string.charAt(0) == '/')
1599
+
1600
+ String string = object.toString();
1601
+
1602
+ // File path for Mac and Windows
1603
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091604 {
9101605 // file(s)
9111606 String[] names = string.split("\n");
....@@ -932,7 +1627,7 @@
9321627
9331628 flashIt = false;
9341629 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1630
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361631 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371632
9381633 if (group.selection.size() == 1)
....@@ -948,23 +1643,33 @@
9481643
9491644 assert target == objEditor.jTree;
9501645 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1646
+ Object3D destinationLeaf;
9511647 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1648
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531649 } catch (Exception e) {
9541650 System.out.println("destinationPath : " + destinationPath);
9551651 return;
9561652 }
9571653
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1654
+ for (int i=group.selection.size(); --i>=0;)
9591655 {
1656
+ Object3D child = (Object3D)group.selection.elementAt(i);
1657
+
1658
+ // Cannot move into itself
1659
+ if (child == destinationLeaf)
1660
+ return;
1661
+ }
1662
+
1663
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1664
+// {
9601665 loadClipboard(true);
9611666 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1667
+ pasteInto(false, false);
1668
+// } else {
1669
+// loadClipboard(false);
1670
+// objEditor.jTree.setSelectionPath(destinationPath);
1671
+// pasteInto(false, false); // true); // ???
1672
+// }
9681673 }
9691674 public void dropActionChanged(DropTargetDragEvent dtde)
9701675 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1774,107 @@
10691774 {
10701775 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711776 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1777
+// gridItem = menu.add(new MenuItem("Grid"));
1778
+// gridItem.addActionListener(this);
1779
+// rectoidItem = menu.add(new MenuItem("Box"));
1780
+// rectoidItem.addActionListener(this);
1781
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1782
+// ellipsoidItem.addActionListener(this);
1783
+// coneItem = menu.add(new MenuItem("Cone"));
1784
+// coneItem.addActionListener(this);
1785
+// torusItem = menu.add(new MenuItem("Torus"));
1786
+// torusItem.addActionListener(this);
1787
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1788
+// superItem.addActionListener(this);
1789
+
1790
+ cameraItem = menu.add(new MenuItem("Camera"));
1791
+ cameraItem.addActionListener(this);
1792
+
1793
+ if (!Globals.ADVANCED)
1794
+ {
10841795 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851796 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1797
+ }
1798
+
1799
+// particleItem = menu.add(new MenuItem("Particle system"));
1800
+// particleItem.addActionListener(this);
1801
+ if (Globals.ADVANCED)
1802
+ {
10881803 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891804 ragdollItem.addActionListener(this);
10901805 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911806 ragdoll2Item.addActionListener(this);
1807
+ }
10921808 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1809
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941810 meshItem.addActionListener(this);
10951811 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961812 // meshGroupItem.addActionListener(this);
1813
+ if (Globals.ADVANCED)
1814
+ {
10971815 springItem = menu.add(new MenuItem("Spring"));
10981816 springItem.addActionListener(this);
10991817 flagItem = menu.add(new MenuItem("Flag"));
11001818 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051819 blobItem = menu.add(new MenuItem("Blob"));
11061820 blobItem.addActionListener(this);
11071821 latheItem = menu.add(new MenuItem("Lathe"));
11081822 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1823
+ }
1824
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1825
+ bezierItem.addActionListener(this);
1826
+// overlayItem = menu.add(new MenuItem("Overlay"));
1827
+// overlayItem.addActionListener(this);
1828
+// lightItem = menu.add(new MenuItem("Light"));
1829
+// lightItem.addActionListener(this);
11111830 menu.add("-");
11121831 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131832 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1833
+// loopItem = menu.add(new MenuItem("Loop"));
1834
+// loopItem.addActionListener(this);
11161835 doubleItem = menu.add(new MenuItem("Fork"));
11171836 doubleItem.addActionListener(this);
1837
+ if (Globals.ADVANCED)
1838
+ {
11181839 tripleItem = menu.add(new MenuItem("Trident"));
11191840 tripleItem.addActionListener(this);
1841
+ }
11201842 }
11211843
11221844 void buildToolsMenu(Menu menu)
11231845 {
11241846 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251847 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1848
+ animationItem.setState(Globals.ANIMATION);
1849
+
1850
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1851
+ archiveItem.addActionListener(this);
11271852
11281853 menu.add("-");
11291854 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301855 parseverticesItem.addActionListener(this);
11311856 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321857 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1858
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341859 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371860 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381861 reduceMorphItem.addActionListener(this);
11391862 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401863 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441864 menu.add("-");
1145
-
11461865 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471866 memoryItem.addActionListener(this);
1867
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1868
+ computeAOItem.addActionListener(this);
1869
+
1870
+ if (Globals.ADVANCED)
1871
+ {
1872
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1873
+ mirrorItem.addActionListener(this);
1874
+ menu.add("-");
11481875 menu.add(analyzeItem = new MenuItem("Analyze"));
11491876 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1877
+ menu.add(dumpItem = new MenuItem("Print"));
11511878 dumpItem.addActionListener(this);
11521879 // menu.add(pathItem = new MenuItem("From-to path"));
11531880 // pathItem.addActionListener(this);
....@@ -1165,6 +1892,7 @@
11651892 menu.add("-");
11661893 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671894 editScriptItem.addActionListener(this);
1895
+ }
11681896 }
11691897
11701898 void ScreenFit()
....@@ -1287,9 +2015,34 @@
12872015 shadow.material = new cMaterial(obj.material);
12882016 shadow.material.diffuse = 0.0001f;
12892017 shadow.material.specular = 0.0001f;
2018
+ //shadow.projectedVertices[1].x = 300;
12902019
12912020 makeSomething(shadow);
12922021 }
2022
+
2023
+ private void ClearUnpinned()
2024
+ {
2025
+ //for (Object3D obj : listUI)
2026
+ for (int i=listUI.size(); --i>=0;)
2027
+ {
2028
+ Object3D obj = listUI.elementAt(i);
2029
+ if (!obj.pinned)
2030
+ {
2031
+ obj.CloseUI();
2032
+ listUI.remove(i);
2033
+ }
2034
+ }
2035
+ }
2036
+
2037
+ private void EditElement(Object3D elem, boolean newWindow)
2038
+ {
2039
+ // if (!(elem instanceof Composite))
2040
+ // newWindow = false;
2041
+ listUI.add(elem);
2042
+ elem.openEditWindow(this, newWindow); //, false);
2043
+ System.out.println("edit : " + elem);
2044
+ elem.editWindow.refreshContents(true); // ? new
2045
+ }
12932046
12942047 /**
12952048 * applyExample
....@@ -1493,9 +2246,9 @@
14932246
14942247 void Overwrite(int mask)
14952248 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2249
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14972250 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
2251
+ Object3D content = Grafreed.clipboard.get(0);
14992252
15002253 if (content instanceof cGroup && ((cGroup)content).transientlink )
15012254 content = ((cGroup)content).get(0);
....@@ -1518,6 +2271,7 @@
15182271 //
15192272 public void actionPerformed(ActionEvent event) // , Object arg)
15202273 {
2274
+ Object source = event.getSource();
15212275 /*
15222276 if (event.getSource() == nameField)
15232277 {
....@@ -1529,11 +2283,11 @@
15292283 }
15302284 else
15312285 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2286
+ if (source == lookAtItem || source == lookFromItem)
15332287 {
15342288 ScreenFit();
15352289 } else
1536
- if (event.getSource() == switchItem)
2290
+ if (source == switchViewItem)
15372291 {
15382292 cVector v1 = new cVector();
15392293 cVector v2 = new cVector();
....@@ -1542,11 +2296,11 @@
15422296 objEditor.cameraView.renderCamera.setAim(v2, v1);
15432297 objEditor.cameraView.repaint();
15442298 } else
1545
- if (event.getSource() == rectoidItem)
2299
+ if (source == rectoidItem || source == boxButton)
15462300 {
15472301 makeSomething(new Box());
15482302 } else
1549
- if (event.getSource() == particleItem)
2303
+ if (source == particleItem || source == particlesButton)
15502304 {
15512305 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15522306 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +2321,9 @@
15672321 applyExample(particleGeom, "SMOKE");
15682322 makeSomething(particleGeom);
15692323 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2324
+ if (source == ragdollItem || source == ragdoll2Item)
15712325 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2326
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15732327
15742328 ragdoll.toParent = LA.newMatrix();
15752329 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +2341,7 @@
15872341 } else
15882342 /*
15892343 */
1590
- if (event.getSource() == heightFieldItem)
2344
+ if (source == heightFieldItem)
15912345 {
15922346 Object3D obj = new Object3D();
15932347
....@@ -1625,31 +2379,31 @@
16252379
16262380 makeSomething(obj);
16272381 } else
1628
- if (event.getSource() == gridItem)
2382
+ if (source == gridItem || source == gridButton)
16292383 {
16302384 makeSomething(new Grid());
16312385 } else
1632
- if (event.getSource() == ellipsoidItem)
2386
+ if (source == ellipsoidItem || source == sphereButton)
16332387 {
16342388 makeSomething(new Sphere());
16352389 } else
1636
- if (event.getSource() == coneItem)
2390
+ if (source == coneItem || source == coneButton)
16372391 {
16382392 makeSomething(new Cone());
16392393 } else
1640
- if (event.getSource() == torusItem)
2394
+ if (source == torusItem || source == torusButton)
16412395 {
16422396 makeSomething(new Torus());
16432397 } else
1644
- if (event.getSource() == superItem)
2398
+ if (source == superItem || source == superButton)
16452399 {
16462400 makeSomething(new Superellipsoid());
16472401 } else
1648
- if (event.getSource() == kleinItem)
2402
+ if (source == kleinItem || source == kleinButton)
16492403 {
16502404 makeSomething(new Klein());
16512405 } else
1652
- if (event.getSource() == blobItem)
2406
+ if (source == blobItem)
16532407 {
16542408 Blob blob = new Blob();
16552409 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +2411,15 @@
16572411 //blob.retile();
16582412 makeSomething(blob);
16592413 } else
1660
- if (event.getSource() == latheItem)
2414
+ if (source == latheItem)
16612415 {
16622416 makeSomething(new Lathe());
16632417 } else
1664
- if (event.getSource() == bezierItem)
2418
+ if (source == bezierItem)
16652419 {
16662420 makeSomething(new BezierSurface());
16672421 } else
1668
- if (event.getSource() == checkerItem)
2422
+ if (source == overlayItem || source == overlayButton)
16692423 {
16702424 /*
16712425 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +2434,7 @@
16802434 */
16812435 makeSomething(new Checker());
16822436 } else
1683
- if (event.getSource() == meshItem)
2437
+ if (source == meshItem)
16842438 {
16852439 Object3D itemtomake = new Object3D();
16862440 Object3D child;
....@@ -1701,35 +2455,52 @@
17012455 makeSomething(child);
17022456 }
17032457 } else
1704
- if (event.getSource() == springItem)
2458
+ if (source == springItem)
17052459 {
17062460 cSpring s = new cSpring();
17072461 s.setup();
17082462 makeSomething(s);
17092463 } else
1710
- if (event.getSource() == flagItem)
2464
+ if (source == flagItem)
17112465 {
17122466 cSpring s = new cFlag();
17132467 s.setup();
17142468 makeSomething(s);
17152469 } else
1716
- if (event.getSource() == lightItem)
2470
+ if (source == lightItem || source == lightButton)
17172471 {
17182472 makeSomething(new Light());
17192473 } else
1720
- if (event.getSource() == csgItem)
2474
+// if (source == skybox1Button ||
2475
+// source == skybox2Button ||
2476
+// source == skybox3Button ||
2477
+// source == skybox4Button ||
2478
+// source == skybox5Button ||
2479
+// source == skybox6Button ||
2480
+// source == skybox7Button ||
2481
+// source == skybox11Button ||
2482
+// source == skybox12Button ||
2483
+// source == skybox13Button ||
2484
+// source == skybox14Button ||
2485
+// source == skybox15Button ||
2486
+// source == skybox16Button ||
2487
+// source == skybox17Button)
2488
+// {
2489
+// ChangeSkybox(source);
2490
+// } else
2491
+ if (source == csgItem)
17212492 {
17222493 group(new CSG());
17232494 } else
1724
- if (event.getSource() == templateItem)
2495
+ if (source == templateItem)
17252496 {
17262497 group(new cTemplate());
17272498 } else
1728
- if (event.getSource() == attributeItem)
2499
+ if (source == attributeItem)
17292500 {
17302501 makeSomething(new Attribute());
17312502 } else
1732
- if (event.getSource() == pointflowItem)
2503
+ if (source == pointflowItem)
17332504 {
17342505 makeSomething(new PointFlow());
17352506 } else
....@@ -1741,7 +2512,7 @@
17412512 } else
17422513 */
17432514
1744
- if (event.getSource() == superLoopItem)
2515
+ if (source == superLoopItem)
17452516 {
17462517 Composite g = new cGroup();
17472518 for (int i=0; i<15; i++)
....@@ -1763,30 +2534,30 @@
17632534
17642535 group(g);
17652536 } else
1766
- if (event.getSource() == loopItem)
2537
+ if (source == loopItem || source == loopButton)
17672538 {
17682539 Composite csg = new GroupLeaf();
17692540 csg.count = 5;
17702541 group(csg);
1771
- Composite child = new cGroup();
2542
+ Composite child = new cGroup("Branch");
17722543 csg.addChild(child);
17732544 child.addChild(csg);
17742545 } else
1775
- if (event.getSource() == doubleItem)
2546
+ if (source == doubleItem)
17762547 {
1777
- Composite csg = new GroupLeaf();
2548
+ Composite csg = new GroupLeaf("Fork");
17782549 csg.count = 5;
17792550 group(csg);
1780
- Composite child = new cGroup();
2551
+ Composite child = new cGroup("Branch A");
17812552 csg.addChild(child);
17822553 child.addChild(csg);
1783
- child = new cGroup();
2554
+ child = new cGroup("Branch B");
17842555 csg.addChild(child);
17852556 child.addChild(csg);
17862557 } else
1787
- if (event.getSource() == tripleItem)
2558
+ if (source == tripleItem)
17882559 {
1789
- Composite csg = new GroupLeaf();
2560
+ Composite csg = new GroupLeaf("Trident");
17902561 csg.count = 4;
17912562 group(csg);
17922563 Composite child = new cGroup();
....@@ -1799,73 +2570,105 @@
17992570 csg.addChild(child);
18002571 child.addChild(csg);
18012572 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
2573
+ if (source == computeAOItem)
18202574 {
18212575 Globals.drawMode = CameraPane.OCCLUSION;
1822
- Globals.theRenderer.repaint();
2576
+ cameraView.repaint();
18232577 } else
1824
- if (event.getSource() == recompileItem)
2578
+ if (source == recompileItem)
18252579 {
18262580 Recompile();
18272581 refreshContents();
18282582 } else
1829
- if (event.getSource() == editScriptItem)
2583
+ if (source == editScriptItem)
18302584 {
18312585 OpenDialog();
18322586 refreshContents();
18332587 } else
1834
- if (event.getSource() == invariantsItem)
2588
+ if (source == invariantsItem)
18352589 {
18362590 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
18382592 } else
1839
- if (event.getSource() == memoryItem)
2593
+ if (source == memoryItem)
18402594 {
18412595 //System.out.println("Invariants:");
18422596 PrintMemory();
18432597 } else
1844
- if (event.getSource() == pathItem)
2598
+ if (source == pathItem)
18452599 {
18462600 PrintPath();
18472601 } else
1848
- if (event.getSource() == analyzeItem)
2602
+ if (source == analyzeItem)
18492603 {
18502604 AnalyzeObject();
18512605 } else
1852
- if (event.getSource() == dumpItem)
2606
+ if (source == dumpItem)
18532607 {
18542608 DumpObject();
18552609 } else
1856
- if (event.getSource() == screenfitButton)
2610
+ if (source == minButton)
18572611 {
1858
- //Reload(lastConverter, lastFilename, true);
2612
+ Minimize();
2613
+ } else
2614
+ if (source == maxButton)
2615
+ {
2616
+ Maximize();
2617
+ } else
2618
+ if (source == fullButton)
2619
+ {
2620
+ ToggleFullScreen();
2621
+ } else
2622
+ if (source == previousVersionButton)
2623
+ {
2624
+ // Go to previous version
2625
+ //if (!Undo())
2626
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2627
+ PreviousVersion();
2628
+ } else
2629
+ if (source == restoreButton)
2630
+ {
2631
+ // Restore current version
2632
+ Restore();
2633
+ //restoreButton.setEnabled(false);
2634
+ } else
2635
+ if (source == replaceButton)
2636
+ {
2637
+ // Overwrite current version
2638
+ Replace();
2639
+ //replaceButton.setEnabled(false);
2640
+ } else
2641
+ if (source == nextVersionButton)
2642
+ {
2643
+ // Go to next version
2644
+ NextVersion();
2645
+ } else
2646
+ if (source == saveVersionButton)
2647
+ {
2648
+ // Save a new version
2649
+ if (!Save(true))
2650
+ java.awt.Toolkit.getDefaultToolkit().beep();
2651
+ } else
2652
+ if (source == deleteVersionButton)
2653
+ {
2654
+ // Delete a new version
2655
+ DeleteVersion();
2656
+ } else
2657
+ if (source == oneStepButton)
2658
+ {
2659
+ Globals.ONESTEP = true;
2660
+ cameraView.repaint();
2661
+ } else
2662
+ if (source == screenfitButton)
2663
+ {
18592664 ScreenFit();
18602665 } else
1861
- if (event.getSource() == screenfitpointButton)
2666
+ if (source == screenfitpointButton)
18622667 {
1863
- //Reload(lastConverter, lastFilename, true);
18642668 ScreenFitPoint();
18652669 } else
1866
- if (event.getSource() == snapobjectButton)
2670
+ if (source == snapobjectButton)
18672671 {
1868
- //Reload(lastConverter, lastFilename, true);
18692672 SnapObject();
18702673 } else
18712674 // if (event.getSource() == recompileButton)
....@@ -1874,13 +2677,13 @@
18742677 // Recompile();
18752678 // refreshContents();
18762679 // } else
1877
- if (event.getSource() == gcButton)
2680
+ if (source == gcButton)
18782681 {
18792682 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802683 System.gc();
18812684 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822685 } else
1883
- if (event.getSource() == editLeafItem)
2686
+ if (source == editLeafItem)
18842687 {
18852688 Object3D obj;
18862689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2697,74 @@
18942697 }
18952698 refreshContents(true);
18962699 } else
1897
- if (event.getSource() == openWindowItem)
2700
+ if (source == openWindowItem)
18982701 {
18992702 EditSelection(true);
19002703 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2704
+ if (source == cutItem || source == clearButton)
19022705 {
19032706 loadClipboard(true);
19042707 } else
1905
- if (event.getSource() == duplicateItem)
2708
+ if (source == undoItem)
19062709 {
1907
- Object3D keep = GrafreeD.clipboard;
2710
+ PreviousVersion();
2711
+ } else
2712
+ if (source == redoItem)
2713
+ {
2714
+ NextVersion();
2715
+ } else
2716
+ if (source == duplicateItem)
2717
+ {
2718
+ Object3D keep = Grafreed.clipboard;
19082719 loadClipboard(false);
19092720 paste(false);
1910
- GrafreeD.clipboard = keep;
2721
+ Grafreed.clipboard = keep;
19112722 } else
1912
- if (event.getSource() == cloneItem)
2723
+ if (source == cloneItem)
19132724 {
19142725 CloneSelection(false);
19152726 } else
1916
- if (event.getSource() == cloneSupportItem)
2727
+ if (source == cloneSupportItem)
19172728 {
19182729 CloneSelection(true);
19192730 } else
1920
- if (event.getSource() == copyItem)
2731
+ if (source == copyItem)
19212732 {
19222733 loadClipboard(false);
19232734 } else
1924
- if (event.getSource() == pasteItem)
2735
+ if (source == pasteItem)
19252736 {
19262737 paste(false);
19272738 } else
1928
- if (event.getSource() == pasteLinkItem)
2739
+ if (source == pasteIntoItem)
19292740 {
1930
- pasteInto(false);
2741
+ pasteInto(true, false);
19312742 } else
1932
- if (event.getSource() == pasteCloneItem)
2743
+ if (source == pasteLinkItem)
19332744 {
1934
- pasteInto(true);
2745
+ pasteInto(false, false);
19352746 } else
1936
- if (event.getSource() == pasteExpandItem)
2747
+ if (source == pasteCloneItem)
2748
+ {
2749
+ pasteInto(true, true);
2750
+ } else
2751
+ if (source == pasteExpandItem)
19372752 {
19382753 paste(true);
19392754 } else
1940
- if (event.getSource() == synchronizeItem)
2755
+ if (source == synchronizeItem)
19412756 {
19422757 Overwrite(Object3D.TRANSFORM);
19432758 } else
1944
- if (event.getSource() == overwriteNameItem)
2759
+ if (source == overwriteNameItem)
19452760 {
19462761 Overwrite(Object3D.NAME);
19472762 } else
1948
- if (event.getSource() == overwriteUVItem)
2763
+ if (source == overwriteUVItem)
19492764 {
19502765 Overwrite(Object3D.UV);
19512766 } else
1952
- if (event.getSource() == overwriteMatItem)
2767
+ if (source == overwriteMatItem)
19532768 {
19542769 /* july 2015
19552770 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2784,7 @@
19692784
19702785 Overwrite(dropAttributes);
19712786 }
1972
- if (event.getSource() == overwriteGeoItem)
2787
+ if (source == overwriteGeoItem)
19732788 {
19742789 Overwrite(Object3D.GEOMETRY);
19752790 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2801,7 @@
19862801 // refreshContents();
19872802 // }
19882803 } else
1989
- if (event.getSource() == generateMeshItem)
2804
+ if (source == generateMeshItem)
19902805 {
19912806 //if (group.selection.size() == 1)
19922807 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2812,7 @@
19972812 ResetModel();
19982813 refreshContents();
19992814 } else
2000
- if (event.getSource() == extractGeometriesItem)
2815
+ if (source == extractGeometriesItem)
20012816 {
20022817 boolean one = false;
20032818
....@@ -2024,7 +2839,7 @@
20242839 ResetModel();
20252840 refreshContents();
20262841 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2842
+ if (source == cloneGeometriesItem)
20282843 {
20292844 boolean one = false;
20302845
....@@ -2050,7 +2865,7 @@
20502865 ResetModel();
20512866 refreshContents();
20522867 } else
2053
- if (event.getSource() == shareGeometriesItem)
2868
+ if (source == shareGeometriesItem)
20542869 {
20552870 boolean one = false;
20562871
....@@ -2080,7 +2895,7 @@
20802895 refreshContents();
20812896 }
20822897 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2898
+ if (source == mergeGeometriesItem)
20842899 {
20852900 boolean one = false;
20862901
....@@ -2110,7 +2925,7 @@
21102925 ResetModel();
21112926 refreshContents();
21122927 } else
2113
- if (event.getSource() == linkverticesItem)
2928
+ if (source == linkverticesItem)
21142929 {
21152930 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162931 // {
....@@ -2123,9 +2938,9 @@
21232938 // group.selection.get(0).setMasterThis(content); // should be identity
21242939 // refreshContents();
21252940 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2941
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272942 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2943
+ Object3D content = Grafreed.clipboard.get(0);
21292944
21302945 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312946 content = ((cGroup)content).get(0);
....@@ -2133,38 +2948,38 @@
21332948 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342949 for (int i=0; i<group.selection.size(); i++)
21352950 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2951
+ boolean random = CameraPane.SWITCH;
2952
+ CameraPane.SWITCH = false; // parse all random nodes
21382953 group.selection.get(i).linkVerticesThis(content);
21392954 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2955
+ CameraPane.SWITCH = random;
21412956 }
21422957 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432958 refreshContents();
21442959 }
21452960 } else
2146
- if (event.getSource() == resetsupportItem)
2961
+ if (source == resetsupportItem)
21472962 {
21482963 for (int i=0; i<group.selection.size(); i++)
21492964 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2965
+ boolean random = CameraPane.SWITCH;
2966
+ CameraPane.SWITCH = false; // parse all random nodes
21522967 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2968
+ CameraPane.SWITCH = random;
21542969 }
21552970
21562971 refreshContents();
21572972 } else
2158
- if (event.getSource() == relinkverticesItem)
2973
+ if (source == relinkverticesItem)
21592974 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2975
+ boolean random = CameraPane.SWITCH;
2976
+ CameraPane.SWITCH = false; // parse all random nodes
21622977 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2978
+ CameraPane.SWITCH = random;
21642979
21652980 refreshContents();
21662981 } else
2167
- if (event.getSource() == resetreferencesItem)
2982
+ if (source == resetreferencesItem)
21682983 {
21692984 for (int i=0; i<group.selection.size(); i++)
21702985 {
....@@ -2173,11 +2988,11 @@
21732988
21742989 refreshContents();
21752990 } else
2176
- if (event.getSource() == setMasterItem)
2991
+ if (source == setMasterItem)
21772992 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2993
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792994 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2995
+ Object3D content = Grafreed.clipboard.get(0);
21812996
21822997 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832998 content = ((cGroup)content).get(0);
....@@ -2186,13 +3001,13 @@
21863001 refreshContents();
21873002 }
21883003 } else
2189
- if (event.getSource() == poseMeshItem)
3004
+ if (source == poseMeshItem)
21903005 {
21913006 if (group.selection.size() == 1)
21923007 {
2193
- if (GrafreeD.clipboard.size() == 1)
3008
+ if (Grafreed.clipboard.size() == 1)
21943009 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
3010
+ Object3D content = Grafreed.clipboard.get(0);
21963011
21973012 if (content instanceof cGroup && ((cGroup)content).transientlink )
21983013 content = ((cGroup)content).get(0);
....@@ -2205,19 +3020,19 @@
22053020 }
22063021
22073022 } else
2208
- if (event.getSource() == revertMeshItem)
3023
+ if (source == revertMeshItem)
22093024 {
22103025 RevertMeshes();
22113026 } else
2212
- if (event.getSource() == resetMeshItem)
3027
+ if (source == resetAllItem)
22133028 {
22143029 ResetAll();
22153030 } else
2216
- if (event.getSource() == stepAllItem)
3031
+ if (source == stepAllItem)
22173032 {
22183033 StepAll();
22193034 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
22213036 {
22223037 //int indices[] = jList.getSelectedIndices();
22233038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +3040,46 @@
22253040
22263041 ClearSelection(false);
22273042 } else
2228
- if (event.getSource() == clearAllItem)
3043
+ if (source == clearAllItem)
22293044 {
22303045 ClearSelection(true);
22313046 } else
2232
- if (event.getSource() == grabItem)
3047
+ if (source == grabItem || source == groupButton)
22333048 {
2234
- group(new cGroup(), true);
3049
+ group(new cGroup(), false); // true);
22353050 } else
2236
- if (event.getSource() == hideItem)
3051
+ if (source == hideItem)
22373052 {
22383053 group(new HiddenObject());
22393054 } else
2240
- if (event.getSource() == frontItem)
3055
+ if (source == frontItem)
22413056 {
22423057 front();
22433058 } else
2244
- if (event.getSource() == backItem)
3059
+ if (source == backItem)
22453060 {
22463061 back();
22473062 } else
2248
- if (event.getSource() == cameraItem)
3063
+ if (source == cameraItem)
22493064 {
22503065 makeSomething(new Camera());
22513066 } else
2252
- if (event.getSource() == compositeItem)
3067
+ if (source == compositeItem || source == compositeButton)
22533068 {
22543069 group(new Composite());
22553070 } else
2256
- if (event.getSource() == randomItem)
3071
+ if (source == switchItem || source == switchButton)
22573072 {
22583073 RandomNode random = new RandomNode();
22593074 group(random);
22603075 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
3076
+ random.name = random.get(0).name + "Switch";
22623077 } else
2263
- if (event.getSource() == physicsItem)
3078
+ if (source == physicsItem)
22643079 {
22653080 group(new PhysicsNode());
22663081 } else
2267
- if (event.getSource() == frameselectorItem)
3082
+ if (source == frameselectorItem)
22683083 {
22693084 for (int i=0; i<group.selection.size(); i++)
22703085 {
....@@ -2276,7 +3091,7 @@
22763091 ResetModel();
22773092 refreshContents();
22783093 } else
2279
- if (event.getSource() == switchGeoItem)
3094
+ if (source == switchGeoItem)
22803095 {
22813096 for (int i=0; i<group.selection.size(); i++)
22823097 {
....@@ -2288,7 +3103,7 @@
22883103 ResetModel();
22893104 refreshContents();
22903105 } else
2291
- if (event.getSource() == switchTransfoItem)
3106
+ if (source == switchTransfoItem)
22923107 {
22933108 for (int i=0; i<group.selection.size(); i++)
22943109 {
....@@ -2300,7 +3115,7 @@
23003115 ResetModel();
23013116 refreshContents();
23023117 } else
2303
- if (event.getSource() == morphItem)
3118
+ if (source == morphItem)
23043119 {
23053120 for (int i=0; i<group.selection.size(); i++)
23063121 {
....@@ -2312,7 +3127,7 @@
23123127 ResetModel();
23133128 refreshContents();
23143129 } else
2315
- if (event.getSource() == scriptNodeItem)
3130
+ if (source == scriptNodeItem)
23163131 {
23173132 boolean atleastone = false;
23183133
....@@ -2351,215 +3166,252 @@
23513166 }
23523167 }
23533168 } else
2354
- if (event.getSource() == linkerItem)
3169
+ if (source == linkerItem)
23553170 {
23563171 group(new cLinker());
23573172 } else
2358
- if (event.getSource() == textureItem)
3173
+ if (source == textureItem || source == textureButton)
23593174 {
23603175 group(new TextureNode());
23613176 } else
2362
- if (event.getSource() == billboardItem)
3177
+ if (source == billboardItem)
23633178 {
23643179 group(new BillboardNode());
23653180 } else
2366
- if (event.getSource() == shadowXItem)
3181
+ if (source == shadowXItem)
23673182 {
23683183 CastShadow(0);
23693184 } else
2370
- if (event.getSource() == shadowYItem)
3185
+ if (source == shadowYItem)
23713186 {
23723187 CastShadow(1);
23733188 } else
2374
- if (event.getSource() == shadowZItem)
3189
+ if (source == shadowZItem)
23753190 {
23763191 CastShadow(2);
23773192 } else
2378
- if (event.getSource() == ungroupItem)
3193
+ if (source == ungroupItem || source == ungroupButton)
23793194 {
2380
- //ungroup();
3195
+ boolean hasRoot = false;
3196
+
23813197 for (int i=0; i<group.selection.size(); i++)
23823198 {
2383
- Ungroup(group.selection.get(i));
3199
+ if (group.selection.get(i) == group)
3200
+ {
3201
+ hasRoot = true;
3202
+ break;
3203
+ }
23843204 }
23853205
2386
- ClearSelection(false);
2387
-
2388
- refreshContents();
3206
+ if (!hasRoot)
3207
+ {
3208
+ for (int i=0; i<group.selection.size(); i++)
3209
+ {
3210
+ Ungroup(group.selection.get(i));
3211
+ }
3212
+
3213
+ ClearSelection(false);
3214
+
3215
+ refreshContents();
3216
+ }
23893217 } else
2390
- if (event.getSource() == genUVItem)
3218
+ if (source == genUVItem)
23913219 {
23923220 GenUV();
23933221 } else
2394
- if (event.getSource() == genNormalsCADItem)
3222
+ if (source == genNormalsCADItem)
23953223 {
23963224 GenNormals(true);
23973225 } else
2398
- if (event.getSource() == genNormalsMESHItem)
3226
+ if (source == genNormalsMESHItem)
23993227 {
2400
- GenNormals(true); // TODO
3228
+ GenNormalsMESH();
24013229 } else
2402
- if (event.getSource() == genNormalsORGANItem)
3230
+ if (source == genNormalsORGANItem)
24033231 {
24043232 GenNormals(false);
24053233 } else
2406
- if (event.getSource() == genNormalsMINEItem)
3234
+ if (source == genNormalsMINEItem)
24073235 {
24083236 GenNormalsMINE();
24093237 } else
2410
- if (event.getSource() == stripifyItem)
3238
+ if (source == stripifyItem)
24113239 {
24123240 Stripify();
24133241 } else
2414
- if (event.getSource() == unstripifyItem)
3242
+ if (source == unstripifyItem)
24153243 {
24163244 Unstripify();
24173245 } else
2418
- if (event.getSource() == trimItem)
3246
+ if (source == trimItem)
24193247 {
24203248 Trim();
24213249 } else
2422
- if (event.getSource() == untrimItem)
3250
+ if (source == untrimItem)
24233251 {
24243252 Untrim();
24253253 } else
2426
- if (event.getSource() == clearColorsItem)
3254
+ if (source == clearColorsItem)
24273255 {
24283256 ClearColors();
24293257 } else
2430
- if (event.getSource() == clearMaterialsItem)
3258
+ if (source == clearMaterialsItem)
24313259 {
24323260 ClearMaterials();
24333261 } else
2434
- if (event.getSource() == liveleavesItem)
3262
+ if (source == liveleavesItem)
24353263 {
24363264 LiveLeaves(true);
24373265 } else
2438
- if (event.getSource() == unliveleavesItem)
3266
+ if (source == unliveleavesItem)
24393267 {
24403268 LiveLeaves(false);
24413269 } else
2442
- if (event.getSource() == supportleavesItem)
3270
+ if (source == supportleavesItem)
24433271 {
24443272 SupportLeaves(true);
24453273 } else
2446
- if (event.getSource() == unsupportleavesItem)
3274
+ if (source == unsupportleavesItem)
24473275 {
24483276 SupportLeaves(false);
24493277 } else
2450
- if (event.getSource() == hideleavesItem)
3278
+ if (source == hideleavesItem)
24513279 {
24523280 HideLeaves(true);
24533281 } else
2454
- if (event.getSource() == showleavesItem)
3282
+ if (source == showleavesItem)
24553283 {
24563284 HideLeaves(false);
24573285 } else
2458
- if (event.getSource() == markleavesItem)
3286
+ if (source == markleavesItem)
24593287 {
24603288 MarkLeaves(true);
24613289 } else
2462
- if (event.getSource() == unmarkleavesItem)
3290
+ if (source == unmarkleavesItem)
24633291 {
24643292 MarkLeaves(false);
24653293 } else
2466
- if (event.getSource() == flipVItem)
3294
+ if (source == rewindleavesItem)
3295
+ {
3296
+ RewindLeaves(true);
3297
+ } else
3298
+ if (source == unrewindleavesItem)
3299
+ {
3300
+ RewindLeaves(false);
3301
+ } else
3302
+ if (source == randomleavesItem)
3303
+ {
3304
+ RandomLeaves(true);
3305
+ } else
3306
+ if (source == unrandomleavesItem)
3307
+ {
3308
+ RandomLeaves(false);
3309
+ } else
3310
+ if (source == flipVItem)
24673311 {
24683312 FlipV(true);
24693313 } else
2470
- if (event.getSource() == unflipVItem)
3314
+ if (source == unflipVItem)
24713315 {
24723316 FlipV(false);
24733317 } else
2474
- if (event.getSource() == lowTexturesItem)
3318
+ if (source == lowTexturesItem)
24753319 {
24763320 SetTexRes(0);
24773321 } else
2478
- if (event.getSource() == normalTexturesItem)
3322
+ if (source == normalTexturesItem)
24793323 {
24803324 SetTexRes(1);
24813325 } else
2482
- if (event.getSource() == highTexturesItem)
3326
+ if (source == highTexturesItem)
24833327 {
24843328 SetTexRes(2);
24853329 } else
2486
- if (event.getSource() == veryhighTexturesItem)
3330
+ if (source == veryhighTexturesItem)
24873331 {
24883332 SetTexRes(3);
24893333 } else
2490
- if (event.getSource() == maxTexturesItem)
3334
+ if (source == maxTexturesItem)
24913335 {
24923336 SetTexRes(4);
24933337 } else
2494
- if (event.getSource() == panoTexturesItem)
3338
+ if (source == panoTexturesItem)
24953339 {
24963340 SetTexRes(5);
24973341 } else
2498
- if (event.getSource() == reverseNormalsItem)
3342
+ if (source == reverseNormalsItem)
24993343 {
25003344 ReverseNormals();
25013345 } else
2502
- if (event.getSource() == parseverticesItem)
3346
+ if (source == parseverticesItem)
25033347 {
25043348 ParseVertices();
25053349 } else
2506
- if (event.getSource() == textureFieldItem)
3350
+ if (source == textureFieldItem)
25073351 {
25083352 TextureVertices();
25093353 } else
2510
- if (event.getSource() == alignItem)
3354
+ if (source == alignItem)
25113355 {
25123356 Align();
25133357 } else
2514
- if (event.getSource() == mirrorItem)
3358
+ if (source == mirrorItem)
25153359 {
25163360 MirrorPoses();
25173361 } else
2518
- if (event.getSource() == reduceMorphItem)
3362
+ if (source == reduceMorphItem)
25193363 {
25203364 MeshReduction(false);
25213365 } else
2522
- if (event.getSource() == reduce34MorphItem)
3366
+ if (source == reduce34MorphItem)
25233367 {
25243368 MeshReduction(true);
25253369 } else
2526
- if (event.getSource() == reverseTrianglesItem)
3370
+ if (source == reverseTrianglesItem)
25273371 {
25283372 ReverseTriangles();
25293373 } else
2530
- if (event.getSource() == reduceMeshItem)
3374
+ if (source == reduceMeshItem)
25313375 {
25323376 ReduceMesh(false);
25333377 } else
2534
- if (event.getSource() == reduce34MeshItem)
3378
+ if (source == reduce34MeshItem)
25353379 {
25363380 ReduceMesh(true);
25373381 } else
2538
- if (event.getSource() == increaseMeshItem)
3382
+ if (source == increaseMeshItem)
25393383 {
25403384 IncreaseMesh();
25413385 } else
2542
- if (event.getSource() == clipMeshItem)
3386
+ if (source == clipMeshItem)
25433387 {
25443388 ClipMesh();
25453389 } else
2546
- if (event.getSource() == smoothMeshItem)
3390
+ if (source == smoothMeshItem)
25473391 {
25483392 SmoothMesh();
25493393 } else
2550
- if (event.getSource() == transformgeometryItem)
3394
+ if (source == transformGeometryItem)
25513395 {
25523396 TransformGeometry();
25533397 } else
2554
- if (event.getSource() == resetTransformItem)
3398
+ if (source == transformChildrenItem)
3399
+ {
3400
+ TransformChildren();
3401
+ } else
3402
+ if (source == resetTransformItem)
25553403 {
25563404 ResetTransform();
25573405 } else
2558
- if (event.getSource() == resetCentroidItem)
3406
+ if (source == resetCentroidItem)
25593407 {
2560
- ResetCentroid();
3408
+ ResetCentroid(true);
25613409 } else
2562
- if (event.getSource() == resetParentItem)
3410
+ if (source == resetCentroidXZItem)
3411
+ {
3412
+ ResetCentroid(false);
3413
+ } else
3414
+ if (source == resetParentItem)
25633415 {
25643416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25653417 {
....@@ -2569,7 +3421,7 @@
25693421
25703422 refreshContents();
25713423 } else
2572
- if (event.getSource() == repairParentItem)
3424
+ if (source == repairParentItem)
25733425 {
25743426 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25753427 {
....@@ -2583,7 +3435,7 @@
25833435
25843436 refreshContents();
25853437 } else
2586
- if (event.getSource() == repairShadowItem)
3438
+ if (source == repairShadowItem)
25873439 {
25883440 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25893441 {
....@@ -2597,7 +3449,7 @@
25973449
25983450 refreshContents();
25993451 } else
2600
- if (event.getSource() == sortbysizeItem)
3452
+ if (source == sortbysizeItem)
26013453 {
26023454 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26033455 {
....@@ -2609,7 +3461,7 @@
26093461 ResetModel();
26103462 refreshContents();
26113463 } else
2612
- if (event.getSource() == sortbynameItem)
3464
+ if (source == sortbynameItem)
26133465 {
26143466 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26153467 {
....@@ -2621,7 +3473,7 @@
26213473 ResetModel();
26223474 refreshContents();
26233475 } else
2624
- if (event.getSource() == attachPigmentItem)
3476
+ if (source == attachPigmentItem)
26253477 {
26263478 String texture = GetFile("Attach pigment");
26273479 Object3D obj;
....@@ -2633,7 +3485,7 @@
26333485
26343486 refreshContents();
26353487 } else
2636
- if (event.getSource() == detachPigmentItem)
3488
+ if (source == detachPigmentItem)
26373489 {
26383490 Object3D obj;
26393491 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +3496,7 @@
26443496
26453497 refreshContents();
26463498 } else
2647
- if (event.getSource() == attachBumpItem)
3499
+ if (source == attachBumpItem)
26483500 {
26493501 String texture = GetFile("Attach bump");
26503502 Object3D obj;
....@@ -2656,18 +3508,18 @@
26563508
26573509 refreshContents();
26583510 } else
2659
- if (event.getSource() == detachBumpItem)
3511
+ if (source == detachBumpItem)
26603512 {
26613513 Object3D obj;
26623514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26633515 {
26643516 obj = (Object3D)e.nextElement();
2665
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
26663518 }
26673519
26683520 refreshContents();
26693521 } else
2670
- if (event.getSource() == pigmentBumpItem)
3522
+ if (source == pigmentBumpItem)
26713523 {
26723524 Object3D obj;
26733525 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +3530,262 @@
26783530
26793531 refreshContents();
26803532 } else
2681
- if (event.getSource() == flashSelectionButton)
3533
+ if (source == embedTexturesItem)
3534
+ {
3535
+ Object3D obj;
3536
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3537
+ {
3538
+ obj = (Object3D)e.nextElement();
3539
+ obj.EmbedTextures(true);
3540
+ }
3541
+
3542
+ refreshContents();
3543
+ } else
3544
+ if (source == deEmbedTexturesItem)
3545
+ {
3546
+ Object3D obj;
3547
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3548
+ {
3549
+ obj = (Object3D)e.nextElement();
3550
+ obj.EmbedTextures(false);
3551
+ }
3552
+
3553
+ CameraPane.texturepigment.clear();
3554
+ CameraPane.texturebump.clear();
3555
+
3556
+ refreshContents();
3557
+ } else
3558
+ if (source == flashSelectionButton)
26823559 {
26833560 CameraPane.flash = true;
26843561 refreshContents();
26853562 } else
2686
- if (event.getSource() == oneButton)
3563
+ if (source == oneButton)
26873564 {
26883565 } else
2689
- if (event.getSource() == twoButton)
3566
+ if (source == twoButton)
26903567 {
26913568 radio.layout = twoButton;
3569
+
3570
+ if (CameraPane.FULLSCREEN)
3571
+ fullscreenLayout = radio.layout;
3572
+
26923573 // bug
26933574 //gridPanel.setDividerLocation(1.0);
26943575 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3576
+// bigThree.remove(scenePanel);
3577
+// bigThree.remove(centralPanel);
3578
+// bigThree.remove(XYZPanel);
3579
+// aWindowConstraints.gridx = 0;
3580
+// aWindowConstraints.gridy = 0;
3581
+// aWindowConstraints.gridwidth = 1;
3582
+// // aConstraints.gridheight = 3;
3583
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3584
+// aWindowConstraints.weightx = 0;
3585
+// aWindowConstraints.weighty = 1;
3586
+// //bigThree.add(jtp, aWindowConstraints);
3587
+// aWindowConstraints.weightx = 1;
3588
+// aWindowConstraints.gridwidth = 3;
3589
+// // aConstraints.gridheight = 3;
3590
+// aWindowConstraints.gridx = 1;
3591
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3592
+// bigThree.add(centralPanel, aWindowConstraints);
3593
+// aWindowConstraints.weightx = 0;
3594
+// aWindowConstraints.gridx = 4;
3595
+// aWindowConstraints.gridwidth = 1;
3596
+// // aConstraints.gridheight = 3;
3597
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3598
+// //bigThree.add(XYZPanel, aWindowConstraints);
3599
+// scenePanel.setVisible(false);
3600
+// centralPanel.setVisible(true);
3601
+// XYZPanel.setVisible(false);
3602
+ bigThree.ClearUI();
3603
+ bigThree.add(centralPanel);
3604
+ bigThree.FlushUI();
3605
+
3606
+ cameraView.requestFocusInWindow();
3607
+
3608
+// refreshContents(true);
3609
+//
3610
+// try
3611
+// {
3612
+// java.awt.Robot bot = new java.awt.Robot();
3613
+// int mask = InputEvent.BUTTON1_MASK;
3614
+// bot.mouseMove(100, 100);
3615
+// bot.mousePress(mask);
3616
+// bot.mouseRelease(mask);
3617
+// }
3618
+// catch (Exception e)
3619
+// {
3620
+//
3621
+// }
3622
+
27193623 } else
2720
- if (event.getSource() == threeButton)
3624
+ if (source == threeButton)
27213625 {
27223626 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
3627
+
3628
+ if (CameraPane.FULLSCREEN)
3629
+ fullscreenLayout = radio.layout;
3630
+
3631
+// bigThree.remove(scenePanel);
3632
+// bigThree.remove(centralPanel);
3633
+// bigThree.remove(XYZPanel);
3634
+// aWindowConstraints.gridx = 0;
3635
+// aWindowConstraints.gridy = 0;
3636
+// aWindowConstraints.gridwidth = 1;
3637
+// // aConstraints.gridheight = 3;
3638
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3639
+// aWindowConstraints.weightx = 0;
3640
+// aWindowConstraints.weighty = 1;
3641
+// //bigThree.add(jtp, aWindowConstraints);
3642
+// aWindowConstraints.weightx = 1;
3643
+// aWindowConstraints.gridwidth = 3;
3644
+// // aConstraints.gridheight = 3;
3645
+// aWindowConstraints.gridx = 1;
3646
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3647
+// bigThree.add(centralPanel, aWindowConstraints);
3648
+// aWindowConstraints.weightx = 0;
3649
+// aWindowConstraints.gridx = 4;
3650
+// aWindowConstraints.gridwidth = 1;
3651
+// // aConstraints.gridheight = 3;
3652
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3653
+// bigThree.add(XYZPanel, aWindowConstraints);
3654
+// bigThree.validate();
3655
+// scenePanel.setVisible(false);
3656
+// centralPanel.setVisible(true);
3657
+// XYZPanel.setVisible(true);
3658
+ bigThree.ClearUI();
3659
+ bigThree.add(scenePanel);
3660
+ bigThree.add(centralPanel);
3661
+ bigThree.FlushUI();
3662
+
3663
+ cameraView.requestFocusInWindow();
27473664 } else
2748
- if (event.getSource() == fourButton)
3665
+ if (source == fourButton)
27493666 {
27503667 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
3668
+
3669
+ if (CameraPane.FULLSCREEN)
3670
+ fullscreenLayout = radio.layout;
3671
+
3672
+// bigThree.remove(scenePanel);
3673
+// bigThree.remove(centralPanel);
3674
+// bigThree.remove(XYZPanel);
3675
+// aWindowConstraints.gridx = 0;
3676
+// aWindowConstraints.gridy = 0;
3677
+// aWindowConstraints.gridwidth = 1;
3678
+// // aWindowConstraints.gridheight = 3;
3679
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3680
+// aWindowConstraints.weightx = 1;
3681
+// aWindowConstraints.weighty = 1;
3682
+// bigThree.add(scenePanel, aWindowConstraints);
3683
+// aWindowConstraints.weightx = 1;
3684
+// aWindowConstraints.gridwidth = 3;
3685
+// // aConstraints.gridheight = 3;
3686
+// aWindowConstraints.gridx = 1;
3687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3688
+// //bigThree.add(cameraPanel, aWindowConstraints);
3689
+// aWindowConstraints.weightx = 0;
3690
+// aWindowConstraints.gridx = 4;
3691
+// aWindowConstraints.gridwidth = 1;
3692
+// // aWindowConstraints.gridheight = 3;
3693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3694
+// //bigThree.add(XYZPanel, aWindowConstraints);
3695
+// bigThree.validate();
3696
+// scenePanel.setVisible(true);
3697
+// centralPanel.setVisible(false);
3698
+// XYZPanel.setVisible(false);
3699
+ bigThree.ClearUI();
3700
+ bigThree.add(scenePanel);
3701
+ bigThree.FlushUI();
3702
+
3703
+ cameraView.requestFocusInWindow();
27753704 } else
2776
- if (event.getSource() == sixButton)
3705
+ if (source == sixButton)
27773706 {
27783707 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
3708
+
3709
+ if (CameraPane.FULLSCREEN)
3710
+ fullscreenLayout = radio.layout;
3711
+
3712
+// bigThree.remove(scenePanel);
3713
+// bigThree.remove(centralPanel);
3714
+// bigThree.remove(XYZPanel);
3715
+// aWindowConstraints.gridx = 0;
3716
+// aWindowConstraints.gridy = 0;
3717
+// aWindowConstraints.gridwidth = 1;
3718
+// // aConstraints.gridheight = 3;
3719
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3720
+// aWindowConstraints.weightx = 0;
3721
+// aWindowConstraints.weighty = 1;
3722
+// bigThree.add(scenePanel, aWindowConstraints);
3723
+// aWindowConstraints.weightx = 1;
3724
+// aWindowConstraints.gridwidth = 3;
3725
+// // aWindowConstraints.gridheight = 3;
3726
+// aWindowConstraints.gridx = 1;
3727
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3728
+// bigThree.add(centralPanel, aWindowConstraints);
3729
+// aWindowConstraints.weightx = 0;
3730
+// aWindowConstraints.gridx = 4;
3731
+// aWindowConstraints.gridwidth = 1;
3732
+// // aWindowConstraints.gridheight = 3;
3733
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3734
+// //bigThree.add(XYZPanel, aConstraints);
3735
+// bigThree.validate();
3736
+// scenePanel.setVisible(true);
3737
+// centralPanel.setVisible(true);
3738
+// XYZPanel.setVisible(false);
3739
+ bigThree.ClearUI();
3740
+ bigThree.add(centralPanel);
3741
+ bigThree.add(scenePanel);
3742
+ bigThree.FlushUI();
3743
+
3744
+ cameraView.requestFocusInWindow();
28033745 } else
2804
- if (event.getSource() == sevenButton)
3746
+ if (source == sevenButton)
28053747 {
28063748 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
3749
+
3750
+ if (CameraPane.FULLSCREEN)
3751
+ fullscreenLayout = radio.layout;
3752
+
3753
+// bigThree.remove(scenePanel);
3754
+// bigThree.remove(centralPanel);
3755
+// bigThree.remove(XYZPanel);
3756
+// aWindowConstraints.gridx = 0;
3757
+// aWindowConstraints.gridy = 0;
3758
+// aWindowConstraints.gridwidth = 1;
3759
+// // aWindowConstraints.gridheight = 3;
3760
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3761
+// aWindowConstraints.weightx = 0;
3762
+// aWindowConstraints.weighty = 1;
3763
+// bigThree.add(scenePanel, aWindowConstraints);
3764
+// aWindowConstraints.weightx = 1;
3765
+// aWindowConstraints.gridwidth = 3;
3766
+// // aWindowConstraints.gridheight = 3;
3767
+// aWindowConstraints.gridx = 1;
3768
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3769
+// bigThree.add(centralPanel, aWindowConstraints);
3770
+// aWindowConstraints.weightx = 0;
3771
+// aWindowConstraints.gridx = 4;
3772
+// aWindowConstraints.gridwidth = 1;
3773
+// // aConstraints.gridheight = 3;
3774
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3775
+// bigThree.add(XYZPanel, aWindowConstraints);
3776
+// bigThree.validate();
3777
+// scenePanel.setVisible(true);
3778
+// centralPanel.setVisible(true);
3779
+// XYZPanel.setVisible(true);
3780
+ bigThree.ClearUI();
3781
+ bigThree.add(scenePanel);
3782
+ bigThree.add(centralPanel);
3783
+ bigThree.add(XYZPanel);
3784
+ bigThree.FlushUI();
3785
+
3786
+ cameraView.requestFocusInWindow();
28313787 } else
2832
- if (event.getSource() == rootButton)
3788
+ if (source == rootButton)
28333789 {
28343790 Object3D obj;
28353791 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,66 +3795,85 @@
28393795 EditObject(obj);
28403796 }
28413797
3798
+ cameraView.requestFocusInWindow();
28423799 refreshContents(true);
28433800 } else
2844
- if (event.getSource() == closeButton)
3801
+ if (source == closeButton)
28453802 {
28463803 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473804 cRadio ab;
28483805 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493806 {
28503807 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3808
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523809 {
3810
+ // Patch to avoid bug with transparency.
3811
+ if (!ab.hadMaterial)
3812
+ {
3813
+ ab.object.material = null;
3814
+ }
3815
+
28533816 buttonGroup.remove(ab);
28543817 radioPanel.remove(ab);
28553818
2856
- ab.GetObject().editWindow = null;
3819
+ //ab.GetObject().editWindow = null;
3820
+ ab.GetObject().manipWindow = null;
28573821 // ab.GetObject().objectUI = null; // ?????????
28583822
28593823 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603824 break;
28613825 }
28623826 }
3827
+
3828
+ cameraView.requestFocusInWindow();
28633829 refreshContents(true);
28643830 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3831
+ if (source == editItem || source == editButton)
28663832 {
3833
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3834
+ {
3835
+ Object3D child = (Object3D)e.nextElement();
3836
+ child.pinned = true;
3837
+ }
3838
+
28673839 EditSelection(false);
28683840 } else
2869
- if (event.getSource() == uneditButton)
3841
+ if (source == uneditButton)
28703842 {
28713843 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723844 {
28733845 Object3D child = (Object3D)e.nextElement();
28743846 if(child.editWindow != null)
2875
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3847
+ child.pinned = false;
28763848 child.CloseUI();
28773849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28783851
2879
- child.editWindow = null; // ???????????
3852
+ //child.editWindow = null; // ???????????
28803853 }
2881
- objEditor.ctrlPanel.revalidate();
3854
+ objEditor.ctrlPanel.FlushUI();
28823855 //objEditor.jTree.clearSelection();
28833856 //objEditor.ResetSliders();
28843857 refreshContents(true);
28853858 } else
2886
- if (event.getSource() == clearPanelButton)
3859
+ if (source == clearPanelButton)
28873860 {
28883861 assert(copy == group);
28893862 //copy.ClearUI();
28903863 for (Object3D obj : listUI)
28913864 {
3865
+ obj.pinned = false;
28923866 obj.CloseUI();
28933867 }
28943868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
28953870 refreshContents(true);
28963871 } else
2897
- if (event.getSource() == allParamsButton)
3872
+ if (source == allParamsButton)
28983873 {
28993874 assert(copy == group);
29003875
2901
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3876
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29023877
29033878 for (Object3D obj : listUI)
29043879 {
....@@ -2915,19 +3890,19 @@
29153890
29163891 refreshContents(true);
29173892 } else
2918
- if (event.getSource() == unselectButton)
3893
+ if (source == unselectButton)
29193894 {
29203895 objEditor.jTree.clearSelection();
29213896 // ?? oct 2012 GrafreeD.clipboard.clear();
29223897 objEditor.ResetSliders();
29233898 refreshContents(true);
29243899 } else
2925
- if(event.getSource() instanceof cRadio)
3900
+ if(source instanceof cRadio)
29263901 {
29273902 group.parent = keepparent;
29283903 group.attributes = 0;
29293904 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3905
+ /*cRadio*/ radio = (cRadio)source;
29313906 Object3D obj = radio.GetObject();
29323907 System.out.println("Edit " + obj);
29333908 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2947,6 +3922,9 @@
29473922 }
29483923
29493924 copy = group;
3925
+
3926
+ SetUndoStates();
3927
+
29503928 //Globals.theRenderer.object = group;
29513929 if(!useclient)
29523930 {
....@@ -2962,20 +3940,49 @@
29623940 frontView.object = group;
29633941 sideView.object = group;
29643942 }
2965
- group.editWindow = this;
3943
+
3944
+// fix "+" issue
3945
+ //group.editWindow = this;
3946
+ group.manipWindow = this;
3947
+
29663948 /*
29673949 currentLayout = radio.layout;
29683950 if (currentLayout == null)
29693951 currentLayout = sevenButton;
29703952 */
29713953 radio.layout.doClick();
3954
+
3955
+ ClearUnpinned();
3956
+
3957
+ //Grafreed.Assert(group != null);
3958
+ //Grafreed.Assert(group.selection != null);
3959
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3960
+ if (group.selection == null || group.selection.size() == 1)
3961
+ EditSelection(false);
29723962 keepparent = group.parent;
29733963 // PARENT = NULL or not???
29743964 //group.parent = null; // ROOT
29753965 //group.attributes = -1;
29763966 ResetModel();
3967
+
3968
+ cameraView.requestFocusInWindow();
29773969 refreshContents(true);
2978
- }
3970
+ } else if (event.getSource() == editCameraItem)
3971
+ {
3972
+ cameraView.ProtectCamera();
3973
+ cameraView.requestFocusInWindow();
3974
+ cameraView.repaint();
3975
+ return;
3976
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3977
+ {
3978
+ cameraView.RevertCamera();
3979
+ cameraView.requestFocusInWindow();
3980
+ cameraView.repaint();
3981
+ return;
3982
+ // } else if (event.getSource() == textureButton)
3983
+ // {
3984
+ // return; // true;
3985
+ }
29793986 else
29803987 {
29813988 //return super.action(event, arg);
....@@ -2984,7 +3991,6 @@
29843991 }
29853992
29863993 boolean useclient = false;
2987
- cRadio radio;
29883994
29893995 void ToggleRoot()
29903996 {
....@@ -3036,6 +4042,28 @@
30364042 refreshContents();
30374043 }
30384044
4045
+ void TransformChildren()
4046
+ {
4047
+ Object3D obj;
4048
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4049
+ {
4050
+ obj = (Object3D)e.nextElement();
4051
+ obj.KeepTextureMatrices();
4052
+ obj.TransformChildren();
4053
+ obj.RestoreTextureMatrices();
4054
+
4055
+// if (obj.parent == null)
4056
+// {
4057
+// System.out.println("NULL PARENT!");
4058
+// new Exception().printStackTrace();
4059
+// }
4060
+// else
4061
+// TouchTransform(obj);
4062
+// //obj.parent.Touch();
4063
+ }
4064
+
4065
+ refreshContents();
4066
+ }
30394067
30404068 void ResetTransform()
30414069 {
....@@ -3148,7 +4176,7 @@
31484176 refreshContents();
31494177 }
31504178
3151
- void ResetCentroid()
4179
+ void ResetCentroid(boolean full)
31524180 {
31534181 Object3D obj;
31544182 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +4191,16 @@
31634191 LA.matIdentity(Object3D.mat);
31644192 obj.getBounds(minima, maxima, false);
31654193 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4194
+ if (full)
4195
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31674196 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31684197 obj.TransformMesh(Object3D.mat);
4198
+
31694199 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4200
+ if (full)
4201
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31714202 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4203
+
31724204 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31734205 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31744206 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +4229,8 @@
31974229
31984230 int size = obj.MemorySize();
31994231
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
4232
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4233
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32014234 }
32024235 }
32034236 catch (Exception e)
....@@ -3234,9 +4267,9 @@
32344267 obj = (Object3D)e.nextElement();
32354268
32364269 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
4270
+ Grafreed.AnalyzeObject(obj);
32384271 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
4272
+ Grafreed.AnalyzeObject(obj.bRep);
32404273
32414274 // System.err.println((size/1024) + " KB is the size of " + obj);
32424275 }
....@@ -3278,6 +4311,13 @@
32784311 void GenNormals(boolean crease)
32794312 {
32804313 group.GenNormalsS(crease);
4314
+
4315
+ refreshContents();
4316
+ }
4317
+
4318
+ void GenNormalsMESH()
4319
+ {
4320
+ group.GenNormalsMeshS();
32814321
32824322 refreshContents();
32834323 }
....@@ -3450,8 +4490,8 @@
34504490
34514491 void ParseVertices()
34524492 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
4493
+ boolean epsequal = Grafreed.epsequal;
4494
+ Grafreed.epsequal = true;
34554495
34564496 for (int i=0; i<group.selection.size(); i++)
34574497 {
....@@ -3476,7 +4516,7 @@
34764516 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34774517 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34784518
3479
- g.add(GrafreeD.clipboard);
4519
+ g.add(Grafreed.clipboard);
34804520
34814521 buffer.add(g);
34824522 }
....@@ -3491,7 +4531,7 @@
34914531 makeSomething(buffer, i==group.selection.size()-1);
34924532 }
34934533
3494
- GrafreeD.epsequal = epsequal;
4534
+ Grafreed.epsequal = epsequal;
34954535
34964536 refreshContents();
34974537 }
....@@ -3509,7 +4549,16 @@
35094549 String pigment = Object3D.GetPigment(tex);
35104550 //String bump = Object3D.GetBump(tex);
35114551
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4552
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4553
+
4554
+ try
4555
+ {
4556
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4557
+ }
4558
+ catch (Exception e)
4559
+ {
4560
+ System.err.println("FAIL: " + node);
4561
+ }
35134562
35144563 double s = v.s;
35154564
....@@ -3597,11 +4646,11 @@
35974646
35984647 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35994648
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
4649
+ boolean random = CameraPane.SWITCH;
4650
+ CameraPane.SWITCH = false; // parse all random nodes
36024651 lowres.linkVerticesThis(null);
36034652 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
4653
+ CameraPane.SWITCH = random;
36054654
36064655 System.err.flush();
36074656
....@@ -3641,7 +4690,7 @@
36414690 return;
36424691
36434692 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4693
+ Object3D ref = Grafreed.clipboard.get(0);
36454694
36464695 Object3D newgroup = new Object3D("Po:" + poses.name);
36474696
....@@ -3835,9 +4884,9 @@
38354884
38364885 void ClipMesh()
38374886 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394888 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4889
+ Object3D content = Grafreed.clipboard.get(0);
38414890
38424891 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434892 content = ((cGroup)content).get(0);
....@@ -3846,7 +4895,7 @@
38464895 // {
38474896 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484897 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4898
+ group.selection.ClipMesh(Grafreed.clipboard);
38504899 }
38514900 // group.selection.ClipMesh(GrafreeD.clipboard);
38524901 System.out.println("DONE.");
....@@ -3893,6 +4942,18 @@
38934942 void MarkLeaves(boolean hide)
38944943 {
38954944 group.selection.MarkLeaves(hide);
4945
+ refreshContents();
4946
+ }
4947
+
4948
+ void RewindLeaves(boolean hide)
4949
+ {
4950
+ group.selection.RewindLeaves(hide);
4951
+ refreshContents();
4952
+ }
4953
+
4954
+ void RandomLeaves(boolean hide)
4955
+ {
4956
+ group.selection.RandomLeaves(hide);
38964957 refreshContents();
38974958 }
38984959
....@@ -3967,28 +5028,25 @@
39675028 // }
39685029 // }
39695030
3970
- static boolean allparams = true;
3971
-
3972
- static Vector<Object3D> listUI = new Vector<Object3D>();
3973
-
39745031 void EditSelection(boolean newWindow)
39755032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
39765039 // aConstraints.gridy = 0;
39775040 for (int i=0; i<group.selection.size(); i++)
39785041 {
39795042 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39805043 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3981
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5044
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39825045
39835046 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
5047
+ if(elem != group || !newWindow)
39855048 {
3986
- // if (!(elem instanceof Composite))
3987
- // newWindow = false;
3988
- listUI.add(elem);
3989
- elem.openEditWindow(this, newWindow); //, false);
3990
- System.out.println("edit : " + elem);
3991
- elem.editWindow.refreshContents(true); // ? new
5049
+ EditElement(elem, newWindow); // ? new
39925050 }
39935051 }
39945052 }
....@@ -4051,9 +5109,7 @@
40515109
40525110 freezemodel = false;
40535111 }
4054
-
4055
- boolean flashIt = true;
4056
-
5112
+
40575113 public void valueChanged(TreeSelectionEvent e)
40585114 //public boolean handleEvent(Event event)
40595115 {
....@@ -4063,7 +5119,8 @@
40635119 //new Exception().printStackTrace();
40645120
40655121 freezemodel = true;
4066
-
5122
+ ClearUnpinned();
5123
+
40675124 /**/
40685125 //switch (event.id)
40695126 {
....@@ -4071,7 +5128,6 @@
40715128 //case 702: // Event.LIST_DESELECT
40725129 group.deselectAll();
40735130 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40755131 if (tps != null)
40765132 {
40775133 for (int i=0; i < tps.length; i++)
....@@ -4080,33 +5136,39 @@
40805136
40815137 //if (child.parent != null)
40825138 //child.parent.addSelectee(child);
5139
+ objEditor.SetMaterial(child);
40835140 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40875141 }
40885142 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
5143
+// else
5144
+// {
5145
+// objEditor.SetMaterial(group); // .GetMaterial());
5146
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5147
+// System.err.println("info : " + group.GetPath());
5148
+// }
40955149
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5150
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40995151 CameraPane.flash = true;
41005152
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5153
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41025154 // a camera
41035155 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5156
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5157
+ {
5158
+ CameraPane.camerachangeframe = 0; // don't refuse it
5159
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5160
+ }
41065161 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41075162 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41085163 }
41095164
5165
+ if (tps != null && tps.length == 1)
5166
+ {
5167
+ EditSelection(false);
5168
+ }
5169
+
5170
+ SetPinStates(tps != null && tps.length > 0);
5171
+
41105172 refreshContents();
41115173 //return true;
41125174 }
....@@ -4115,6 +5177,37 @@
41155177
41165178 freezemodel = false;
41175179 }
5180
+
5181
+ void SetPinStates(boolean enabled)
5182
+ {
5183
+ editButton.setEnabled(enabled);
5184
+ uneditButton.setEnabled(enabled);
5185
+ //unselectButton.setEnabled(enabled);
5186
+ flashSelectionButton.setEnabled(enabled);
5187
+
5188
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5189
+ }
5190
+
5191
+ void refreshContents(boolean cp)
5192
+ {
5193
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5194
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5195
+ {
5196
+ objEditor.ClearInfo(); // .GetMaterial());
5197
+
5198
+ for (int i=0; i < group.selection.Size(); i++)
5199
+ {
5200
+ Object3D child = (Object3D) group.selection.get(i);
5201
+
5202
+ objEditor.AddInfo(child, this, true);
5203
+ System.err.println("info : " + child.GetPath());
5204
+ }
5205
+
5206
+ objEditor.SetText(); // jan 2014
5207
+ }
5208
+
5209
+ super.refreshContents(cp);
5210
+ }
41185211
41195212 void linkSomething(Object3D thing)
41205213 {
....@@ -4186,16 +5279,19 @@
41865279 {
41875280 if (group.selection.isEmpty())
41885281 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
5282
+
5283
+ Grafreed.clipboardIsTempGroup = false;
41905284 Composite tGroup = null;
41915285 if (group.selection.size() > 0) // 1)
41925286 {
41935287 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
5288
+ Grafreed.clipboardIsTempGroup = true;
41955289 }
41965290
41975291 if (cut)
41985292 {
5293
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5294
+// Save();
41995295 //int indices[] = jList.getSelectedIndices();
42005296 //for (int i = indices.length - 1; i >= 0; i--)
42015297 //jList.remove(indices[i]);
....@@ -4231,16 +5327,16 @@
42315327 //System.out.println("cut " + child);
42325328 //System.out.println("parent = " + child.parent);
42335329 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
5330
+ if (Grafreed.clipboardIsTempGroup)
42355331 tGroup.add/*Child*/(tmp);
42365332 else
4237
- GrafreeD.clipboard = tmp;
5333
+ Grafreed.clipboard = tmp;
42385334 }
42395335 else
4240
- if (GrafreeD.clipboardIsTempGroup)
5336
+ if (Grafreed.clipboardIsTempGroup)
42415337 tGroup.add/*Child*/(child);
42425338 else
4243
- GrafreeD.clipboard = child;
5339
+ Grafreed.clipboard = child;
42445340 }
42455341
42465342 //ResetModel();
....@@ -4272,21 +5368,23 @@
42725368 //System.out.println("cut " + elem);
42735369 //System.out.println("parent = " + elem.parent);
42745370 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
5371
+ if (Grafreed.clipboardIsTempGroup)
42765372 tGroup.add/*Child*/(tmp);
42775373 else
4278
- GrafreeD.clipboard = tmp;
5374
+ Grafreed.clipboard = tmp;
42795375 }
42805376 else
4281
- if (GrafreeD.clipboardIsTempGroup)
5377
+ if (Grafreed.clipboardIsTempGroup)
42825378 tGroup.add/*Child*/(child);
42835379 else
4284
- GrafreeD.clipboard = child;
5380
+ Grafreed.clipboard = child;
42855381 }
42865382
42875383 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
5384
+
5385
+ if (Grafreed.clipboardIsTempGroup)
5386
+ Grafreed.clipboard = tGroup;
5387
+
42905388 if (cut)
42915389 {
42925390 ResetModel();
....@@ -4296,11 +5394,15 @@
42965394
42975395 void paste(boolean expand)
42985396 {
5397
+ if (Globals.REPLACEONMAKE)
5398
+ Save();
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
42995401 // if (GrafreeD.clipboard == null)
43005402 // return;
43015403 boolean first = true;
43025404
4303
- if (GrafreeD.clipboardIsTempGroup)
5405
+ if (Grafreed.clipboardIsTempGroup)
43045406 {
43055407 Composite temp;
43065408
....@@ -4311,7 +5413,7 @@
43115413 temp = (Composite)Applet3D.clipboard.deepCopy();
43125414 */
43135415 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5416
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43155417 {
43165418 Object3D child = (Object3D)e.nextElement();
43175419
....@@ -4345,21 +5447,22 @@
43455447 //Object3D cb = Applet3D.clipboard;
43465448 //temp.addChild(cb);
43475449 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5450
+ assert(Grafreed.clipboard.parent == null);
5451
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5452
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5453
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5454
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43535455 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
5456
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5457
+ Grafreed.clipboard.get(0).parent = keepparent;
43565458 }
43575459
5460
+ Globals.REPLACEONMAKE = keep;
43585461 ResetModel();
43595462 refreshContents();
43605463 }
43615464
4362
- void pasteInto(boolean copyit)
5465
+ void pasteInto(boolean copyit, boolean clone)
43635466 {
43645467 // if (GrafreeD.clipboard == null)
43655468 // return;
....@@ -4388,15 +5491,22 @@
43885491 if (copyit)
43895492 {
43905493 // paste(false);
4391
- CloneClipboard(false); // sept 2014
5494
+ if (clone)
5495
+ {
5496
+ CloneClipboard(false); // sept 2014
5497
+ }
5498
+ else
5499
+ {
5500
+ paste(false);
5501
+ }
43925502 }
43935503 else
43945504 {
43955505 boolean first = true;
43965506
4397
- if (GrafreeD.clipboardIsTempGroup)
5507
+ if (Grafreed.clipboardIsTempGroup)
43985508 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
5509
+ Composite temp = (Composite)Grafreed.clipboard;
44005510 Object3D copy;
44015511 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44025512 {
....@@ -4406,7 +5516,7 @@
44065516 }
44075517 } else
44085518 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
5519
+ linkSomething(Grafreed.clipboard); //.get(0));
44105520 }
44115521 }
44125522 }
....@@ -4483,6 +5593,10 @@
44835593
44845594 void group(Object3D csg, boolean grab)
44855595 {
5596
+ if (Globals.REPLACEONMAKE)
5597
+ Save();
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
44865600 if (//false) // why??
44875601 !group.selection.isEmpty())
44885602 {
....@@ -4596,10 +5710,15 @@
45965710 //node.add(csg);
45975711 //makeSomething(node);
45985712 makeSomething(csg);
5713
+ Globals.REPLACEONMAKE = keep;
45995714 }
46005715
46015716 void Ungroup(Object3D g)
46025717 {
5718
+ if (Globals.REPLACEONMAKE)
5719
+ Save();
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
46035722 if (g instanceof HiddenObject)
46045723 {
46055724 HiddenObject h = (HiddenObject) g;
....@@ -4616,6 +5735,7 @@
46165735 objEditor.makeSomething(g.get(i), false);
46175736 }
46185737 }
5738
+ Globals.REPLACEONMAKE = keep;
46195739 }
46205740
46215741 void ungroup()
....@@ -4811,21 +5931,6 @@
48115931 }
48125932 */
48135933
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48295934 /*
48305935 public void Callback(Object obj)
48315936 {
....@@ -4849,26 +5954,9 @@
48495954 }
48505955 */
48515956
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48695957 String GetFile(String dialogName)
48705958 {
4871
- if (GrafreeD.standAlone)
5959
+ if (Grafreed.standAlone)
48725960 {
48735961 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745962 browser.show();
....@@ -4932,10 +6020,48 @@
49326020 cButton flashSelectionButton;
49336021 cButton editButton;
49346022 cButton uneditButton;
6023
+ JCheckBox allParamsButton;
49356024 cButton clearpanelButton;
4936
- cButton allParamsButton;
49376025 cButton unselectButton;
49386026
6027
+ cButton restoreCameraButton;
6028
+
6029
+ cButton oneStepButton;
6030
+
6031
+ cButton groupButton;
6032
+ cButton ungroupButton;
6033
+ cButton compositeButton;
6034
+ cButton switchButton;
6035
+ cButton loopButton;
6036
+ cButton textureButton;
6037
+
6038
+ cButton skybox1Button;
6039
+ cButton skybox2Button;
6040
+ cButton skybox3Button;
6041
+ cButton skybox4Button;
6042
+ cButton skybox5Button;
6043
+ cButton skybox6Button;
6044
+ cButton skybox7Button;
6045
+
6046
+ cButton skybox11Button;
6047
+ cButton skybox12Button;
6048
+ cButton skybox13Button;
6049
+ cButton skybox14Button;
6050
+ cButton skybox15Button;
6051
+ cButton skybox16Button;
6052
+ cButton skybox17Button;
6053
+
6054
+ cButton gridButton;
6055
+ cButton boxButton;
6056
+ cButton sphereButton;
6057
+ cButton coneButton;
6058
+ cButton torusButton;
6059
+ cButton superButton;
6060
+ cButton kleinButton;
6061
+ cButton particlesButton;
6062
+ cButton overlayButton;
6063
+ cButton lightButton;
6064
+
49396065 cButton screenfitButton;
49406066 cButton screenfitpointButton;
49416067 cButton snapobjectButton;
....@@ -4947,14 +6073,6 @@
49476073
49486074 cButton setsupportButton;
49496075
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
4957
-
49586076 //
49596077 //Composite
49606078 Object3D // to do !!
....@@ -4964,9 +6082,11 @@
49646082 //JTree jTree;
49656083 private MenuItem lookAtItem;
49666084 private MenuItem lookFromItem;
4967
- private MenuItem switchItem;
6085
+ private MenuItem switchViewItem;
49686086 private MenuItem cutItem;
4969
- private MenuItem duplicateItem;
6087
+ private MenuItem undoItem;
6088
+ private MenuItem redoItem;
6089
+ private JMenuItem duplicateItem;
49706090 private MenuItem cloneItem;
49716091 private MenuItem cloneSupportItem;
49726092 private MenuItem overwriteGeoItem;
....@@ -4979,7 +6099,7 @@
49796099 private MenuItem linkverticesItem;
49806100 private MenuItem relinkverticesItem;
49816101 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
6102
+ private MenuItem resetAllItem;
49836103 private MenuItem stepAllItem;
49846104 private MenuItem revertMeshItem;
49856105 private MenuItem poseMeshItem;
....@@ -4990,10 +6110,11 @@
49906110 private MenuItem mergeGeometriesItem;
49916111 private MenuItem copyItem;
49926112 private MenuItem pasteItem;
6113
+ private MenuItem pasteIntoItem;
49936114 private MenuItem pasteLinkItem;
49946115 private MenuItem pasteCloneItem;
49956116 private MenuItem pasteExpandItem;
4996
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
49976118 private MenuItem clearAllItem;
49986119 private MenuItem genUVItem;
49996120 private MenuItem genNormalsMESHItem;
....@@ -5028,6 +6149,10 @@
50286149 private MenuItem showleavesItem;
50296150 private MenuItem markleavesItem;
50306151 private MenuItem unmarkleavesItem;
6152
+ private MenuItem rewindleavesItem;
6153
+ private MenuItem unrewindleavesItem;
6154
+ private MenuItem randomleavesItem;
6155
+ private MenuItem unrandomleavesItem;
50316156
50326157 private MenuItem flipVItem;
50336158 private MenuItem unflipVItem;
....@@ -5039,15 +6164,17 @@
50396164 private MenuItem panoTexturesItem;
50406165
50416166 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
6167
+ private MenuItem resetCentroidXZItem;
50436168 private MenuItem resetTransformItem;
6169
+ private MenuItem transformGeometryItem;
6170
+ private MenuItem transformChildrenItem;
50446171 private MenuItem hideItem;
50456172 private MenuItem grabItem;
50466173 private MenuItem backItem;
50476174 private MenuItem frontItem;
50486175 private MenuItem cameraItem;
50496176 private MenuItem compositeItem;
5050
- private MenuItem randomItem;
6177
+ private MenuItem switchItem;
50516178 private MenuItem physicsItem;
50526179 private MenuItem frameselectorItem;
50536180 private MenuItem scriptNodeItem;
....@@ -5071,6 +6198,8 @@
50716198 private MenuItem attachBumpItem;
50726199 private MenuItem detachBumpItem;
50736200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
50746203
50756204 private MenuItem particleItem;
50766205 private MenuItem ragdollItem;
....@@ -5087,7 +6216,7 @@
50876216 private MenuItem blobItem;
50886217 private MenuItem latheItem;
50896218 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
6219
+ private MenuItem overlayItem;
50916220 private MenuItem meshItem;
50926221 // private MenuItem meshGroupItem;
50936222 private MenuItem springItem;
....@@ -5109,11 +6238,6 @@
51096238 private MenuItem doubleItem;
51106239 private MenuItem tripleItem;
51116240
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51176241 private MenuItem computeAOItem;
51186242 private MenuItem recompileItem;
51196243 private MenuItem editScriptItem;
....@@ -5123,4 +6247,8 @@
51236247 private MenuItem analyzeItem;
51246248 private MenuItem dumpItem;
51256249 //boolean freezemodel = false;
6250
+
6251
+ Menu cameraMenu;
6252
+ MenuItem editCameraItem;
6253
+ MenuItem restoreCameraItem;
51266254 }