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,153 +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", CameraPane.isLIVE()), 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);
612
+ screenfitButton.setToolTipText("Screen fit");
613
+ screenfitButton.addActionListener(this);
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");
441648 liveCB.addItemListener(this);
442649
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
461656 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
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);
468663
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
507
- screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510665 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515666
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
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));
523675
524
- oe.toolbarPanel.add(new cButton(" ", false));
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ twoButton.setToolTipText("Show center view only");
532678 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
679
+ this.fullscreenLayout = twoButton;
680
+
681
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534682 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
683
+ fourButton.setToolTipText("Show left panel only");
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
685
+ sixButton.setToolTipText("2-column layout left");
536686 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ threeButton.setToolTipText("2-column layout right");
538689 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
+ sevenButton.setToolTipText("3-column layout");
540692 sevenButton.addActionListener(this);
541693 //
542694
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ rootButton.setToolTipText("Edit selection in new tab");
544697 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
698
+
699
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ closeButton.setToolTipText("Close tab");
547701 closeButton.addActionListener(this);
548702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549703 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551
-
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
554
- editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558704
559
- 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");
560790 uneditButton.addActionListener(this);
561791
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
574794 allParamsButton.addActionListener(this);
575795
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
581802 unselectButton.addActionListener(this);
582803
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
+
583814 // oe.aConstraints.gridx += 1;
584815 // oe.aConstraints.weighty = 0;
585816 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +822,25 @@
591822 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592823 // gcButton.addActionListener(this);
593824
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
825
+ cGridBag jSPPanel = new cGridBag();
826
+
827
+ JScrollPane jSP;
605828 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
607830 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
612
-
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
617
- colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
620
- materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
623
- textureCB.addItemListener(this);
624
-
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
627831
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
+
628844 //jList.addListSelectionListener(this);
629845 oe.jTree.addTreeSelectionListener(this);
630846 //jTree.setRootVisible(false);
....@@ -646,10 +862,144 @@
646862 radio.layout = sevenButton;
647863 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648864 }
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
+ }
649991
650992 void EditObject(Object3D obj)
651993 {
652994 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
+
6531003 radioButton.SetObject(obj);
6541004 radioButton.layout = sevenButton;
6551005 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -658,8 +1008,11 @@
6581008 buttonGroup.add(radioButton);
6591009 radioButton.doClick();
6601010 }
1011
+
6611012 void SetupViews(ObjEditor oe)
6621013 {
1014
+ theFrame = this;
1015
+
6631016 oe.SetupViews();
6641017
6651018 System.out.println("SetupViews");
....@@ -668,22 +1021,28 @@
6681021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6691022 }
6701023
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- JCheckBox smoothfocusCB;
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;
6811037 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
6871046
6881047 // static int COLOR = 1;
6891048 // static int MATERIAL = 2;
....@@ -691,9 +1050,9 @@
6911050
6921051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6931052
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
6971056
6981057 public void itemStateChanged(ItemEvent e)
6991058 {
....@@ -721,6 +1080,7 @@
7211080 } else if(e.getSource() == liveCB)
7221081 {
7231082 cameraView.ToggleLive();
1083
+ refreshContents(false);
7241084 }
7251085 else if(e.getSource() == supportCB)
7261086 {
....@@ -756,6 +1116,10 @@
7561116 cameraView.repaint();
7571117 // refreshContents();
7581118 }
1119
+ else if(e.getSource() == zoomBoxCB)
1120
+ {
1121
+ cameraView.ToggleZoomBoxMode();
1122
+ }
7591123 else if(e.getSource() == smoothfocusCB)
7601124 {
7611125 cameraView.ToggleSmoothFocus();
....@@ -781,6 +1145,18 @@
7811145 {
7821146 cameraView.ToggleOeil();
7831147 }
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
+ }
7841160 else if(e.getSource() == lookAtCB)
7851161 {
7861162 cameraView.ToggleLookAt();
....@@ -797,7 +1173,8 @@
7971173
7981174 /**/
7991175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
800
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
8011178 if ((path == null) || (path.getPathCount() <= 1)) {
8021179 // We can't move the root node or an empty selection
8031180 return;
....@@ -860,8 +1237,6 @@
8601237 }
8611238 }
8621239
863
- String string = (String) object;
864
-
8651240 System.out.println("Transfer = " + object + "; drop : " + target);
8661241 // if( object instanceof java.io.File[])
8671242 // {
....@@ -869,7 +1244,11 @@
8691244 // objEditor.DropFile((java.io.File[]) object, true);
8701245 // return;
8711246 // }
872
- 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) == ':')
8731252 {
8741253 // file(s)
8751254 String[] names = string.split("\n");
....@@ -896,7 +1275,7 @@
8961275
8971276 flashIt = false;
8981277 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1278
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001279 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011280
9021281 if (group.selection.size() == 1)
....@@ -912,23 +1291,33 @@
9121291
9131292 assert target == objEditor.jTree;
9141293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
9151295 try {
916
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9171297 } catch (Exception e) {
9181298 System.out.println("destinationPath : " + destinationPath);
9191299 return;
9201300 }
9211301
922
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
9231303 {
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
+// {
9241313 loadClipboard(true);
9251314 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
927
- } else {
928
- loadClipboard(false);
929
- objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
931
- }
1315
+ pasteInto(false, false);
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
9321321 }
9331322 public void dropActionChanged(DropTargetDragEvent dtde)
9341323 // Called if the user has modified the current drop gesture
....@@ -1033,85 +1422,107 @@
10331422 {
10341423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10351424 //heightFieldItem.addActionListener(this);
1036
- gridItem = menu.add(new MenuItem("Grid"));
1037
- gridItem.addActionListener(this);
1038
- rectoidItem = menu.add(new MenuItem("Box"));
1039
- rectoidItem.addActionListener(this);
1040
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1041
- ellipsoidItem.addActionListener(this);
1042
- coneItem = menu.add(new MenuItem("Cone"));
1043
- coneItem.addActionListener(this);
1044
- torusItem = menu.add(new MenuItem("Torus"));
1045
- torusItem.addActionListener(this);
1046
- superItem = menu.add(new MenuItem("Superellipsoid"));
1047
- superItem.addActionListener(this);
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
+ {
10481443 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10491444 kleinItem.addActionListener(this);
1050
- particleItem = menu.add(new MenuItem("Particle system"));
1051
- particleItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
10521451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531452 ragdollItem.addActionListener(this);
10541453 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551454 ragdoll2Item.addActionListener(this);
1455
+ }
10561456 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1457
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581458 meshItem.addActionListener(this);
10591459 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601460 // meshGroupItem.addActionListener(this);
1461
+ if (Globals.ADVANCED)
1462
+ {
10611463 springItem = menu.add(new MenuItem("Spring"));
10621464 springItem.addActionListener(this);
10631465 flagItem = menu.add(new MenuItem("Flag"));
10641466 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691467 blobItem = menu.add(new MenuItem("Blob"));
10701468 blobItem.addActionListener(this);
10711469 latheItem = menu.add(new MenuItem("Lathe"));
10721470 latheItem.addActionListener(this);
1073
- lightItem = menu.add(new MenuItem("Light"));
1074
- 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);
10751478 menu.add("-");
10761479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10771480 //superLoopItem.addActionListener(this);
1078
- loopItem = menu.add(new MenuItem("Loop"));
1079
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
10801483 doubleItem = menu.add(new MenuItem("Fork"));
10811484 doubleItem.addActionListener(this);
1485
+ if (Globals.ADVANCED)
1486
+ {
10821487 tripleItem = menu.add(new MenuItem("Trident"));
10831488 tripleItem.addActionListener(this);
1489
+ }
10841490 }
10851491
10861492 void buildToolsMenu(Menu menu)
10871493 {
10881494 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891495 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1496
+ animationItem.setState(Globals.ANIMATION);
1497
+
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
10911500
10921501 menu.add("-");
10931502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941503 parseverticesItem.addActionListener(this);
10951504 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961505 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1506
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981507 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011508 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021509 reduceMorphItem.addActionListener(this);
11031510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041511 reduce34MorphItem.addActionListener(this);
1105
-
1106
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1107
- computeAOItem.addActionListener(this);
11081512 menu.add("-");
1109
-
11101513 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111514 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("-");
11121523 menu.add(analyzeItem = new MenuItem("Analyze"));
11131524 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
11151526 dumpItem.addActionListener(this);
11161527 // menu.add(pathItem = new MenuItem("From-to path"));
11171528 // pathItem.addActionListener(this);
....@@ -1120,6 +1531,8 @@
11201531 resetParentItem.addActionListener(this);
11211532 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221533 repairParentItem.addActionListener(this);
1534
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1535
+ repairShadowItem.addActionListener(this);
11231536 menu.add(invariantsItem = new MenuItem("Invariants"));
11241537 invariantsItem.addActionListener(this);
11251538 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1540,7 @@
11271540 menu.add("-");
11281541 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291542 editScriptItem.addActionListener(this);
1543
+ }
11301544 }
11311545
11321546 void ScreenFit()
....@@ -1249,9 +1663,24 @@
12491663 shadow.material = new cMaterial(obj.material);
12501664 shadow.material.diffuse = 0.0001f;
12511665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
12521667
12531668 makeSomething(shadow);
12541669 }
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
+ }
12551684
12561685 /**
12571686 * applyExample
....@@ -1455,9 +1884,9 @@
14551884
14561885 void Overwrite(int mask)
14571886 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1887
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591888 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1889
+ Object3D content = Grafreed.clipboard.get(0);
14611890
14621891 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631892 content = ((cGroup)content).get(0);
....@@ -1480,6 +1909,7 @@
14801909 //
14811910 public void actionPerformed(ActionEvent event) // , Object arg)
14821911 {
1912
+ Object source = event.getSource();
14831913 /*
14841914 if (event.getSource() == nameField)
14851915 {
....@@ -1491,11 +1921,11 @@
14911921 }
14921922 else
14931923 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1924
+ if (source == lookAtItem || source == lookFromItem)
14951925 {
14961926 ScreenFit();
14971927 } else
1498
- if (event.getSource() == switchItem)
1928
+ if (source == switchViewItem)
14991929 {
15001930 cVector v1 = new cVector();
15011931 cVector v2 = new cVector();
....@@ -1504,11 +1934,11 @@
15041934 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051935 objEditor.cameraView.repaint();
15061936 } else
1507
- if (event.getSource() == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
15081938 {
15091939 makeSomething(new Box());
15101940 } else
1511
- if (event.getSource() == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
15121942 {
15131943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1959,9 @@
15291959 applyExample(particleGeom, "SMOKE");
15301960 makeSomething(particleGeom);
15311961 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1962
+ if (source == ragdollItem || source == ragdoll2Item)
15331963 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1964
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351965
15361966 ragdoll.toParent = LA.newMatrix();
15371967 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1979,7 @@
15491979 } else
15501980 /*
15511981 */
1552
- if (event.getSource() == heightFieldItem)
1982
+ if (source == heightFieldItem)
15531983 {
15541984 Object3D obj = new Object3D();
15551985
....@@ -1587,31 +2017,31 @@
15872017
15882018 makeSomething(obj);
15892019 } else
1590
- if (event.getSource() == gridItem)
2020
+ if (source == gridItem || source == gridButton)
15912021 {
15922022 makeSomething(new Grid());
15932023 } else
1594
- if (event.getSource() == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
15952025 {
15962026 makeSomething(new Sphere());
15972027 } else
1598
- if (event.getSource() == coneItem)
2028
+ if (source == coneItem || source == coneButton)
15992029 {
16002030 makeSomething(new Cone());
16012031 } else
1602
- if (event.getSource() == torusItem)
2032
+ if (source == torusItem || source == torusButton)
16032033 {
16042034 makeSomething(new Torus());
16052035 } else
1606
- if (event.getSource() == superItem)
2036
+ if (source == superItem || source == superButton)
16072037 {
16082038 makeSomething(new Superellipsoid());
16092039 } else
1610
- if (event.getSource() == kleinItem)
2040
+ if (source == kleinItem || source == kleinButton)
16112041 {
16122042 makeSomething(new Klein());
16132043 } else
1614
- if (event.getSource() == blobItem)
2044
+ if (source == blobItem)
16152045 {
16162046 Blob blob = new Blob();
16172047 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +2049,15 @@
16192049 //blob.retile();
16202050 makeSomething(blob);
16212051 } else
1622
- if (event.getSource() == latheItem)
2052
+ if (source == latheItem)
16232053 {
16242054 makeSomething(new Lathe());
16252055 } else
1626
- if (event.getSource() == bezierItem)
2056
+ if (source == bezierItem)
16272057 {
16282058 makeSomething(new BezierSurface());
16292059 } else
1630
- if (event.getSource() == checkerItem)
2060
+ if (source == overlayItem || source == overlayButton)
16312061 {
16322062 /*
16332063 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +2072,7 @@
16422072 */
16432073 makeSomething(new Checker());
16442074 } else
1645
- if (event.getSource() == meshItem)
2075
+ if (source == meshItem)
16462076 {
16472077 Object3D itemtomake = new Object3D();
16482078 Object3D child;
....@@ -1663,35 +2093,35 @@
16632093 makeSomething(child);
16642094 }
16652095 } else
1666
- if (event.getSource() == springItem)
2096
+ if (source == springItem)
16672097 {
16682098 cSpring s = new cSpring();
16692099 s.setup();
16702100 makeSomething(s);
16712101 } else
1672
- if (event.getSource() == flagItem)
2102
+ if (source == flagItem)
16732103 {
16742104 cSpring s = new cFlag();
16752105 s.setup();
16762106 makeSomething(s);
16772107 } else
1678
- if (event.getSource() == lightItem)
2108
+ if (source == lightItem || source == lightButton)
16792109 {
16802110 makeSomething(new Light());
16812111 } else
1682
- if (event.getSource() == csgItem)
2112
+ if (source == csgItem)
16832113 {
16842114 group(new CSG());
16852115 } else
1686
- if (event.getSource() == templateItem)
2116
+ if (source == templateItem)
16872117 {
16882118 group(new cTemplate());
16892119 } else
1690
- if (event.getSource() == attributeItem)
2120
+ if (source == attributeItem)
16912121 {
16922122 makeSomething(new Attribute());
16932123 } else
1694
- if (event.getSource() == pointflowItem)
2124
+ if (source == pointflowItem)
16952125 {
16962126 makeSomething(new PointFlow());
16972127 } else
....@@ -1703,7 +2133,7 @@
17032133 } else
17042134 */
17052135
1706
- if (event.getSource() == superLoopItem)
2136
+ if (source == superLoopItem)
17072137 {
17082138 Composite g = new cGroup();
17092139 for (int i=0; i<15; i++)
....@@ -1725,30 +2155,30 @@
17252155
17262156 group(g);
17272157 } else
1728
- if (event.getSource() == loopItem)
2158
+ if (source == loopItem || source == loopButton)
17292159 {
17302160 Composite csg = new GroupLeaf();
17312161 csg.count = 5;
17322162 group(csg);
1733
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
17342164 csg.addChild(child);
17352165 child.addChild(csg);
17362166 } else
1737
- if (event.getSource() == doubleItem)
2167
+ if (source == doubleItem)
17382168 {
1739
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
17402170 csg.count = 5;
17412171 group(csg);
1742
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
17432173 csg.addChild(child);
17442174 child.addChild(csg);
1745
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
17462176 csg.addChild(child);
17472177 child.addChild(csg);
17482178 } else
1749
- if (event.getSource() == tripleItem)
2179
+ if (source == tripleItem)
17502180 {
1751
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
17522182 csg.count = 4;
17532183 group(csg);
17542184 Composite child = new cGroup();
....@@ -1761,73 +2191,98 @@
17612191 csg.addChild(child);
17622192 child.addChild(csg);
17632193 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
2194
+ if (source == computeAOItem)
17662195 {
1767
- ImportGFD();
2196
+ Globals.drawMode = CameraPane.OCCLUSION;
2197
+ Globals.theRenderer.repaint();
17682198 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
2199
+ if (source == recompileItem)
17872200 {
17882201 Recompile();
17892202 refreshContents();
17902203 } else
1791
- if (event.getSource() == editScriptItem)
2204
+ if (source == editScriptItem)
17922205 {
17932206 OpenDialog();
17942207 refreshContents();
17952208 } else
1796
- if (event.getSource() == invariantsItem)
2209
+ if (source == invariantsItem)
17972210 {
17982211 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
2212
+ Grafreed.grafreeD.universe.invariants();
18002213 } else
1801
- if (event.getSource() == memoryItem)
2214
+ if (source == memoryItem)
18022215 {
18032216 //System.out.println("Invariants:");
18042217 PrintMemory();
18052218 } else
1806
- if (event.getSource() == pathItem)
2219
+ if (source == pathItem)
18072220 {
18082221 PrintPath();
18092222 } else
1810
- if (event.getSource() == analyzeItem)
2223
+ if (source == analyzeItem)
18112224 {
18122225 AnalyzeObject();
18132226 } else
1814
- if (event.getSource() == dumpItem)
2227
+ if (source == dumpItem)
18152228 {
18162229 DumpObject();
18172230 } else
1818
- if (event.getSource() == screenfitButton)
2231
+ if (source == minButton)
18192232 {
1820
- //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
+ {
18212278 ScreenFit();
18222279 } else
1823
- if (event.getSource() == screenfitpointButton)
2280
+ if (source == screenfitpointButton)
18242281 {
1825
- //Reload(lastConverter, lastFilename, true);
18262282 ScreenFitPoint();
18272283 } else
1828
- if (event.getSource() == snapobjectButton)
2284
+ if (source == snapobjectButton)
18292285 {
1830
- //Reload(lastConverter, lastFilename, true);
18312286 SnapObject();
18322287 } else
18332288 // if (event.getSource() == recompileButton)
....@@ -1836,13 +2291,13 @@
18362291 // Recompile();
18372292 // refreshContents();
18382293 // } else
1839
- if (event.getSource() == gcButton)
2294
+ if (source == gcButton)
18402295 {
18412296 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422297 System.gc();
18432298 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442299 } else
1845
- if (event.getSource() == editLeafItem)
2300
+ if (source == editLeafItem)
18462301 {
18472302 Object3D obj;
18482303 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2311,74 @@
18562311 }
18572312 refreshContents(true);
18582313 } else
1859
- if (event.getSource() == openWindowItem)
2314
+ if (source == openWindowItem)
18602315 {
18612316 EditSelection(true);
18622317 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2318
+ if (source == cutItem || source == clearButton)
18642319 {
18652320 loadClipboard(true);
18662321 } else
1867
- if (event.getSource() == duplicateItem)
2322
+ if (source == undoItem)
18682323 {
1869
- 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;
18702333 loadClipboard(false);
18712334 paste(false);
1872
- GrafreeD.clipboard = keep;
2335
+ Grafreed.clipboard = keep;
18732336 } else
1874
- if (event.getSource() == cloneItem)
2337
+ if (source == cloneItem)
18752338 {
18762339 CloneSelection(false);
18772340 } else
1878
- if (event.getSource() == cloneSupportItem)
2341
+ if (source == cloneSupportItem)
18792342 {
18802343 CloneSelection(true);
18812344 } else
1882
- if (event.getSource() == copyItem)
2345
+ if (source == copyItem)
18832346 {
18842347 loadClipboard(false);
18852348 } else
1886
- if (event.getSource() == pasteItem)
2349
+ if (source == pasteItem)
18872350 {
18882351 paste(false);
18892352 } else
1890
- if (event.getSource() == pasteLinkItem)
2353
+ if (source == pasteIntoItem)
18912354 {
1892
- pasteInto(false);
2355
+ pasteInto(true, false);
18932356 } else
1894
- if (event.getSource() == pasteCloneItem)
2357
+ if (source == pasteLinkItem)
18952358 {
1896
- pasteInto(true);
2359
+ pasteInto(false, false);
18972360 } else
1898
- if (event.getSource() == pasteExpandItem)
2361
+ if (source == pasteCloneItem)
2362
+ {
2363
+ pasteInto(true, true);
2364
+ } else
2365
+ if (source == pasteExpandItem)
18992366 {
19002367 paste(true);
19012368 } else
1902
- if (event.getSource() == synchronizeItem)
2369
+ if (source == synchronizeItem)
19032370 {
19042371 Overwrite(Object3D.TRANSFORM);
19052372 } else
1906
- if (event.getSource() == overwriteNameItem)
2373
+ if (source == overwriteNameItem)
19072374 {
19082375 Overwrite(Object3D.NAME);
19092376 } else
1910
- if (event.getSource() == overwriteUVItem)
2377
+ if (source == overwriteUVItem)
19112378 {
19122379 Overwrite(Object3D.UV);
19132380 } else
1914
- if (event.getSource() == overwriteMatItem)
2381
+ if (source == overwriteMatItem)
19152382 {
19162383 /* july 2015
19172384 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2398,7 @@
19312398
19322399 Overwrite(dropAttributes);
19332400 }
1934
- if (event.getSource() == overwriteGeoItem)
2401
+ if (source == overwriteGeoItem)
19352402 {
19362403 Overwrite(Object3D.GEOMETRY);
19372404 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2415,7 @@
19482415 // refreshContents();
19492416 // }
19502417 } else
1951
- if (event.getSource() == generateMeshItem)
2418
+ if (source == generateMeshItem)
19522419 {
19532420 //if (group.selection.size() == 1)
19542421 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2426,7 @@
19592426 ResetModel();
19602427 refreshContents();
19612428 } else
1962
- if (event.getSource() == extractGeometriesItem)
2429
+ if (source == extractGeometriesItem)
19632430 {
19642431 boolean one = false;
19652432
....@@ -1986,7 +2453,7 @@
19862453 ResetModel();
19872454 refreshContents();
19882455 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2456
+ if (source == cloneGeometriesItem)
19902457 {
19912458 boolean one = false;
19922459
....@@ -2012,7 +2479,7 @@
20122479 ResetModel();
20132480 refreshContents();
20142481 } else
2015
- if (event.getSource() == shareGeometriesItem)
2482
+ if (source == shareGeometriesItem)
20162483 {
20172484 boolean one = false;
20182485
....@@ -2042,7 +2509,7 @@
20422509 refreshContents();
20432510 }
20442511 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2512
+ if (source == mergeGeometriesItem)
20462513 {
20472514 boolean one = false;
20482515
....@@ -2072,7 +2539,7 @@
20722539 ResetModel();
20732540 refreshContents();
20742541 } else
2075
- if (event.getSource() == linkverticesItem)
2542
+ if (source == linkverticesItem)
20762543 {
20772544 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782545 // {
....@@ -2085,48 +2552,48 @@
20852552 // group.selection.get(0).setMasterThis(content); // should be identity
20862553 // refreshContents();
20872554 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2555
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892556 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2557
+ Object3D content = Grafreed.clipboard.get(0);
20912558
20922559 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932560 content = ((cGroup)content).get(0);
20942561
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2562
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962563 for (int i=0; i<group.selection.size(); i++)
20972564 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2565
+ boolean random = CameraPane.SWITCH;
2566
+ CameraPane.SWITCH = false; // parse all random nodes
21002567 group.selection.get(i).linkVerticesThis(content);
21012568 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2569
+ CameraPane.SWITCH = random;
21032570 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2571
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052572 refreshContents();
21062573 }
21072574 } else
2108
- if (event.getSource() == resetsupportItem)
2575
+ if (source == resetsupportItem)
21092576 {
21102577 for (int i=0; i<group.selection.size(); i++)
21112578 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2579
+ boolean random = CameraPane.SWITCH;
2580
+ CameraPane.SWITCH = false; // parse all random nodes
21142581 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2582
+ CameraPane.SWITCH = random;
21162583 }
21172584
21182585 refreshContents();
21192586 } else
2120
- if (event.getSource() == relinkverticesItem)
2587
+ if (source == relinkverticesItem)
21212588 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2589
+ boolean random = CameraPane.SWITCH;
2590
+ CameraPane.SWITCH = false; // parse all random nodes
21242591 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2592
+ CameraPane.SWITCH = random;
21262593
21272594 refreshContents();
21282595 } else
2129
- if (event.getSource() == resetreferencesItem)
2596
+ if (source == resetreferencesItem)
21302597 {
21312598 for (int i=0; i<group.selection.size(); i++)
21322599 {
....@@ -2135,11 +2602,11 @@
21352602
21362603 refreshContents();
21372604 } else
2138
- if (event.getSource() == setMasterItem)
2605
+ if (source == setMasterItem)
21392606 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2607
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412608 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2609
+ Object3D content = Grafreed.clipboard.get(0);
21432610
21442611 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452612 content = ((cGroup)content).get(0);
....@@ -2148,13 +2615,13 @@
21482615 refreshContents();
21492616 }
21502617 } else
2151
- if (event.getSource() == poseMeshItem)
2618
+ if (source == poseMeshItem)
21522619 {
21532620 if (group.selection.size() == 1)
21542621 {
2155
- if (GrafreeD.clipboard.size() == 1)
2622
+ if (Grafreed.clipboard.size() == 1)
21562623 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2624
+ Object3D content = Grafreed.clipboard.get(0);
21582625
21592626 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602627 content = ((cGroup)content).get(0);
....@@ -2167,19 +2634,19 @@
21672634 }
21682635
21692636 } else
2170
- if (event.getSource() == revertMeshItem)
2637
+ if (source == revertMeshItem)
21712638 {
21722639 RevertMeshes();
21732640 } else
2174
- if (event.getSource() == resetMeshItem)
2641
+ if (source == resetAllItem)
21752642 {
21762643 ResetAll();
21772644 } else
2178
- if (event.getSource() == stepAllItem)
2645
+ if (source == stepAllItem)
21792646 {
21802647 StepAll();
21812648 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2649
+ if (source == clearItem) // || event.getSource() == clearButton)
21832650 {
21842651 //int indices[] = jList.getSelectedIndices();
21852652 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2654,46 @@
21872654
21882655 ClearSelection(false);
21892656 } else
2190
- if (event.getSource() == clearAllItem)
2657
+ if (source == clearAllItem)
21912658 {
21922659 ClearSelection(true);
21932660 } else
2194
- if (event.getSource() == grabItem)
2661
+ if (source == grabItem || source == groupButton)
21952662 {
2196
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
21972664 } else
2198
- if (event.getSource() == hideItem)
2665
+ if (source == hideItem)
21992666 {
22002667 group(new HiddenObject());
22012668 } else
2202
- if (event.getSource() == frontItem)
2669
+ if (source == frontItem)
22032670 {
22042671 front();
22052672 } else
2206
- if (event.getSource() == backItem)
2673
+ if (source == backItem)
22072674 {
22082675 back();
22092676 } else
2210
- if (event.getSource() == cameraItem)
2677
+ if (source == cameraItem)
22112678 {
22122679 makeSomething(new Camera());
22132680 } else
2214
- if (event.getSource() == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
22152682 {
22162683 group(new Composite());
22172684 } else
2218
- if (event.getSource() == randomItem)
2685
+ if (source == switchItem || source == switchButton)
22192686 {
22202687 RandomNode random = new RandomNode();
22212688 group(random);
22222689 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2690
+ random.name = random.get(0).name + "Switch";
22242691 } else
2225
- if (event.getSource() == physicsItem)
2692
+ if (source == physicsItem)
22262693 {
22272694 group(new PhysicsNode());
22282695 } else
2229
- if (event.getSource() == frameselectorItem)
2696
+ if (source == frameselectorItem)
22302697 {
22312698 for (int i=0; i<group.selection.size(); i++)
22322699 {
....@@ -2238,7 +2705,7 @@
22382705 ResetModel();
22392706 refreshContents();
22402707 } else
2241
- if (event.getSource() == switchGeoItem)
2708
+ if (source == switchGeoItem)
22422709 {
22432710 for (int i=0; i<group.selection.size(); i++)
22442711 {
....@@ -2250,7 +2717,7 @@
22502717 ResetModel();
22512718 refreshContents();
22522719 } else
2253
- if (event.getSource() == switchTransfoItem)
2720
+ if (source == switchTransfoItem)
22542721 {
22552722 for (int i=0; i<group.selection.size(); i++)
22562723 {
....@@ -2262,7 +2729,7 @@
22622729 ResetModel();
22632730 refreshContents();
22642731 } else
2265
- if (event.getSource() == morphItem)
2732
+ if (source == morphItem)
22662733 {
22672734 for (int i=0; i<group.selection.size(); i++)
22682735 {
....@@ -2274,7 +2741,7 @@
22742741 ResetModel();
22752742 refreshContents();
22762743 } else
2277
- if (event.getSource() == scriptNodeItem)
2744
+ if (source == scriptNodeItem)
22782745 {
22792746 boolean atleastone = false;
22802747
....@@ -2313,215 +2780,252 @@
23132780 }
23142781 }
23152782 } else
2316
- if (event.getSource() == linkerItem)
2783
+ if (source == linkerItem)
23172784 {
23182785 group(new cLinker());
23192786 } else
2320
- if (event.getSource() == textureItem)
2787
+ if (source == textureItem || source == textureButton)
23212788 {
23222789 group(new TextureNode());
23232790 } else
2324
- if (event.getSource() == billboardItem)
2791
+ if (source == billboardItem)
23252792 {
23262793 group(new BillboardNode());
23272794 } else
2328
- if (event.getSource() == shadowXItem)
2795
+ if (source == shadowXItem)
23292796 {
23302797 CastShadow(0);
23312798 } else
2332
- if (event.getSource() == shadowYItem)
2799
+ if (source == shadowYItem)
23332800 {
23342801 CastShadow(1);
23352802 } else
2336
- if (event.getSource() == shadowZItem)
2803
+ if (source == shadowZItem)
23372804 {
23382805 CastShadow(2);
23392806 } else
2340
- if (event.getSource() == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
23412808 {
2342
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
23432811 for (int i=0; i<group.selection.size(); i++)
23442812 {
2345
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
23462818 }
23472819
2348
- ClearSelection(false);
2349
-
2350
- 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
+ }
23512831 } else
2352
- if (event.getSource() == genUVItem)
2832
+ if (source == genUVItem)
23532833 {
23542834 GenUV();
23552835 } else
2356
- if (event.getSource() == genNormalsCADItem)
2836
+ if (source == genNormalsCADItem)
23572837 {
23582838 GenNormals(true);
23592839 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2840
+ if (source == genNormalsMESHItem)
23612841 {
2362
- GenNormals(true); // TODO
2842
+ GenNormalsMESH();
23632843 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2844
+ if (source == genNormalsORGANItem)
23652845 {
23662846 GenNormals(false);
23672847 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2848
+ if (source == genNormalsMINEItem)
23692849 {
23702850 GenNormalsMINE();
23712851 } else
2372
- if (event.getSource() == stripifyItem)
2852
+ if (source == stripifyItem)
23732853 {
23742854 Stripify();
23752855 } else
2376
- if (event.getSource() == unstripifyItem)
2856
+ if (source == unstripifyItem)
23772857 {
23782858 Unstripify();
23792859 } else
2380
- if (event.getSource() == trimItem)
2860
+ if (source == trimItem)
23812861 {
23822862 Trim();
23832863 } else
2384
- if (event.getSource() == untrimItem)
2864
+ if (source == untrimItem)
23852865 {
23862866 Untrim();
23872867 } else
2388
- if (event.getSource() == clearColorsItem)
2868
+ if (source == clearColorsItem)
23892869 {
23902870 ClearColors();
23912871 } else
2392
- if (event.getSource() == clearMaterialsItem)
2872
+ if (source == clearMaterialsItem)
23932873 {
23942874 ClearMaterials();
23952875 } else
2396
- if (event.getSource() == liveleavesItem)
2876
+ if (source == liveleavesItem)
23972877 {
23982878 LiveLeaves(true);
23992879 } else
2400
- if (event.getSource() == unliveleavesItem)
2880
+ if (source == unliveleavesItem)
24012881 {
24022882 LiveLeaves(false);
24032883 } else
2404
- if (event.getSource() == supportleavesItem)
2884
+ if (source == supportleavesItem)
24052885 {
24062886 SupportLeaves(true);
24072887 } else
2408
- if (event.getSource() == unsupportleavesItem)
2888
+ if (source == unsupportleavesItem)
24092889 {
24102890 SupportLeaves(false);
24112891 } else
2412
- if (event.getSource() == hideleavesItem)
2892
+ if (source == hideleavesItem)
24132893 {
24142894 HideLeaves(true);
24152895 } else
2416
- if (event.getSource() == showleavesItem)
2896
+ if (source == showleavesItem)
24172897 {
24182898 HideLeaves(false);
24192899 } else
2420
- if (event.getSource() == markleavesItem)
2900
+ if (source == markleavesItem)
24212901 {
24222902 MarkLeaves(true);
24232903 } else
2424
- if (event.getSource() == unmarkleavesItem)
2904
+ if (source == unmarkleavesItem)
24252905 {
24262906 MarkLeaves(false);
24272907 } else
2428
- 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)
24292925 {
24302926 FlipV(true);
24312927 } else
2432
- if (event.getSource() == unflipVItem)
2928
+ if (source == unflipVItem)
24332929 {
24342930 FlipV(false);
24352931 } else
2436
- if (event.getSource() == lowTexturesItem)
2932
+ if (source == lowTexturesItem)
24372933 {
24382934 SetTexRes(0);
24392935 } else
2440
- if (event.getSource() == normalTexturesItem)
2936
+ if (source == normalTexturesItem)
24412937 {
24422938 SetTexRes(1);
24432939 } else
2444
- if (event.getSource() == highTexturesItem)
2940
+ if (source == highTexturesItem)
24452941 {
24462942 SetTexRes(2);
24472943 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2944
+ if (source == veryhighTexturesItem)
24492945 {
24502946 SetTexRes(3);
24512947 } else
2452
- if (event.getSource() == maxTexturesItem)
2948
+ if (source == maxTexturesItem)
24532949 {
24542950 SetTexRes(4);
24552951 } else
2456
- if (event.getSource() == panoTexturesItem)
2952
+ if (source == panoTexturesItem)
24572953 {
24582954 SetTexRes(5);
24592955 } else
2460
- if (event.getSource() == reverseNormalsItem)
2956
+ if (source == reverseNormalsItem)
24612957 {
24622958 ReverseNormals();
24632959 } else
2464
- if (event.getSource() == parseverticesItem)
2960
+ if (source == parseverticesItem)
24652961 {
24662962 ParseVertices();
24672963 } else
2468
- if (event.getSource() == textureFieldItem)
2964
+ if (source == textureFieldItem)
24692965 {
24702966 TextureVertices();
24712967 } else
2472
- if (event.getSource() == alignItem)
2968
+ if (source == alignItem)
24732969 {
24742970 Align();
24752971 } else
2476
- if (event.getSource() == mirrorItem)
2972
+ if (source == mirrorItem)
24772973 {
24782974 MirrorPoses();
24792975 } else
2480
- if (event.getSource() == reduceMorphItem)
2976
+ if (source == reduceMorphItem)
24812977 {
24822978 MeshReduction(false);
24832979 } else
2484
- if (event.getSource() == reduce34MorphItem)
2980
+ if (source == reduce34MorphItem)
24852981 {
24862982 MeshReduction(true);
24872983 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2984
+ if (source == reverseTrianglesItem)
24892985 {
24902986 ReverseTriangles();
24912987 } else
2492
- if (event.getSource() == reduceMeshItem)
2988
+ if (source == reduceMeshItem)
24932989 {
24942990 ReduceMesh(false);
24952991 } else
2496
- if (event.getSource() == reduce34MeshItem)
2992
+ if (source == reduce34MeshItem)
24972993 {
24982994 ReduceMesh(true);
24992995 } else
2500
- if (event.getSource() == increaseMeshItem)
2996
+ if (source == increaseMeshItem)
25012997 {
25022998 IncreaseMesh();
25032999 } else
2504
- if (event.getSource() == clipMeshItem)
3000
+ if (source == clipMeshItem)
25053001 {
25063002 ClipMesh();
25073003 } else
2508
- if (event.getSource() == smoothMeshItem)
3004
+ if (source == smoothMeshItem)
25093005 {
25103006 SmoothMesh();
25113007 } else
2512
- if (event.getSource() == transformgeometryItem)
3008
+ if (source == transformGeometryItem)
25133009 {
25143010 TransformGeometry();
25153011 } else
2516
- if (event.getSource() == resetTransformItem)
3012
+ if (source == transformChildrenItem)
3013
+ {
3014
+ TransformChildren();
3015
+ } else
3016
+ if (source == resetTransformItem)
25173017 {
25183018 ResetTransform();
25193019 } else
2520
- if (event.getSource() == resetCentroidItem)
3020
+ if (source == resetCentroidItem)
25213021 {
2522
- ResetCentroid();
3022
+ ResetCentroid(true);
25233023 } else
2524
- if (event.getSource() == resetParentItem)
3024
+ if (source == resetCentroidXZItem)
3025
+ {
3026
+ ResetCentroid(false);
3027
+ } else
3028
+ if (source == resetParentItem)
25253029 {
25263030 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25273031 {
....@@ -2531,7 +3035,7 @@
25313035
25323036 refreshContents();
25333037 } else
2534
- if (event.getSource() == repairParentItem)
3038
+ if (source == repairParentItem)
25353039 {
25363040 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25373041 {
....@@ -2545,7 +3049,21 @@
25453049
25463050 refreshContents();
25473051 } else
2548
- if (event.getSource() == sortbysizeItem)
3052
+ if (source == repairShadowItem)
3053
+ {
3054
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3055
+ {
3056
+ Object3D obj = (Object3D)e.nextElement();
3057
+ obj.RepairShadow();
3058
+// for (int i=0; i<obj.size(); i++)
3059
+// {
3060
+// obj.get(i).parent = obj;
3061
+// }
3062
+ }
3063
+
3064
+ refreshContents();
3065
+ } else
3066
+ if (source == sortbysizeItem)
25493067 {
25503068 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513069 {
....@@ -2557,7 +3075,7 @@
25573075 ResetModel();
25583076 refreshContents();
25593077 } else
2560
- if (event.getSource() == sortbynameItem)
3078
+ if (source == sortbynameItem)
25613079 {
25623080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25633081 {
....@@ -2569,7 +3087,7 @@
25693087 ResetModel();
25703088 refreshContents();
25713089 } else
2572
- if (event.getSource() == attachPigmentItem)
3090
+ if (source == attachPigmentItem)
25733091 {
25743092 String texture = GetFile("Attach pigment");
25753093 Object3D obj;
....@@ -2581,7 +3099,7 @@
25813099
25823100 refreshContents();
25833101 } else
2584
- if (event.getSource() == detachPigmentItem)
3102
+ if (source == detachPigmentItem)
25853103 {
25863104 Object3D obj;
25873105 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +3110,7 @@
25923110
25933111 refreshContents();
25943112 } else
2595
- if (event.getSource() == attachBumpItem)
3113
+ if (source == attachBumpItem)
25963114 {
25973115 String texture = GetFile("Attach bump");
25983116 Object3D obj;
....@@ -2604,7 +3122,7 @@
26043122
26053123 refreshContents();
26063124 } else
2607
- if (event.getSource() == detachBumpItem)
3125
+ if (source == detachBumpItem)
26083126 {
26093127 Object3D obj;
26103128 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +3133,7 @@
26153133
26163134 refreshContents();
26173135 } else
2618
- if (event.getSource() == pigmentBumpItem)
3136
+ if (source == pigmentBumpItem)
26193137 {
26203138 Object3D obj;
26213139 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +3144,237 @@
26263144
26273145 refreshContents();
26283146 } else
2629
- if (event.getSource() == flashSelectionButton)
3147
+ if (source == flashSelectionButton)
26303148 {
26313149 CameraPane.flash = true;
26323150 refreshContents();
26333151 } else
2634
- if (event.getSource() == oneButton)
3152
+ if (source == oneButton)
26353153 {
26363154 } else
2637
- if (event.getSource() == twoButton)
3155
+ if (source == twoButton)
26383156 {
26393157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
26403162 // bug
26413163 //gridPanel.setDividerLocation(1.0);
26423164 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
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
+
26673212 } else
2668
- if (event.getSource() == threeButton)
3213
+ if (source == threeButton)
26693214 {
26703215 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- bigThree.revalidate();
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();
26953253 } else
2696
- if (event.getSource() == fourButton)
3254
+ if (source == fourButton)
26973255 {
26983256 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
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();
27233293 } else
2724
- if (event.getSource() == sixButton)
3294
+ if (source == sixButton)
27253295 {
27263296 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- bigThree.revalidate();
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();
27513334 } else
2752
- if (event.getSource() == sevenButton)
3335
+ if (source == sevenButton)
27533336 {
27543337 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- bigThree.revalidate();
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();
27793376 } else
2780
- if (event.getSource() == rootButton)
3377
+ if (source == rootButton)
27813378 {
27823379 Object3D obj;
27833380 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,66 +3384,84 @@
27873384 EditObject(obj);
27883385 }
27893386
3387
+ cameraView.requestFocusInWindow();
27903388 refreshContents(true);
27913389 } else
2792
- if (event.getSource() == closeButton)
3390
+ if (source == closeButton)
27933391 {
27943392 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953393 cRadio ab;
27963394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27973395 {
27983396 ab = (cRadio)e.nextElement();
2799
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28003398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
28013405 buttonGroup.remove(ab);
28023406 radioPanel.remove(ab);
28033407
2804
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
28053410 // ab.GetObject().objectUI = null; // ?????????
28063411
28073412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28083413 break;
28093414 }
28103415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
28113418 refreshContents(true);
28123419 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3420
+ if (source == editItem || source == editButton)
28143421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
28153428 EditSelection(false);
28163429 } else
2817
- if (event.getSource() == uneditButton)
3430
+ if (source == uneditButton)
28183431 {
28193432 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203433 {
28213434 Object3D child = (Object3D)e.nextElement();
28223435 if(child.editWindow != null)
28233436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
28243438 child.CloseUI();
28253439 listUI.remove(child);
28263440
2827
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
28283442 }
2829
- objEditor.ctrlPanel.revalidate();
3443
+ objEditor.ctrlPanel.FlushUI();
28303444 //objEditor.jTree.clearSelection();
28313445 //objEditor.ResetSliders();
28323446 refreshContents(true);
28333447 } else
2834
- if (event.getSource() == clearPanelButton)
3448
+ if (source == clearPanelButton)
28353449 {
28363450 assert(copy == group);
28373451 //copy.ClearUI();
28383452 for (Object3D obj : listUI)
28393453 {
3454
+ obj.pinned = false;
28403455 obj.CloseUI();
28413456 }
28423457 listUI.clear();
28433458 refreshContents(true);
28443459 } else
2845
- if (event.getSource() == allParamsButton)
3460
+ if (source == allParamsButton)
28463461 {
28473462 assert(copy == group);
28483463
2849
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28503465
28513466 for (Object3D obj : listUI)
28523467 {
....@@ -2863,19 +3478,19 @@
28633478
28643479 refreshContents(true);
28653480 } else
2866
- if (event.getSource() == unselectButton)
3481
+ if (source == unselectButton)
28673482 {
28683483 objEditor.jTree.clearSelection();
28693484 // ?? oct 2012 GrafreeD.clipboard.clear();
28703485 objEditor.ResetSliders();
28713486 refreshContents(true);
28723487 } else
2873
- if(event.getSource() instanceof cRadio)
3488
+ if(source instanceof cRadio)
28743489 {
28753490 group.parent = keepparent;
28763491 group.attributes = 0;
28773492 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3493
+ /*cRadio*/ radio = (cRadio)source;
28793494 Object3D obj = radio.GetObject();
28803495 System.out.println("Edit " + obj);
28813496 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3510,10 @@
28953510 }
28963511
28973512 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3513
+
3514
+ SetUndoStates();
3515
+
3516
+ //Globals.theRenderer.object = group;
28993517 if(!useclient)
29003518 {
29013519 cameraView.renderCamera = radio.camera;
....@@ -2904,25 +3522,50 @@
29043522 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053523 cameraView.targetLookAt.set(radio.camera.lookAt);
29063524 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3525
+ //cameraView.lighttouched = true;
3526
+ Globals.lighttouched = true;
29083527 topView.object = group;
29093528 frontView.object = group;
29103529 sideView.object = group;
29113530 }
2912
- group.editWindow = this;
3531
+
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
3535
+
29133536 /*
29143537 currentLayout = radio.layout;
29153538 if (currentLayout == null)
29163539 currentLayout = sevenButton;
29173540 */
29183541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
29193547 keepparent = group.parent;
29203548 // PARENT = NULL or not???
29213549 //group.parent = null; // ROOT
29223550 //group.attributes = -1;
29233551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
29243554 refreshContents(true);
2925
- }
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
+ }
29263569 else
29273570 {
29283571 //return super.action(event, arg);
....@@ -2931,7 +3574,6 @@
29313574 }
29323575
29333576 boolean useclient = false;
2934
- cRadio radio;
29353577
29363578 void ToggleRoot()
29373579 {
....@@ -2940,7 +3582,7 @@
29403582 if (useclient)
29413583 {
29423584 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3585
+ Globals.lighttouched = true;
29443586 //topView.object = client;
29453587 //frontView.object = client;
29463588 //sideView.object = client;
....@@ -2948,7 +3590,7 @@
29483590 else
29493591 {
29503592 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3593
+ Globals.lighttouched = true;
29523594 //topView.object = group;
29533595 //frontView.object = group;
29543596 //sideView.object = group;
....@@ -2983,6 +3625,28 @@
29833625 refreshContents();
29843626 }
29853627
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
+ }
29863650
29873651 void ResetTransform()
29883652 {
....@@ -3095,7 +3759,7 @@
30953759 refreshContents();
30963760 }
30973761
3098
- void ResetCentroid()
3762
+ void ResetCentroid(boolean full)
30993763 {
31003764 Object3D obj;
31013765 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3774,16 @@
31103774 LA.matIdentity(Object3D.mat);
31113775 obj.getBounds(minima, maxima, false);
31123776 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3777
+ if (full)
3778
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143779 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153780 obj.TransformMesh(Object3D.mat);
3781
+
31163782 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3783
+ if (full)
3784
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183785 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3786
+
31193787 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203788 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213789 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +3812,8 @@
31443812
31453813 int size = obj.MemorySize();
31463814
3147
- 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)");
31483817 }
31493818 }
31503819 catch (Exception e)
....@@ -3181,9 +3850,9 @@
31813850 obj = (Object3D)e.nextElement();
31823851
31833852 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3853
+ Grafreed.AnalyzeObject(obj);
31853854 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3855
+ Grafreed.AnalyzeObject(obj.bRep);
31873856
31883857 // System.err.println((size/1024) + " KB is the size of " + obj);
31893858 }
....@@ -3225,6 +3894,13 @@
32253894 void GenNormals(boolean crease)
32263895 {
32273896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
32283904
32293905 refreshContents();
32303906 }
....@@ -3397,8 +4073,8 @@
33974073
33984074 void ParseVertices()
33994075 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
4076
+ boolean epsequal = Grafreed.epsequal;
4077
+ Grafreed.epsequal = true;
34024078
34034079 for (int i=0; i<group.selection.size(); i++)
34044080 {
....@@ -3423,7 +4099,7 @@
34234099 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34244100 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34254101
3426
- g.add(GrafreeD.clipboard);
4102
+ g.add(Grafreed.clipboard);
34274103
34284104 buffer.add(g);
34294105 }
....@@ -3438,7 +4114,7 @@
34384114 makeSomething(buffer, i==group.selection.size()-1);
34394115 }
34404116
3441
- GrafreeD.epsequal = epsequal;
4117
+ Grafreed.epsequal = epsequal;
34424118
34434119 refreshContents();
34444120 }
....@@ -3456,7 +4132,16 @@
34564132 String pigment = Object3D.GetPigment(tex);
34574133 //String bump = Object3D.GetBump(tex);
34584134
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
34604145
34614146 double s = v.s;
34624147
....@@ -3544,11 +4229,11 @@
35444229
35454230 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35464231
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
4232
+ boolean random = CameraPane.SWITCH;
4233
+ CameraPane.SWITCH = false; // parse all random nodes
35494234 lowres.linkVerticesThis(null);
35504235 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
4236
+ CameraPane.SWITCH = random;
35524237
35534238 System.err.flush();
35544239
....@@ -3588,7 +4273,7 @@
35884273 return;
35894274
35904275 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
4276
+ Object3D ref = Grafreed.clipboard.get(0);
35924277
35934278 Object3D newgroup = new Object3D("Po:" + poses.name);
35944279
....@@ -3757,7 +4442,7 @@
37574442 group.selection.RelinkToSupport(); // july 2014
37584443 System.out.println("DONE.");
37594444 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4445
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614446 }
37624447
37634448 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4467,9 @@
37824467
37834468 void ClipMesh()
37844469 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4470
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864471 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4472
+ Object3D content = Grafreed.clipboard.get(0);
37884473
37894474 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904475 content = ((cGroup)content).get(0);
....@@ -3793,7 +4478,7 @@
37934478 // {
37944479 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954480 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4481
+ group.selection.ClipMesh(Grafreed.clipboard);
37974482 }
37984483 // group.selection.ClipMesh(GrafreeD.clipboard);
37994484 System.out.println("DONE.");
....@@ -3840,6 +4525,18 @@
38404525 void MarkLeaves(boolean hide)
38414526 {
38424527 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);
38434540 refreshContents();
38444541 }
38454542
....@@ -3914,10 +4611,6 @@
39144611 // }
39154612 // }
39164613
3917
- static boolean allparams = true;
3918
-
3919
- static Vector<Object3D> listUI = new Vector<Object3D>();
3920
-
39214614 void EditSelection(boolean newWindow)
39224615 {
39234616 // aConstraints.gridy = 0;
....@@ -3925,10 +4618,10 @@
39254618 {
39264619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39274620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294622
39304623 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4624
+ if(elem != group || !newWindow)
39324625 {
39334626 // if (!(elem instanceof Composite))
39344627 // newWindow = false;
....@@ -4010,7 +4703,8 @@
40104703 //new Exception().printStackTrace();
40114704
40124705 freezemodel = true;
4013
-
4706
+ ClearUnpinned();
4707
+
40144708 /**/
40154709 //switch (event.id)
40164710 {
....@@ -4018,7 +4712,6 @@
40184712 //case 702: // Event.LIST_DESELECT
40194713 group.deselectAll();
40204714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40224715 if (tps != null)
40234716 {
40244717 for (int i=0; i < tps.length; i++)
....@@ -4027,33 +4720,39 @@
40274720
40284721 //if (child.parent != null)
40294722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
40304724 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40344725 }
40354726 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4727
+// else
4728
+// {
4729
+// objEditor.SetMaterial(group); // .GetMaterial());
4730
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4731
+// System.err.println("info : " + group.GetPath());
4732
+// }
40424733
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- if (flashIt && !CameraPane.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))
40464735 CameraPane.flash = true;
40474736
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494738 // a camera
40504739 {
4051
- CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
4745
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4746
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554747 }
40564748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
40574756 refreshContents();
40584757 //return true;
40594758 }
....@@ -4062,6 +4761,35 @@
40624761
40634762 freezemodel = false;
40644763 }
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
+ }
40654793
40664794 void linkSomething(Object3D thing)
40674795 {
....@@ -4133,16 +4861,19 @@
41334861 {
41344862 if (group.selection.isEmpty())
41354863 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4864
+
4865
+ Grafreed.clipboardIsTempGroup = false;
41374866 Composite tGroup = null;
41384867 if (group.selection.size() > 0) // 1)
41394868 {
41404869 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4870
+ Grafreed.clipboardIsTempGroup = true;
41424871 }
41434872
41444873 if (cut)
41454874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
41464877 //int indices[] = jList.getSelectedIndices();
41474878 //for (int i = indices.length - 1; i >= 0; i--)
41484879 //jList.remove(indices[i]);
....@@ -4178,16 +4909,16 @@
41784909 //System.out.println("cut " + child);
41794910 //System.out.println("parent = " + child.parent);
41804911 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4912
+ if (Grafreed.clipboardIsTempGroup)
41824913 tGroup.add/*Child*/(tmp);
41834914 else
4184
- GrafreeD.clipboard = tmp;
4915
+ Grafreed.clipboard = tmp;
41854916 }
41864917 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4918
+ if (Grafreed.clipboardIsTempGroup)
41884919 tGroup.add/*Child*/(child);
41894920 else
4190
- GrafreeD.clipboard = child;
4921
+ Grafreed.clipboard = child;
41914922 }
41924923
41934924 //ResetModel();
....@@ -4219,21 +4950,23 @@
42194950 //System.out.println("cut " + elem);
42204951 //System.out.println("parent = " + elem.parent);
42214952 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
42234954 tGroup.add/*Child*/(tmp);
42244955 else
4225
- GrafreeD.clipboard = tmp;
4956
+ Grafreed.clipboard = tmp;
42264957 }
42274958 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4959
+ if (Grafreed.clipboardIsTempGroup)
42294960 tGroup.add/*Child*/(child);
42304961 else
4231
- GrafreeD.clipboard = child;
4962
+ Grafreed.clipboard = child;
42324963 }
42334964
42344965 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4966
+
4967
+ if (Grafreed.clipboardIsTempGroup)
4968
+ Grafreed.clipboard = tGroup;
4969
+
42374970 if (cut)
42384971 {
42394972 ResetModel();
....@@ -4243,11 +4976,15 @@
42434976
42444977 void paste(boolean expand)
42454978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
42464983 // if (GrafreeD.clipboard == null)
42474984 // return;
42484985 boolean first = true;
42494986
4250
- if (GrafreeD.clipboardIsTempGroup)
4987
+ if (Grafreed.clipboardIsTempGroup)
42514988 {
42524989 Composite temp;
42534990
....@@ -4258,7 +4995,7 @@
42584995 temp = (Composite)Applet3D.clipboard.deepCopy();
42594996 */
42604997 Object3D elem;
4261
- 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))
42624999 {
42635000 Object3D child = (Object3D)e.nextElement();
42645001
....@@ -4292,21 +5029,22 @@
42925029 //Object3D cb = Applet3D.clipboard;
42935030 //temp.addChild(cb);
42945031 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
43005037 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
5038
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5039
+ Grafreed.clipboard.get(0).parent = keepparent;
43035040 }
43045041
5042
+ Globals.REPLACEONMAKE = keep;
43055043 ResetModel();
43065044 refreshContents();
43075045 }
43085046
4309
- void pasteInto(boolean copyit)
5047
+ void pasteInto(boolean copyit, boolean clone)
43105048 {
43115049 // if (GrafreeD.clipboard == null)
43125050 // return;
....@@ -4335,15 +5073,22 @@
43355073 if (copyit)
43365074 {
43375075 // paste(false);
4338
- CloneClipboard(false); // sept 2014
5076
+ if (clone)
5077
+ {
5078
+ CloneClipboard(false); // sept 2014
5079
+ }
5080
+ else
5081
+ {
5082
+ paste(false);
5083
+ }
43395084 }
43405085 else
43415086 {
43425087 boolean first = true;
43435088
4344
- if (GrafreeD.clipboardIsTempGroup)
5089
+ if (Grafreed.clipboardIsTempGroup)
43455090 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
5091
+ Composite temp = (Composite)Grafreed.clipboard;
43475092 Object3D copy;
43485093 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43495094 {
....@@ -4353,7 +5098,7 @@
43535098 }
43545099 } else
43555100 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
5101
+ linkSomething(Grafreed.clipboard); //.get(0));
43575102 }
43585103 }
43595104 }
....@@ -4430,6 +5175,10 @@
44305175
44315176 void group(Object3D csg, boolean grab)
44325177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
44335182 if (//false) // why??
44345183 !group.selection.isEmpty())
44355184 {
....@@ -4543,10 +5292,15 @@
45435292 //node.add(csg);
45445293 //makeSomething(node);
45455294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
45465296 }
45475297
45485298 void Ungroup(Object3D g)
45495299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
45505304 if (g instanceof HiddenObject)
45515305 {
45525306 HiddenObject h = (HiddenObject) g;
....@@ -4563,6 +5317,7 @@
45635317 objEditor.makeSomething(g.get(i), false);
45645318 }
45655319 }
5320
+ Globals.REPLACEONMAKE = keep;
45665321 }
45675322
45685323 void ungroup()
....@@ -4758,21 +5513,6 @@
47585513 }
47595514 */
47605515
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765516 /*
47775517 public void Callback(Object obj)
47785518 {
....@@ -4796,26 +5536,9 @@
47965536 }
47975537 */
47985538
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165539 String GetFile(String dialogName)
48175540 {
4818
- if (GrafreeD.standAlone)
5541
+ if (Grafreed.standAlone)
48195542 {
48205543 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215544 browser.show();
....@@ -4879,10 +5602,33 @@
48795602 cButton flashSelectionButton;
48805603 cButton editButton;
48815604 cButton uneditButton;
5605
+ JCheckBox allParamsButton;
48825606 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845607 cButton unselectButton;
48855608
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
+
48865632 cButton screenfitButton;
48875633 cButton screenfitpointButton;
48885634 cButton snapobjectButton;
....@@ -4894,14 +5640,6 @@
48945640
48955641 cButton setsupportButton;
48965642
4897
- cButton twoButton;
4898
- cButton sixButton;
4899
- cButton threeButton;
4900
- cButton sevenButton;
4901
- cButton fourButton; // full panel
4902
- cButton oneButton; // full XYZ
4903
- //cButton currentLayout;
4904
-
49055643 //
49065644 //Composite
49075645 Object3D // to do !!
....@@ -4911,9 +5649,11 @@
49115649 //JTree jTree;
49125650 private MenuItem lookAtItem;
49135651 private MenuItem lookFromItem;
4914
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
49155653 private MenuItem cutItem;
4916
- private MenuItem duplicateItem;
5654
+ private MenuItem undoItem;
5655
+ private MenuItem redoItem;
5656
+ private JMenuItem duplicateItem;
49175657 private MenuItem cloneItem;
49185658 private MenuItem cloneSupportItem;
49195659 private MenuItem overwriteGeoItem;
....@@ -4926,7 +5666,7 @@
49265666 private MenuItem linkverticesItem;
49275667 private MenuItem relinkverticesItem;
49285668 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5669
+ private MenuItem resetAllItem;
49305670 private MenuItem stepAllItem;
49315671 private MenuItem revertMeshItem;
49325672 private MenuItem poseMeshItem;
....@@ -4937,6 +5677,7 @@
49375677 private MenuItem mergeGeometriesItem;
49385678 private MenuItem copyItem;
49395679 private MenuItem pasteItem;
5680
+ private MenuItem pasteIntoItem;
49405681 private MenuItem pasteLinkItem;
49415682 private MenuItem pasteCloneItem;
49425683 private MenuItem pasteExpandItem;
....@@ -4975,6 +5716,10 @@
49755716 private MenuItem showleavesItem;
49765717 private MenuItem markleavesItem;
49775718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
49785723
49795724 private MenuItem flipVItem;
49805725 private MenuItem unflipVItem;
....@@ -4986,15 +5731,17 @@
49865731 private MenuItem panoTexturesItem;
49875732
49885733 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5734
+ private MenuItem resetCentroidXZItem;
49905735 private MenuItem resetTransformItem;
5736
+ private MenuItem transformGeometryItem;
5737
+ private MenuItem transformChildrenItem;
49915738 private MenuItem hideItem;
49925739 private MenuItem grabItem;
49935740 private MenuItem backItem;
49945741 private MenuItem frontItem;
49955742 private MenuItem cameraItem;
49965743 private MenuItem compositeItem;
4997
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
49985745 private MenuItem physicsItem;
49995746 private MenuItem frameselectorItem;
50005747 private MenuItem scriptNodeItem;
....@@ -5009,6 +5756,7 @@
50095756
50105757 private MenuItem resetParentItem;
50115758 private MenuItem repairParentItem;
5759
+ private MenuItem repairShadowItem;
50125760 private MenuItem sortbysizeItem;
50135761 private MenuItem sortbynameItem;
50145762
....@@ -5033,7 +5781,7 @@
50335781 private MenuItem blobItem;
50345782 private MenuItem latheItem;
50355783 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5784
+ private MenuItem overlayItem;
50375785 private MenuItem meshItem;
50385786 // private MenuItem meshGroupItem;
50395787 private MenuItem springItem;
....@@ -5055,11 +5803,6 @@
50555803 private MenuItem doubleItem;
50565804 private MenuItem tripleItem;
50575805
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635806 private MenuItem computeAOItem;
50645807 private MenuItem recompileItem;
50655808 private MenuItem editScriptItem;
....@@ -5069,4 +5812,8 @@
50695812 private MenuItem analyzeItem;
50705813 private MenuItem dumpItem;
50715814 //boolean freezemodel = false;
5815
+
5816
+ Menu cameraMenu;
5817
+ MenuItem editCameraItem;
5818
+ MenuItem restoreCameraItem;
50725819 }