Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
GroupEditor.java
....@@ -12,6 +12,7 @@
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,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,6 +84,10 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
87
+ if (Globals.REPLACEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.REPLACEONMAKE;
90
+ Globals.REPLACEONMAKE = false;
8691 // Object3D keep = GrafreeD.clipboard;
8792 //Object3D obj;
8893 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +98,19 @@
9398
9499 makeSomething(clone, i==group.selection.size()-1);
95100 }
101
+ Globals.REPLACEONMAKE = keep;
96102 }
97103
98104 void CloneClipboard(boolean supports)
99105 {
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));
106
+ assert(Grafreed.clipboard.parent == null);
107
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
108
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
109
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
110
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105111 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
112
+ makeSomething(CloneObject(Grafreed.clipboard, false));
113
+ Grafreed.clipboard.get(0).parent = keepparent;
108114 }
109115
110116 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +124,7 @@
118124 // obj.support = null;
119125 if (!supports)
120126 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
127
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122128 obj.parent = parent;
123129 // obj.support = support;
124130 // clone.support = support; // aout 2013
....@@ -147,30 +153,29 @@
147153
148154 //JTextField nameField;
149155
150
- void SetupMenu2(ObjEditor oe)
156
+ void SetupMenu2(GroupEditor oe)
151157 {
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);
158
+ oe.jTree = new cTree();
159
+
163160 Menu menu;
164161 oe.menuBar.add(menu = new Menu("Edit"));
165162 //editItem = menu.add(new MenuItem("Edit"));
166163 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+
165
+// undoItem = menu.add(new MenuItem("Undo"));
166
+// undoItem.addActionListener(this);
167
+// redoItem = menu.add(new MenuItem("Redo"));
168
+// redoItem.addActionListener(this);
169
+// menu.add("-");
170
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168171 duplicateItem.addActionListener(this);
169
- menu.add("-");
170172 cloneItem = menu.add(new MenuItem("Clone"));
171173 cloneItem.addActionListener(this);
174
+ if (Globals.ADVANCED)
175
+ {
172176 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173177 cloneSupportItem.addActionListener(this);
178
+ }
174179 menu.add("-");
175180 cutItem = menu.add(new MenuItem("Cut"));
176181 cutItem.addActionListener(this);
....@@ -178,27 +183,123 @@
178183 copyItem.addActionListener(this);
179184 pasteItem = menu.add(new MenuItem("Paste"));
180185 pasteItem.addActionListener(this);
186
+
187
+ menu.add("-");
188
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
189
+ pasteIntoItem.addActionListener(this);
181190 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182191 pasteLinkItem.addActionListener(this);
183192 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184193 pasteCloneItem.addActionListener(this);
185194 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186195 // pasteExpandItem.addActionListener(this);
196
+ menu.add("-");
187197 clearItem = menu.add(new MenuItem("Clear"));
188198 clearItem.addActionListener(this);
199
+
200
+ if (Globals.ADVANCED)
201
+ {
202
+ // Deletes the cameras...
189203 clearAllItem = menu.add(new MenuItem("Clear All"));
190204 clearAllItem.addActionListener(this);
205
+ }
206
+
207
+ menuBar.add(cameraMenu = new Menu("View"));
208
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
209
+ //zBufferItem.addActionListener(this);
210
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
211
+ //normalLensItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
214
+
215
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
216
+// toggleFullScreenItem.addItemListener(this);
217
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
218
+// cameraMenu.add("-");
219
+//
220
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
221
+// toggleTextureItem.addItemListener(this);
222
+// toggleTextureItem.setState(CameraPane.textureon);
223
+//
224
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
225
+// toggleSwitchItem.addItemListener(this);
226
+// toggleSwitchItem.setState(CameraPane.SWITCH);
227
+
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
229
+ toggleHandleItem.addItemListener(this);
230
+ toggleHandleItem.setState(CameraPane.HANDLES);
231
+
232
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
233
+ togglePaintItem.addItemListener(this);
234
+ togglePaintItem.setState(CameraPane.PAINTMODE);
235
+
236
+ if (Globals.ADVANCED)
237
+ {
238
+ cameraMenu.add("-");
239
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
240
+ toggleLiveItem.addItemListener(this);
241
+ toggleLiveItem.setState(Globals.isLIVE());
191242
243
+ cameraMenu.add(stepItem = new MenuItem("Step"));
244
+ stepItem.addActionListener(this);
245
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
246
+ // toggleDLItem.addItemListener(this);
247
+ // toggleDLItem.setState(false);
248
+
249
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
250
+ toggleRenderItem.addItemListener(this);
251
+ toggleRenderItem.setState(!CameraPane.frozen);
252
+
253
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
254
+ toggleDebugItem.addItemListener(this);
255
+ toggleDebugItem.setState(Globals.DEBUG);
256
+
257
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
258
+ toggleFrustumItem.addItemListener(this);
259
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
260
+
261
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
262
+ toggleFootContactItem.addItemListener(this);
263
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
264
+
265
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
266
+ toggleTimelineItem.addItemListener(this);
267
+ }
268
+
269
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
270
+// toggleRootItem.addItemListener(this);
271
+// toggleRootItem.setState(false);
272
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
273
+// animationItem.addItemListener(this);
274
+// animationItem.setState(CameraPane.ANIMATION);
275
+ cameraMenu.add("-");
276
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
277
+ editCameraItem.addActionListener(this);
278
+
279
+ if (Globals.ADVANCED)
280
+ {
281
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
282
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
284
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
285
+ oe.cameraMenu.add("-");
286
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
287
+ openWindowItem.addActionListener(this);
288
+ editLeafItem.addActionListener(this);
289
+ lookAtItem.addActionListener(this);
290
+ //lookFromItem.addActinoListener(this);
291
+ //switchViewItem.addActionListener(this);
292
+ }
293
+
192294 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);
295
+ if (Globals.ADVANCED)
296
+ {
197297 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198298 revertMeshItem.addActionListener(this);
199299 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200300 resetreferencesItem.addActionListener(this);
201301 menu.add("-");
302
+ }
202303 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203304 overwriteGeoItem.addActionListener(this);
204305 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +311,104 @@
210311 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211312 overwriteUVItem.addActionListener(this);
212313 menu.add("-");
314
+ if (Globals.ADVANCED)
315
+ {
213316 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214317 generateMeshItem.addActionListener(this);
215318 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216319 poseMeshItem.addActionListener(this);
217320 menu.add("-");
321
+ }
218322 resetsupportItem = menu.add(new MenuItem("Reset support"));
219323 resetsupportItem.addActionListener(this);
220324 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221325 linkverticesItem.addActionListener(this);
222326 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223327 relinkverticesItem.addActionListener(this);
328
+
329
+ if (Globals.ADVANCED)
330
+ {
224331 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225332 setMasterItem.addActionListener(this);
333
+ }
226334
227335 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
230338 backItem = menu.add(new MenuItem("Back"));
231339 backItem.addActionListener(this);
232340 frontItem = menu.add(new MenuItem("Front"));
233341 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
347
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237348 hideItem.addActionListener(this);
349
+ }
238350 ungroupItem = menu.add(new MenuItem("Ungroup"));
239351 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);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
247359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248360 switchGeoItem.addActionListener(this);
249361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250362 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
363
+ morphItem = menu.add(new MenuItem("Morph Group"));
252364 morphItem.addActionListener(this);
365
+
366
+ menu.add("-");
367
+ physicsItem = menu.add(new MenuItem("Physics"));
368
+ physicsItem.addActionListener(this);
369
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
370
+ frameselectorItem.addActionListener(this);
253371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254372 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
373
+ }
257374
258375 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
261378 billboardItem = menu.add(new MenuItem("Billboard"));
262379 billboardItem.addActionListener(this);
263380 csgItem = menu.add(new MenuItem("CSG"));
264381 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266383 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268385 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
391
+ if (Globals.ADVANCED)
392
+ {
393
+ menu.add("-");
271394 linkerItem = menu.add(new MenuItem("Linker"));
272395 linkerItem.addActionListener(this);
273396 templateItem = menu.add(new MenuItem("Template"));
274397 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277398 pointflowItem = menu.add(new MenuItem("Point Flow"));
278399 pointflowItem.addActionListener(this);
400
+ }
279401 menu.add("-");
280402 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281403 resetTransformItem.addActionListener(this);
282404 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283405 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
406
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
407
+ resetCentroidXZItem.addActionListener(this);
408
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
409
+ transformGeometryItem.addActionListener(this);
410
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
411
+ transformChildrenItem.addActionListener(this);
286412
287413 oe.menuBar.add(menu = new Menu("Geometry"));
288414 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +419,11 @@
293419 genNormalsCADItem.addActionListener(this);
294420 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295421 genNormalsMESHItem.addActionListener(this);
422
+ if (Globals.ADVANCED)
423
+ {
296424 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297425 genNormalsMINEItem.addActionListener(this);
426
+ }
298427 stripifyItem = menu.add(new MenuItem("Stripify"));
299428 stripifyItem.addActionListener(this);
300429 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +445,34 @@
316445 reduce34MeshItem.addActionListener(this);
317446 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318447 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321448 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322449 clipMeshItem.addActionListener(this);
450
+
451
+ if (Globals.ADVANCED)
452
+ {
453
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
454
+ smoothMeshItem.addActionListener(this);
455
+ }
323456
324457 oe.menuBar.add(menu = new Menu("Attributes"));
325458 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326459 clearMaterialsItem.addActionListener(this);
460
+ resetAllItem = menu.add(new MenuItem("Reset All"));
461
+ resetAllItem.addActionListener(this);
462
+ stepAllItem = menu.add(new MenuItem("Step All"));
463
+ stepAllItem.addActionListener(this);
327464 menu.add("-");
328465 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329466 liveleavesItem.addActionListener(this);
330467 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331468 unliveleavesItem.addActionListener(this);
469
+ if (Globals.ADVANCED)
470
+ {
332471 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333472 supportleavesItem.addActionListener(this);
334473 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335474 unsupportleavesItem.addActionListener(this);
475
+ }
336476 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337477 hideleavesItem.addActionListener(this);
338478 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +481,14 @@
341481 markleavesItem.addActionListener(this);
342482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343483 unmarkleavesItem.addActionListener(this);
484
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
485
+ rewindleavesItem.addActionListener(this);
486
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
487
+ unrewindleavesItem.addActionListener(this);
488
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
489
+ randomleavesItem.addActionListener(this);
490
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
491
+ unrandomleavesItem.addActionListener(this);
344492 menu.add("-");
345493 flipVItem = menu.add(new MenuItem("Flip V"));
346494 flipVItem.addActionListener(this);
....@@ -376,35 +524,41 @@
376524 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377525 sortbynameItem.addActionListener(this);
378526 menu.add("-");
527
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
528
+ shareGeometriesItem.addActionListener(this);
529
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
530
+ mergeGeometriesItem.addActionListener(this);
531
+ if (Globals.ADVANCED)
532
+ {
533
+ // Pretty much the same as duplicate and clone.
379534 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380535 extractGeometriesItem.addActionListener(this);
381536 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382537 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);
538
+ }
387539
388540 oe.menuBar.add(menu = new Menu("Insert"));
389541 buildCreateMenu(menu);
390542
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
-
402543 oe.menuBar.add(menu = new Menu("Tools"));
403544 buildToolsMenu(menu);
404545 }
405546
547
+
406548 void SetupUI2(ObjEditor oe)
407549 {
550
+ // June 2019
551
+ if (oe == null)
552
+ {
553
+ //super.SetupUI2(this);
554
+ //return;
555
+ }
556
+
557
+ if (copy != group)
558
+ {
559
+ //super.SetupUI2(this);
560
+ }
561
+
408562 //new Exception().printStackTrace();
409563
410564 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,176 +587,230 @@
433587 oe.radioPanel.add(dummyButton);
434588 oe.buttonGroup.add(dummyButton);
435589 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
590
+ cGridBag copyOptionsPanel = new cGridBag();
591
+
592
+ copyOptionsPanel.preferredHeight = 1;
439593
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
- liveCB.setToolTipText("Enabled animation");
442
- liveCB.addItemListener(this);
443
-
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
- fastCB.setToolTipText("Fast mode");
447
- fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
515
- trackCB.setToolTipText("Enable tracking");
516
- trackCB.addItemListener(this);
517
-
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
594
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
595
+
596
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ //minButton.setToolTipText("Minimize window");
598
+ //minButton.addActionListener(this);
599
+
600
+ if (Globals.ADVANCED)
601
+ {
602
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ maxButton.setToolTipText("Maximize window");
604
+ maxButton.addActionListener(this);
605
+ }
606
+
607
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ fullButton.setToolTipText("Full-screen window");
609
+ fullButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520612 screenfitButton.setToolTipText("Screen fit");
521613 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
614
+
615
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ restoreCameraButton.setToolTipText("Restore viewpoint");
617
+ restoreCameraButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ saveButton.setToolTipText("New version");
621
+ saveButton.addActionListener(this);
622
+
623
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ undoButton.setToolTipText("Previous version");
625
+ undoButton.addActionListener(this);
626
+ undoButton.setEnabled(false);
627
+
628
+ cGridBag updown = new cGridBag().setVertical(true);
629
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreButton.setToolTipText("Restore current");
631
+ restoreButton.addActionListener(this);
632
+ restoreButton.setEnabled(false);
633
+
634
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ replaceButton.setToolTipText("Replace current");
636
+ replaceButton.addActionListener(this);
637
+ replaceButton.setEnabled(false);
638
+
639
+ copyOptionsPanel.add(updown);
640
+
641
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ redoButton.setToolTipText("Next version");
643
+ redoButton.addActionListener(this);
644
+ redoButton.setEnabled(false);
645
+
646
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
647
+ liveCB.setToolTipText("Enable animation");
648
+ liveCB.addItemListener(this);
649
+
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ oneStepButton.setToolTipText("Animate one step forward");
652
+ oneStepButton.addActionListener(this);
653
+
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
655
+ fastCB.setToolTipText("Fast mode");
656
+ fastCB.addItemListener(this);
657
+
658
+ //oe.toolboxPanel.Return();
659
+
660
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
661
+// trackCB.setToolTipText("Enable tracking");
662
+// trackCB.addItemListener(this);
663
+
523664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524665 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530666
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
- flashSelectionButton.setToolTipText("Show selection");
538
- flashSelectionButton.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
669
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ snapobjectButton.addActionListener(this);
671
+ snapobjectButton.setToolTipText("Snap Object");
672
+ }
673
+
674
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
539675
540
- oe.toolbarPanel.add(new cButton(" ", false));
541
-
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548677 twoButton.setToolTipText("Show center view only");
549678 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
679
+ this.fullscreenLayout = twoButton;
680
+
681
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
551682 fourButton.addActionListener(this);
552683 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
554685 sixButton.setToolTipText("2-column layout left");
555686 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557688 threeButton.setToolTipText("2-column layout right");
558689 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560691 sevenButton.setToolTipText("3-column layout");
561692 sevenButton.addActionListener(this);
562693 //
563694
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
695
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ rootButton.setToolTipText("Edit selection in new tab");
566697 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
698
+
699
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569700 closeButton.setToolTipText("Close tab");
570701 closeButton.addActionListener(this);
571702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572703 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574
-
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
577
- editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581704
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
705
+ // INSERT
706
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ gridButton.setToolTipText("Create grid");
708
+ gridButton.addActionListener(this);
709
+
710
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ boxButton.setToolTipText("Create box");
712
+ boxButton.addActionListener(this);
713
+
714
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ sphereButton.setToolTipText("Create sphere");
716
+ sphereButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ coneButton.setToolTipText("Create cone");
720
+ coneButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ torusButton.setToolTipText("Create torus");
724
+ torusButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ superButton.setToolTipText("Create superellipsoid");
728
+ superButton.addActionListener(this);
729
+
730
+ if (Globals.ADVANCED)
731
+ {
732
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ kleinButton.setToolTipText("Create Klein bottle");
734
+ kleinButton.addActionListener(this);
735
+ }
736
+
737
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ particlesButton.setToolTipText("Create particle system");
739
+ particlesButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.Return();
742
+
743
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ groupButton.setToolTipText("Create group");
745
+ groupButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ compositeButton.setToolTipText("Create composite");
749
+ compositeButton.addActionListener(this);
750
+
751
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ switchButton.setToolTipText("Create item switcher");
753
+ switchButton.addActionListener(this);
754
+
755
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ loopButton.setToolTipText("Create loop");
757
+ loopButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ textureButton.setToolTipText("Create texture");
761
+ textureButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ overlayButton.setToolTipText("Create overlay");
765
+ overlayButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ lightButton.setToolTipText("Create light");
769
+ lightButton.addActionListener(this);
770
+
771
+ for (int i=6; --i>=0;)
772
+ {
773
+ oe.toolboxPanel.Return();
774
+ oe.toolboxPanel.add(new cGridBag());
775
+ oe.toolboxPanel.add(new cGridBag());
776
+ oe.toolboxPanel.add(new cGridBag());
777
+ oe.toolboxPanel.add(new cGridBag());
778
+ oe.toolboxPanel.add(new cGridBag());
779
+ oe.toolboxPanel.add(new cGridBag());
780
+ oe.toolboxPanel.add(new cGridBag());
781
+ }
782
+
783
+ // EDIT panel
784
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ editButton.setToolTipText("Pin selection controls");
786
+ editButton.addActionListener(this);
787
+
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
583790 uneditButton.addActionListener(this);
584791
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
597794 allParamsButton.addActionListener(this);
598795
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
796
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ clearPanelButton.setToolTipText("Clear edit panel");
798
+ clearPanelButton.addActionListener(this);
799
+
800
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ unselectButton.setToolTipText("Unselect");
604802 unselectButton.addActionListener(this);
605803
804
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ flashSelectionButton.setToolTipText("Highlight selection");
806
+ flashSelectionButton.addActionListener(this);
807
+
808
+ editCommandsPanel.preferredHeight = 1;
809
+
810
+ SetPinStates(false);
811
+// oe.treePanel.add(commandsPanel);
812
+// oe.treePanel.Return();
813
+
606814 // oe.aConstraints.gridx += 1;
607815 // oe.aConstraints.weighty = 0;
608816 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +822,25 @@
614822 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615823 // gcButton.addActionListener(this);
616824
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
825
+ cGridBag jSPPanel = new cGridBag();
826
+
827
+ JScrollPane jSP;
628828 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
630830 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
635
-
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
640
- colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
643
- materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
646
- textureCB.addItemListener(this);
647
-
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
650831
832
+ oe.treePanel.add(jSPPanel);
833
+ oe.treePanel.Return();
834
+
835
+ oe.treePanel.add(copyOptionsPanel);
836
+ oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
840
+
841
+// mainPanel.setDividerLocation(0.5); //1.0);
842
+// mainPanel.setResizeWeight(0.5);
843
+
651844 //jList.addListSelectionListener(this);
652845 oe.jTree.addTreeSelectionListener(this);
653846 //jTree.setRootVisible(false);
....@@ -669,10 +862,144 @@
669862 radio.layout = sevenButton;
670863 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671864 }
865
+
866
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
867
+ {
868
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
869
+ colorCB.setToolTipText("Copy color when dropped");
870
+ colorCB.addItemListener(this);
871
+
872
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
873
+ materialCB.setToolTipText("Copy material when dropped");
874
+ materialCB.addItemListener(this);
875
+
876
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
877
+ textureCB.setToolTipText("Copy texture when dropped");
878
+ textureCB.addItemListener(this);
879
+
880
+ panel.Return();
881
+
882
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
883
+ boxCB.setToolTipText("Display bounding boxes");
884
+ boxCB.addItemListener(this);
885
+
886
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
888
+ zoomBoxCB.addItemListener(this);
889
+
890
+ if (true) // Globals.ADVANCED)
891
+ {
892
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
893
+// supportCB.setToolTipText("Enable rigging");
894
+// supportCB.addItemListener(this);
895
+
896
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
897
+ freezeCB.setToolTipText("Fast moving camera");
898
+ freezeCB.addItemListener(this);
899
+
900
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
901
+ // localCB.addItemListener(this);
902
+
903
+ panel.Return();
904
+
905
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
906
+ crowdCB.setToolTipText("Used for crowds");
907
+ crowdCB.addItemListener(this);
908
+
909
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
910
+ smoothCB.setToolTipText("Snapping delay");
911
+ smoothCB.addItemListener(this);
912
+
913
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
914
+ slowCB.setToolTipText("Smooth interpolation");
915
+ slowCB.addItemListener(this);
916
+
917
+// constraints.gridy += 1;
918
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
919
+// speakerMocapCB.addItemListener(this);
920
+
921
+ panel.Return();
922
+
923
+ if (false)
924
+ {
925
+ // handled in scripts
926
+ //constraints.gridy += 1;
927
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
928
+ speakerCameraCB.addItemListener(this);
929
+
930
+ //constraints.gridy += 1;
931
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
932
+ speakerFocusCB.addItemListener(this);
933
+
934
+ //constraints.gridy += 1;
935
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
936
+ smoothfocusCB.addItemListener(this);
937
+ panel.Return();
938
+ }
939
+
940
+//constraints.gridx += 1;
941
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
942
+// debugCB.addItemListener(this);
943
+
944
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
945
+ trackCB.setToolTipText("Enable tracking target");
946
+ trackCB.addItemListener(this);
947
+
948
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
949
+ oeilCB.setToolTipText("Move camera when tracking");
950
+ oeilCB.addItemListener(this);
951
+
952
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
953
+ shadowCB.setToolTipText("When live compute shadows");
954
+ shadowCB.addItemListener(this);
955
+
956
+ panel.Return();
957
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
958
+ toggleTextureCB.setToolTipText("Load textures");
959
+ toggleTextureCB.addItemListener(this);
960
+
961
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
962
+ toggleSwitchCB.setToolTipText("Choose a single item");
963
+ toggleSwitchCB.addItemListener(this);
964
+
965
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
966
+ autokeepCB.setToolTipText("On structure change");
967
+ autokeepCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ if (Globals.ADVANCED)
971
+ {
972
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
973
+ lookAtCB.setToolTipText("Look-at target");
974
+ lookAtCB.addItemListener(this);
975
+ }
976
+
977
+ }
978
+
979
+ cGridBag fill = new cGridBag();
980
+ fill.preferredHeight = 200;
981
+ cGridBag fill2 = new cGridBag();
982
+ fill2.preferredHeight = 200;
983
+ cGridBag fill3 = new cGridBag();
984
+ fill3.preferredHeight = 200;
985
+
986
+ panel.add(fill);
987
+ panel.add(fill2);
988
+ panel.add(fill3);
989
+
990
+ }
672991
673992 void EditObject(Object3D obj)
674993 {
675994 cRadio radioButton = new cRadio(obj.name);
995
+
996
+ // June 2019. Patch to avoid bug with transparency.
997
+ radioButton.hadMaterial = obj.material != null;
998
+ if (!radioButton.hadMaterial)
999
+ {
1000
+ obj.material = new cMaterial();
1001
+ }
1002
+
6761003 radioButton.SetObject(obj);
6771004 radioButton.layout = sevenButton;
6781005 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -681,8 +1008,11 @@
6811008 buttonGroup.add(radioButton);
6821009 radioButton.doClick();
6831010 }
1011
+
6841012 void SetupViews(ObjEditor oe)
6851013 {
1014
+ theFrame = this;
1015
+
6861016 oe.SetupViews();
6871017
6881018 System.out.println("SetupViews");
....@@ -691,23 +1021,28 @@
6911021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6921022 }
6931023
694
- JCheckBox liveCB;
695
- JCheckBox supportCB;
696
- JCheckBox localCB;
697
- JCheckBox crowdCB;
698
- JCheckBox smoothCB;
699
- JCheckBox fastCB;
700
- JCheckBox slowCB;
701
- JCheckBox boxCB;
702
- JCheckBox zoomBoxCB;
703
- JCheckBox trackCB;
704
- JCheckBox smoothfocusCB;
1024
+ cToggleButton liveCB;
1025
+ cCheckBox supportCB;
1026
+ cCheckBox localCB;
1027
+ cCheckBox crowdCB;
1028
+ cCheckBox smoothCB;
1029
+ cToggleButton fastCB;
1030
+ cCheckBox slowCB;
1031
+ cCheckBox boxCB;
1032
+ cCheckBox zoomBoxCB;
1033
+ cCheckBox freezeCB;
1034
+ //cToggleButton trackCB;
1035
+ cCheckBox trackCB;
1036
+ cCheckBox smoothfocusCB;
7051037 // JCheckBox speakerMocapCB;
706
- JCheckBox speakerCameraCB;
707
- JCheckBox speakerFocusCB;
708
- JCheckBox debugCB;
709
- JCheckBox oeilCB;
710
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
7111046
7121047 // static int COLOR = 1;
7131048 // static int MATERIAL = 2;
....@@ -715,9 +1050,9 @@
7151050
7161051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7171052
718
- JCheckBox colorCB;
719
- JCheckBox materialCB;
720
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
7211056
7221057 public void itemStateChanged(ItemEvent e)
7231058 {
....@@ -745,6 +1080,7 @@
7451080 } else if(e.getSource() == liveCB)
7461081 {
7471082 cameraView.ToggleLive();
1083
+ refreshContents(false);
7481084 }
7491085 else if(e.getSource() == supportCB)
7501086 {
....@@ -809,6 +1145,18 @@
8091145 {
8101146 cameraView.ToggleOeil();
8111147 }
1148
+ else if(e.getSource() == shadowCB)
1149
+ {
1150
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1151
+ }
1152
+ else if(e.getSource() == freezeCB)
1153
+ {
1154
+ Globals.FREEZEONMOVE ^= true;
1155
+ }
1156
+ else if(e.getSource() == autokeepCB)
1157
+ {
1158
+ Globals.REPLACEONMAKE ^= true;
1159
+ }
8121160 else if(e.getSource() == lookAtCB)
8131161 {
8141162 cameraView.ToggleLookAt();
....@@ -825,7 +1173,8 @@
8251173
8261174 /**/
8271175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
828
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
8291178 if ((path == null) || (path.getPathCount() <= 1)) {
8301179 // We can't move the root node or an empty selection
8311180 return;
....@@ -888,8 +1237,6 @@
8881237 }
8891238 }
8901239
891
- String string = (String) object;
892
-
8931240 System.out.println("Transfer = " + object + "; drop : " + target);
8941241 // if( object instanceof java.io.File[])
8951242 // {
....@@ -897,7 +1244,11 @@
8971244 // objEditor.DropFile((java.io.File[]) object, true);
8981245 // return;
8991246 // }
900
- if (string.charAt(0) == '/')
1247
+
1248
+ String string = object.toString();
1249
+
1250
+ // File path for Mac and Windows
1251
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9011252 {
9021253 // file(s)
9031254 String[] names = string.split("\n");
....@@ -924,7 +1275,7 @@
9241275
9251276 flashIt = false;
9261277 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1278
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9281279 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9291280
9301281 if (group.selection.size() == 1)
....@@ -940,23 +1291,33 @@
9401291
9411292 assert target == objEditor.jTree;
9421293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
9431295 try {
944
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9451297 } catch (Exception e) {
9461298 System.out.println("destinationPath : " + destinationPath);
9471299 return;
9481300 }
9491301
950
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
9511303 {
1304
+ Object3D child = (Object3D)group.selection.elementAt(i);
1305
+
1306
+ // Cannot move into itself
1307
+ if (child == destinationLeaf)
1308
+ return;
1309
+ }
1310
+
1311
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1312
+// {
9521313 loadClipboard(true);
9531314 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
955
- } else {
956
- loadClipboard(false);
957
- objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
959
- }
1315
+ pasteInto(false, false);
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
9601321 }
9611322 public void dropActionChanged(DropTargetDragEvent dtde)
9621323 // Called if the user has modified the current drop gesture
....@@ -1061,85 +1422,107 @@
10611422 {
10621423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10631424 //heightFieldItem.addActionListener(this);
1064
- gridItem = menu.add(new MenuItem("Grid"));
1065
- gridItem.addActionListener(this);
1066
- rectoidItem = menu.add(new MenuItem("Box"));
1067
- rectoidItem.addActionListener(this);
1068
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1069
- ellipsoidItem.addActionListener(this);
1070
- coneItem = menu.add(new MenuItem("Cone"));
1071
- coneItem.addActionListener(this);
1072
- torusItem = menu.add(new MenuItem("Torus"));
1073
- torusItem.addActionListener(this);
1074
- superItem = menu.add(new MenuItem("Superellipsoid"));
1075
- superItem.addActionListener(this);
1425
+// gridItem = menu.add(new MenuItem("Grid"));
1426
+// gridItem.addActionListener(this);
1427
+// rectoidItem = menu.add(new MenuItem("Box"));
1428
+// rectoidItem.addActionListener(this);
1429
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1430
+// ellipsoidItem.addActionListener(this);
1431
+// coneItem = menu.add(new MenuItem("Cone"));
1432
+// coneItem.addActionListener(this);
1433
+// torusItem = menu.add(new MenuItem("Torus"));
1434
+// torusItem.addActionListener(this);
1435
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1436
+// superItem.addActionListener(this);
1437
+
1438
+ cameraItem = menu.add(new MenuItem("Camera"));
1439
+ cameraItem.addActionListener(this);
1440
+
1441
+ if (!Globals.ADVANCED)
1442
+ {
10761443 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10771444 kleinItem.addActionListener(this);
1078
- particleItem = menu.add(new MenuItem("Particle system"));
1079
- particleItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10801451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811452 ragdollItem.addActionListener(this);
10821453 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831454 ragdoll2Item.addActionListener(this);
1455
+ }
10841456 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1457
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861458 meshItem.addActionListener(this);
10871459 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881460 // meshGroupItem.addActionListener(this);
1461
+ if (Globals.ADVANCED)
1462
+ {
10891463 springItem = menu.add(new MenuItem("Spring"));
10901464 springItem.addActionListener(this);
10911465 flagItem = menu.add(new MenuItem("Flag"));
10921466 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971467 blobItem = menu.add(new MenuItem("Blob"));
10981468 blobItem.addActionListener(this);
10991469 latheItem = menu.add(new MenuItem("Lathe"));
11001470 latheItem.addActionListener(this);
1101
- lightItem = menu.add(new MenuItem("Light"));
1102
- lightItem.addActionListener(this);
1471
+ }
1472
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1473
+ bezierItem.addActionListener(this);
1474
+// overlayItem = menu.add(new MenuItem("Overlay"));
1475
+// overlayItem.addActionListener(this);
1476
+// lightItem = menu.add(new MenuItem("Light"));
1477
+// lightItem.addActionListener(this);
11031478 menu.add("-");
11041479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11051480 //superLoopItem.addActionListener(this);
1106
- loopItem = menu.add(new MenuItem("Loop"));
1107
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
11081483 doubleItem = menu.add(new MenuItem("Fork"));
11091484 doubleItem.addActionListener(this);
1485
+ if (Globals.ADVANCED)
1486
+ {
11101487 tripleItem = menu.add(new MenuItem("Trident"));
11111488 tripleItem.addActionListener(this);
1489
+ }
11121490 }
11131491
11141492 void buildToolsMenu(Menu menu)
11151493 {
11161494 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171495 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1496
+ animationItem.setState(Globals.ANIMATION);
1497
+
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
11191500
11201501 menu.add("-");
11211502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221503 parseverticesItem.addActionListener(this);
11231504 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241505 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1506
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261507 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291508 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301509 reduceMorphItem.addActionListener(this);
11311510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321511 reduce34MorphItem.addActionListener(this);
1133
-
1134
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1135
- computeAOItem.addActionListener(this);
11361512 menu.add("-");
1137
-
11381513 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391514 memoryItem.addActionListener(this);
1515
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1516
+ computeAOItem.addActionListener(this);
1517
+
1518
+ if (Globals.ADVANCED)
1519
+ {
1520
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1521
+ mirrorItem.addActionListener(this);
1522
+ menu.add("-");
11401523 menu.add(analyzeItem = new MenuItem("Analyze"));
11411524 analyzeItem.addActionListener(this);
1142
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
11431526 dumpItem.addActionListener(this);
11441527 // menu.add(pathItem = new MenuItem("From-to path"));
11451528 // pathItem.addActionListener(this);
....@@ -1157,6 +1540,7 @@
11571540 menu.add("-");
11581541 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591542 editScriptItem.addActionListener(this);
1543
+ }
11601544 }
11611545
11621546 void ScreenFit()
....@@ -1279,9 +1663,24 @@
12791663 shadow.material = new cMaterial(obj.material);
12801664 shadow.material.diffuse = 0.0001f;
12811665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
12821667
12831668 makeSomething(shadow);
12841669 }
1670
+
1671
+ private void ClearUnpinned()
1672
+ {
1673
+ //for (Object3D obj : listUI)
1674
+ for (int i=listUI.size(); --i>=0;)
1675
+ {
1676
+ Object3D obj = listUI.elementAt(i);
1677
+ if (!obj.pinned)
1678
+ {
1679
+ obj.CloseUI();
1680
+ listUI.remove(i);
1681
+ }
1682
+ }
1683
+ }
12851684
12861685 /**
12871686 * applyExample
....@@ -1485,9 +1884,9 @@
14851884
14861885 void Overwrite(int mask)
14871886 {
1488
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14891888 {
1490
- Object3D content = GrafreeD.clipboard.get(0);
1889
+ Object3D content = Grafreed.clipboard.get(0);
14911890
14921891 if (content instanceof cGroup && ((cGroup)content).transientlink )
14931892 content = ((cGroup)content).get(0);
....@@ -1510,6 +1909,7 @@
15101909 //
15111910 public void actionPerformed(ActionEvent event) // , Object arg)
15121911 {
1912
+ Object source = event.getSource();
15131913 /*
15141914 if (event.getSource() == nameField)
15151915 {
....@@ -1521,11 +1921,11 @@
15211921 }
15221922 else
15231923 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1924
+ if (source == lookAtItem || source == lookFromItem)
15251925 {
15261926 ScreenFit();
15271927 } else
1528
- if (event.getSource() == switchItem)
1928
+ if (source == switchViewItem)
15291929 {
15301930 cVector v1 = new cVector();
15311931 cVector v2 = new cVector();
....@@ -1534,11 +1934,11 @@
15341934 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351935 objEditor.cameraView.repaint();
15361936 } else
1537
- if (event.getSource() == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
15381938 {
15391939 makeSomething(new Box());
15401940 } else
1541
- if (event.getSource() == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
15421942 {
15431943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1959,9 @@
15591959 applyExample(particleGeom, "SMOKE");
15601960 makeSomething(particleGeom);
15611961 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1962
+ if (source == ragdollItem || source == ragdoll2Item)
15631963 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1964
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651965
15661966 ragdoll.toParent = LA.newMatrix();
15671967 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1979,7 @@
15791979 } else
15801980 /*
15811981 */
1582
- if (event.getSource() == heightFieldItem)
1982
+ if (source == heightFieldItem)
15831983 {
15841984 Object3D obj = new Object3D();
15851985
....@@ -1617,31 +2017,31 @@
16172017
16182018 makeSomething(obj);
16192019 } else
1620
- if (event.getSource() == gridItem)
2020
+ if (source == gridItem || source == gridButton)
16212021 {
16222022 makeSomething(new Grid());
16232023 } else
1624
- if (event.getSource() == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
16252025 {
16262026 makeSomething(new Sphere());
16272027 } else
1628
- if (event.getSource() == coneItem)
2028
+ if (source == coneItem || source == coneButton)
16292029 {
16302030 makeSomething(new Cone());
16312031 } else
1632
- if (event.getSource() == torusItem)
2032
+ if (source == torusItem || source == torusButton)
16332033 {
16342034 makeSomething(new Torus());
16352035 } else
1636
- if (event.getSource() == superItem)
2036
+ if (source == superItem || source == superButton)
16372037 {
16382038 makeSomething(new Superellipsoid());
16392039 } else
1640
- if (event.getSource() == kleinItem)
2040
+ if (source == kleinItem || source == kleinButton)
16412041 {
16422042 makeSomething(new Klein());
16432043 } else
1644
- if (event.getSource() == blobItem)
2044
+ if (source == blobItem)
16452045 {
16462046 Blob blob = new Blob();
16472047 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +2049,15 @@
16492049 //blob.retile();
16502050 makeSomething(blob);
16512051 } else
1652
- if (event.getSource() == latheItem)
2052
+ if (source == latheItem)
16532053 {
16542054 makeSomething(new Lathe());
16552055 } else
1656
- if (event.getSource() == bezierItem)
2056
+ if (source == bezierItem)
16572057 {
16582058 makeSomething(new BezierSurface());
16592059 } else
1660
- if (event.getSource() == checkerItem)
2060
+ if (source == overlayItem || source == overlayButton)
16612061 {
16622062 /*
16632063 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +2072,7 @@
16722072 */
16732073 makeSomething(new Checker());
16742074 } else
1675
- if (event.getSource() == meshItem)
2075
+ if (source == meshItem)
16762076 {
16772077 Object3D itemtomake = new Object3D();
16782078 Object3D child;
....@@ -1693,35 +2093,35 @@
16932093 makeSomething(child);
16942094 }
16952095 } else
1696
- if (event.getSource() == springItem)
2096
+ if (source == springItem)
16972097 {
16982098 cSpring s = new cSpring();
16992099 s.setup();
17002100 makeSomething(s);
17012101 } else
1702
- if (event.getSource() == flagItem)
2102
+ if (source == flagItem)
17032103 {
17042104 cSpring s = new cFlag();
17052105 s.setup();
17062106 makeSomething(s);
17072107 } else
1708
- if (event.getSource() == lightItem)
2108
+ if (source == lightItem || source == lightButton)
17092109 {
17102110 makeSomething(new Light());
17112111 } else
1712
- if (event.getSource() == csgItem)
2112
+ if (source == csgItem)
17132113 {
17142114 group(new CSG());
17152115 } else
1716
- if (event.getSource() == templateItem)
2116
+ if (source == templateItem)
17172117 {
17182118 group(new cTemplate());
17192119 } else
1720
- if (event.getSource() == attributeItem)
2120
+ if (source == attributeItem)
17212121 {
17222122 makeSomething(new Attribute());
17232123 } else
1724
- if (event.getSource() == pointflowItem)
2124
+ if (source == pointflowItem)
17252125 {
17262126 makeSomething(new PointFlow());
17272127 } else
....@@ -1733,7 +2133,7 @@
17332133 } else
17342134 */
17352135
1736
- if (event.getSource() == superLoopItem)
2136
+ if (source == superLoopItem)
17372137 {
17382138 Composite g = new cGroup();
17392139 for (int i=0; i<15; i++)
....@@ -1755,30 +2155,30 @@
17552155
17562156 group(g);
17572157 } else
1758
- if (event.getSource() == loopItem)
2158
+ if (source == loopItem || source == loopButton)
17592159 {
17602160 Composite csg = new GroupLeaf();
17612161 csg.count = 5;
17622162 group(csg);
1763
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
17642164 csg.addChild(child);
17652165 child.addChild(csg);
17662166 } else
1767
- if (event.getSource() == doubleItem)
2167
+ if (source == doubleItem)
17682168 {
1769
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
17702170 csg.count = 5;
17712171 group(csg);
1772
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
17732173 csg.addChild(child);
17742174 child.addChild(csg);
1775
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
17762176 csg.addChild(child);
17772177 child.addChild(csg);
17782178 } else
1779
- if (event.getSource() == tripleItem)
2179
+ if (source == tripleItem)
17802180 {
1781
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
17822182 csg.count = 4;
17832183 group(csg);
17842184 Composite child = new cGroup();
....@@ -1791,73 +2191,98 @@
17912191 csg.addChild(child);
17922192 child.addChild(csg);
17932193 } else
1794
-
1795
- if (event.getSource() == importGFDItem)
1796
- {
1797
- ImportGFD();
1798
- } else
1799
- if (event.getSource() == importVRMLX3DItem)
1800
- {
1801
- ImportVRMLX3D();
1802
- } else
1803
- if (event.getSource() == import3DSItem)
1804
- {
1805
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1806
- } else
1807
- if (event.getSource() == importOBJItem)
1808
- {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1810
- } else
1811
- if (event.getSource() == computeAOItem)
2194
+ if (source == computeAOItem)
18122195 {
18132196 Globals.drawMode = CameraPane.OCCLUSION;
18142197 Globals.theRenderer.repaint();
18152198 } else
1816
- if (event.getSource() == recompileItem)
2199
+ if (source == recompileItem)
18172200 {
18182201 Recompile();
18192202 refreshContents();
18202203 } else
1821
- if (event.getSource() == editScriptItem)
2204
+ if (source == editScriptItem)
18222205 {
18232206 OpenDialog();
18242207 refreshContents();
18252208 } else
1826
- if (event.getSource() == invariantsItem)
2209
+ if (source == invariantsItem)
18272210 {
18282211 System.out.println("Invariants:");
1829
- GrafreeD.grafreeD.universe.invariants();
2212
+ Grafreed.grafreeD.universe.invariants();
18302213 } else
1831
- if (event.getSource() == memoryItem)
2214
+ if (source == memoryItem)
18322215 {
18332216 //System.out.println("Invariants:");
18342217 PrintMemory();
18352218 } else
1836
- if (event.getSource() == pathItem)
2219
+ if (source == pathItem)
18372220 {
18382221 PrintPath();
18392222 } else
1840
- if (event.getSource() == analyzeItem)
2223
+ if (source == analyzeItem)
18412224 {
18422225 AnalyzeObject();
18432226 } else
1844
- if (event.getSource() == dumpItem)
2227
+ if (source == dumpItem)
18452228 {
18462229 DumpObject();
18472230 } else
1848
- if (event.getSource() == screenfitButton)
2231
+ if (source == minButton)
18492232 {
1850
- //Reload(lastConverter, lastFilename, true);
2233
+ Minimize();
2234
+ } else
2235
+ if (source == maxButton)
2236
+ {
2237
+ Maximize();
2238
+ } else
2239
+ if (source == fullButton)
2240
+ {
2241
+ ToggleFullScreen();
2242
+ } else
2243
+ if (source == undoButton)
2244
+ {
2245
+ // Go to previous version
2246
+ //if (!Undo())
2247
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2248
+ Undo();
2249
+ } else
2250
+ if (source == restoreButton)
2251
+ {
2252
+ // Restore current version
2253
+ Restore();
2254
+ } else
2255
+ if (source == replaceButton)
2256
+ {
2257
+ // Overwrite current version
2258
+ Replace();
2259
+ } else
2260
+ if (source == redoButton)
2261
+ {
2262
+ // Go to next version
2263
+ Redo();
2264
+ } else
2265
+ if (source == saveButton)
2266
+ {
2267
+ // Save a new version
2268
+ if (!Save(true))
2269
+ java.awt.Toolkit.getDefaultToolkit().beep();
2270
+ } else
2271
+ if (source == oneStepButton)
2272
+ {
2273
+ Globals.ONESTEP = true;
2274
+ cameraView.repaint();
2275
+ } else
2276
+ if (source == screenfitButton)
2277
+ {
18512278 ScreenFit();
18522279 } else
1853
- if (event.getSource() == screenfitpointButton)
2280
+ if (source == screenfitpointButton)
18542281 {
1855
- //Reload(lastConverter, lastFilename, true);
18562282 ScreenFitPoint();
18572283 } else
1858
- if (event.getSource() == snapobjectButton)
2284
+ if (source == snapobjectButton)
18592285 {
1860
- //Reload(lastConverter, lastFilename, true);
18612286 SnapObject();
18622287 } else
18632288 // if (event.getSource() == recompileButton)
....@@ -1866,13 +2291,13 @@
18662291 // Recompile();
18672292 // refreshContents();
18682293 // } else
1869
- if (event.getSource() == gcButton)
2294
+ if (source == gcButton)
18702295 {
18712296 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18722297 System.gc();
18732298 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18742299 } else
1875
- if (event.getSource() == editLeafItem)
2300
+ if (source == editLeafItem)
18762301 {
18772302 Object3D obj;
18782303 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +2311,74 @@
18862311 }
18872312 refreshContents(true);
18882313 } else
1889
- if (event.getSource() == openWindowItem)
2314
+ if (source == openWindowItem)
18902315 {
18912316 EditSelection(true);
18922317 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2318
+ if (source == cutItem || source == clearButton)
18942319 {
18952320 loadClipboard(true);
18962321 } else
1897
- if (event.getSource() == duplicateItem)
2322
+ if (source == undoItem)
18982323 {
1899
- Object3D keep = GrafreeD.clipboard;
2324
+ Undo();
2325
+ } else
2326
+ if (source == redoItem)
2327
+ {
2328
+ Redo();
2329
+ } else
2330
+ if (source == duplicateItem)
2331
+ {
2332
+ Object3D keep = Grafreed.clipboard;
19002333 loadClipboard(false);
19012334 paste(false);
1902
- GrafreeD.clipboard = keep;
2335
+ Grafreed.clipboard = keep;
19032336 } else
1904
- if (event.getSource() == cloneItem)
2337
+ if (source == cloneItem)
19052338 {
19062339 CloneSelection(false);
19072340 } else
1908
- if (event.getSource() == cloneSupportItem)
2341
+ if (source == cloneSupportItem)
19092342 {
19102343 CloneSelection(true);
19112344 } else
1912
- if (event.getSource() == copyItem)
2345
+ if (source == copyItem)
19132346 {
19142347 loadClipboard(false);
19152348 } else
1916
- if (event.getSource() == pasteItem)
2349
+ if (source == pasteItem)
19172350 {
19182351 paste(false);
19192352 } else
1920
- if (event.getSource() == pasteLinkItem)
2353
+ if (source == pasteIntoItem)
19212354 {
1922
- pasteInto(false);
2355
+ pasteInto(true, false);
19232356 } else
1924
- if (event.getSource() == pasteCloneItem)
2357
+ if (source == pasteLinkItem)
19252358 {
1926
- pasteInto(true);
2359
+ pasteInto(false, false);
19272360 } else
1928
- if (event.getSource() == pasteExpandItem)
2361
+ if (source == pasteCloneItem)
2362
+ {
2363
+ pasteInto(true, true);
2364
+ } else
2365
+ if (source == pasteExpandItem)
19292366 {
19302367 paste(true);
19312368 } else
1932
- if (event.getSource() == synchronizeItem)
2369
+ if (source == synchronizeItem)
19332370 {
19342371 Overwrite(Object3D.TRANSFORM);
19352372 } else
1936
- if (event.getSource() == overwriteNameItem)
2373
+ if (source == overwriteNameItem)
19372374 {
19382375 Overwrite(Object3D.NAME);
19392376 } else
1940
- if (event.getSource() == overwriteUVItem)
2377
+ if (source == overwriteUVItem)
19412378 {
19422379 Overwrite(Object3D.UV);
19432380 } else
1944
- if (event.getSource() == overwriteMatItem)
2381
+ if (source == overwriteMatItem)
19452382 {
19462383 /* july 2015
19472384 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2398,7 @@
19612398
19622399 Overwrite(dropAttributes);
19632400 }
1964
- if (event.getSource() == overwriteGeoItem)
2401
+ if (source == overwriteGeoItem)
19652402 {
19662403 Overwrite(Object3D.GEOMETRY);
19672404 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2415,7 @@
19782415 // refreshContents();
19792416 // }
19802417 } else
1981
- if (event.getSource() == generateMeshItem)
2418
+ if (source == generateMeshItem)
19822419 {
19832420 //if (group.selection.size() == 1)
19842421 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2426,7 @@
19892426 ResetModel();
19902427 refreshContents();
19912428 } else
1992
- if (event.getSource() == extractGeometriesItem)
2429
+ if (source == extractGeometriesItem)
19932430 {
19942431 boolean one = false;
19952432
....@@ -2016,7 +2453,7 @@
20162453 ResetModel();
20172454 refreshContents();
20182455 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2456
+ if (source == cloneGeometriesItem)
20202457 {
20212458 boolean one = false;
20222459
....@@ -2042,7 +2479,7 @@
20422479 ResetModel();
20432480 refreshContents();
20442481 } else
2045
- if (event.getSource() == shareGeometriesItem)
2482
+ if (source == shareGeometriesItem)
20462483 {
20472484 boolean one = false;
20482485
....@@ -2072,7 +2509,7 @@
20722509 refreshContents();
20732510 }
20742511 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2512
+ if (source == mergeGeometriesItem)
20762513 {
20772514 boolean one = false;
20782515
....@@ -2102,7 +2539,7 @@
21022539 ResetModel();
21032540 refreshContents();
21042541 } else
2105
- if (event.getSource() == linkverticesItem)
2542
+ if (source == linkverticesItem)
21062543 {
21072544 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082545 // {
....@@ -2115,9 +2552,9 @@
21152552 // group.selection.get(0).setMasterThis(content); // should be identity
21162553 // refreshContents();
21172554 // }
2118
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2555
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21192556 {
2120
- Object3D content = GrafreeD.clipboard.get(0);
2557
+ Object3D content = Grafreed.clipboard.get(0);
21212558
21222559 if (content instanceof cGroup && ((cGroup)content).transientlink )
21232560 content = ((cGroup)content).get(0);
....@@ -2125,38 +2562,38 @@
21252562 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262563 for (int i=0; i<group.selection.size(); i++)
21272564 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2565
+ boolean random = CameraPane.SWITCH;
2566
+ CameraPane.SWITCH = false; // parse all random nodes
21302567 group.selection.get(i).linkVerticesThis(content);
21312568 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2569
+ CameraPane.SWITCH = random;
21332570 }
21342571 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352572 refreshContents();
21362573 }
21372574 } else
2138
- if (event.getSource() == resetsupportItem)
2575
+ if (source == resetsupportItem)
21392576 {
21402577 for (int i=0; i<group.selection.size(); i++)
21412578 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2579
+ boolean random = CameraPane.SWITCH;
2580
+ CameraPane.SWITCH = false; // parse all random nodes
21442581 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2582
+ CameraPane.SWITCH = random;
21462583 }
21472584
21482585 refreshContents();
21492586 } else
2150
- if (event.getSource() == relinkverticesItem)
2587
+ if (source == relinkverticesItem)
21512588 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2589
+ boolean random = CameraPane.SWITCH;
2590
+ CameraPane.SWITCH = false; // parse all random nodes
21542591 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
21562593
21572594 refreshContents();
21582595 } else
2159
- if (event.getSource() == resetreferencesItem)
2596
+ if (source == resetreferencesItem)
21602597 {
21612598 for (int i=0; i<group.selection.size(); i++)
21622599 {
....@@ -2165,11 +2602,11 @@
21652602
21662603 refreshContents();
21672604 } else
2168
- if (event.getSource() == setMasterItem)
2605
+ if (source == setMasterItem)
21692606 {
2170
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2607
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21712608 {
2172
- Object3D content = GrafreeD.clipboard.get(0);
2609
+ Object3D content = Grafreed.clipboard.get(0);
21732610
21742611 if (content instanceof cGroup && ((cGroup)content).transientlink )
21752612 content = ((cGroup)content).get(0);
....@@ -2178,13 +2615,13 @@
21782615 refreshContents();
21792616 }
21802617 } else
2181
- if (event.getSource() == poseMeshItem)
2618
+ if (source == poseMeshItem)
21822619 {
21832620 if (group.selection.size() == 1)
21842621 {
2185
- if (GrafreeD.clipboard.size() == 1)
2622
+ if (Grafreed.clipboard.size() == 1)
21862623 {
2187
- Object3D content = GrafreeD.clipboard.get(0);
2624
+ Object3D content = Grafreed.clipboard.get(0);
21882625
21892626 if (content instanceof cGroup && ((cGroup)content).transientlink )
21902627 content = ((cGroup)content).get(0);
....@@ -2197,19 +2634,19 @@
21972634 }
21982635
21992636 } else
2200
- if (event.getSource() == revertMeshItem)
2637
+ if (source == revertMeshItem)
22012638 {
22022639 RevertMeshes();
22032640 } else
2204
- if (event.getSource() == resetMeshItem)
2641
+ if (source == resetAllItem)
22052642 {
22062643 ResetAll();
22072644 } else
2208
- if (event.getSource() == stepAllItem)
2645
+ if (source == stepAllItem)
22092646 {
22102647 StepAll();
22112648 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2649
+ if (source == clearItem) // || event.getSource() == clearButton)
22132650 {
22142651 //int indices[] = jList.getSelectedIndices();
22152652 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2654,46 @@
22172654
22182655 ClearSelection(false);
22192656 } else
2220
- if (event.getSource() == clearAllItem)
2657
+ if (source == clearAllItem)
22212658 {
22222659 ClearSelection(true);
22232660 } else
2224
- if (event.getSource() == grabItem)
2661
+ if (source == grabItem || source == groupButton)
22252662 {
2226
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
22272664 } else
2228
- if (event.getSource() == hideItem)
2665
+ if (source == hideItem)
22292666 {
22302667 group(new HiddenObject());
22312668 } else
2232
- if (event.getSource() == frontItem)
2669
+ if (source == frontItem)
22332670 {
22342671 front();
22352672 } else
2236
- if (event.getSource() == backItem)
2673
+ if (source == backItem)
22372674 {
22382675 back();
22392676 } else
2240
- if (event.getSource() == cameraItem)
2677
+ if (source == cameraItem)
22412678 {
22422679 makeSomething(new Camera());
22432680 } else
2244
- if (event.getSource() == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
22452682 {
22462683 group(new Composite());
22472684 } else
2248
- if (event.getSource() == randomItem)
2685
+ if (source == switchItem || source == switchButton)
22492686 {
22502687 RandomNode random = new RandomNode();
22512688 group(random);
22522689 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2690
+ random.name = random.get(0).name + "Switch";
22542691 } else
2255
- if (event.getSource() == physicsItem)
2692
+ if (source == physicsItem)
22562693 {
22572694 group(new PhysicsNode());
22582695 } else
2259
- if (event.getSource() == frameselectorItem)
2696
+ if (source == frameselectorItem)
22602697 {
22612698 for (int i=0; i<group.selection.size(); i++)
22622699 {
....@@ -2268,7 +2705,7 @@
22682705 ResetModel();
22692706 refreshContents();
22702707 } else
2271
- if (event.getSource() == switchGeoItem)
2708
+ if (source == switchGeoItem)
22722709 {
22732710 for (int i=0; i<group.selection.size(); i++)
22742711 {
....@@ -2280,7 +2717,7 @@
22802717 ResetModel();
22812718 refreshContents();
22822719 } else
2283
- if (event.getSource() == switchTransfoItem)
2720
+ if (source == switchTransfoItem)
22842721 {
22852722 for (int i=0; i<group.selection.size(); i++)
22862723 {
....@@ -2292,7 +2729,7 @@
22922729 ResetModel();
22932730 refreshContents();
22942731 } else
2295
- if (event.getSource() == morphItem)
2732
+ if (source == morphItem)
22962733 {
22972734 for (int i=0; i<group.selection.size(); i++)
22982735 {
....@@ -2304,7 +2741,7 @@
23042741 ResetModel();
23052742 refreshContents();
23062743 } else
2307
- if (event.getSource() == scriptNodeItem)
2744
+ if (source == scriptNodeItem)
23082745 {
23092746 boolean atleastone = false;
23102747
....@@ -2343,215 +2780,252 @@
23432780 }
23442781 }
23452782 } else
2346
- if (event.getSource() == linkerItem)
2783
+ if (source == linkerItem)
23472784 {
23482785 group(new cLinker());
23492786 } else
2350
- if (event.getSource() == textureItem)
2787
+ if (source == textureItem || source == textureButton)
23512788 {
23522789 group(new TextureNode());
23532790 } else
2354
- if (event.getSource() == billboardItem)
2791
+ if (source == billboardItem)
23552792 {
23562793 group(new BillboardNode());
23572794 } else
2358
- if (event.getSource() == shadowXItem)
2795
+ if (source == shadowXItem)
23592796 {
23602797 CastShadow(0);
23612798 } else
2362
- if (event.getSource() == shadowYItem)
2799
+ if (source == shadowYItem)
23632800 {
23642801 CastShadow(1);
23652802 } else
2366
- if (event.getSource() == shadowZItem)
2803
+ if (source == shadowZItem)
23672804 {
23682805 CastShadow(2);
23692806 } else
2370
- if (event.getSource() == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
23712808 {
2372
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
23732811 for (int i=0; i<group.selection.size(); i++)
23742812 {
2375
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
23762818 }
23772819
2378
- ClearSelection(false);
2379
-
2380
- refreshContents();
2820
+ if (!hasRoot)
2821
+ {
2822
+ for (int i=0; i<group.selection.size(); i++)
2823
+ {
2824
+ Ungroup(group.selection.get(i));
2825
+ }
2826
+
2827
+ ClearSelection(false);
2828
+
2829
+ refreshContents();
2830
+ }
23812831 } else
2382
- if (event.getSource() == genUVItem)
2832
+ if (source == genUVItem)
23832833 {
23842834 GenUV();
23852835 } else
2386
- if (event.getSource() == genNormalsCADItem)
2836
+ if (source == genNormalsCADItem)
23872837 {
23882838 GenNormals(true);
23892839 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2840
+ if (source == genNormalsMESHItem)
23912841 {
2392
- GenNormals(true); // TODO
2842
+ GenNormalsMESH();
23932843 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2844
+ if (source == genNormalsORGANItem)
23952845 {
23962846 GenNormals(false);
23972847 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2848
+ if (source == genNormalsMINEItem)
23992849 {
24002850 GenNormalsMINE();
24012851 } else
2402
- if (event.getSource() == stripifyItem)
2852
+ if (source == stripifyItem)
24032853 {
24042854 Stripify();
24052855 } else
2406
- if (event.getSource() == unstripifyItem)
2856
+ if (source == unstripifyItem)
24072857 {
24082858 Unstripify();
24092859 } else
2410
- if (event.getSource() == trimItem)
2860
+ if (source == trimItem)
24112861 {
24122862 Trim();
24132863 } else
2414
- if (event.getSource() == untrimItem)
2864
+ if (source == untrimItem)
24152865 {
24162866 Untrim();
24172867 } else
2418
- if (event.getSource() == clearColorsItem)
2868
+ if (source == clearColorsItem)
24192869 {
24202870 ClearColors();
24212871 } else
2422
- if (event.getSource() == clearMaterialsItem)
2872
+ if (source == clearMaterialsItem)
24232873 {
24242874 ClearMaterials();
24252875 } else
2426
- if (event.getSource() == liveleavesItem)
2876
+ if (source == liveleavesItem)
24272877 {
24282878 LiveLeaves(true);
24292879 } else
2430
- if (event.getSource() == unliveleavesItem)
2880
+ if (source == unliveleavesItem)
24312881 {
24322882 LiveLeaves(false);
24332883 } else
2434
- if (event.getSource() == supportleavesItem)
2884
+ if (source == supportleavesItem)
24352885 {
24362886 SupportLeaves(true);
24372887 } else
2438
- if (event.getSource() == unsupportleavesItem)
2888
+ if (source == unsupportleavesItem)
24392889 {
24402890 SupportLeaves(false);
24412891 } else
2442
- if (event.getSource() == hideleavesItem)
2892
+ if (source == hideleavesItem)
24432893 {
24442894 HideLeaves(true);
24452895 } else
2446
- if (event.getSource() == showleavesItem)
2896
+ if (source == showleavesItem)
24472897 {
24482898 HideLeaves(false);
24492899 } else
2450
- if (event.getSource() == markleavesItem)
2900
+ if (source == markleavesItem)
24512901 {
24522902 MarkLeaves(true);
24532903 } else
2454
- if (event.getSource() == unmarkleavesItem)
2904
+ if (source == unmarkleavesItem)
24552905 {
24562906 MarkLeaves(false);
24572907 } else
2458
- if (event.getSource() == flipVItem)
2908
+ if (source == rewindleavesItem)
2909
+ {
2910
+ RewindLeaves(true);
2911
+ } else
2912
+ if (source == unrewindleavesItem)
2913
+ {
2914
+ RewindLeaves(false);
2915
+ } else
2916
+ if (source == randomleavesItem)
2917
+ {
2918
+ RandomLeaves(true);
2919
+ } else
2920
+ if (source == unrandomleavesItem)
2921
+ {
2922
+ RandomLeaves(false);
2923
+ } else
2924
+ if (source == flipVItem)
24592925 {
24602926 FlipV(true);
24612927 } else
2462
- if (event.getSource() == unflipVItem)
2928
+ if (source == unflipVItem)
24632929 {
24642930 FlipV(false);
24652931 } else
2466
- if (event.getSource() == lowTexturesItem)
2932
+ if (source == lowTexturesItem)
24672933 {
24682934 SetTexRes(0);
24692935 } else
2470
- if (event.getSource() == normalTexturesItem)
2936
+ if (source == normalTexturesItem)
24712937 {
24722938 SetTexRes(1);
24732939 } else
2474
- if (event.getSource() == highTexturesItem)
2940
+ if (source == highTexturesItem)
24752941 {
24762942 SetTexRes(2);
24772943 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2944
+ if (source == veryhighTexturesItem)
24792945 {
24802946 SetTexRes(3);
24812947 } else
2482
- if (event.getSource() == maxTexturesItem)
2948
+ if (source == maxTexturesItem)
24832949 {
24842950 SetTexRes(4);
24852951 } else
2486
- if (event.getSource() == panoTexturesItem)
2952
+ if (source == panoTexturesItem)
24872953 {
24882954 SetTexRes(5);
24892955 } else
2490
- if (event.getSource() == reverseNormalsItem)
2956
+ if (source == reverseNormalsItem)
24912957 {
24922958 ReverseNormals();
24932959 } else
2494
- if (event.getSource() == parseverticesItem)
2960
+ if (source == parseverticesItem)
24952961 {
24962962 ParseVertices();
24972963 } else
2498
- if (event.getSource() == textureFieldItem)
2964
+ if (source == textureFieldItem)
24992965 {
25002966 TextureVertices();
25012967 } else
2502
- if (event.getSource() == alignItem)
2968
+ if (source == alignItem)
25032969 {
25042970 Align();
25052971 } else
2506
- if (event.getSource() == mirrorItem)
2972
+ if (source == mirrorItem)
25072973 {
25082974 MirrorPoses();
25092975 } else
2510
- if (event.getSource() == reduceMorphItem)
2976
+ if (source == reduceMorphItem)
25112977 {
25122978 MeshReduction(false);
25132979 } else
2514
- if (event.getSource() == reduce34MorphItem)
2980
+ if (source == reduce34MorphItem)
25152981 {
25162982 MeshReduction(true);
25172983 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2984
+ if (source == reverseTrianglesItem)
25192985 {
25202986 ReverseTriangles();
25212987 } else
2522
- if (event.getSource() == reduceMeshItem)
2988
+ if (source == reduceMeshItem)
25232989 {
25242990 ReduceMesh(false);
25252991 } else
2526
- if (event.getSource() == reduce34MeshItem)
2992
+ if (source == reduce34MeshItem)
25272993 {
25282994 ReduceMesh(true);
25292995 } else
2530
- if (event.getSource() == increaseMeshItem)
2996
+ if (source == increaseMeshItem)
25312997 {
25322998 IncreaseMesh();
25332999 } else
2534
- if (event.getSource() == clipMeshItem)
3000
+ if (source == clipMeshItem)
25353001 {
25363002 ClipMesh();
25373003 } else
2538
- if (event.getSource() == smoothMeshItem)
3004
+ if (source == smoothMeshItem)
25393005 {
25403006 SmoothMesh();
25413007 } else
2542
- if (event.getSource() == transformgeometryItem)
3008
+ if (source == transformGeometryItem)
25433009 {
25443010 TransformGeometry();
25453011 } else
2546
- if (event.getSource() == resetTransformItem)
3012
+ if (source == transformChildrenItem)
3013
+ {
3014
+ TransformChildren();
3015
+ } else
3016
+ if (source == resetTransformItem)
25473017 {
25483018 ResetTransform();
25493019 } else
2550
- if (event.getSource() == resetCentroidItem)
3020
+ if (source == resetCentroidItem)
25513021 {
2552
- ResetCentroid();
3022
+ ResetCentroid(true);
25533023 } else
2554
- if (event.getSource() == resetParentItem)
3024
+ if (source == resetCentroidXZItem)
3025
+ {
3026
+ ResetCentroid(false);
3027
+ } else
3028
+ if (source == resetParentItem)
25553029 {
25563030 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25573031 {
....@@ -2561,7 +3035,7 @@
25613035
25623036 refreshContents();
25633037 } else
2564
- if (event.getSource() == repairParentItem)
3038
+ if (source == repairParentItem)
25653039 {
25663040 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25673041 {
....@@ -2575,7 +3049,7 @@
25753049
25763050 refreshContents();
25773051 } else
2578
- if (event.getSource() == repairShadowItem)
3052
+ if (source == repairShadowItem)
25793053 {
25803054 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25813055 {
....@@ -2589,7 +3063,7 @@
25893063
25903064 refreshContents();
25913065 } else
2592
- if (event.getSource() == sortbysizeItem)
3066
+ if (source == sortbysizeItem)
25933067 {
25943068 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25953069 {
....@@ -2601,7 +3075,7 @@
26013075 ResetModel();
26023076 refreshContents();
26033077 } else
2604
- if (event.getSource() == sortbynameItem)
3078
+ if (source == sortbynameItem)
26053079 {
26063080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26073081 {
....@@ -2613,7 +3087,7 @@
26133087 ResetModel();
26143088 refreshContents();
26153089 } else
2616
- if (event.getSource() == attachPigmentItem)
3090
+ if (source == attachPigmentItem)
26173091 {
26183092 String texture = GetFile("Attach pigment");
26193093 Object3D obj;
....@@ -2625,7 +3099,7 @@
26253099
26263100 refreshContents();
26273101 } else
2628
- if (event.getSource() == detachPigmentItem)
3102
+ if (source == detachPigmentItem)
26293103 {
26303104 Object3D obj;
26313105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +3110,7 @@
26363110
26373111 refreshContents();
26383112 } else
2639
- if (event.getSource() == attachBumpItem)
3113
+ if (source == attachBumpItem)
26403114 {
26413115 String texture = GetFile("Attach bump");
26423116 Object3D obj;
....@@ -2648,7 +3122,7 @@
26483122
26493123 refreshContents();
26503124 } else
2651
- if (event.getSource() == detachBumpItem)
3125
+ if (source == detachBumpItem)
26523126 {
26533127 Object3D obj;
26543128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +3133,7 @@
26593133
26603134 refreshContents();
26613135 } else
2662
- if (event.getSource() == pigmentBumpItem)
3136
+ if (source == pigmentBumpItem)
26633137 {
26643138 Object3D obj;
26653139 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +3144,237 @@
26703144
26713145 refreshContents();
26723146 } else
2673
- if (event.getSource() == flashSelectionButton)
3147
+ if (source == flashSelectionButton)
26743148 {
26753149 CameraPane.flash = true;
26763150 refreshContents();
26773151 } else
2678
- if (event.getSource() == oneButton)
3152
+ if (source == oneButton)
26793153 {
26803154 } else
2681
- if (event.getSource() == twoButton)
3155
+ if (source == twoButton)
26823156 {
26833157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
26843162 // bug
26853163 //gridPanel.setDividerLocation(1.0);
26863164 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
3165
+// bigThree.remove(scenePanel);
3166
+// bigThree.remove(centralPanel);
3167
+// bigThree.remove(XYZPanel);
3168
+// aWindowConstraints.gridx = 0;
3169
+// aWindowConstraints.gridy = 0;
3170
+// aWindowConstraints.gridwidth = 1;
3171
+// // aConstraints.gridheight = 3;
3172
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3173
+// aWindowConstraints.weightx = 0;
3174
+// aWindowConstraints.weighty = 1;
3175
+// //bigThree.add(jtp, aWindowConstraints);
3176
+// aWindowConstraints.weightx = 1;
3177
+// aWindowConstraints.gridwidth = 3;
3178
+// // aConstraints.gridheight = 3;
3179
+// aWindowConstraints.gridx = 1;
3180
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3181
+// bigThree.add(centralPanel, aWindowConstraints);
3182
+// aWindowConstraints.weightx = 0;
3183
+// aWindowConstraints.gridx = 4;
3184
+// aWindowConstraints.gridwidth = 1;
3185
+// // aConstraints.gridheight = 3;
3186
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3187
+// //bigThree.add(XYZPanel, aWindowConstraints);
3188
+// scenePanel.setVisible(false);
3189
+// centralPanel.setVisible(true);
3190
+// XYZPanel.setVisible(false);
3191
+ bigThree.ClearUI();
3192
+ bigThree.add(centralPanel);
3193
+ bigThree.FlushUI();
3194
+
3195
+ cameraView.requestFocusInWindow();
3196
+
3197
+// refreshContents(true);
3198
+//
3199
+// try
3200
+// {
3201
+// java.awt.Robot bot = new java.awt.Robot();
3202
+// int mask = InputEvent.BUTTON1_MASK;
3203
+// bot.mouseMove(100, 100);
3204
+// bot.mousePress(mask);
3205
+// bot.mouseRelease(mask);
3206
+// }
3207
+// catch (Exception e)
3208
+// {
3209
+//
3210
+// }
3211
+
27113212 } else
2712
- if (event.getSource() == threeButton)
3213
+ if (source == threeButton)
27133214 {
27143215 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
3216
+
3217
+ if (CameraPane.FULLSCREEN)
3218
+ fullscreenLayout = radio.layout;
3219
+
3220
+// bigThree.remove(scenePanel);
3221
+// bigThree.remove(centralPanel);
3222
+// bigThree.remove(XYZPanel);
3223
+// aWindowConstraints.gridx = 0;
3224
+// aWindowConstraints.gridy = 0;
3225
+// aWindowConstraints.gridwidth = 1;
3226
+// // aConstraints.gridheight = 3;
3227
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3228
+// aWindowConstraints.weightx = 0;
3229
+// aWindowConstraints.weighty = 1;
3230
+// //bigThree.add(jtp, aWindowConstraints);
3231
+// aWindowConstraints.weightx = 1;
3232
+// aWindowConstraints.gridwidth = 3;
3233
+// // aConstraints.gridheight = 3;
3234
+// aWindowConstraints.gridx = 1;
3235
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3236
+// bigThree.add(centralPanel, aWindowConstraints);
3237
+// aWindowConstraints.weightx = 0;
3238
+// aWindowConstraints.gridx = 4;
3239
+// aWindowConstraints.gridwidth = 1;
3240
+// // aConstraints.gridheight = 3;
3241
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3242
+// bigThree.add(XYZPanel, aWindowConstraints);
3243
+// bigThree.validate();
3244
+// scenePanel.setVisible(false);
3245
+// centralPanel.setVisible(true);
3246
+// XYZPanel.setVisible(true);
3247
+ bigThree.ClearUI();
3248
+ bigThree.add(centralPanel);
3249
+ bigThree.add(XYZPanel);
3250
+ bigThree.FlushUI();
3251
+
3252
+ cameraView.requestFocusInWindow();
27393253 } else
2740
- if (event.getSource() == fourButton)
3254
+ if (source == fourButton)
27413255 {
27423256 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
3257
+
3258
+ if (CameraPane.FULLSCREEN)
3259
+ fullscreenLayout = radio.layout;
3260
+
3261
+// bigThree.remove(scenePanel);
3262
+// bigThree.remove(centralPanel);
3263
+// bigThree.remove(XYZPanel);
3264
+// aWindowConstraints.gridx = 0;
3265
+// aWindowConstraints.gridy = 0;
3266
+// aWindowConstraints.gridwidth = 1;
3267
+// // aWindowConstraints.gridheight = 3;
3268
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3269
+// aWindowConstraints.weightx = 1;
3270
+// aWindowConstraints.weighty = 1;
3271
+// bigThree.add(scenePanel, aWindowConstraints);
3272
+// aWindowConstraints.weightx = 1;
3273
+// aWindowConstraints.gridwidth = 3;
3274
+// // aConstraints.gridheight = 3;
3275
+// aWindowConstraints.gridx = 1;
3276
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3277
+// //bigThree.add(cameraPanel, aWindowConstraints);
3278
+// aWindowConstraints.weightx = 0;
3279
+// aWindowConstraints.gridx = 4;
3280
+// aWindowConstraints.gridwidth = 1;
3281
+// // aWindowConstraints.gridheight = 3;
3282
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3283
+// //bigThree.add(XYZPanel, aWindowConstraints);
3284
+// bigThree.validate();
3285
+// scenePanel.setVisible(true);
3286
+// centralPanel.setVisible(false);
3287
+// XYZPanel.setVisible(false);
3288
+ bigThree.ClearUI();
3289
+ bigThree.add(scenePanel);
3290
+ bigThree.FlushUI();
3291
+
3292
+ cameraView.requestFocusInWindow();
27673293 } else
2768
- if (event.getSource() == sixButton)
3294
+ if (source == sixButton)
27693295 {
27703296 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
3297
+
3298
+ if (CameraPane.FULLSCREEN)
3299
+ fullscreenLayout = radio.layout;
3300
+
3301
+// bigThree.remove(scenePanel);
3302
+// bigThree.remove(centralPanel);
3303
+// bigThree.remove(XYZPanel);
3304
+// aWindowConstraints.gridx = 0;
3305
+// aWindowConstraints.gridy = 0;
3306
+// aWindowConstraints.gridwidth = 1;
3307
+// // aConstraints.gridheight = 3;
3308
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3309
+// aWindowConstraints.weightx = 0;
3310
+// aWindowConstraints.weighty = 1;
3311
+// bigThree.add(scenePanel, aWindowConstraints);
3312
+// aWindowConstraints.weightx = 1;
3313
+// aWindowConstraints.gridwidth = 3;
3314
+// // aWindowConstraints.gridheight = 3;
3315
+// aWindowConstraints.gridx = 1;
3316
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3317
+// bigThree.add(centralPanel, aWindowConstraints);
3318
+// aWindowConstraints.weightx = 0;
3319
+// aWindowConstraints.gridx = 4;
3320
+// aWindowConstraints.gridwidth = 1;
3321
+// // aWindowConstraints.gridheight = 3;
3322
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3323
+// //bigThree.add(XYZPanel, aConstraints);
3324
+// bigThree.validate();
3325
+// scenePanel.setVisible(true);
3326
+// centralPanel.setVisible(true);
3327
+// XYZPanel.setVisible(false);
3328
+ bigThree.ClearUI();
3329
+ bigThree.add(scenePanel);
3330
+ bigThree.add(centralPanel);
3331
+ bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
27953334 } else
2796
- if (event.getSource() == sevenButton)
3335
+ if (source == sevenButton)
27973336 {
27983337 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
3338
+
3339
+ if (CameraPane.FULLSCREEN)
3340
+ fullscreenLayout = radio.layout;
3341
+
3342
+// bigThree.remove(scenePanel);
3343
+// bigThree.remove(centralPanel);
3344
+// bigThree.remove(XYZPanel);
3345
+// aWindowConstraints.gridx = 0;
3346
+// aWindowConstraints.gridy = 0;
3347
+// aWindowConstraints.gridwidth = 1;
3348
+// // aWindowConstraints.gridheight = 3;
3349
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3350
+// aWindowConstraints.weightx = 0;
3351
+// aWindowConstraints.weighty = 1;
3352
+// bigThree.add(scenePanel, aWindowConstraints);
3353
+// aWindowConstraints.weightx = 1;
3354
+// aWindowConstraints.gridwidth = 3;
3355
+// // aWindowConstraints.gridheight = 3;
3356
+// aWindowConstraints.gridx = 1;
3357
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3358
+// bigThree.add(centralPanel, aWindowConstraints);
3359
+// aWindowConstraints.weightx = 0;
3360
+// aWindowConstraints.gridx = 4;
3361
+// aWindowConstraints.gridwidth = 1;
3362
+// // aConstraints.gridheight = 3;
3363
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3364
+// bigThree.add(XYZPanel, aWindowConstraints);
3365
+// bigThree.validate();
3366
+// scenePanel.setVisible(true);
3367
+// centralPanel.setVisible(true);
3368
+// XYZPanel.setVisible(true);
3369
+ bigThree.ClearUI();
3370
+ bigThree.add(scenePanel);
3371
+ bigThree.add(centralPanel);
3372
+ bigThree.add(XYZPanel);
3373
+ bigThree.FlushUI();
3374
+
3375
+ cameraView.requestFocusInWindow();
28233376 } else
2824
- if (event.getSource() == rootButton)
3377
+ if (source == rootButton)
28253378 {
28263379 Object3D obj;
28273380 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2831,66 +3384,84 @@
28313384 EditObject(obj);
28323385 }
28333386
3387
+ cameraView.requestFocusInWindow();
28343388 refreshContents(true);
28353389 } else
2836
- if (event.getSource() == closeButton)
3390
+ if (source == closeButton)
28373391 {
28383392 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28393393 cRadio ab;
28403394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28413395 {
28423396 ab = (cRadio)e.nextElement();
2843
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28443398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
28453405 buttonGroup.remove(ab);
28463406 radioPanel.remove(ab);
28473407
2848
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
28493410 // ab.GetObject().objectUI = null; // ?????????
28503411
28513412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28523413 break;
28533414 }
28543415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
28553418 refreshContents(true);
28563419 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
3420
+ if (source == editItem || source == editButton)
28583421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
28593428 EditSelection(false);
28603429 } else
2861
- if (event.getSource() == uneditButton)
3430
+ if (source == uneditButton)
28623431 {
28633432 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28643433 {
28653434 Object3D child = (Object3D)e.nextElement();
28663435 if(child.editWindow != null)
28673436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
28683438 child.CloseUI();
28693439 listUI.remove(child);
28703440
2871
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
28723442 }
2873
- objEditor.ctrlPanel.revalidate();
3443
+ objEditor.ctrlPanel.FlushUI();
28743444 //objEditor.jTree.clearSelection();
28753445 //objEditor.ResetSliders();
28763446 refreshContents(true);
28773447 } else
2878
- if (event.getSource() == clearPanelButton)
3448
+ if (source == clearPanelButton)
28793449 {
28803450 assert(copy == group);
28813451 //copy.ClearUI();
28823452 for (Object3D obj : listUI)
28833453 {
3454
+ obj.pinned = false;
28843455 obj.CloseUI();
28853456 }
28863457 listUI.clear();
28873458 refreshContents(true);
28883459 } else
2889
- if (event.getSource() == allParamsButton)
3460
+ if (source == allParamsButton)
28903461 {
28913462 assert(copy == group);
28923463
2893
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28943465
28953466 for (Object3D obj : listUI)
28963467 {
....@@ -2907,19 +3478,19 @@
29073478
29083479 refreshContents(true);
29093480 } else
2910
- if (event.getSource() == unselectButton)
3481
+ if (source == unselectButton)
29113482 {
29123483 objEditor.jTree.clearSelection();
29133484 // ?? oct 2012 GrafreeD.clipboard.clear();
29143485 objEditor.ResetSliders();
29153486 refreshContents(true);
29163487 } else
2917
- if(event.getSource() instanceof cRadio)
3488
+ if(source instanceof cRadio)
29183489 {
29193490 group.parent = keepparent;
29203491 group.attributes = 0;
29213492 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3493
+ /*cRadio*/ radio = (cRadio)source;
29233494 Object3D obj = radio.GetObject();
29243495 System.out.println("Edit " + obj);
29253496 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2939,6 +3510,9 @@
29393510 }
29403511
29413512 copy = group;
3513
+
3514
+ SetUndoStates();
3515
+
29423516 //Globals.theRenderer.object = group;
29433517 if(!useclient)
29443518 {
....@@ -2954,20 +3528,44 @@
29543528 frontView.object = group;
29553529 sideView.object = group;
29563530 }
2957
- group.editWindow = this;
3531
+
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
3535
+
29583536 /*
29593537 currentLayout = radio.layout;
29603538 if (currentLayout == null)
29613539 currentLayout = sevenButton;
29623540 */
29633541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
29643547 keepparent = group.parent;
29653548 // PARENT = NULL or not???
29663549 //group.parent = null; // ROOT
29673550 //group.attributes = -1;
29683551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
29693554 refreshContents(true);
2970
- }
3555
+ } else if (event.getSource() == editCameraItem)
3556
+ {
3557
+ cameraView.ProtectCamera();
3558
+ cameraView.repaint();
3559
+ return;
3560
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3561
+ {
3562
+ cameraView.RevertCamera();
3563
+ cameraView.repaint();
3564
+ return;
3565
+ // } else if (event.getSource() == textureButton)
3566
+ // {
3567
+ // return; // true;
3568
+ }
29713569 else
29723570 {
29733571 //return super.action(event, arg);
....@@ -2976,7 +3574,6 @@
29763574 }
29773575
29783576 boolean useclient = false;
2979
- cRadio radio;
29803577
29813578 void ToggleRoot()
29823579 {
....@@ -3028,6 +3625,28 @@
30283625 refreshContents();
30293626 }
30303627
3628
+ void TransformChildren()
3629
+ {
3630
+ Object3D obj;
3631
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3632
+ {
3633
+ obj = (Object3D)e.nextElement();
3634
+ obj.KeepTextureMatrices();
3635
+ obj.TransformChildren();
3636
+ obj.RestoreTextureMatrices();
3637
+
3638
+// if (obj.parent == null)
3639
+// {
3640
+// System.out.println("NULL PARENT!");
3641
+// new Exception().printStackTrace();
3642
+// }
3643
+// else
3644
+// TouchTransform(obj);
3645
+// //obj.parent.Touch();
3646
+ }
3647
+
3648
+ refreshContents();
3649
+ }
30313650
30323651 void ResetTransform()
30333652 {
....@@ -3140,7 +3759,7 @@
31403759 refreshContents();
31413760 }
31423761
3143
- void ResetCentroid()
3762
+ void ResetCentroid(boolean full)
31443763 {
31453764 Object3D obj;
31463765 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3155,12 +3774,16 @@
31553774 LA.matIdentity(Object3D.mat);
31563775 obj.getBounds(minima, maxima, false);
31573776 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3158
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3777
+ if (full)
3778
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31593779 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31603780 obj.TransformMesh(Object3D.mat);
3781
+
31613782 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3162
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3783
+ if (full)
3784
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31633785 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3786
+
31643787 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31653788 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31663789 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3189,7 +3812,8 @@
31893812
31903813 int size = obj.MemorySize();
31913814
3192
- System.err.println((size/1024) + " KB is the size of " + obj);
3815
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3816
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31933817 }
31943818 }
31953819 catch (Exception e)
....@@ -3226,9 +3850,9 @@
32263850 obj = (Object3D)e.nextElement();
32273851
32283852 System.out.println("Object is: " + obj);
3229
- GrafreeD.AnalyzeObject(obj);
3853
+ Grafreed.AnalyzeObject(obj);
32303854 System.out.println("Boundary rep: " + obj.bRep);
3231
- GrafreeD.AnalyzeObject(obj.bRep);
3855
+ Grafreed.AnalyzeObject(obj.bRep);
32323856
32333857 // System.err.println((size/1024) + " KB is the size of " + obj);
32343858 }
....@@ -3270,6 +3894,13 @@
32703894 void GenNormals(boolean crease)
32713895 {
32723896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
32733904
32743905 refreshContents();
32753906 }
....@@ -3442,8 +4073,8 @@
34424073
34434074 void ParseVertices()
34444075 {
3445
- boolean epsequal = GrafreeD.epsequal;
3446
- GrafreeD.epsequal = true;
4076
+ boolean epsequal = Grafreed.epsequal;
4077
+ Grafreed.epsequal = true;
34474078
34484079 for (int i=0; i<group.selection.size(); i++)
34494080 {
....@@ -3468,7 +4099,7 @@
34684099 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34694100 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34704101
3471
- g.add(GrafreeD.clipboard);
4102
+ g.add(Grafreed.clipboard);
34724103
34734104 buffer.add(g);
34744105 }
....@@ -3483,7 +4114,7 @@
34834114 makeSomething(buffer, i==group.selection.size()-1);
34844115 }
34854116
3486
- GrafreeD.epsequal = epsequal;
4117
+ Grafreed.epsequal = epsequal;
34874118
34884119 refreshContents();
34894120 }
....@@ -3501,7 +4132,16 @@
35014132 String pigment = Object3D.GetPigment(tex);
35024133 //String bump = Object3D.GetBump(tex);
35034134
3504
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4135
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4136
+
4137
+ try
4138
+ {
4139
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4140
+ }
4141
+ catch (Exception e)
4142
+ {
4143
+ System.err.println("FAIL: " + node);
4144
+ }
35054145
35064146 double s = v.s;
35074147
....@@ -3589,11 +4229,11 @@
35894229
35904230 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35914231
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
4232
+ boolean random = CameraPane.SWITCH;
4233
+ CameraPane.SWITCH = false; // parse all random nodes
35944234 lowres.linkVerticesThis(null);
35954235 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
4236
+ CameraPane.SWITCH = random;
35974237
35984238 System.err.flush();
35994239
....@@ -3633,7 +4273,7 @@
36334273 return;
36344274
36354275 Object3D poses = group.selection.get(0);
3636
- Object3D ref = GrafreeD.clipboard.get(0);
4276
+ Object3D ref = Grafreed.clipboard.get(0);
36374277
36384278 Object3D newgroup = new Object3D("Po:" + poses.name);
36394279
....@@ -3827,9 +4467,9 @@
38274467
38284468 void ClipMesh()
38294469 {
3830
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4470
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38314471 {
3832
- Object3D content = GrafreeD.clipboard.get(0);
4472
+ Object3D content = Grafreed.clipboard.get(0);
38334473
38344474 if (content instanceof cGroup && ((cGroup)content).transientlink )
38354475 content = ((cGroup)content).get(0);
....@@ -3838,7 +4478,7 @@
38384478 // {
38394479 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38404480 // }
3841
- group.selection.ClipMesh(GrafreeD.clipboard);
4481
+ group.selection.ClipMesh(Grafreed.clipboard);
38424482 }
38434483 // group.selection.ClipMesh(GrafreeD.clipboard);
38444484 System.out.println("DONE.");
....@@ -3885,6 +4525,18 @@
38854525 void MarkLeaves(boolean hide)
38864526 {
38874527 group.selection.MarkLeaves(hide);
4528
+ refreshContents();
4529
+ }
4530
+
4531
+ void RewindLeaves(boolean hide)
4532
+ {
4533
+ group.selection.RewindLeaves(hide);
4534
+ refreshContents();
4535
+ }
4536
+
4537
+ void RandomLeaves(boolean hide)
4538
+ {
4539
+ group.selection.RandomLeaves(hide);
38884540 refreshContents();
38894541 }
38904542
....@@ -3959,10 +4611,6 @@
39594611 // }
39604612 // }
39614613
3962
- static boolean allparams = true;
3963
-
3964
- static Vector<Object3D> listUI = new Vector<Object3D>();
3965
-
39664614 void EditSelection(boolean newWindow)
39674615 {
39684616 // aConstraints.gridy = 0;
....@@ -3970,10 +4618,10 @@
39704618 {
39714619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39724620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3973
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39744622
39754623 Object3D elem = (Object3D)group.selection.elementAt(i);
3976
- if(elem != group)
4624
+ if(elem != group || !newWindow)
39774625 {
39784626 // if (!(elem instanceof Composite))
39794627 // newWindow = false;
....@@ -4055,7 +4703,8 @@
40554703 //new Exception().printStackTrace();
40564704
40574705 freezemodel = true;
4058
-
4706
+ ClearUnpinned();
4707
+
40594708 /**/
40604709 //switch (event.id)
40614710 {
....@@ -4063,7 +4712,6 @@
40634712 //case 702: // Event.LIST_DESELECT
40644713 group.deselectAll();
40654714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4066
- objEditor.ClearInfo(); // .GetMaterial());
40674715 if (tps != null)
40684716 {
40694717 for (int i=0; i < tps.length; i++)
....@@ -4072,33 +4720,39 @@
40724720
40734721 //if (child.parent != null)
40744722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
40754724 group.addSelectee(child);
4076
- objEditor.SetMaterial(child); // .GetMaterial());
4077
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4078
- System.err.println("info : " + child.GetPath());
40794725 }
40804726 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4727
+// else
4728
+// {
4729
+// objEditor.SetMaterial(group); // .GetMaterial());
4730
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4731
+// System.err.println("info : " + group.GetPath());
4732
+// }
40874733
4088
- objEditor.SetText(); // jan 2014
4089
-
4090
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4734
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40914735 CameraPane.flash = true;
40924736
4093
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40944738 // a camera
40954739 {
4096
- CameraPane.camerachangeframe = 0; // don't refuse it
4097
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4741
+ {
4742
+ CameraPane.camerachangeframe = 0; // don't refuse it
4743
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4744
+ }
40984745 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
40994746 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41004747 }
41014748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
41024756 refreshContents();
41034757 //return true;
41044758 }
....@@ -4107,6 +4761,35 @@
41074761
41084762 freezemodel = false;
41094763 }
4764
+
4765
+ void SetPinStates(boolean enabled)
4766
+ {
4767
+ editButton.setEnabled(enabled);
4768
+ uneditButton.setEnabled(enabled);
4769
+ unselectButton.setEnabled(enabled);
4770
+ flashSelectionButton.setEnabled(enabled);
4771
+ }
4772
+
4773
+ void refreshContents(boolean cp)
4774
+ {
4775
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4776
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4777
+ {
4778
+ objEditor.ClearInfo(); // .GetMaterial());
4779
+
4780
+ for (int i=0; i < group.selection.Size(); i++)
4781
+ {
4782
+ Object3D child = (Object3D) group.selection.get(i);
4783
+
4784
+ objEditor.AddInfo(child, this, true);
4785
+ System.err.println("info : " + child.GetPath());
4786
+ }
4787
+
4788
+ objEditor.SetText(); // jan 2014
4789
+ }
4790
+
4791
+ super.refreshContents(cp);
4792
+ }
41104793
41114794 void linkSomething(Object3D thing)
41124795 {
....@@ -4178,16 +4861,19 @@
41784861 {
41794862 if (group.selection.isEmpty())
41804863 return;
4181
- GrafreeD.clipboardIsTempGroup = false;
4864
+
4865
+ Grafreed.clipboardIsTempGroup = false;
41824866 Composite tGroup = null;
41834867 if (group.selection.size() > 0) // 1)
41844868 {
41854869 tGroup = new cGroup();
4186
- GrafreeD.clipboardIsTempGroup = true;
4870
+ Grafreed.clipboardIsTempGroup = true;
41874871 }
41884872
41894873 if (cut)
41904874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
41914877 //int indices[] = jList.getSelectedIndices();
41924878 //for (int i = indices.length - 1; i >= 0; i--)
41934879 //jList.remove(indices[i]);
....@@ -4223,16 +4909,16 @@
42234909 //System.out.println("cut " + child);
42244910 //System.out.println("parent = " + child.parent);
42254911 // tmp.addChild(child);
4226
- if (GrafreeD.clipboardIsTempGroup)
4912
+ if (Grafreed.clipboardIsTempGroup)
42274913 tGroup.add/*Child*/(tmp);
42284914 else
4229
- GrafreeD.clipboard = tmp;
4915
+ Grafreed.clipboard = tmp;
42304916 }
42314917 else
4232
- if (GrafreeD.clipboardIsTempGroup)
4918
+ if (Grafreed.clipboardIsTempGroup)
42334919 tGroup.add/*Child*/(child);
42344920 else
4235
- GrafreeD.clipboard = child;
4921
+ Grafreed.clipboard = child;
42364922 }
42374923
42384924 //ResetModel();
....@@ -4264,21 +4950,23 @@
42644950 //System.out.println("cut " + elem);
42654951 //System.out.println("parent = " + elem.parent);
42664952 // tmp.addChild(elem);
4267
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
42684954 tGroup.add/*Child*/(tmp);
42694955 else
4270
- GrafreeD.clipboard = tmp;
4956
+ Grafreed.clipboard = tmp;
42714957 }
42724958 else
4273
- if (GrafreeD.clipboardIsTempGroup)
4959
+ if (Grafreed.clipboardIsTempGroup)
42744960 tGroup.add/*Child*/(child);
42754961 else
4276
- GrafreeD.clipboard = child;
4962
+ Grafreed.clipboard = child;
42774963 }
42784964
42794965 }
4280
- if (GrafreeD.clipboardIsTempGroup)
4281
- GrafreeD.clipboard = tGroup;
4966
+
4967
+ if (Grafreed.clipboardIsTempGroup)
4968
+ Grafreed.clipboard = tGroup;
4969
+
42824970 if (cut)
42834971 {
42844972 ResetModel();
....@@ -4288,11 +4976,15 @@
42884976
42894977 void paste(boolean expand)
42904978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
42914983 // if (GrafreeD.clipboard == null)
42924984 // return;
42934985 boolean first = true;
42944986
4295
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
42964988 {
42974989 Composite temp;
42984990
....@@ -4303,7 +4995,7 @@
43034995 temp = (Composite)Applet3D.clipboard.deepCopy();
43044996 */
43054997 Object3D elem;
4306
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4998
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43074999 {
43085000 Object3D child = (Object3D)e.nextElement();
43095001
....@@ -4337,21 +5029,22 @@
43375029 //Object3D cb = Applet3D.clipboard;
43385030 //temp.addChild(cb);
43395031 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4340
- assert(GrafreeD.clipboard.parent == null);
4341
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5032
+ assert(Grafreed.clipboard.parent == null);
5033
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5034
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5035
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5036
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43455037 else
4346
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
- GrafreeD.clipboard.get(0).parent = keepparent;
5038
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5039
+ Grafreed.clipboard.get(0).parent = keepparent;
43485040 }
43495041
5042
+ Globals.REPLACEONMAKE = keep;
43505043 ResetModel();
43515044 refreshContents();
43525045 }
43535046
4354
- void pasteInto(boolean copyit)
5047
+ void pasteInto(boolean copyit, boolean clone)
43555048 {
43565049 // if (GrafreeD.clipboard == null)
43575050 // return;
....@@ -4380,15 +5073,22 @@
43805073 if (copyit)
43815074 {
43825075 // paste(false);
4383
- CloneClipboard(false); // sept 2014
5076
+ if (clone)
5077
+ {
5078
+ CloneClipboard(false); // sept 2014
5079
+ }
5080
+ else
5081
+ {
5082
+ paste(false);
5083
+ }
43845084 }
43855085 else
43865086 {
43875087 boolean first = true;
43885088
4389
- if (GrafreeD.clipboardIsTempGroup)
5089
+ if (Grafreed.clipboardIsTempGroup)
43905090 {
4391
- Composite temp = (Composite)GrafreeD.clipboard;
5091
+ Composite temp = (Composite)Grafreed.clipboard;
43925092 Object3D copy;
43935093 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43945094 {
....@@ -4398,7 +5098,7 @@
43985098 }
43995099 } else
44005100 {
4401
- linkSomething(GrafreeD.clipboard); //.get(0));
5101
+ linkSomething(Grafreed.clipboard); //.get(0));
44025102 }
44035103 }
44045104 }
....@@ -4475,6 +5175,10 @@
44755175
44765176 void group(Object3D csg, boolean grab)
44775177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
44785182 if (//false) // why??
44795183 !group.selection.isEmpty())
44805184 {
....@@ -4588,10 +5292,15 @@
45885292 //node.add(csg);
45895293 //makeSomething(node);
45905294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
45915296 }
45925297
45935298 void Ungroup(Object3D g)
45945299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
45955304 if (g instanceof HiddenObject)
45965305 {
45975306 HiddenObject h = (HiddenObject) g;
....@@ -4608,6 +5317,7 @@
46085317 objEditor.makeSomething(g.get(i), false);
46095318 }
46105319 }
5320
+ Globals.REPLACEONMAKE = keep;
46115321 }
46125322
46135323 void ungroup()
....@@ -4803,21 +5513,6 @@
48035513 }
48045514 */
48055515
4806
- void ImportGFD()
4807
- {
4808
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4809
- browser.show();
4810
- String filename = browser.getFile();
4811
- if (filename != null && filename.length() > 0)
4812
- {
4813
- String fullname = browser.getDirectory() + filename;
4814
-
4815
- //Object3D readobj =
4816
- objEditor.ReadGFD(fullname, objEditor);
4817
- //makeSomething(readobj);
4818
- }
4819
- }
4820
-
48215516 /*
48225517 public void Callback(Object obj)
48235518 {
....@@ -4841,26 +5536,9 @@
48415536 }
48425537 */
48435538
4844
- void ImportVRMLX3D()
4845
- {
4846
- if (GrafreeD.standAlone)
4847
- {
4848
- /**/
4849
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4850
- browser.show();
4851
- String filename = browser.getFile();
4852
- if (filename != null && filename.length() > 0)
4853
- {
4854
- String fullname = browser.getDirectory() + filename;
4855
- LoadVRMLX3D(fullname);
4856
- }
4857
- /**/
4858
- }
4859
- }
4860
-
48615539 String GetFile(String dialogName)
48625540 {
4863
- if (GrafreeD.standAlone)
5541
+ if (Grafreed.standAlone)
48645542 {
48655543 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48665544 browser.show();
....@@ -4924,10 +5602,33 @@
49245602 cButton flashSelectionButton;
49255603 cButton editButton;
49265604 cButton uneditButton;
5605
+ JCheckBox allParamsButton;
49275606 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295607 cButton unselectButton;
49305608
5609
+ cButton restoreCameraButton;
5610
+
5611
+ cButton saveButton;
5612
+ cButton oneStepButton;
5613
+
5614
+ cButton groupButton;
5615
+ cButton ungroupButton;
5616
+ cButton compositeButton;
5617
+ cButton switchButton;
5618
+ cButton loopButton;
5619
+ cButton textureButton;
5620
+
5621
+ cButton gridButton;
5622
+ cButton boxButton;
5623
+ cButton sphereButton;
5624
+ cButton coneButton;
5625
+ cButton torusButton;
5626
+ cButton superButton;
5627
+ cButton kleinButton;
5628
+ cButton particlesButton;
5629
+ cButton overlayButton;
5630
+ cButton lightButton;
5631
+
49315632 cButton screenfitButton;
49325633 cButton screenfitpointButton;
49335634 cButton snapobjectButton;
....@@ -4939,14 +5640,6 @@
49395640
49405641 cButton setsupportButton;
49415642
4942
- cButton twoButton;
4943
- cButton sixButton;
4944
- cButton threeButton;
4945
- cButton sevenButton;
4946
- cButton fourButton; // full panel
4947
- cButton oneButton; // full XYZ
4948
- //cButton currentLayout;
4949
-
49505643 //
49515644 //Composite
49525645 Object3D // to do !!
....@@ -4956,9 +5649,11 @@
49565649 //JTree jTree;
49575650 private MenuItem lookAtItem;
49585651 private MenuItem lookFromItem;
4959
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
49605653 private MenuItem cutItem;
4961
- private MenuItem duplicateItem;
5654
+ private MenuItem undoItem;
5655
+ private MenuItem redoItem;
5656
+ private JMenuItem duplicateItem;
49625657 private MenuItem cloneItem;
49635658 private MenuItem cloneSupportItem;
49645659 private MenuItem overwriteGeoItem;
....@@ -4971,7 +5666,7 @@
49715666 private MenuItem linkverticesItem;
49725667 private MenuItem relinkverticesItem;
49735668 private MenuItem setMasterItem;
4974
- private MenuItem resetMeshItem;
5669
+ private MenuItem resetAllItem;
49755670 private MenuItem stepAllItem;
49765671 private MenuItem revertMeshItem;
49775672 private MenuItem poseMeshItem;
....@@ -4982,6 +5677,7 @@
49825677 private MenuItem mergeGeometriesItem;
49835678 private MenuItem copyItem;
49845679 private MenuItem pasteItem;
5680
+ private MenuItem pasteIntoItem;
49855681 private MenuItem pasteLinkItem;
49865682 private MenuItem pasteCloneItem;
49875683 private MenuItem pasteExpandItem;
....@@ -5020,6 +5716,10 @@
50205716 private MenuItem showleavesItem;
50215717 private MenuItem markleavesItem;
50225718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
50235723
50245724 private MenuItem flipVItem;
50255725 private MenuItem unflipVItem;
....@@ -5031,15 +5731,17 @@
50315731 private MenuItem panoTexturesItem;
50325732
50335733 private MenuItem resetCentroidItem;
5034
- private MenuItem transformgeometryItem;
5734
+ private MenuItem resetCentroidXZItem;
50355735 private MenuItem resetTransformItem;
5736
+ private MenuItem transformGeometryItem;
5737
+ private MenuItem transformChildrenItem;
50365738 private MenuItem hideItem;
50375739 private MenuItem grabItem;
50385740 private MenuItem backItem;
50395741 private MenuItem frontItem;
50405742 private MenuItem cameraItem;
50415743 private MenuItem compositeItem;
5042
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
50435745 private MenuItem physicsItem;
50445746 private MenuItem frameselectorItem;
50455747 private MenuItem scriptNodeItem;
....@@ -5079,7 +5781,7 @@
50795781 private MenuItem blobItem;
50805782 private MenuItem latheItem;
50815783 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5784
+ private MenuItem overlayItem;
50835785 private MenuItem meshItem;
50845786 // private MenuItem meshGroupItem;
50855787 private MenuItem springItem;
....@@ -5101,11 +5803,6 @@
51015803 private MenuItem doubleItem;
51025804 private MenuItem tripleItem;
51035805
5104
- private MenuItem importGFDItem;
5105
- private MenuItem importVRMLX3DItem;
5106
- private MenuItem import3DSItem;
5107
- private MenuItem importOBJItem;
5108
-
51095806 private MenuItem computeAOItem;
51105807 private MenuItem recompileItem;
51115808 private MenuItem editScriptItem;
....@@ -5115,4 +5812,8 @@
51155812 private MenuItem analyzeItem;
51165813 private MenuItem dumpItem;
51175814 //boolean freezemodel = false;
5815
+
5816
+ Menu cameraMenu;
5817
+ MenuItem editCameraItem;
5818
+ MenuItem restoreCameraItem;
51185819 }