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,153 +915,243 @@
433915 oe.radioPanel.add(dummyButton);
434916 oe.buttonGroup.add(dummyButton);
435917 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
918
+ cGridBag copyOptionsPanel = new cGridBag();
919
+
920
+ copyOptionsPanel.preferredHeight = 2;
439921
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
922
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
923
+
924
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
925
+ //minButton.setToolTipText("Minimize window");
926
+ //minButton.addActionListener(this);
927
+
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);
940
+ screenfitButton.setToolTipText("Screen fit");
941
+ screenfitButton.addActionListener(this);
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");
441980 liveCB.addItemListener(this);
442981
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
461988 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.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);
468995
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
507
- screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509996 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510997 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515998
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
523
-
524
- oe.toolbarPanel.add(new cButton(" ", false));
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
532
- twoButton.addActionListener(this);
533
- 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);
5341006 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
- sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
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");
5381019 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
540
- 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);
5411026 //
5421027
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
1028
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ rootButton.setToolTipText("Open selection in new tab");
5441030 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1031
+
1032
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ closeButton.setToolTipText("Close tab");
5471034 closeButton.addActionListener(this);
5481035 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5491036 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551
-
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
554
- editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
5581037
559
- 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");
5601131 uneditButton.addActionListener(this);
5611132
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- 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");
5741135 allParamsButton.addActionListener(this);
5751136
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
581
- 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);
5821140
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
+
5831155 // oe.aConstraints.gridx += 1;
5841156 // oe.aConstraints.weighty = 0;
5851157 // oe.aConstraints.gridwidth = 1;
....@@ -591,47 +1163,32 @@
5911163 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5921164 // gcButton.addActionListener(this);
5931165
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
1166
+ cGridBag jSPPanel = new cGridBag();
1167
+
1168
+ JScrollPane jSP;
6051169 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1170
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6071171 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
612
-
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
617
- colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
620
- materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
623
- textureCB.addItemListener(this);
624
-
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
6271172
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
+
6281185 //jList.addListSelectionListener(this);
6291186 oe.jTree.addTreeSelectionListener(this);
6301187 //jTree.setRootVisible(false);
6311188 //jTree.setEditable(true);
6321189 oe.jTree.setDragEnabled(true);
6331190 //jTree.setPreferredSize(new Dimension(10,10));
634
- jSP.setPreferredSize(new Dimension(100,200));
1191
+ //jSP.setPreferredSize(new Dimension(100,200));
6351192
6361193 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6371194
....@@ -643,23 +1200,163 @@
6431200 dgr.addDragGestureListener(this);
6441201 }catch(Exception e) {}
6451202 */
646
- radio.layout = sevenButton;
1203
+ radio.layout = threeButton; // sixButton;
6471204 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6481205 }
1206
+
1207
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1208
+ {
1209
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1210
+ colorCB.setToolTipText("Copy color when dropped");
1211
+ colorCB.addItemListener(this);
1212
+
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
+
1241
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1242
+ // localCB.addItemListener(this);
1243
+
1244
+ panel.Return();
1245
+
1246
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1247
+ crowdCB.setToolTipText("Used for crowds");
1248
+ crowdCB.addItemListener(this);
1249
+
1250
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1251
+ smoothCB.setToolTipText("Snapping delay");
1252
+ smoothCB.addItemListener(this);
1253
+
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
+
1261
+// constraints.gridy += 1;
1262
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1263
+// speakerMocapCB.addItemListener(this);
1264
+
1265
+ panel.Return();
1266
+
1267
+ if (false)
1268
+ {
1269
+ // handled in scripts
1270
+ //constraints.gridy += 1;
1271
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1272
+ speakerCameraCB.addItemListener(this);
1273
+
1274
+ //constraints.gridy += 1;
1275
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1276
+ speakerFocusCB.addItemListener(this);
1277
+
1278
+ //constraints.gridy += 1;
1279
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1280
+ smoothfocusCB.addItemListener(this);
1281
+ panel.Return();
1282
+ }
1283
+
1284
+//constraints.gridx += 1;
1285
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1286
+// debugCB.addItemListener(this);
1287
+
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");
1294
+ oeilCB.addItemListener(this);
1295
+
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);
1317
+ lookAtCB.setToolTipText("Look-at target");
1318
+ 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);
1333
+
1334
+ }
6491335
6501336 void EditObject(Object3D obj)
6511337 {
6521338 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
+
6531347 radioButton.SetObject(obj);
654
- radioButton.layout = sevenButton;
1348
+ radioButton.layout = threeButton; // sixButton;
6551349 radioButton.SetCamera(cameraView.renderCamera, false);
6561350 radioButton.addActionListener(this);
6571351 radioPanel.add(radioButton);
6581352 buttonGroup.add(radioButton);
6591353 radioButton.doClick();
6601354 }
1355
+
6611356 void SetupViews(ObjEditor oe)
6621357 {
1358
+ theFrame = this;
1359
+
6631360 oe.SetupViews();
6641361
6651362 System.out.println("SetupViews");
....@@ -668,22 +1365,30 @@
6681365 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6691366 }
6701367
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- 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;
6811383 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
1384
+ cCheckBox speakerCameraCB;
1385
+ cCheckBox speakerFocusCB;
1386
+ cCheckBox debugCB;
1387
+
1388
+ cCheckBox oeilCB;
1389
+ cCheckBox shadowCB;
1390
+ cCheckBox autokeepCB;
1391
+ cCheckBox lookAtCB;
6871392
6881393 // static int COLOR = 1;
6891394 // static int MATERIAL = 2;
....@@ -691,9 +1396,9 @@
6911396
6921397 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6931398
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
1399
+ cCheckBox colorCB;
1400
+ cCheckBox materialCB;
1401
+ cCheckBox textureCB;
6971402
6981403 public void itemStateChanged(ItemEvent e)
6991404 {
....@@ -721,6 +1426,7 @@
7211426 } else if(e.getSource() == liveCB)
7221427 {
7231428 cameraView.ToggleLive();
1429
+ refreshContents(false);
7241430 }
7251431 else if(e.getSource() == supportCB)
7261432 {
....@@ -736,6 +1442,12 @@
7361442 {
7371443 cameraView.ToggleInertia();
7381444 cameraView.repaint();
1445
+ }
1446
+ else if(e.getSource() == minshaderCB)
1447
+ {
1448
+ Globals.MINSHADER ^= true;
1449
+ cameraView.programInitialized = false;
1450
+ cameraView.repaint();
7391451 }
7401452 else if(e.getSource() == localCB)
7411453 {
....@@ -755,6 +1467,10 @@
7551467 Recompile();
7561468 cameraView.repaint();
7571469 // refreshContents();
1470
+ }
1471
+ else if(e.getSource() == zoomBoxCB)
1472
+ {
1473
+ cameraView.ToggleZoomBoxMode();
7581474 }
7591475 else if(e.getSource() == smoothfocusCB)
7601476 {
....@@ -781,6 +1497,18 @@
7811497 {
7821498 cameraView.ToggleOeil();
7831499 }
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
+ }
7841512 else if(e.getSource() == lookAtCB)
7851513 {
7861514 cameraView.ToggleLookAt();
....@@ -797,7 +1525,8 @@
7971525
7981526 /**/
7991527 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
800
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1528
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1529
+ TreePath path = objEditor.jTree.getSelectionPath();
8011530 if ((path == null) || (path.getPathCount() <= 1)) {
8021531 // We can't move the root node or an empty selection
8031532 return;
....@@ -860,8 +1589,6 @@
8601589 }
8611590 }
8621591
863
- String string = (String) object;
864
-
8651592 System.out.println("Transfer = " + object + "; drop : " + target);
8661593 // if( object instanceof java.io.File[])
8671594 // {
....@@ -869,7 +1596,11 @@
8691596 // objEditor.DropFile((java.io.File[]) object, true);
8701597 // return;
8711598 // }
872
- 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) == ':')
8731604 {
8741605 // file(s)
8751606 String[] names = string.split("\n");
....@@ -896,7 +1627,7 @@
8961627
8971628 flashIt = false;
8981629 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1630
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001631 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011632
9021633 if (group.selection.size() == 1)
....@@ -912,23 +1643,33 @@
9121643
9131644 assert target == objEditor.jTree;
9141645 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1646
+ Object3D destinationLeaf;
9151647 try {
916
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1648
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9171649 } catch (Exception e) {
9181650 System.out.println("destinationPath : " + destinationPath);
9191651 return;
9201652 }
9211653
922
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1654
+ for (int i=group.selection.size(); --i>=0;)
9231655 {
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
+// {
9241665 loadClipboard(true);
9251666 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
927
- } else {
928
- loadClipboard(false);
929
- objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
931
- }
1667
+ pasteInto(false, false);
1668
+// } else {
1669
+// loadClipboard(false);
1670
+// objEditor.jTree.setSelectionPath(destinationPath);
1671
+// pasteInto(false, false); // true); // ???
1672
+// }
9321673 }
9331674 public void dropActionChanged(DropTargetDragEvent dtde)
9341675 // Called if the user has modified the current drop gesture
....@@ -1033,85 +1774,107 @@
10331774 {
10341775 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10351776 //heightFieldItem.addActionListener(this);
1036
- gridItem = menu.add(new MenuItem("Grid"));
1037
- gridItem.addActionListener(this);
1038
- rectoidItem = menu.add(new MenuItem("Box"));
1039
- rectoidItem.addActionListener(this);
1040
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1041
- ellipsoidItem.addActionListener(this);
1042
- coneItem = menu.add(new MenuItem("Cone"));
1043
- coneItem.addActionListener(this);
1044
- torusItem = menu.add(new MenuItem("Torus"));
1045
- torusItem.addActionListener(this);
1046
- superItem = menu.add(new MenuItem("Superellipsoid"));
1047
- 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
+ {
10481795 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10491796 kleinItem.addActionListener(this);
1050
- particleItem = menu.add(new MenuItem("Particle system"));
1051
- particleItem.addActionListener(this);
1797
+ }
1798
+
1799
+// particleItem = menu.add(new MenuItem("Particle system"));
1800
+// particleItem.addActionListener(this);
1801
+ if (Globals.ADVANCED)
1802
+ {
10521803 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531804 ragdollItem.addActionListener(this);
10541805 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551806 ragdoll2Item.addActionListener(this);
1807
+ }
10561808 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1809
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581810 meshItem.addActionListener(this);
10591811 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601812 // meshGroupItem.addActionListener(this);
1813
+ if (Globals.ADVANCED)
1814
+ {
10611815 springItem = menu.add(new MenuItem("Spring"));
10621816 springItem.addActionListener(this);
10631817 flagItem = menu.add(new MenuItem("Flag"));
10641818 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691819 blobItem = menu.add(new MenuItem("Blob"));
10701820 blobItem.addActionListener(this);
10711821 latheItem = menu.add(new MenuItem("Lathe"));
10721822 latheItem.addActionListener(this);
1073
- lightItem = menu.add(new MenuItem("Light"));
1074
- 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);
10751830 menu.add("-");
10761831 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10771832 //superLoopItem.addActionListener(this);
1078
- loopItem = menu.add(new MenuItem("Loop"));
1079
- loopItem.addActionListener(this);
1833
+// loopItem = menu.add(new MenuItem("Loop"));
1834
+// loopItem.addActionListener(this);
10801835 doubleItem = menu.add(new MenuItem("Fork"));
10811836 doubleItem.addActionListener(this);
1837
+ if (Globals.ADVANCED)
1838
+ {
10821839 tripleItem = menu.add(new MenuItem("Trident"));
10831840 tripleItem.addActionListener(this);
1841
+ }
10841842 }
10851843
10861844 void buildToolsMenu(Menu menu)
10871845 {
10881846 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891847 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1848
+ animationItem.setState(Globals.ANIMATION);
1849
+
1850
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1851
+ archiveItem.addActionListener(this);
10911852
10921853 menu.add("-");
10931854 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941855 parseverticesItem.addActionListener(this);
10951856 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961857 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1858
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981859 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011860 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021861 reduceMorphItem.addActionListener(this);
11031862 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041863 reduce34MorphItem.addActionListener(this);
1105
-
1106
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1107
- computeAOItem.addActionListener(this);
11081864 menu.add("-");
1109
-
11101865 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111866 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("-");
11121875 menu.add(analyzeItem = new MenuItem("Analyze"));
11131876 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1877
+ menu.add(dumpItem = new MenuItem("Print"));
11151878 dumpItem.addActionListener(this);
11161879 // menu.add(pathItem = new MenuItem("From-to path"));
11171880 // pathItem.addActionListener(this);
....@@ -1120,6 +1883,8 @@
11201883 resetParentItem.addActionListener(this);
11211884 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221885 repairParentItem.addActionListener(this);
1886
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1887
+ repairShadowItem.addActionListener(this);
11231888 menu.add(invariantsItem = new MenuItem("Invariants"));
11241889 invariantsItem.addActionListener(this);
11251890 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1892,7 @@
11271892 menu.add("-");
11281893 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291894 editScriptItem.addActionListener(this);
1895
+ }
11301896 }
11311897
11321898 void ScreenFit()
....@@ -1249,9 +2015,34 @@
12492015 shadow.material = new cMaterial(obj.material);
12502016 shadow.material.diffuse = 0.0001f;
12512017 shadow.material.specular = 0.0001f;
2018
+ //shadow.projectedVertices[1].x = 300;
12522019
12532020 makeSomething(shadow);
12542021 }
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
+ }
12552046
12562047 /**
12572048 * applyExample
....@@ -1455,9 +2246,9 @@
14552246
14562247 void Overwrite(int mask)
14572248 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2249
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14592250 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
2251
+ Object3D content = Grafreed.clipboard.get(0);
14612252
14622253 if (content instanceof cGroup && ((cGroup)content).transientlink )
14632254 content = ((cGroup)content).get(0);
....@@ -1480,6 +2271,7 @@
14802271 //
14812272 public void actionPerformed(ActionEvent event) // , Object arg)
14822273 {
2274
+ Object source = event.getSource();
14832275 /*
14842276 if (event.getSource() == nameField)
14852277 {
....@@ -1491,11 +2283,11 @@
14912283 }
14922284 else
14932285 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2286
+ if (source == lookAtItem || source == lookFromItem)
14952287 {
14962288 ScreenFit();
14972289 } else
1498
- if (event.getSource() == switchItem)
2290
+ if (source == switchViewItem)
14992291 {
15002292 cVector v1 = new cVector();
15012293 cVector v2 = new cVector();
....@@ -1504,11 +2296,11 @@
15042296 objEditor.cameraView.renderCamera.setAim(v2, v1);
15052297 objEditor.cameraView.repaint();
15062298 } else
1507
- if (event.getSource() == rectoidItem)
2299
+ if (source == rectoidItem || source == boxButton)
15082300 {
15092301 makeSomething(new Box());
15102302 } else
1511
- if (event.getSource() == particleItem)
2303
+ if (source == particleItem || source == particlesButton)
15122304 {
15132305 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15142306 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +2321,9 @@
15292321 applyExample(particleGeom, "SMOKE");
15302322 makeSomething(particleGeom);
15312323 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2324
+ if (source == ragdollItem || source == ragdoll2Item)
15332325 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2326
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15352327
15362328 ragdoll.toParent = LA.newMatrix();
15372329 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +2341,7 @@
15492341 } else
15502342 /*
15512343 */
1552
- if (event.getSource() == heightFieldItem)
2344
+ if (source == heightFieldItem)
15532345 {
15542346 Object3D obj = new Object3D();
15552347
....@@ -1587,31 +2379,31 @@
15872379
15882380 makeSomething(obj);
15892381 } else
1590
- if (event.getSource() == gridItem)
2382
+ if (source == gridItem || source == gridButton)
15912383 {
15922384 makeSomething(new Grid());
15932385 } else
1594
- if (event.getSource() == ellipsoidItem)
2386
+ if (source == ellipsoidItem || source == sphereButton)
15952387 {
15962388 makeSomething(new Sphere());
15972389 } else
1598
- if (event.getSource() == coneItem)
2390
+ if (source == coneItem || source == coneButton)
15992391 {
16002392 makeSomething(new Cone());
16012393 } else
1602
- if (event.getSource() == torusItem)
2394
+ if (source == torusItem || source == torusButton)
16032395 {
16042396 makeSomething(new Torus());
16052397 } else
1606
- if (event.getSource() == superItem)
2398
+ if (source == superItem || source == superButton)
16072399 {
16082400 makeSomething(new Superellipsoid());
16092401 } else
1610
- if (event.getSource() == kleinItem)
2402
+ if (source == kleinItem || source == kleinButton)
16112403 {
16122404 makeSomething(new Klein());
16132405 } else
1614
- if (event.getSource() == blobItem)
2406
+ if (source == blobItem)
16152407 {
16162408 Blob blob = new Blob();
16172409 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +2411,15 @@
16192411 //blob.retile();
16202412 makeSomething(blob);
16212413 } else
1622
- if (event.getSource() == latheItem)
2414
+ if (source == latheItem)
16232415 {
16242416 makeSomething(new Lathe());
16252417 } else
1626
- if (event.getSource() == bezierItem)
2418
+ if (source == bezierItem)
16272419 {
16282420 makeSomething(new BezierSurface());
16292421 } else
1630
- if (event.getSource() == checkerItem)
2422
+ if (source == overlayItem || source == overlayButton)
16312423 {
16322424 /*
16332425 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +2434,7 @@
16422434 */
16432435 makeSomething(new Checker());
16442436 } else
1645
- if (event.getSource() == meshItem)
2437
+ if (source == meshItem)
16462438 {
16472439 Object3D itemtomake = new Object3D();
16482440 Object3D child;
....@@ -1663,35 +2455,52 @@
16632455 makeSomething(child);
16642456 }
16652457 } else
1666
- if (event.getSource() == springItem)
2458
+ if (source == springItem)
16672459 {
16682460 cSpring s = new cSpring();
16692461 s.setup();
16702462 makeSomething(s);
16712463 } else
1672
- if (event.getSource() == flagItem)
2464
+ if (source == flagItem)
16732465 {
16742466 cSpring s = new cFlag();
16752467 s.setup();
16762468 makeSomething(s);
16772469 } else
1678
- if (event.getSource() == lightItem)
2470
+ if (source == lightItem || source == lightButton)
16792471 {
16802472 makeSomething(new Light());
16812473 } else
1682
- 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)
16832492 {
16842493 group(new CSG());
16852494 } else
1686
- if (event.getSource() == templateItem)
2495
+ if (source == templateItem)
16872496 {
16882497 group(new cTemplate());
16892498 } else
1690
- if (event.getSource() == attributeItem)
2499
+ if (source == attributeItem)
16912500 {
16922501 makeSomething(new Attribute());
16932502 } else
1694
- if (event.getSource() == pointflowItem)
2503
+ if (source == pointflowItem)
16952504 {
16962505 makeSomething(new PointFlow());
16972506 } else
....@@ -1703,7 +2512,7 @@
17032512 } else
17042513 */
17052514
1706
- if (event.getSource() == superLoopItem)
2515
+ if (source == superLoopItem)
17072516 {
17082517 Composite g = new cGroup();
17092518 for (int i=0; i<15; i++)
....@@ -1725,30 +2534,30 @@
17252534
17262535 group(g);
17272536 } else
1728
- if (event.getSource() == loopItem)
2537
+ if (source == loopItem || source == loopButton)
17292538 {
17302539 Composite csg = new GroupLeaf();
17312540 csg.count = 5;
17322541 group(csg);
1733
- Composite child = new cGroup();
2542
+ Composite child = new cGroup("Branch");
17342543 csg.addChild(child);
17352544 child.addChild(csg);
17362545 } else
1737
- if (event.getSource() == doubleItem)
2546
+ if (source == doubleItem)
17382547 {
1739
- Composite csg = new GroupLeaf();
2548
+ Composite csg = new GroupLeaf("Fork");
17402549 csg.count = 5;
17412550 group(csg);
1742
- Composite child = new cGroup();
2551
+ Composite child = new cGroup("Branch A");
17432552 csg.addChild(child);
17442553 child.addChild(csg);
1745
- child = new cGroup();
2554
+ child = new cGroup("Branch B");
17462555 csg.addChild(child);
17472556 child.addChild(csg);
17482557 } else
1749
- if (event.getSource() == tripleItem)
2558
+ if (source == tripleItem)
17502559 {
1751
- Composite csg = new GroupLeaf();
2560
+ Composite csg = new GroupLeaf("Trident");
17522561 csg.count = 4;
17532562 group(csg);
17542563 Composite child = new cGroup();
....@@ -1761,73 +2570,105 @@
17612570 csg.addChild(child);
17622571 child.addChild(csg);
17632572 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
2573
+ if (source == computeAOItem)
17662574 {
1767
- ImportGFD();
2575
+ Globals.drawMode = CameraPane.OCCLUSION;
2576
+ cameraView.repaint();
17682577 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
2578
+ if (source == recompileItem)
17872579 {
17882580 Recompile();
17892581 refreshContents();
17902582 } else
1791
- if (event.getSource() == editScriptItem)
2583
+ if (source == editScriptItem)
17922584 {
17932585 OpenDialog();
17942586 refreshContents();
17952587 } else
1796
- if (event.getSource() == invariantsItem)
2588
+ if (source == invariantsItem)
17972589 {
17982590 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
2591
+ Grafreed.grafreed.universe.invariants();
18002592 } else
1801
- if (event.getSource() == memoryItem)
2593
+ if (source == memoryItem)
18022594 {
18032595 //System.out.println("Invariants:");
18042596 PrintMemory();
18052597 } else
1806
- if (event.getSource() == pathItem)
2598
+ if (source == pathItem)
18072599 {
18082600 PrintPath();
18092601 } else
1810
- if (event.getSource() == analyzeItem)
2602
+ if (source == analyzeItem)
18112603 {
18122604 AnalyzeObject();
18132605 } else
1814
- if (event.getSource() == dumpItem)
2606
+ if (source == dumpItem)
18152607 {
18162608 DumpObject();
18172609 } else
1818
- if (event.getSource() == screenfitButton)
2610
+ if (source == minButton)
18192611 {
1820
- //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
+ {
18212664 ScreenFit();
18222665 } else
1823
- if (event.getSource() == screenfitpointButton)
2666
+ if (source == screenfitpointButton)
18242667 {
1825
- //Reload(lastConverter, lastFilename, true);
18262668 ScreenFitPoint();
18272669 } else
1828
- if (event.getSource() == snapobjectButton)
2670
+ if (source == snapobjectButton)
18292671 {
1830
- //Reload(lastConverter, lastFilename, true);
18312672 SnapObject();
18322673 } else
18332674 // if (event.getSource() == recompileButton)
....@@ -1836,13 +2677,13 @@
18362677 // Recompile();
18372678 // refreshContents();
18382679 // } else
1839
- if (event.getSource() == gcButton)
2680
+ if (source == gcButton)
18402681 {
18412682 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422683 System.gc();
18432684 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442685 } else
1845
- if (event.getSource() == editLeafItem)
2686
+ if (source == editLeafItem)
18462687 {
18472688 Object3D obj;
18482689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2697,74 @@
18562697 }
18572698 refreshContents(true);
18582699 } else
1859
- if (event.getSource() == openWindowItem)
2700
+ if (source == openWindowItem)
18602701 {
18612702 EditSelection(true);
18622703 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2704
+ if (source == cutItem || source == clearButton)
18642705 {
18652706 loadClipboard(true);
18662707 } else
1867
- if (event.getSource() == duplicateItem)
2708
+ if (source == undoItem)
18682709 {
1869
- 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;
18702719 loadClipboard(false);
18712720 paste(false);
1872
- GrafreeD.clipboard = keep;
2721
+ Grafreed.clipboard = keep;
18732722 } else
1874
- if (event.getSource() == cloneItem)
2723
+ if (source == cloneItem)
18752724 {
18762725 CloneSelection(false);
18772726 } else
1878
- if (event.getSource() == cloneSupportItem)
2727
+ if (source == cloneSupportItem)
18792728 {
18802729 CloneSelection(true);
18812730 } else
1882
- if (event.getSource() == copyItem)
2731
+ if (source == copyItem)
18832732 {
18842733 loadClipboard(false);
18852734 } else
1886
- if (event.getSource() == pasteItem)
2735
+ if (source == pasteItem)
18872736 {
18882737 paste(false);
18892738 } else
1890
- if (event.getSource() == pasteLinkItem)
2739
+ if (source == pasteIntoItem)
18912740 {
1892
- pasteInto(false);
2741
+ pasteInto(true, false);
18932742 } else
1894
- if (event.getSource() == pasteCloneItem)
2743
+ if (source == pasteLinkItem)
18952744 {
1896
- pasteInto(true);
2745
+ pasteInto(false, false);
18972746 } else
1898
- if (event.getSource() == pasteExpandItem)
2747
+ if (source == pasteCloneItem)
2748
+ {
2749
+ pasteInto(true, true);
2750
+ } else
2751
+ if (source == pasteExpandItem)
18992752 {
19002753 paste(true);
19012754 } else
1902
- if (event.getSource() == synchronizeItem)
2755
+ if (source == synchronizeItem)
19032756 {
19042757 Overwrite(Object3D.TRANSFORM);
19052758 } else
1906
- if (event.getSource() == overwriteNameItem)
2759
+ if (source == overwriteNameItem)
19072760 {
19082761 Overwrite(Object3D.NAME);
19092762 } else
1910
- if (event.getSource() == overwriteUVItem)
2763
+ if (source == overwriteUVItem)
19112764 {
19122765 Overwrite(Object3D.UV);
19132766 } else
1914
- if (event.getSource() == overwriteMatItem)
2767
+ if (source == overwriteMatItem)
19152768 {
19162769 /* july 2015
19172770 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2784,7 @@
19312784
19322785 Overwrite(dropAttributes);
19332786 }
1934
- if (event.getSource() == overwriteGeoItem)
2787
+ if (source == overwriteGeoItem)
19352788 {
19362789 Overwrite(Object3D.GEOMETRY);
19372790 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2801,7 @@
19482801 // refreshContents();
19492802 // }
19502803 } else
1951
- if (event.getSource() == generateMeshItem)
2804
+ if (source == generateMeshItem)
19522805 {
19532806 //if (group.selection.size() == 1)
19542807 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2812,7 @@
19592812 ResetModel();
19602813 refreshContents();
19612814 } else
1962
- if (event.getSource() == extractGeometriesItem)
2815
+ if (source == extractGeometriesItem)
19632816 {
19642817 boolean one = false;
19652818
....@@ -1986,7 +2839,7 @@
19862839 ResetModel();
19872840 refreshContents();
19882841 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2842
+ if (source == cloneGeometriesItem)
19902843 {
19912844 boolean one = false;
19922845
....@@ -2012,7 +2865,7 @@
20122865 ResetModel();
20132866 refreshContents();
20142867 } else
2015
- if (event.getSource() == shareGeometriesItem)
2868
+ if (source == shareGeometriesItem)
20162869 {
20172870 boolean one = false;
20182871
....@@ -2042,7 +2895,7 @@
20422895 refreshContents();
20432896 }
20442897 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2898
+ if (source == mergeGeometriesItem)
20462899 {
20472900 boolean one = false;
20482901
....@@ -2072,7 +2925,7 @@
20722925 ResetModel();
20732926 refreshContents();
20742927 } else
2075
- if (event.getSource() == linkverticesItem)
2928
+ if (source == linkverticesItem)
20762929 {
20772930 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782931 // {
....@@ -2085,48 +2938,48 @@
20852938 // group.selection.get(0).setMasterThis(content); // should be identity
20862939 // refreshContents();
20872940 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2941
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892942 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2943
+ Object3D content = Grafreed.clipboard.get(0);
20912944
20922945 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932946 content = ((cGroup)content).get(0);
20942947
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2948
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962949 for (int i=0; i<group.selection.size(); i++)
20972950 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2951
+ boolean random = CameraPane.SWITCH;
2952
+ CameraPane.SWITCH = false; // parse all random nodes
21002953 group.selection.get(i).linkVerticesThis(content);
21012954 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2955
+ CameraPane.SWITCH = random;
21032956 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2957
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052958 refreshContents();
21062959 }
21072960 } else
2108
- if (event.getSource() == resetsupportItem)
2961
+ if (source == resetsupportItem)
21092962 {
21102963 for (int i=0; i<group.selection.size(); i++)
21112964 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2965
+ boolean random = CameraPane.SWITCH;
2966
+ CameraPane.SWITCH = false; // parse all random nodes
21142967 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2968
+ CameraPane.SWITCH = random;
21162969 }
21172970
21182971 refreshContents();
21192972 } else
2120
- if (event.getSource() == relinkverticesItem)
2973
+ if (source == relinkverticesItem)
21212974 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2975
+ boolean random = CameraPane.SWITCH;
2976
+ CameraPane.SWITCH = false; // parse all random nodes
21242977 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2978
+ CameraPane.SWITCH = random;
21262979
21272980 refreshContents();
21282981 } else
2129
- if (event.getSource() == resetreferencesItem)
2982
+ if (source == resetreferencesItem)
21302983 {
21312984 for (int i=0; i<group.selection.size(); i++)
21322985 {
....@@ -2135,11 +2988,11 @@
21352988
21362989 refreshContents();
21372990 } else
2138
- if (event.getSource() == setMasterItem)
2991
+ if (source == setMasterItem)
21392992 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2993
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412994 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2995
+ Object3D content = Grafreed.clipboard.get(0);
21432996
21442997 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452998 content = ((cGroup)content).get(0);
....@@ -2148,13 +3001,13 @@
21483001 refreshContents();
21493002 }
21503003 } else
2151
- if (event.getSource() == poseMeshItem)
3004
+ if (source == poseMeshItem)
21523005 {
21533006 if (group.selection.size() == 1)
21543007 {
2155
- if (GrafreeD.clipboard.size() == 1)
3008
+ if (Grafreed.clipboard.size() == 1)
21563009 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
3010
+ Object3D content = Grafreed.clipboard.get(0);
21583011
21593012 if (content instanceof cGroup && ((cGroup)content).transientlink )
21603013 content = ((cGroup)content).get(0);
....@@ -2167,19 +3020,19 @@
21673020 }
21683021
21693022 } else
2170
- if (event.getSource() == revertMeshItem)
3023
+ if (source == revertMeshItem)
21713024 {
21723025 RevertMeshes();
21733026 } else
2174
- if (event.getSource() == resetMeshItem)
3027
+ if (source == resetAllItem)
21753028 {
21763029 ResetAll();
21773030 } else
2178
- if (event.getSource() == stepAllItem)
3031
+ if (source == stepAllItem)
21793032 {
21803033 StepAll();
21813034 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3035
+ if (source == deleteItem) // || event.getSource() == clearButton)
21833036 {
21843037 //int indices[] = jList.getSelectedIndices();
21853038 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +3040,46 @@
21873040
21883041 ClearSelection(false);
21893042 } else
2190
- if (event.getSource() == clearAllItem)
3043
+ if (source == clearAllItem)
21913044 {
21923045 ClearSelection(true);
21933046 } else
2194
- if (event.getSource() == grabItem)
3047
+ if (source == grabItem || source == groupButton)
21953048 {
2196
- group(new cGroup(), true);
3049
+ group(new cGroup(), false); // true);
21973050 } else
2198
- if (event.getSource() == hideItem)
3051
+ if (source == hideItem)
21993052 {
22003053 group(new HiddenObject());
22013054 } else
2202
- if (event.getSource() == frontItem)
3055
+ if (source == frontItem)
22033056 {
22043057 front();
22053058 } else
2206
- if (event.getSource() == backItem)
3059
+ if (source == backItem)
22073060 {
22083061 back();
22093062 } else
2210
- if (event.getSource() == cameraItem)
3063
+ if (source == cameraItem)
22113064 {
22123065 makeSomething(new Camera());
22133066 } else
2214
- if (event.getSource() == compositeItem)
3067
+ if (source == compositeItem || source == compositeButton)
22153068 {
22163069 group(new Composite());
22173070 } else
2218
- if (event.getSource() == randomItem)
3071
+ if (source == switchItem || source == switchButton)
22193072 {
22203073 RandomNode random = new RandomNode();
22213074 group(random);
22223075 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
3076
+ random.name = random.get(0).name + "Switch";
22243077 } else
2225
- if (event.getSource() == physicsItem)
3078
+ if (source == physicsItem)
22263079 {
22273080 group(new PhysicsNode());
22283081 } else
2229
- if (event.getSource() == frameselectorItem)
3082
+ if (source == frameselectorItem)
22303083 {
22313084 for (int i=0; i<group.selection.size(); i++)
22323085 {
....@@ -2238,7 +3091,7 @@
22383091 ResetModel();
22393092 refreshContents();
22403093 } else
2241
- if (event.getSource() == switchGeoItem)
3094
+ if (source == switchGeoItem)
22423095 {
22433096 for (int i=0; i<group.selection.size(); i++)
22443097 {
....@@ -2250,7 +3103,7 @@
22503103 ResetModel();
22513104 refreshContents();
22523105 } else
2253
- if (event.getSource() == switchTransfoItem)
3106
+ if (source == switchTransfoItem)
22543107 {
22553108 for (int i=0; i<group.selection.size(); i++)
22563109 {
....@@ -2262,7 +3115,7 @@
22623115 ResetModel();
22633116 refreshContents();
22643117 } else
2265
- if (event.getSource() == morphItem)
3118
+ if (source == morphItem)
22663119 {
22673120 for (int i=0; i<group.selection.size(); i++)
22683121 {
....@@ -2274,7 +3127,7 @@
22743127 ResetModel();
22753128 refreshContents();
22763129 } else
2277
- if (event.getSource() == scriptNodeItem)
3130
+ if (source == scriptNodeItem)
22783131 {
22793132 boolean atleastone = false;
22803133
....@@ -2313,215 +3166,252 @@
23133166 }
23143167 }
23153168 } else
2316
- if (event.getSource() == linkerItem)
3169
+ if (source == linkerItem)
23173170 {
23183171 group(new cLinker());
23193172 } else
2320
- if (event.getSource() == textureItem)
3173
+ if (source == textureItem || source == textureButton)
23213174 {
23223175 group(new TextureNode());
23233176 } else
2324
- if (event.getSource() == billboardItem)
3177
+ if (source == billboardItem)
23253178 {
23263179 group(new BillboardNode());
23273180 } else
2328
- if (event.getSource() == shadowXItem)
3181
+ if (source == shadowXItem)
23293182 {
23303183 CastShadow(0);
23313184 } else
2332
- if (event.getSource() == shadowYItem)
3185
+ if (source == shadowYItem)
23333186 {
23343187 CastShadow(1);
23353188 } else
2336
- if (event.getSource() == shadowZItem)
3189
+ if (source == shadowZItem)
23373190 {
23383191 CastShadow(2);
23393192 } else
2340
- if (event.getSource() == ungroupItem)
3193
+ if (source == ungroupItem || source == ungroupButton)
23413194 {
2342
- //ungroup();
3195
+ boolean hasRoot = false;
3196
+
23433197 for (int i=0; i<group.selection.size(); i++)
23443198 {
2345
- Ungroup(group.selection.get(i));
3199
+ if (group.selection.get(i) == group)
3200
+ {
3201
+ hasRoot = true;
3202
+ break;
3203
+ }
23463204 }
23473205
2348
- ClearSelection(false);
2349
-
2350
- 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
+ }
23513217 } else
2352
- if (event.getSource() == genUVItem)
3218
+ if (source == genUVItem)
23533219 {
23543220 GenUV();
23553221 } else
2356
- if (event.getSource() == genNormalsCADItem)
3222
+ if (source == genNormalsCADItem)
23573223 {
23583224 GenNormals(true);
23593225 } else
2360
- if (event.getSource() == genNormalsMESHItem)
3226
+ if (source == genNormalsMESHItem)
23613227 {
2362
- GenNormals(true); // TODO
3228
+ GenNormalsMESH();
23633229 } else
2364
- if (event.getSource() == genNormalsORGANItem)
3230
+ if (source == genNormalsORGANItem)
23653231 {
23663232 GenNormals(false);
23673233 } else
2368
- if (event.getSource() == genNormalsMINEItem)
3234
+ if (source == genNormalsMINEItem)
23693235 {
23703236 GenNormalsMINE();
23713237 } else
2372
- if (event.getSource() == stripifyItem)
3238
+ if (source == stripifyItem)
23733239 {
23743240 Stripify();
23753241 } else
2376
- if (event.getSource() == unstripifyItem)
3242
+ if (source == unstripifyItem)
23773243 {
23783244 Unstripify();
23793245 } else
2380
- if (event.getSource() == trimItem)
3246
+ if (source == trimItem)
23813247 {
23823248 Trim();
23833249 } else
2384
- if (event.getSource() == untrimItem)
3250
+ if (source == untrimItem)
23853251 {
23863252 Untrim();
23873253 } else
2388
- if (event.getSource() == clearColorsItem)
3254
+ if (source == clearColorsItem)
23893255 {
23903256 ClearColors();
23913257 } else
2392
- if (event.getSource() == clearMaterialsItem)
3258
+ if (source == clearMaterialsItem)
23933259 {
23943260 ClearMaterials();
23953261 } else
2396
- if (event.getSource() == liveleavesItem)
3262
+ if (source == liveleavesItem)
23973263 {
23983264 LiveLeaves(true);
23993265 } else
2400
- if (event.getSource() == unliveleavesItem)
3266
+ if (source == unliveleavesItem)
24013267 {
24023268 LiveLeaves(false);
24033269 } else
2404
- if (event.getSource() == supportleavesItem)
3270
+ if (source == supportleavesItem)
24053271 {
24063272 SupportLeaves(true);
24073273 } else
2408
- if (event.getSource() == unsupportleavesItem)
3274
+ if (source == unsupportleavesItem)
24093275 {
24103276 SupportLeaves(false);
24113277 } else
2412
- if (event.getSource() == hideleavesItem)
3278
+ if (source == hideleavesItem)
24133279 {
24143280 HideLeaves(true);
24153281 } else
2416
- if (event.getSource() == showleavesItem)
3282
+ if (source == showleavesItem)
24173283 {
24183284 HideLeaves(false);
24193285 } else
2420
- if (event.getSource() == markleavesItem)
3286
+ if (source == markleavesItem)
24213287 {
24223288 MarkLeaves(true);
24233289 } else
2424
- if (event.getSource() == unmarkleavesItem)
3290
+ if (source == unmarkleavesItem)
24253291 {
24263292 MarkLeaves(false);
24273293 } else
2428
- 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)
24293311 {
24303312 FlipV(true);
24313313 } else
2432
- if (event.getSource() == unflipVItem)
3314
+ if (source == unflipVItem)
24333315 {
24343316 FlipV(false);
24353317 } else
2436
- if (event.getSource() == lowTexturesItem)
3318
+ if (source == lowTexturesItem)
24373319 {
24383320 SetTexRes(0);
24393321 } else
2440
- if (event.getSource() == normalTexturesItem)
3322
+ if (source == normalTexturesItem)
24413323 {
24423324 SetTexRes(1);
24433325 } else
2444
- if (event.getSource() == highTexturesItem)
3326
+ if (source == highTexturesItem)
24453327 {
24463328 SetTexRes(2);
24473329 } else
2448
- if (event.getSource() == veryhighTexturesItem)
3330
+ if (source == veryhighTexturesItem)
24493331 {
24503332 SetTexRes(3);
24513333 } else
2452
- if (event.getSource() == maxTexturesItem)
3334
+ if (source == maxTexturesItem)
24533335 {
24543336 SetTexRes(4);
24553337 } else
2456
- if (event.getSource() == panoTexturesItem)
3338
+ if (source == panoTexturesItem)
24573339 {
24583340 SetTexRes(5);
24593341 } else
2460
- if (event.getSource() == reverseNormalsItem)
3342
+ if (source == reverseNormalsItem)
24613343 {
24623344 ReverseNormals();
24633345 } else
2464
- if (event.getSource() == parseverticesItem)
3346
+ if (source == parseverticesItem)
24653347 {
24663348 ParseVertices();
24673349 } else
2468
- if (event.getSource() == textureFieldItem)
3350
+ if (source == textureFieldItem)
24693351 {
24703352 TextureVertices();
24713353 } else
2472
- if (event.getSource() == alignItem)
3354
+ if (source == alignItem)
24733355 {
24743356 Align();
24753357 } else
2476
- if (event.getSource() == mirrorItem)
3358
+ if (source == mirrorItem)
24773359 {
24783360 MirrorPoses();
24793361 } else
2480
- if (event.getSource() == reduceMorphItem)
3362
+ if (source == reduceMorphItem)
24813363 {
24823364 MeshReduction(false);
24833365 } else
2484
- if (event.getSource() == reduce34MorphItem)
3366
+ if (source == reduce34MorphItem)
24853367 {
24863368 MeshReduction(true);
24873369 } else
2488
- if (event.getSource() == reverseTrianglesItem)
3370
+ if (source == reverseTrianglesItem)
24893371 {
24903372 ReverseTriangles();
24913373 } else
2492
- if (event.getSource() == reduceMeshItem)
3374
+ if (source == reduceMeshItem)
24933375 {
24943376 ReduceMesh(false);
24953377 } else
2496
- if (event.getSource() == reduce34MeshItem)
3378
+ if (source == reduce34MeshItem)
24973379 {
24983380 ReduceMesh(true);
24993381 } else
2500
- if (event.getSource() == increaseMeshItem)
3382
+ if (source == increaseMeshItem)
25013383 {
25023384 IncreaseMesh();
25033385 } else
2504
- if (event.getSource() == clipMeshItem)
3386
+ if (source == clipMeshItem)
25053387 {
25063388 ClipMesh();
25073389 } else
2508
- if (event.getSource() == smoothMeshItem)
3390
+ if (source == smoothMeshItem)
25093391 {
25103392 SmoothMesh();
25113393 } else
2512
- if (event.getSource() == transformgeometryItem)
3394
+ if (source == transformGeometryItem)
25133395 {
25143396 TransformGeometry();
25153397 } else
2516
- if (event.getSource() == resetTransformItem)
3398
+ if (source == transformChildrenItem)
3399
+ {
3400
+ TransformChildren();
3401
+ } else
3402
+ if (source == resetTransformItem)
25173403 {
25183404 ResetTransform();
25193405 } else
2520
- if (event.getSource() == resetCentroidItem)
3406
+ if (source == resetCentroidItem)
25213407 {
2522
- ResetCentroid();
3408
+ ResetCentroid(true);
25233409 } else
2524
- if (event.getSource() == resetParentItem)
3410
+ if (source == resetCentroidXZItem)
3411
+ {
3412
+ ResetCentroid(false);
3413
+ } else
3414
+ if (source == resetParentItem)
25253415 {
25263416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25273417 {
....@@ -2531,7 +3421,7 @@
25313421
25323422 refreshContents();
25333423 } else
2534
- if (event.getSource() == repairParentItem)
3424
+ if (source == repairParentItem)
25353425 {
25363426 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25373427 {
....@@ -2545,7 +3435,21 @@
25453435
25463436 refreshContents();
25473437 } else
2548
- if (event.getSource() == sortbysizeItem)
3438
+ if (source == repairShadowItem)
3439
+ {
3440
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3441
+ {
3442
+ Object3D obj = (Object3D)e.nextElement();
3443
+ obj.RepairShadow();
3444
+// for (int i=0; i<obj.size(); i++)
3445
+// {
3446
+// obj.get(i).parent = obj;
3447
+// }
3448
+ }
3449
+
3450
+ refreshContents();
3451
+ } else
3452
+ if (source == sortbysizeItem)
25493453 {
25503454 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513455 {
....@@ -2557,7 +3461,7 @@
25573461 ResetModel();
25583462 refreshContents();
25593463 } else
2560
- if (event.getSource() == sortbynameItem)
3464
+ if (source == sortbynameItem)
25613465 {
25623466 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25633467 {
....@@ -2569,7 +3473,7 @@
25693473 ResetModel();
25703474 refreshContents();
25713475 } else
2572
- if (event.getSource() == attachPigmentItem)
3476
+ if (source == attachPigmentItem)
25733477 {
25743478 String texture = GetFile("Attach pigment");
25753479 Object3D obj;
....@@ -2581,7 +3485,7 @@
25813485
25823486 refreshContents();
25833487 } else
2584
- if (event.getSource() == detachPigmentItem)
3488
+ if (source == detachPigmentItem)
25853489 {
25863490 Object3D obj;
25873491 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +3496,7 @@
25923496
25933497 refreshContents();
25943498 } else
2595
- if (event.getSource() == attachBumpItem)
3499
+ if (source == attachBumpItem)
25963500 {
25973501 String texture = GetFile("Attach bump");
25983502 Object3D obj;
....@@ -2604,18 +3508,18 @@
26043508
26053509 refreshContents();
26063510 } else
2607
- if (event.getSource() == detachBumpItem)
3511
+ if (source == detachBumpItem)
26083512 {
26093513 Object3D obj;
26103514 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26113515 {
26123516 obj = (Object3D)e.nextElement();
2613
- obj.SetBumpTexture(null);
3517
+ obj.ResetBumpTexture();
26143518 }
26153519
26163520 refreshContents();
26173521 } else
2618
- if (event.getSource() == pigmentBumpItem)
3522
+ if (source == pigmentBumpItem)
26193523 {
26203524 Object3D obj;
26213525 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +3530,262 @@
26263530
26273531 refreshContents();
26283532 } else
2629
- 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)
26303559 {
26313560 CameraPane.flash = true;
26323561 refreshContents();
26333562 } else
2634
- if (event.getSource() == oneButton)
3563
+ if (source == oneButton)
26353564 {
26363565 } else
2637
- if (event.getSource() == twoButton)
3566
+ if (source == twoButton)
26383567 {
26393568 radio.layout = twoButton;
3569
+
3570
+ if (CameraPane.FULLSCREEN)
3571
+ fullscreenLayout = radio.layout;
3572
+
26403573 // bug
26413574 //gridPanel.setDividerLocation(1.0);
26423575 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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
+
26673623 } else
2668
- if (event.getSource() == threeButton)
3624
+ if (source == threeButton)
26693625 {
26703626 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- 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();
26953664 } else
2696
- if (event.getSource() == fourButton)
3665
+ if (source == fourButton)
26973666 {
26983667 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27233704 } else
2724
- if (event.getSource() == sixButton)
3705
+ if (source == sixButton)
27253706 {
27263707 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- 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();
27513745 } else
2752
- if (event.getSource() == sevenButton)
3746
+ if (source == sevenButton)
27533747 {
27543748 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- 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();
27793787 } else
2780
- if (event.getSource() == rootButton)
3788
+ if (source == rootButton)
27813789 {
27823790 Object3D obj;
27833791 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,66 +3795,85 @@
27873795 EditObject(obj);
27883796 }
27893797
3798
+ cameraView.requestFocusInWindow();
27903799 refreshContents(true);
27913800 } else
2792
- if (event.getSource() == closeButton)
3801
+ if (source == closeButton)
27933802 {
27943803 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953804 cRadio ab;
27963805 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27973806 {
27983807 ab = (cRadio)e.nextElement();
2799
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3808
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28003809 {
3810
+ // Patch to avoid bug with transparency.
3811
+ if (!ab.hadMaterial)
3812
+ {
3813
+ ab.object.material = null;
3814
+ }
3815
+
28013816 buttonGroup.remove(ab);
28023817 radioPanel.remove(ab);
28033818
2804
- ab.GetObject().editWindow = null;
3819
+ //ab.GetObject().editWindow = null;
3820
+ ab.GetObject().manipWindow = null;
28053821 // ab.GetObject().objectUI = null; // ?????????
28063822
28073823 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28083824 break;
28093825 }
28103826 }
3827
+
3828
+ cameraView.requestFocusInWindow();
28113829 refreshContents(true);
28123830 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3831
+ if (source == editItem || source == editButton)
28143832 {
3833
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3834
+ {
3835
+ Object3D child = (Object3D)e.nextElement();
3836
+ child.pinned = true;
3837
+ }
3838
+
28153839 EditSelection(false);
28163840 } else
2817
- if (event.getSource() == uneditButton)
3841
+ if (source == uneditButton)
28183842 {
28193843 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203844 {
28213845 Object3D child = (Object3D)e.nextElement();
28223846 if(child.editWindow != null)
2823
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3847
+ child.pinned = false;
28243848 child.CloseUI();
28253849 listUI.remove(child);
3850
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28263851
2827
- child.editWindow = null; // ???????????
3852
+ //child.editWindow = null; // ???????????
28283853 }
2829
- objEditor.ctrlPanel.revalidate();
3854
+ objEditor.ctrlPanel.FlushUI();
28303855 //objEditor.jTree.clearSelection();
28313856 //objEditor.ResetSliders();
28323857 refreshContents(true);
28333858 } else
2834
- if (event.getSource() == clearPanelButton)
3859
+ if (source == clearPanelButton)
28353860 {
28363861 assert(copy == group);
28373862 //copy.ClearUI();
28383863 for (Object3D obj : listUI)
28393864 {
3865
+ obj.pinned = false;
28403866 obj.CloseUI();
28413867 }
28423868 listUI.clear();
3869
+ SetPinStates(group.selection.size() > 0);
28433870 refreshContents(true);
28443871 } else
2845
- if (event.getSource() == allParamsButton)
3872
+ if (source == allParamsButton)
28463873 {
28473874 assert(copy == group);
28483875
2849
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3876
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28503877
28513878 for (Object3D obj : listUI)
28523879 {
....@@ -2863,19 +3890,19 @@
28633890
28643891 refreshContents(true);
28653892 } else
2866
- if (event.getSource() == unselectButton)
3893
+ if (source == unselectButton)
28673894 {
28683895 objEditor.jTree.clearSelection();
28693896 // ?? oct 2012 GrafreeD.clipboard.clear();
28703897 objEditor.ResetSliders();
28713898 refreshContents(true);
28723899 } else
2873
- if(event.getSource() instanceof cRadio)
3900
+ if(source instanceof cRadio)
28743901 {
28753902 group.parent = keepparent;
28763903 group.attributes = 0;
28773904 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3905
+ /*cRadio*/ radio = (cRadio)source;
28793906 Object3D obj = radio.GetObject();
28803907 System.out.println("Edit " + obj);
28813908 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3922,10 @@
28953922 }
28963923
28973924 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3925
+
3926
+ SetUndoStates();
3927
+
3928
+ //Globals.theRenderer.object = group;
28993929 if(!useclient)
29003930 {
29013931 cameraView.renderCamera = radio.camera;
....@@ -2904,25 +3934,55 @@
29043934 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053935 cameraView.targetLookAt.set(radio.camera.lookAt);
29063936 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3937
+ //cameraView.lighttouched = true;
3938
+ Globals.lighttouched = true;
29083939 topView.object = group;
29093940 frontView.object = group;
29103941 sideView.object = group;
29113942 }
2912
- group.editWindow = this;
3943
+
3944
+// fix "+" issue
3945
+ //group.editWindow = this;
3946
+ group.manipWindow = this;
3947
+
29133948 /*
29143949 currentLayout = radio.layout;
29153950 if (currentLayout == null)
29163951 currentLayout = sevenButton;
29173952 */
29183953 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);
29193962 keepparent = group.parent;
29203963 // PARENT = NULL or not???
29213964 //group.parent = null; // ROOT
29223965 //group.attributes = -1;
29233966 ResetModel();
3967
+
3968
+ cameraView.requestFocusInWindow();
29243969 refreshContents(true);
2925
- }
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
+ }
29263986 else
29273987 {
29283988 //return super.action(event, arg);
....@@ -2931,7 +3991,6 @@
29313991 }
29323992
29333993 boolean useclient = false;
2934
- cRadio radio;
29353994
29363995 void ToggleRoot()
29373996 {
....@@ -2940,7 +3999,7 @@
29403999 if (useclient)
29414000 {
29424001 cameraView.object = client;
2943
- cameraView.lighttouched = true;
4002
+ Globals.lighttouched = true;
29444003 //topView.object = client;
29454004 //frontView.object = client;
29464005 //sideView.object = client;
....@@ -2948,7 +4007,7 @@
29484007 else
29494008 {
29504009 cameraView.object = group;
2951
- cameraView.lighttouched = true;
4010
+ Globals.lighttouched = true;
29524011 //topView.object = group;
29534012 //frontView.object = group;
29544013 //sideView.object = group;
....@@ -2983,6 +4042,28 @@
29834042 refreshContents();
29844043 }
29854044
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
+ }
29864067
29874068 void ResetTransform()
29884069 {
....@@ -3095,7 +4176,7 @@
30954176 refreshContents();
30964177 }
30974178
3098
- void ResetCentroid()
4179
+ void ResetCentroid(boolean full)
30994180 {
31004181 Object3D obj;
31014182 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +4191,16 @@
31104191 LA.matIdentity(Object3D.mat);
31114192 obj.getBounds(minima, maxima, false);
31124193 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4194
+ if (full)
4195
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31144196 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31154197 obj.TransformMesh(Object3D.mat);
4198
+
31164199 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4200
+ if (full)
4201
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31184202 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4203
+
31194204 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31204205 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31214206 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +4229,8 @@
31444229
31454230 int size = obj.MemorySize();
31464231
3147
- 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)");
31484234 }
31494235 }
31504236 catch (Exception e)
....@@ -3181,9 +4267,9 @@
31814267 obj = (Object3D)e.nextElement();
31824268
31834269 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
4270
+ Grafreed.AnalyzeObject(obj);
31854271 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
4272
+ Grafreed.AnalyzeObject(obj.bRep);
31874273
31884274 // System.err.println((size/1024) + " KB is the size of " + obj);
31894275 }
....@@ -3225,6 +4311,13 @@
32254311 void GenNormals(boolean crease)
32264312 {
32274313 group.GenNormalsS(crease);
4314
+
4315
+ refreshContents();
4316
+ }
4317
+
4318
+ void GenNormalsMESH()
4319
+ {
4320
+ group.GenNormalsMeshS();
32284321
32294322 refreshContents();
32304323 }
....@@ -3397,8 +4490,8 @@
33974490
33984491 void ParseVertices()
33994492 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
4493
+ boolean epsequal = Grafreed.epsequal;
4494
+ Grafreed.epsequal = true;
34024495
34034496 for (int i=0; i<group.selection.size(); i++)
34044497 {
....@@ -3423,7 +4516,7 @@
34234516 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34244517 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34254518
3426
- g.add(GrafreeD.clipboard);
4519
+ g.add(Grafreed.clipboard);
34274520
34284521 buffer.add(g);
34294522 }
....@@ -3438,7 +4531,7 @@
34384531 makeSomething(buffer, i==group.selection.size()-1);
34394532 }
34404533
3441
- GrafreeD.epsequal = epsequal;
4534
+ Grafreed.epsequal = epsequal;
34424535
34434536 refreshContents();
34444537 }
....@@ -3456,7 +4549,16 @@
34564549 String pigment = Object3D.GetPigment(tex);
34574550 //String bump = Object3D.GetBump(tex);
34584551
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
34604562
34614563 double s = v.s;
34624564
....@@ -3544,11 +4646,11 @@
35444646
35454647 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35464648
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
4649
+ boolean random = CameraPane.SWITCH;
4650
+ CameraPane.SWITCH = false; // parse all random nodes
35494651 lowres.linkVerticesThis(null);
35504652 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
4653
+ CameraPane.SWITCH = random;
35524654
35534655 System.err.flush();
35544656
....@@ -3588,7 +4690,7 @@
35884690 return;
35894691
35904692 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
4693
+ Object3D ref = Grafreed.clipboard.get(0);
35924694
35934695 Object3D newgroup = new Object3D("Po:" + poses.name);
35944696
....@@ -3757,7 +4859,7 @@
37574859 group.selection.RelinkToSupport(); // july 2014
37584860 System.out.println("DONE.");
37594861 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4862
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614863 }
37624864
37634865 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4884,9 @@
37824884
37834885 void ClipMesh()
37844886 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864888 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4889
+ Object3D content = Grafreed.clipboard.get(0);
37884890
37894891 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904892 content = ((cGroup)content).get(0);
....@@ -3793,7 +4895,7 @@
37934895 // {
37944896 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954897 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4898
+ group.selection.ClipMesh(Grafreed.clipboard);
37974899 }
37984900 // group.selection.ClipMesh(GrafreeD.clipboard);
37994901 System.out.println("DONE.");
....@@ -3840,6 +4942,18 @@
38404942 void MarkLeaves(boolean hide)
38414943 {
38424944 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);
38434957 refreshContents();
38444958 }
38454959
....@@ -3914,28 +5028,25 @@
39145028 // }
39155029 // }
39165030
3917
- static boolean allparams = true;
3918
-
3919
- static Vector<Object3D> listUI = new Vector<Object3D>();
3920
-
39215031 void EditSelection(boolean newWindow)
39225032 {
5033
+ if (group.selection == null)
5034
+ {
5035
+ EditElement(group, newWindow); // ? new
5036
+ return;
5037
+ }
5038
+
39235039 // aConstraints.gridy = 0;
39245040 for (int i=0; i<group.selection.size(); i++)
39255041 {
39265042 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39275043 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5044
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39295045
39305046 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
5047
+ if(elem != group || !newWindow)
39325048 {
3933
- // if (!(elem instanceof Composite))
3934
- // newWindow = false;
3935
- listUI.add(elem);
3936
- elem.openEditWindow(this, newWindow); //, false);
3937
- System.out.println("edit : " + elem);
3938
- elem.editWindow.refreshContents(true); // ? new
5049
+ EditElement(elem, newWindow); // ? new
39395050 }
39405051 }
39415052 }
....@@ -3998,9 +5109,7 @@
39985109
39995110 freezemodel = false;
40005111 }
4001
-
4002
- boolean flashIt = true;
4003
-
5112
+
40045113 public void valueChanged(TreeSelectionEvent e)
40055114 //public boolean handleEvent(Event event)
40065115 {
....@@ -4010,7 +5119,8 @@
40105119 //new Exception().printStackTrace();
40115120
40125121 freezemodel = true;
4013
-
5122
+ ClearUnpinned();
5123
+
40145124 /**/
40155125 //switch (event.id)
40165126 {
....@@ -4018,7 +5128,6 @@
40185128 //case 702: // Event.LIST_DESELECT
40195129 group.deselectAll();
40205130 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40225131 if (tps != null)
40235132 {
40245133 for (int i=0; i < tps.length; i++)
....@@ -4027,33 +5136,39 @@
40275136
40285137 //if (child.parent != null)
40295138 //child.parent.addSelectee(child);
5139
+ objEditor.SetMaterial(child);
40305140 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40345141 }
40355142 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
5143
+// else
5144
+// {
5145
+// objEditor.SetMaterial(group); // .GetMaterial());
5146
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5147
+// System.err.println("info : " + group.GetPath());
5148
+// }
40425149
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- if (flashIt && !CameraPane.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))
40465151 CameraPane.flash = true;
40475152
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5153
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40495154 // a camera
40505155 {
4051
- CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
5161
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5162
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40555163 }
40565164
5165
+ if (tps != null && tps.length == 1)
5166
+ {
5167
+ EditSelection(false);
5168
+ }
5169
+
5170
+ SetPinStates(tps != null && tps.length > 0);
5171
+
40575172 refreshContents();
40585173 //return true;
40595174 }
....@@ -4062,6 +5177,37 @@
40625177
40635178 freezemodel = false;
40645179 }
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
+ }
40655211
40665212 void linkSomething(Object3D thing)
40675213 {
....@@ -4133,16 +5279,19 @@
41335279 {
41345280 if (group.selection.isEmpty())
41355281 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
5282
+
5283
+ Grafreed.clipboardIsTempGroup = false;
41375284 Composite tGroup = null;
41385285 if (group.selection.size() > 0) // 1)
41395286 {
41405287 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
5288
+ Grafreed.clipboardIsTempGroup = true;
41425289 }
41435290
41445291 if (cut)
41455292 {
5293
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5294
+// Save();
41465295 //int indices[] = jList.getSelectedIndices();
41475296 //for (int i = indices.length - 1; i >= 0; i--)
41485297 //jList.remove(indices[i]);
....@@ -4178,16 +5327,16 @@
41785327 //System.out.println("cut " + child);
41795328 //System.out.println("parent = " + child.parent);
41805329 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
5330
+ if (Grafreed.clipboardIsTempGroup)
41825331 tGroup.add/*Child*/(tmp);
41835332 else
4184
- GrafreeD.clipboard = tmp;
5333
+ Grafreed.clipboard = tmp;
41855334 }
41865335 else
4187
- if (GrafreeD.clipboardIsTempGroup)
5336
+ if (Grafreed.clipboardIsTempGroup)
41885337 tGroup.add/*Child*/(child);
41895338 else
4190
- GrafreeD.clipboard = child;
5339
+ Grafreed.clipboard = child;
41915340 }
41925341
41935342 //ResetModel();
....@@ -4219,21 +5368,23 @@
42195368 //System.out.println("cut " + elem);
42205369 //System.out.println("parent = " + elem.parent);
42215370 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
5371
+ if (Grafreed.clipboardIsTempGroup)
42235372 tGroup.add/*Child*/(tmp);
42245373 else
4225
- GrafreeD.clipboard = tmp;
5374
+ Grafreed.clipboard = tmp;
42265375 }
42275376 else
4228
- if (GrafreeD.clipboardIsTempGroup)
5377
+ if (Grafreed.clipboardIsTempGroup)
42295378 tGroup.add/*Child*/(child);
42305379 else
4231
- GrafreeD.clipboard = child;
5380
+ Grafreed.clipboard = child;
42325381 }
42335382
42345383 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
5384
+
5385
+ if (Grafreed.clipboardIsTempGroup)
5386
+ Grafreed.clipboard = tGroup;
5387
+
42375388 if (cut)
42385389 {
42395390 ResetModel();
....@@ -4243,11 +5394,15 @@
42435394
42445395 void paste(boolean expand)
42455396 {
5397
+ if (Globals.REPLACEONMAKE)
5398
+ Save();
5399
+ boolean keep = Globals.REPLACEONMAKE;
5400
+ Globals.REPLACEONMAKE = false;
42465401 // if (GrafreeD.clipboard == null)
42475402 // return;
42485403 boolean first = true;
42495404
4250
- if (GrafreeD.clipboardIsTempGroup)
5405
+ if (Grafreed.clipboardIsTempGroup)
42515406 {
42525407 Composite temp;
42535408
....@@ -4258,7 +5413,7 @@
42585413 temp = (Composite)Applet3D.clipboard.deepCopy();
42595414 */
42605415 Object3D elem;
4261
- 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))
42625417 {
42635418 Object3D child = (Object3D)e.nextElement();
42645419
....@@ -4292,21 +5447,22 @@
42925447 //Object3D cb = Applet3D.clipboard;
42935448 //temp.addChild(cb);
42945449 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- 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());
43005455 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
5456
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5457
+ Grafreed.clipboard.get(0).parent = keepparent;
43035458 }
43045459
5460
+ Globals.REPLACEONMAKE = keep;
43055461 ResetModel();
43065462 refreshContents();
43075463 }
43085464
4309
- void pasteInto(boolean copyit)
5465
+ void pasteInto(boolean copyit, boolean clone)
43105466 {
43115467 // if (GrafreeD.clipboard == null)
43125468 // return;
....@@ -4335,15 +5491,22 @@
43355491 if (copyit)
43365492 {
43375493 // paste(false);
4338
- CloneClipboard(false); // sept 2014
5494
+ if (clone)
5495
+ {
5496
+ CloneClipboard(false); // sept 2014
5497
+ }
5498
+ else
5499
+ {
5500
+ paste(false);
5501
+ }
43395502 }
43405503 else
43415504 {
43425505 boolean first = true;
43435506
4344
- if (GrafreeD.clipboardIsTempGroup)
5507
+ if (Grafreed.clipboardIsTempGroup)
43455508 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
5509
+ Composite temp = (Composite)Grafreed.clipboard;
43475510 Object3D copy;
43485511 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43495512 {
....@@ -4353,7 +5516,7 @@
43535516 }
43545517 } else
43555518 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
5519
+ linkSomething(Grafreed.clipboard); //.get(0));
43575520 }
43585521 }
43595522 }
....@@ -4430,6 +5593,10 @@
44305593
44315594 void group(Object3D csg, boolean grab)
44325595 {
5596
+ if (Globals.REPLACEONMAKE)
5597
+ Save();
5598
+ boolean keep = Globals.REPLACEONMAKE;
5599
+ Globals.REPLACEONMAKE = false;
44335600 if (//false) // why??
44345601 !group.selection.isEmpty())
44355602 {
....@@ -4543,10 +5710,15 @@
45435710 //node.add(csg);
45445711 //makeSomething(node);
45455712 makeSomething(csg);
5713
+ Globals.REPLACEONMAKE = keep;
45465714 }
45475715
45485716 void Ungroup(Object3D g)
45495717 {
5718
+ if (Globals.REPLACEONMAKE)
5719
+ Save();
5720
+ boolean keep = Globals.REPLACEONMAKE;
5721
+ Globals.REPLACEONMAKE = false;
45505722 if (g instanceof HiddenObject)
45515723 {
45525724 HiddenObject h = (HiddenObject) g;
....@@ -4563,6 +5735,7 @@
45635735 objEditor.makeSomething(g.get(i), false);
45645736 }
45655737 }
5738
+ Globals.REPLACEONMAKE = keep;
45665739 }
45675740
45685741 void ungroup()
....@@ -4758,21 +5931,6 @@
47585931 }
47595932 */
47605933
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765934 /*
47775935 public void Callback(Object obj)
47785936 {
....@@ -4796,26 +5954,9 @@
47965954 }
47975955 */
47985956
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165957 String GetFile(String dialogName)
48175958 {
4818
- if (GrafreeD.standAlone)
5959
+ if (Grafreed.standAlone)
48195960 {
48205961 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215962 browser.show();
....@@ -4879,10 +6020,48 @@
48796020 cButton flashSelectionButton;
48806021 cButton editButton;
48816022 cButton uneditButton;
6023
+ JCheckBox allParamsButton;
48826024 cButton clearpanelButton;
4883
- cButton allParamsButton;
48846025 cButton unselectButton;
48856026
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
+
48866065 cButton screenfitButton;
48876066 cButton screenfitpointButton;
48886067 cButton snapobjectButton;
....@@ -4894,14 +6073,6 @@
48946073
48956074 cButton setsupportButton;
48966075
4897
- cButton twoButton;
4898
- cButton sixButton;
4899
- cButton threeButton;
4900
- cButton sevenButton;
4901
- cButton fourButton; // full panel
4902
- cButton oneButton; // full XYZ
4903
- //cButton currentLayout;
4904
-
49056076 //
49066077 //Composite
49076078 Object3D // to do !!
....@@ -4911,9 +6082,11 @@
49116082 //JTree jTree;
49126083 private MenuItem lookAtItem;
49136084 private MenuItem lookFromItem;
4914
- private MenuItem switchItem;
6085
+ private MenuItem switchViewItem;
49156086 private MenuItem cutItem;
4916
- private MenuItem duplicateItem;
6087
+ private MenuItem undoItem;
6088
+ private MenuItem redoItem;
6089
+ private JMenuItem duplicateItem;
49176090 private MenuItem cloneItem;
49186091 private MenuItem cloneSupportItem;
49196092 private MenuItem overwriteGeoItem;
....@@ -4926,7 +6099,7 @@
49266099 private MenuItem linkverticesItem;
49276100 private MenuItem relinkverticesItem;
49286101 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
6102
+ private MenuItem resetAllItem;
49306103 private MenuItem stepAllItem;
49316104 private MenuItem revertMeshItem;
49326105 private MenuItem poseMeshItem;
....@@ -4937,10 +6110,11 @@
49376110 private MenuItem mergeGeometriesItem;
49386111 private MenuItem copyItem;
49396112 private MenuItem pasteItem;
6113
+ private MenuItem pasteIntoItem;
49406114 private MenuItem pasteLinkItem;
49416115 private MenuItem pasteCloneItem;
49426116 private MenuItem pasteExpandItem;
4943
- private MenuItem clearItem;
6117
+ private MenuItem deleteItem;
49446118 private MenuItem clearAllItem;
49456119 private MenuItem genUVItem;
49466120 private MenuItem genNormalsMESHItem;
....@@ -4975,6 +6149,10 @@
49756149 private MenuItem showleavesItem;
49766150 private MenuItem markleavesItem;
49776151 private MenuItem unmarkleavesItem;
6152
+ private MenuItem rewindleavesItem;
6153
+ private MenuItem unrewindleavesItem;
6154
+ private MenuItem randomleavesItem;
6155
+ private MenuItem unrandomleavesItem;
49786156
49796157 private MenuItem flipVItem;
49806158 private MenuItem unflipVItem;
....@@ -4986,15 +6164,17 @@
49866164 private MenuItem panoTexturesItem;
49876165
49886166 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
6167
+ private MenuItem resetCentroidXZItem;
49906168 private MenuItem resetTransformItem;
6169
+ private MenuItem transformGeometryItem;
6170
+ private MenuItem transformChildrenItem;
49916171 private MenuItem hideItem;
49926172 private MenuItem grabItem;
49936173 private MenuItem backItem;
49946174 private MenuItem frontItem;
49956175 private MenuItem cameraItem;
49966176 private MenuItem compositeItem;
4997
- private MenuItem randomItem;
6177
+ private MenuItem switchItem;
49986178 private MenuItem physicsItem;
49996179 private MenuItem frameselectorItem;
50006180 private MenuItem scriptNodeItem;
....@@ -5009,6 +6189,7 @@
50096189
50106190 private MenuItem resetParentItem;
50116191 private MenuItem repairParentItem;
6192
+ private MenuItem repairShadowItem;
50126193 private MenuItem sortbysizeItem;
50136194 private MenuItem sortbynameItem;
50146195
....@@ -5017,6 +6198,8 @@
50176198 private MenuItem attachBumpItem;
50186199 private MenuItem detachBumpItem;
50196200 private MenuItem pigmentBumpItem;
6201
+ private MenuItem embedTexturesItem;
6202
+ private MenuItem deEmbedTexturesItem;
50206203
50216204 private MenuItem particleItem;
50226205 private MenuItem ragdollItem;
....@@ -5033,7 +6216,7 @@
50336216 private MenuItem blobItem;
50346217 private MenuItem latheItem;
50356218 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
6219
+ private MenuItem overlayItem;
50376220 private MenuItem meshItem;
50386221 // private MenuItem meshGroupItem;
50396222 private MenuItem springItem;
....@@ -5055,11 +6238,6 @@
50556238 private MenuItem doubleItem;
50566239 private MenuItem tripleItem;
50576240
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50636241 private MenuItem computeAOItem;
50646242 private MenuItem recompileItem;
50656243 private MenuItem editScriptItem;
....@@ -5069,4 +6247,8 @@
50696247 private MenuItem analyzeItem;
50706248 private MenuItem dumpItem;
50716249 //boolean freezemodel = false;
6250
+
6251
+ Menu cameraMenu;
6252
+ MenuItem editCameraItem;
6253
+ MenuItem restoreCameraItem;
50726254 }