Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
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.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = 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.SAVEONMAKE = 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,40 @@
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
406547 void SetupUI2(ObjEditor oe)
407548 {
549
+ // June 2019
550
+ if (oe == null)
551
+ {
552
+ //super.SetupUI2(this);
553
+ //return;
554
+ }
555
+
556
+ if (copy != group)
557
+ {
558
+ //super.SetupUI2(this);
559
+ }
560
+
408561 //new Exception().printStackTrace();
409562
410563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,110 +586,217 @@
433586 oe.radioPanel.add(dummyButton);
434587 oe.buttonGroup.add(dummyButton);
435588 */
436
- aConstraints.gridy += 1;
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
437592
438593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439594
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
595
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ //minButton.setToolTipText("Minimize window");
597
+ //minButton.addActionListener(this);
442598
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
445
- liveCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
- trackCB.setToolTipText("Enable tracking");
450
- trackCB.addItemListener(this);
451
-
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
599
+ if (Globals.ADVANCED)
600
+ {
601
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ maxButton.setToolTipText("Maximize window");
603
+ maxButton.addActionListener(this);
604
+ }
605
+
606
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ fullButton.setToolTipText("Full-screen window");
608
+ fullButton.addActionListener(this);
609
+
610
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454611 screenfitButton.setToolTipText("Screen fit");
455612 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
613
+
614
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ restoreCameraButton.setToolTipText("Restore viewpoint");
616
+ restoreCameraButton.addActionListener(this);
617
+
618
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ undoButton.setToolTipText("Undo changes");
620
+ undoButton.addActionListener(this);
621
+ undoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ redoButton.setToolTipText("Redo changes");
625
+ redoButton.addActionListener(this);
626
+ redoButton.setEnabled(false);
627
+
628
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ saveButton.setToolTipText("Save changes");
630
+ saveButton.addActionListener(this);
631
+
632
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
633
+ liveCB.setToolTipText("Enable animation");
634
+ liveCB.addItemListener(this);
635
+
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ oneStepButton.setToolTipText("Animate one step forward");
638
+ oneStepButton.addActionListener(this);
639
+
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
641
+ fastCB.setToolTipText("Fast mode");
642
+ fastCB.addItemListener(this);
643
+
644
+ //oe.toolboxPanel.Return();
645
+
646
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
647
+// trackCB.setToolTipText("Enable tracking");
648
+// trackCB.addItemListener(this);
649
+
457650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458651 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464652
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
- flashSelectionButton.setToolTipText("Show selection");
472
- flashSelectionButton.addActionListener(this);
653
+ if (Globals.ADVANCED)
654
+ {
655
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ snapobjectButton.addActionListener(this);
657
+ snapobjectButton.setToolTipText("Snap Object");
658
+ }
659
+
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473661
474
- oe.toolbarPanel.add(new cButton(" ", false));
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482663 twoButton.setToolTipText("Show center view only");
483664 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
665
+ this.fullscreenLayout = twoButton;
666
+
667
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485668 fourButton.addActionListener(this);
486669 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488671 sixButton.setToolTipText("2-column layout left");
489672 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491674 threeButton.setToolTipText("2-column layout right");
492675 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494677 sevenButton.setToolTipText("3-column layout");
495678 sevenButton.addActionListener(this);
496679 //
497680
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
681
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ rootButton.setToolTipText("Edit selection in new tab");
500683 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
684
+
685
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503686 closeButton.setToolTipText("Close tab");
504687 closeButton.addActionListener(this);
505688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506689 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508
-
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
511
- editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515690
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
691
+ // INSERT
692
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ gridButton.setToolTipText("Create grid");
694
+ gridButton.addActionListener(this);
695
+
696
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
+ boxButton.setToolTipText("Create box");
698
+ boxButton.addActionListener(this);
699
+
700
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+ sphereButton.setToolTipText("Create sphere");
702
+ sphereButton.addActionListener(this);
703
+
704
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ coneButton.setToolTipText("Create cone");
706
+ coneButton.addActionListener(this);
707
+
708
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ torusButton.setToolTipText("Create torus");
710
+ torusButton.addActionListener(this);
711
+
712
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ superButton.setToolTipText("Create superellipsoid");
714
+ superButton.addActionListener(this);
715
+
716
+ if (Globals.ADVANCED)
717
+ {
718
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ kleinButton.setToolTipText("Create Klein bottle");
720
+ kleinButton.addActionListener(this);
721
+ }
722
+
723
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ particlesButton.setToolTipText("Create particle system");
725
+ particlesButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.Return();
728
+
729
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ groupButton.setToolTipText("Create group");
731
+ groupButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ compositeButton.setToolTipText("Create composite");
735
+ compositeButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ switchButton.setToolTipText("Create item switcher");
739
+ switchButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ loopButton.setToolTipText("Create loop");
743
+ loopButton.addActionListener(this);
744
+
745
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ textureButton.setToolTipText("Create texture");
747
+ textureButton.addActionListener(this);
748
+
749
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ overlayButton.setToolTipText("Create overlay");
751
+ overlayButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ lightButton.setToolTipText("Create light");
755
+ lightButton.addActionListener(this);
756
+
757
+ for (int i=6; --i>=0;)
758
+ {
759
+ oe.toolboxPanel.Return();
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ oe.toolboxPanel.add(new cGridBag());
763
+ oe.toolboxPanel.add(new cGridBag());
764
+ oe.toolboxPanel.add(new cGridBag());
765
+ oe.toolboxPanel.add(new cGridBag());
766
+ oe.toolboxPanel.add(new cGridBag());
767
+ }
768
+
769
+ // EDIT panel
770
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ editButton.setToolTipText("Pin selection controls");
772
+ editButton.addActionListener(this);
773
+
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
517776 uneditButton.addActionListener(this);
518777
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
531780 allParamsButton.addActionListener(this);
532781
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
783
+ clearPanelButton.setToolTipText("Clear edit panel");
784
+ clearPanelButton.addActionListener(this);
785
+
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
787
+ unselectButton.setToolTipText("Unselect");
538788 unselectButton.addActionListener(this);
539789
790
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
791
+ flashSelectionButton.setToolTipText("Highlight selection");
792
+ flashSelectionButton.addActionListener(this);
793
+
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
799
+
540800 // oe.aConstraints.gridx += 1;
541801 // oe.aConstraints.weighty = 0;
542802 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +808,22 @@
548808 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549809 // gcButton.addActionListener(this);
550810
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
811
+ cGridBag jSPPanel = new cGridBag();
812
+
813
+ JScrollPane jSP;
562814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
564816 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
574
- colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
577
- materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
580
- textureCB.addItemListener(this);
581
-
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
584817
818
+ oe.treePanel.add(jSPPanel);
819
+ oe.treePanel.Return();
820
+
821
+ oe.treePanel.add(copyOptionsPanel);
822
+ oe.treePanel.Return();
823
+
824
+// mainPanel.setDividerLocation(0.5); //1.0);
825
+// mainPanel.setResizeWeight(0.5);
826
+
585827 //jList.addListSelectionListener(this);
586828 oe.jTree.addTreeSelectionListener(this);
587829 //jTree.setRootVisible(false);
....@@ -604,83 +846,143 @@
604846 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605847 }
606848
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
849
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608850 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
851
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
852
+ colorCB.setToolTipText("Copy color when dropped");
853
+ colorCB.addItemListener(this);
618854
619
- // constraints.gridy += 1;
855
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
856
+ materialCB.setToolTipText("Copy material when dropped");
857
+ materialCB.addItemListener(this);
858
+
859
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
860
+ textureCB.setToolTipText("Copy texture when dropped");
861
+ textureCB.addItemListener(this);
862
+
863
+ panel.Return();
864
+
865
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
866
+ boxCB.setToolTipText("Display bounding boxes");
867
+ boxCB.addItemListener(this);
868
+
869
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
871
+ zoomBoxCB.addItemListener(this);
872
+
873
+ if (true) // Globals.ADVANCED)
874
+ {
875
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
876
+// supportCB.setToolTipText("Enable rigging");
877
+// supportCB.addItemListener(this);
878
+
879
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
880
+ freezeCB.setToolTipText("Fast moving camera");
881
+ freezeCB.addItemListener(this);
882
+
620883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621884 // localCB.addItemListener(this);
622885
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
886
+ panel.Return();
887
+
888
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625889 crowdCB.setToolTipText("Used for crowds");
626890 crowdCB.addItemListener(this);
627891
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
892
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630893 smoothCB.setToolTipText("Snapping delay");
631894 smoothCB.addItemListener(this);
632895
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
896
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635897 slowCB.setToolTipText("Smooth interpolation");
636898 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
639
- boxCB.setToolTipText("Display bounding boxes");
640
- boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
- zoomBoxCB.addItemListener(this);
645
-
899
+
646900 // constraints.gridy += 1;
647901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648902 // speakerMocapCB.addItemListener(this);
649903
904
+ panel.Return();
905
+
650906 if (false)
651907 {
652908 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
909
+ //constraints.gridy += 1;
910
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655911 speakerCameraCB.addItemListener(this);
656912
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
913
+ //constraints.gridy += 1;
914
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659915 speakerFocusCB.addItemListener(this);
660916
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
917
+ //constraints.gridy += 1;
918
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
664921 }
665922
666923 //constraints.gridx += 1;
667924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668925 // debugCB.addItemListener(this);
669926
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
931
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
672933 oeilCB.addItemListener(this);
673934
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
935
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
936
+ shadowCB.setToolTipText("When live compute shadows");
937
+ shadowCB.addItemListener(this);
938
+
939
+ panel.Return();
940
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
941
+ toggleTextureCB.setToolTipText("Load textures");
942
+ toggleTextureCB.addItemListener(this);
943
+
944
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
945
+ toggleSwitchCB.setToolTipText("Choose a single item");
946
+ toggleSwitchCB.addItemListener(this);
947
+
948
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
949
+ autosaveCB.setToolTipText("On structure change");
950
+ autosaveCB.addItemListener(this);
951
+
952
+ panel.Return();
953
+ if (Globals.ADVANCED)
954
+ {
955
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676956 lookAtCB.setToolTipText("Look-at target");
677957 lookAtCB.addItemListener(this);
958
+ }
959
+
960
+ }
961
+
962
+ cGridBag fill = new cGridBag();
963
+ fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
968
+
969
+ panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
678972
679973 }
680974
681975 void EditObject(Object3D obj)
682976 {
683977 cRadio radioButton = new cRadio(obj.name);
978
+
979
+ // June 2019. Patch to avoid bug with transparency.
980
+ radioButton.hadMaterial = obj.material != null;
981
+ if (!radioButton.hadMaterial)
982
+ {
983
+ obj.material = new cMaterial();
984
+ }
985
+
684986 radioButton.SetObject(obj);
685987 radioButton.layout = sevenButton;
686988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -689,8 +991,11 @@
689991 buttonGroup.add(radioButton);
690992 radioButton.doClick();
691993 }
994
+
692995 void SetupViews(ObjEditor oe)
693996 {
997
+ theFrame = this;
998
+
694999 oe.SetupViews();
6951000
6961001 System.out.println("SetupViews");
....@@ -699,23 +1004,28 @@
6991004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7001005 }
7011006
702
- JCheckBox liveCB;
703
- JCheckBox supportCB;
704
- JCheckBox localCB;
705
- JCheckBox crowdCB;
706
- JCheckBox smoothCB;
707
- JCheckBox fastCB;
708
- JCheckBox slowCB;
709
- JCheckBox boxCB;
710
- JCheckBox zoomBoxCB;
711
- JCheckBox trackCB;
712
- JCheckBox smoothfocusCB;
1007
+ cToggleButton liveCB;
1008
+ cCheckBox supportCB;
1009
+ cCheckBox localCB;
1010
+ cCheckBox crowdCB;
1011
+ cCheckBox smoothCB;
1012
+ cToggleButton fastCB;
1013
+ cCheckBox slowCB;
1014
+ cCheckBox boxCB;
1015
+ cCheckBox zoomBoxCB;
1016
+ cCheckBox freezeCB;
1017
+ //cToggleButton trackCB;
1018
+ cCheckBox trackCB;
1019
+ cCheckBox smoothfocusCB;
7131020 // JCheckBox speakerMocapCB;
714
- JCheckBox speakerCameraCB;
715
- JCheckBox speakerFocusCB;
716
- JCheckBox debugCB;
717
- JCheckBox oeilCB;
718
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
7191029
7201030 // static int COLOR = 1;
7211031 // static int MATERIAL = 2;
....@@ -723,9 +1033,9 @@
7231033
7241034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7251035
726
- JCheckBox colorCB;
727
- JCheckBox materialCB;
728
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
7291039
7301040 public void itemStateChanged(ItemEvent e)
7311041 {
....@@ -753,6 +1063,7 @@
7531063 } else if(e.getSource() == liveCB)
7541064 {
7551065 cameraView.ToggleLive();
1066
+ refreshContents(false);
7561067 }
7571068 else if(e.getSource() == supportCB)
7581069 {
....@@ -817,6 +1128,18 @@
8171128 {
8181129 cameraView.ToggleOeil();
8191130 }
1131
+ else if(e.getSource() == shadowCB)
1132
+ {
1133
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1134
+ }
1135
+ else if(e.getSource() == freezeCB)
1136
+ {
1137
+ Globals.FREEZEONMOVE ^= true;
1138
+ }
1139
+ else if(e.getSource() == autosaveCB)
1140
+ {
1141
+ Globals.SAVEONMAKE ^= true;
1142
+ }
8201143 else if(e.getSource() == lookAtCB)
8211144 {
8221145 cameraView.ToggleLookAt();
....@@ -833,7 +1156,8 @@
8331156
8341157 /**/
8351158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
836
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
8371161 if ((path == null) || (path.getPathCount() <= 1)) {
8381162 // We can't move the root node or an empty selection
8391163 return;
....@@ -896,8 +1220,6 @@
8961220 }
8971221 }
8981222
899
- String string = (String) object;
900
-
9011223 System.out.println("Transfer = " + object + "; drop : " + target);
9021224 // if( object instanceof java.io.File[])
9031225 // {
....@@ -905,7 +1227,11 @@
9051227 // objEditor.DropFile((java.io.File[]) object, true);
9061228 // return;
9071229 // }
908
- if (string.charAt(0) == '/')
1230
+
1231
+ String string = object.toString();
1232
+
1233
+ // File path for Mac and Windows
1234
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9091235 {
9101236 // file(s)
9111237 String[] names = string.split("\n");
....@@ -932,7 +1258,7 @@
9321258
9331259 flashIt = false;
9341260 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1261
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9361262 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9371263
9381264 if (group.selection.size() == 1)
....@@ -948,23 +1274,33 @@
9481274
9491275 assert target == objEditor.jTree;
9501276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
9511278 try {
952
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9531280 } catch (Exception e) {
9541281 System.out.println("destinationPath : " + destinationPath);
9551282 return;
9561283 }
9571284
958
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
9591286 {
1287
+ Object3D child = (Object3D)group.selection.elementAt(i);
1288
+
1289
+ // Cannot move into itself
1290
+ if (child == destinationLeaf)
1291
+ return;
1292
+ }
1293
+
1294
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1295
+// {
9601296 loadClipboard(true);
9611297 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
963
- } else {
964
- loadClipboard(false);
965
- objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
967
- }
1298
+ pasteInto(false, false);
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
9681304 }
9691305 public void dropActionChanged(DropTargetDragEvent dtde)
9701306 // Called if the user has modified the current drop gesture
....@@ -1069,85 +1405,107 @@
10691405 {
10701406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10711407 //heightFieldItem.addActionListener(this);
1072
- gridItem = menu.add(new MenuItem("Grid"));
1073
- gridItem.addActionListener(this);
1074
- rectoidItem = menu.add(new MenuItem("Box"));
1075
- rectoidItem.addActionListener(this);
1076
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1077
- ellipsoidItem.addActionListener(this);
1078
- coneItem = menu.add(new MenuItem("Cone"));
1079
- coneItem.addActionListener(this);
1080
- torusItem = menu.add(new MenuItem("Torus"));
1081
- torusItem.addActionListener(this);
1082
- superItem = menu.add(new MenuItem("Superellipsoid"));
1083
- superItem.addActionListener(this);
1408
+// gridItem = menu.add(new MenuItem("Grid"));
1409
+// gridItem.addActionListener(this);
1410
+// rectoidItem = menu.add(new MenuItem("Box"));
1411
+// rectoidItem.addActionListener(this);
1412
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1413
+// ellipsoidItem.addActionListener(this);
1414
+// coneItem = menu.add(new MenuItem("Cone"));
1415
+// coneItem.addActionListener(this);
1416
+// torusItem = menu.add(new MenuItem("Torus"));
1417
+// torusItem.addActionListener(this);
1418
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1419
+// superItem.addActionListener(this);
1420
+
1421
+ cameraItem = menu.add(new MenuItem("Camera"));
1422
+ cameraItem.addActionListener(this);
1423
+
1424
+ if (!Globals.ADVANCED)
1425
+ {
10841426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10851427 kleinItem.addActionListener(this);
1086
- particleItem = menu.add(new MenuItem("Particle system"));
1087
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
1432
+ if (Globals.ADVANCED)
1433
+ {
10881434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891435 ragdollItem.addActionListener(this);
10901436 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911437 ragdoll2Item.addActionListener(this);
1438
+ }
10921439 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1440
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941441 meshItem.addActionListener(this);
10951442 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961443 // meshGroupItem.addActionListener(this);
1444
+ if (Globals.ADVANCED)
1445
+ {
10971446 springItem = menu.add(new MenuItem("Spring"));
10981447 springItem.addActionListener(this);
10991448 flagItem = menu.add(new MenuItem("Flag"));
11001449 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051450 blobItem = menu.add(new MenuItem("Blob"));
11061451 blobItem.addActionListener(this);
11071452 latheItem = menu.add(new MenuItem("Lathe"));
11081453 latheItem.addActionListener(this);
1109
- lightItem = menu.add(new MenuItem("Light"));
1110
- lightItem.addActionListener(this);
1454
+ }
1455
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1456
+ bezierItem.addActionListener(this);
1457
+// overlayItem = menu.add(new MenuItem("Overlay"));
1458
+// overlayItem.addActionListener(this);
1459
+// lightItem = menu.add(new MenuItem("Light"));
1460
+// lightItem.addActionListener(this);
11111461 menu.add("-");
11121462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11131463 //superLoopItem.addActionListener(this);
1114
- loopItem = menu.add(new MenuItem("Loop"));
1115
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
11161466 doubleItem = menu.add(new MenuItem("Fork"));
11171467 doubleItem.addActionListener(this);
1468
+ if (Globals.ADVANCED)
1469
+ {
11181470 tripleItem = menu.add(new MenuItem("Trident"));
11191471 tripleItem.addActionListener(this);
1472
+ }
11201473 }
11211474
11221475 void buildToolsMenu(Menu menu)
11231476 {
11241477 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251478 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1479
+ animationItem.setState(Globals.ANIMATION);
1480
+
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
11271483
11281484 menu.add("-");
11291485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301486 parseverticesItem.addActionListener(this);
11311487 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321488 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1489
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341490 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371491 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381492 reduceMorphItem.addActionListener(this);
11391493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401494 reduce34MorphItem.addActionListener(this);
1141
-
1142
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1143
- computeAOItem.addActionListener(this);
11441495 menu.add("-");
1145
-
11461496 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471497 memoryItem.addActionListener(this);
1498
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1499
+ computeAOItem.addActionListener(this);
1500
+
1501
+ if (Globals.ADVANCED)
1502
+ {
1503
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1504
+ mirrorItem.addActionListener(this);
1505
+ menu.add("-");
11481506 menu.add(analyzeItem = new MenuItem("Analyze"));
11491507 analyzeItem.addActionListener(this);
1150
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
11511509 dumpItem.addActionListener(this);
11521510 // menu.add(pathItem = new MenuItem("From-to path"));
11531511 // pathItem.addActionListener(this);
....@@ -1165,6 +1523,7 @@
11651523 menu.add("-");
11661524 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671525 editScriptItem.addActionListener(this);
1526
+ }
11681527 }
11691528
11701529 void ScreenFit()
....@@ -1287,9 +1646,24 @@
12871646 shadow.material = new cMaterial(obj.material);
12881647 shadow.material.diffuse = 0.0001f;
12891648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
12901650
12911651 makeSomething(shadow);
12921652 }
1653
+
1654
+ private void ClearUnpinned()
1655
+ {
1656
+ //for (Object3D obj : listUI)
1657
+ for (int i=listUI.size(); --i>=0;)
1658
+ {
1659
+ Object3D obj = listUI.elementAt(i);
1660
+ if (!obj.pinned)
1661
+ {
1662
+ obj.CloseUI();
1663
+ listUI.remove(i);
1664
+ }
1665
+ }
1666
+ }
12931667
12941668 /**
12951669 * applyExample
....@@ -1493,9 +1867,9 @@
14931867
14941868 void Overwrite(int mask)
14951869 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1870
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971871 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1872
+ Object3D content = Grafreed.clipboard.get(0);
14991873
15001874 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011875 content = ((cGroup)content).get(0);
....@@ -1518,6 +1892,7 @@
15181892 //
15191893 public void actionPerformed(ActionEvent event) // , Object arg)
15201894 {
1895
+ Object source = event.getSource();
15211896 /*
15221897 if (event.getSource() == nameField)
15231898 {
....@@ -1529,11 +1904,11 @@
15291904 }
15301905 else
15311906 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1907
+ if (source == lookAtItem || source == lookFromItem)
15331908 {
15341909 ScreenFit();
15351910 } else
1536
- if (event.getSource() == switchItem)
1911
+ if (source == switchViewItem)
15371912 {
15381913 cVector v1 = new cVector();
15391914 cVector v2 = new cVector();
....@@ -1542,11 +1917,11 @@
15421917 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431918 objEditor.cameraView.repaint();
15441919 } else
1545
- if (event.getSource() == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
15461921 {
15471922 makeSomething(new Box());
15481923 } else
1549
- if (event.getSource() == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
15501925 {
15511926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1942,9 @@
15671942 applyExample(particleGeom, "SMOKE");
15681943 makeSomething(particleGeom);
15691944 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1945
+ if (source == ragdollItem || source == ragdoll2Item)
15711946 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1947
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731948
15741949 ragdoll.toParent = LA.newMatrix();
15751950 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1962,7 @@
15871962 } else
15881963 /*
15891964 */
1590
- if (event.getSource() == heightFieldItem)
1965
+ if (source == heightFieldItem)
15911966 {
15921967 Object3D obj = new Object3D();
15931968
....@@ -1625,31 +2000,31 @@
16252000
16262001 makeSomething(obj);
16272002 } else
1628
- if (event.getSource() == gridItem)
2003
+ if (source == gridItem || source == gridButton)
16292004 {
16302005 makeSomething(new Grid());
16312006 } else
1632
- if (event.getSource() == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
16332008 {
16342009 makeSomething(new Sphere());
16352010 } else
1636
- if (event.getSource() == coneItem)
2011
+ if (source == coneItem || source == coneButton)
16372012 {
16382013 makeSomething(new Cone());
16392014 } else
1640
- if (event.getSource() == torusItem)
2015
+ if (source == torusItem || source == torusButton)
16412016 {
16422017 makeSomething(new Torus());
16432018 } else
1644
- if (event.getSource() == superItem)
2019
+ if (source == superItem || source == superButton)
16452020 {
16462021 makeSomething(new Superellipsoid());
16472022 } else
1648
- if (event.getSource() == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
16492024 {
16502025 makeSomething(new Klein());
16512026 } else
1652
- if (event.getSource() == blobItem)
2027
+ if (source == blobItem)
16532028 {
16542029 Blob blob = new Blob();
16552030 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +2032,15 @@
16572032 //blob.retile();
16582033 makeSomething(blob);
16592034 } else
1660
- if (event.getSource() == latheItem)
2035
+ if (source == latheItem)
16612036 {
16622037 makeSomething(new Lathe());
16632038 } else
1664
- if (event.getSource() == bezierItem)
2039
+ if (source == bezierItem)
16652040 {
16662041 makeSomething(new BezierSurface());
16672042 } else
1668
- if (event.getSource() == checkerItem)
2043
+ if (source == overlayItem || source == overlayButton)
16692044 {
16702045 /*
16712046 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +2055,7 @@
16802055 */
16812056 makeSomething(new Checker());
16822057 } else
1683
- if (event.getSource() == meshItem)
2058
+ if (source == meshItem)
16842059 {
16852060 Object3D itemtomake = new Object3D();
16862061 Object3D child;
....@@ -1701,35 +2076,35 @@
17012076 makeSomething(child);
17022077 }
17032078 } else
1704
- if (event.getSource() == springItem)
2079
+ if (source == springItem)
17052080 {
17062081 cSpring s = new cSpring();
17072082 s.setup();
17082083 makeSomething(s);
17092084 } else
1710
- if (event.getSource() == flagItem)
2085
+ if (source == flagItem)
17112086 {
17122087 cSpring s = new cFlag();
17132088 s.setup();
17142089 makeSomething(s);
17152090 } else
1716
- if (event.getSource() == lightItem)
2091
+ if (source == lightItem || source == lightButton)
17172092 {
17182093 makeSomething(new Light());
17192094 } else
1720
- if (event.getSource() == csgItem)
2095
+ if (source == csgItem)
17212096 {
17222097 group(new CSG());
17232098 } else
1724
- if (event.getSource() == templateItem)
2099
+ if (source == templateItem)
17252100 {
17262101 group(new cTemplate());
17272102 } else
1728
- if (event.getSource() == attributeItem)
2103
+ if (source == attributeItem)
17292104 {
17302105 makeSomething(new Attribute());
17312106 } else
1732
- if (event.getSource() == pointflowItem)
2107
+ if (source == pointflowItem)
17332108 {
17342109 makeSomething(new PointFlow());
17352110 } else
....@@ -1741,7 +2116,7 @@
17412116 } else
17422117 */
17432118
1744
- if (event.getSource() == superLoopItem)
2119
+ if (source == superLoopItem)
17452120 {
17462121 Composite g = new cGroup();
17472122 for (int i=0; i<15; i++)
....@@ -1763,30 +2138,30 @@
17632138
17642139 group(g);
17652140 } else
1766
- if (event.getSource() == loopItem)
2141
+ if (source == loopItem || source == loopButton)
17672142 {
17682143 Composite csg = new GroupLeaf();
17692144 csg.count = 5;
17702145 group(csg);
1771
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
17722147 csg.addChild(child);
17732148 child.addChild(csg);
17742149 } else
1775
- if (event.getSource() == doubleItem)
2150
+ if (source == doubleItem)
17762151 {
1777
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
17782153 csg.count = 5;
17792154 group(csg);
1780
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
17812156 csg.addChild(child);
17822157 child.addChild(csg);
1783
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
17842159 csg.addChild(child);
17852160 child.addChild(csg);
17862161 } else
1787
- if (event.getSource() == tripleItem)
2162
+ if (source == tripleItem)
17882163 {
1789
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
17902165 csg.count = 4;
17912166 group(csg);
17922167 Composite child = new cGroup();
....@@ -1799,73 +2174,84 @@
17992174 csg.addChild(child);
18002175 child.addChild(csg);
18012176 } else
1802
-
1803
- if (event.getSource() == importGFDItem)
1804
- {
1805
- ImportGFD();
1806
- } else
1807
- if (event.getSource() == importVRMLX3DItem)
1808
- {
1809
- ImportVRMLX3D();
1810
- } else
1811
- if (event.getSource() == import3DSItem)
1812
- {
1813
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1814
- } else
1815
- if (event.getSource() == importOBJItem)
1816
- {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1818
- } else
1819
- if (event.getSource() == computeAOItem)
2177
+ if (source == computeAOItem)
18202178 {
18212179 Globals.drawMode = CameraPane.OCCLUSION;
18222180 Globals.theRenderer.repaint();
18232181 } else
1824
- if (event.getSource() == recompileItem)
2182
+ if (source == recompileItem)
18252183 {
18262184 Recompile();
18272185 refreshContents();
18282186 } else
1829
- if (event.getSource() == editScriptItem)
2187
+ if (source == editScriptItem)
18302188 {
18312189 OpenDialog();
18322190 refreshContents();
18332191 } else
1834
- if (event.getSource() == invariantsItem)
2192
+ if (source == invariantsItem)
18352193 {
18362194 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
2195
+ Grafreed.grafreeD.universe.invariants();
18382196 } else
1839
- if (event.getSource() == memoryItem)
2197
+ if (source == memoryItem)
18402198 {
18412199 //System.out.println("Invariants:");
18422200 PrintMemory();
18432201 } else
1844
- if (event.getSource() == pathItem)
2202
+ if (source == pathItem)
18452203 {
18462204 PrintPath();
18472205 } else
1848
- if (event.getSource() == analyzeItem)
2206
+ if (source == analyzeItem)
18492207 {
18502208 AnalyzeObject();
18512209 } else
1852
- if (event.getSource() == dumpItem)
2210
+ if (source == dumpItem)
18532211 {
18542212 DumpObject();
18552213 } else
1856
- if (event.getSource() == screenfitButton)
2214
+ if (source == minButton)
18572215 {
1858
- //Reload(lastConverter, lastFilename, true);
2216
+ Minimize();
2217
+ } else
2218
+ if (source == maxButton)
2219
+ {
2220
+ Maximize();
2221
+ } else
2222
+ if (source == fullButton)
2223
+ {
2224
+ ToggleFullScreen();
2225
+ } else
2226
+ if (source == undoButton)
2227
+ {
2228
+ if (!Undo())
2229
+ java.awt.Toolkit.getDefaultToolkit().beep();
2230
+ } else
2231
+ if (source == redoButton)
2232
+ {
2233
+ Redo();
2234
+ } else
2235
+ if (source == saveButton)
2236
+ {
2237
+ if (!Save(true))
2238
+ java.awt.Toolkit.getDefaultToolkit().beep();
2239
+ } else
2240
+ if (source == oneStepButton)
2241
+ {
2242
+ Globals.ONESTEP = true;
2243
+ cameraView.repaint();
2244
+ } else
2245
+ if (source == screenfitButton)
2246
+ {
18592247 ScreenFit();
18602248 } else
1861
- if (event.getSource() == screenfitpointButton)
2249
+ if (source == screenfitpointButton)
18622250 {
1863
- //Reload(lastConverter, lastFilename, true);
18642251 ScreenFitPoint();
18652252 } else
1866
- if (event.getSource() == snapobjectButton)
2253
+ if (source == snapobjectButton)
18672254 {
1868
- //Reload(lastConverter, lastFilename, true);
18692255 SnapObject();
18702256 } else
18712257 // if (event.getSource() == recompileButton)
....@@ -1874,13 +2260,13 @@
18742260 // Recompile();
18752261 // refreshContents();
18762262 // } else
1877
- if (event.getSource() == gcButton)
2263
+ if (source == gcButton)
18782264 {
18792265 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18802266 System.gc();
18812267 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18822268 } else
1883
- if (event.getSource() == editLeafItem)
2269
+ if (source == editLeafItem)
18842270 {
18852271 Object3D obj;
18862272 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +2280,74 @@
18942280 }
18952281 refreshContents(true);
18962282 } else
1897
- if (event.getSource() == openWindowItem)
2283
+ if (source == openWindowItem)
18982284 {
18992285 EditSelection(true);
19002286 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2287
+ if (source == cutItem || source == clearButton)
19022288 {
19032289 loadClipboard(true);
19042290 } else
1905
- if (event.getSource() == duplicateItem)
2291
+ if (source == undoItem)
19062292 {
1907
- Object3D keep = GrafreeD.clipboard;
2293
+ Undo();
2294
+ } else
2295
+ if (source == redoItem)
2296
+ {
2297
+ Redo();
2298
+ } else
2299
+ if (source == duplicateItem)
2300
+ {
2301
+ Object3D keep = Grafreed.clipboard;
19082302 loadClipboard(false);
19092303 paste(false);
1910
- GrafreeD.clipboard = keep;
2304
+ Grafreed.clipboard = keep;
19112305 } else
1912
- if (event.getSource() == cloneItem)
2306
+ if (source == cloneItem)
19132307 {
19142308 CloneSelection(false);
19152309 } else
1916
- if (event.getSource() == cloneSupportItem)
2310
+ if (source == cloneSupportItem)
19172311 {
19182312 CloneSelection(true);
19192313 } else
1920
- if (event.getSource() == copyItem)
2314
+ if (source == copyItem)
19212315 {
19222316 loadClipboard(false);
19232317 } else
1924
- if (event.getSource() == pasteItem)
2318
+ if (source == pasteItem)
19252319 {
19262320 paste(false);
19272321 } else
1928
- if (event.getSource() == pasteLinkItem)
2322
+ if (source == pasteIntoItem)
19292323 {
1930
- pasteInto(false);
2324
+ pasteInto(true, false);
19312325 } else
1932
- if (event.getSource() == pasteCloneItem)
2326
+ if (source == pasteLinkItem)
19332327 {
1934
- pasteInto(true);
2328
+ pasteInto(false, false);
19352329 } else
1936
- if (event.getSource() == pasteExpandItem)
2330
+ if (source == pasteCloneItem)
2331
+ {
2332
+ pasteInto(true, true);
2333
+ } else
2334
+ if (source == pasteExpandItem)
19372335 {
19382336 paste(true);
19392337 } else
1940
- if (event.getSource() == synchronizeItem)
2338
+ if (source == synchronizeItem)
19412339 {
19422340 Overwrite(Object3D.TRANSFORM);
19432341 } else
1944
- if (event.getSource() == overwriteNameItem)
2342
+ if (source == overwriteNameItem)
19452343 {
19462344 Overwrite(Object3D.NAME);
19472345 } else
1948
- if (event.getSource() == overwriteUVItem)
2346
+ if (source == overwriteUVItem)
19492347 {
19502348 Overwrite(Object3D.UV);
19512349 } else
1952
- if (event.getSource() == overwriteMatItem)
2350
+ if (source == overwriteMatItem)
19532351 {
19542352 /* july 2015
19552353 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2367,7 @@
19692367
19702368 Overwrite(dropAttributes);
19712369 }
1972
- if (event.getSource() == overwriteGeoItem)
2370
+ if (source == overwriteGeoItem)
19732371 {
19742372 Overwrite(Object3D.GEOMETRY);
19752373 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2384,7 @@
19862384 // refreshContents();
19872385 // }
19882386 } else
1989
- if (event.getSource() == generateMeshItem)
2387
+ if (source == generateMeshItem)
19902388 {
19912389 //if (group.selection.size() == 1)
19922390 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2395,7 @@
19972395 ResetModel();
19982396 refreshContents();
19992397 } else
2000
- if (event.getSource() == extractGeometriesItem)
2398
+ if (source == extractGeometriesItem)
20012399 {
20022400 boolean one = false;
20032401
....@@ -2024,7 +2422,7 @@
20242422 ResetModel();
20252423 refreshContents();
20262424 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2425
+ if (source == cloneGeometriesItem)
20282426 {
20292427 boolean one = false;
20302428
....@@ -2050,7 +2448,7 @@
20502448 ResetModel();
20512449 refreshContents();
20522450 } else
2053
- if (event.getSource() == shareGeometriesItem)
2451
+ if (source == shareGeometriesItem)
20542452 {
20552453 boolean one = false;
20562454
....@@ -2080,7 +2478,7 @@
20802478 refreshContents();
20812479 }
20822480 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2481
+ if (source == mergeGeometriesItem)
20842482 {
20852483 boolean one = false;
20862484
....@@ -2110,7 +2508,7 @@
21102508 ResetModel();
21112509 refreshContents();
21122510 } else
2113
- if (event.getSource() == linkverticesItem)
2511
+ if (source == linkverticesItem)
21142512 {
21152513 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162514 // {
....@@ -2123,9 +2521,9 @@
21232521 // group.selection.get(0).setMasterThis(content); // should be identity
21242522 // refreshContents();
21252523 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2524
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272525 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2526
+ Object3D content = Grafreed.clipboard.get(0);
21292527
21302528 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312529 content = ((cGroup)content).get(0);
....@@ -2133,38 +2531,38 @@
21332531 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342532 for (int i=0; i<group.selection.size(); i++)
21352533 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2534
+ boolean random = CameraPane.SWITCH;
2535
+ CameraPane.SWITCH = false; // parse all random nodes
21382536 group.selection.get(i).linkVerticesThis(content);
21392537 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2538
+ CameraPane.SWITCH = random;
21412539 }
21422540 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432541 refreshContents();
21442542 }
21452543 } else
2146
- if (event.getSource() == resetsupportItem)
2544
+ if (source == resetsupportItem)
21472545 {
21482546 for (int i=0; i<group.selection.size(); i++)
21492547 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2548
+ boolean random = CameraPane.SWITCH;
2549
+ CameraPane.SWITCH = false; // parse all random nodes
21522550 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2551
+ CameraPane.SWITCH = random;
21542552 }
21552553
21562554 refreshContents();
21572555 } else
2158
- if (event.getSource() == relinkverticesItem)
2556
+ if (source == relinkverticesItem)
21592557 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2558
+ boolean random = CameraPane.SWITCH;
2559
+ CameraPane.SWITCH = false; // parse all random nodes
21622560 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2561
+ CameraPane.SWITCH = random;
21642562
21652563 refreshContents();
21662564 } else
2167
- if (event.getSource() == resetreferencesItem)
2565
+ if (source == resetreferencesItem)
21682566 {
21692567 for (int i=0; i<group.selection.size(); i++)
21702568 {
....@@ -2173,11 +2571,11 @@
21732571
21742572 refreshContents();
21752573 } else
2176
- if (event.getSource() == setMasterItem)
2574
+ if (source == setMasterItem)
21772575 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2576
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792577 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2578
+ Object3D content = Grafreed.clipboard.get(0);
21812579
21822580 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832581 content = ((cGroup)content).get(0);
....@@ -2186,13 +2584,13 @@
21862584 refreshContents();
21872585 }
21882586 } else
2189
- if (event.getSource() == poseMeshItem)
2587
+ if (source == poseMeshItem)
21902588 {
21912589 if (group.selection.size() == 1)
21922590 {
2193
- if (GrafreeD.clipboard.size() == 1)
2591
+ if (Grafreed.clipboard.size() == 1)
21942592 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2593
+ Object3D content = Grafreed.clipboard.get(0);
21962594
21972595 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982596 content = ((cGroup)content).get(0);
....@@ -2205,19 +2603,19 @@
22052603 }
22062604
22072605 } else
2208
- if (event.getSource() == revertMeshItem)
2606
+ if (source == revertMeshItem)
22092607 {
22102608 RevertMeshes();
22112609 } else
2212
- if (event.getSource() == resetMeshItem)
2610
+ if (source == resetAllItem)
22132611 {
22142612 ResetAll();
22152613 } else
2216
- if (event.getSource() == stepAllItem)
2614
+ if (source == stepAllItem)
22172615 {
22182616 StepAll();
22192617 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2618
+ if (source == clearItem) // || event.getSource() == clearButton)
22212619 {
22222620 //int indices[] = jList.getSelectedIndices();
22232621 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2623,46 @@
22252623
22262624 ClearSelection(false);
22272625 } else
2228
- if (event.getSource() == clearAllItem)
2626
+ if (source == clearAllItem)
22292627 {
22302628 ClearSelection(true);
22312629 } else
2232
- if (event.getSource() == grabItem)
2630
+ if (source == grabItem || source == groupButton)
22332631 {
2234
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
22352633 } else
2236
- if (event.getSource() == hideItem)
2634
+ if (source == hideItem)
22372635 {
22382636 group(new HiddenObject());
22392637 } else
2240
- if (event.getSource() == frontItem)
2638
+ if (source == frontItem)
22412639 {
22422640 front();
22432641 } else
2244
- if (event.getSource() == backItem)
2642
+ if (source == backItem)
22452643 {
22462644 back();
22472645 } else
2248
- if (event.getSource() == cameraItem)
2646
+ if (source == cameraItem)
22492647 {
22502648 makeSomething(new Camera());
22512649 } else
2252
- if (event.getSource() == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
22532651 {
22542652 group(new Composite());
22552653 } else
2256
- if (event.getSource() == randomItem)
2654
+ if (source == switchItem || source == switchButton)
22572655 {
22582656 RandomNode random = new RandomNode();
22592657 group(random);
22602658 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2659
+ random.name = random.get(0).name + "Switch";
22622660 } else
2263
- if (event.getSource() == physicsItem)
2661
+ if (source == physicsItem)
22642662 {
22652663 group(new PhysicsNode());
22662664 } else
2267
- if (event.getSource() == frameselectorItem)
2665
+ if (source == frameselectorItem)
22682666 {
22692667 for (int i=0; i<group.selection.size(); i++)
22702668 {
....@@ -2276,7 +2674,7 @@
22762674 ResetModel();
22772675 refreshContents();
22782676 } else
2279
- if (event.getSource() == switchGeoItem)
2677
+ if (source == switchGeoItem)
22802678 {
22812679 for (int i=0; i<group.selection.size(); i++)
22822680 {
....@@ -2288,7 +2686,7 @@
22882686 ResetModel();
22892687 refreshContents();
22902688 } else
2291
- if (event.getSource() == switchTransfoItem)
2689
+ if (source == switchTransfoItem)
22922690 {
22932691 for (int i=0; i<group.selection.size(); i++)
22942692 {
....@@ -2300,7 +2698,7 @@
23002698 ResetModel();
23012699 refreshContents();
23022700 } else
2303
- if (event.getSource() == morphItem)
2701
+ if (source == morphItem)
23042702 {
23052703 for (int i=0; i<group.selection.size(); i++)
23062704 {
....@@ -2312,7 +2710,7 @@
23122710 ResetModel();
23132711 refreshContents();
23142712 } else
2315
- if (event.getSource() == scriptNodeItem)
2713
+ if (source == scriptNodeItem)
23162714 {
23172715 boolean atleastone = false;
23182716
....@@ -2351,215 +2749,252 @@
23512749 }
23522750 }
23532751 } else
2354
- if (event.getSource() == linkerItem)
2752
+ if (source == linkerItem)
23552753 {
23562754 group(new cLinker());
23572755 } else
2358
- if (event.getSource() == textureItem)
2756
+ if (source == textureItem || source == textureButton)
23592757 {
23602758 group(new TextureNode());
23612759 } else
2362
- if (event.getSource() == billboardItem)
2760
+ if (source == billboardItem)
23632761 {
23642762 group(new BillboardNode());
23652763 } else
2366
- if (event.getSource() == shadowXItem)
2764
+ if (source == shadowXItem)
23672765 {
23682766 CastShadow(0);
23692767 } else
2370
- if (event.getSource() == shadowYItem)
2768
+ if (source == shadowYItem)
23712769 {
23722770 CastShadow(1);
23732771 } else
2374
- if (event.getSource() == shadowZItem)
2772
+ if (source == shadowZItem)
23752773 {
23762774 CastShadow(2);
23772775 } else
2378
- if (event.getSource() == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
23792777 {
2380
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
23812780 for (int i=0; i<group.selection.size(); i++)
23822781 {
2383
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
23842787 }
23852788
2386
- ClearSelection(false);
2387
-
2388
- refreshContents();
2789
+ if (!hasRoot)
2790
+ {
2791
+ for (int i=0; i<group.selection.size(); i++)
2792
+ {
2793
+ Ungroup(group.selection.get(i));
2794
+ }
2795
+
2796
+ ClearSelection(false);
2797
+
2798
+ refreshContents();
2799
+ }
23892800 } else
2390
- if (event.getSource() == genUVItem)
2801
+ if (source == genUVItem)
23912802 {
23922803 GenUV();
23932804 } else
2394
- if (event.getSource() == genNormalsCADItem)
2805
+ if (source == genNormalsCADItem)
23952806 {
23962807 GenNormals(true);
23972808 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2809
+ if (source == genNormalsMESHItem)
23992810 {
2400
- GenNormals(true); // TODO
2811
+ GenNormalsMESH();
24012812 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2813
+ if (source == genNormalsORGANItem)
24032814 {
24042815 GenNormals(false);
24052816 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2817
+ if (source == genNormalsMINEItem)
24072818 {
24082819 GenNormalsMINE();
24092820 } else
2410
- if (event.getSource() == stripifyItem)
2821
+ if (source == stripifyItem)
24112822 {
24122823 Stripify();
24132824 } else
2414
- if (event.getSource() == unstripifyItem)
2825
+ if (source == unstripifyItem)
24152826 {
24162827 Unstripify();
24172828 } else
2418
- if (event.getSource() == trimItem)
2829
+ if (source == trimItem)
24192830 {
24202831 Trim();
24212832 } else
2422
- if (event.getSource() == untrimItem)
2833
+ if (source == untrimItem)
24232834 {
24242835 Untrim();
24252836 } else
2426
- if (event.getSource() == clearColorsItem)
2837
+ if (source == clearColorsItem)
24272838 {
24282839 ClearColors();
24292840 } else
2430
- if (event.getSource() == clearMaterialsItem)
2841
+ if (source == clearMaterialsItem)
24312842 {
24322843 ClearMaterials();
24332844 } else
2434
- if (event.getSource() == liveleavesItem)
2845
+ if (source == liveleavesItem)
24352846 {
24362847 LiveLeaves(true);
24372848 } else
2438
- if (event.getSource() == unliveleavesItem)
2849
+ if (source == unliveleavesItem)
24392850 {
24402851 LiveLeaves(false);
24412852 } else
2442
- if (event.getSource() == supportleavesItem)
2853
+ if (source == supportleavesItem)
24432854 {
24442855 SupportLeaves(true);
24452856 } else
2446
- if (event.getSource() == unsupportleavesItem)
2857
+ if (source == unsupportleavesItem)
24472858 {
24482859 SupportLeaves(false);
24492860 } else
2450
- if (event.getSource() == hideleavesItem)
2861
+ if (source == hideleavesItem)
24512862 {
24522863 HideLeaves(true);
24532864 } else
2454
- if (event.getSource() == showleavesItem)
2865
+ if (source == showleavesItem)
24552866 {
24562867 HideLeaves(false);
24572868 } else
2458
- if (event.getSource() == markleavesItem)
2869
+ if (source == markleavesItem)
24592870 {
24602871 MarkLeaves(true);
24612872 } else
2462
- if (event.getSource() == unmarkleavesItem)
2873
+ if (source == unmarkleavesItem)
24632874 {
24642875 MarkLeaves(false);
24652876 } else
2466
- if (event.getSource() == flipVItem)
2877
+ if (source == rewindleavesItem)
2878
+ {
2879
+ RewindLeaves(true);
2880
+ } else
2881
+ if (source == unrewindleavesItem)
2882
+ {
2883
+ RewindLeaves(false);
2884
+ } else
2885
+ if (source == randomleavesItem)
2886
+ {
2887
+ RandomLeaves(true);
2888
+ } else
2889
+ if (source == unrandomleavesItem)
2890
+ {
2891
+ RandomLeaves(false);
2892
+ } else
2893
+ if (source == flipVItem)
24672894 {
24682895 FlipV(true);
24692896 } else
2470
- if (event.getSource() == unflipVItem)
2897
+ if (source == unflipVItem)
24712898 {
24722899 FlipV(false);
24732900 } else
2474
- if (event.getSource() == lowTexturesItem)
2901
+ if (source == lowTexturesItem)
24752902 {
24762903 SetTexRes(0);
24772904 } else
2478
- if (event.getSource() == normalTexturesItem)
2905
+ if (source == normalTexturesItem)
24792906 {
24802907 SetTexRes(1);
24812908 } else
2482
- if (event.getSource() == highTexturesItem)
2909
+ if (source == highTexturesItem)
24832910 {
24842911 SetTexRes(2);
24852912 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2913
+ if (source == veryhighTexturesItem)
24872914 {
24882915 SetTexRes(3);
24892916 } else
2490
- if (event.getSource() == maxTexturesItem)
2917
+ if (source == maxTexturesItem)
24912918 {
24922919 SetTexRes(4);
24932920 } else
2494
- if (event.getSource() == panoTexturesItem)
2921
+ if (source == panoTexturesItem)
24952922 {
24962923 SetTexRes(5);
24972924 } else
2498
- if (event.getSource() == reverseNormalsItem)
2925
+ if (source == reverseNormalsItem)
24992926 {
25002927 ReverseNormals();
25012928 } else
2502
- if (event.getSource() == parseverticesItem)
2929
+ if (source == parseverticesItem)
25032930 {
25042931 ParseVertices();
25052932 } else
2506
- if (event.getSource() == textureFieldItem)
2933
+ if (source == textureFieldItem)
25072934 {
25082935 TextureVertices();
25092936 } else
2510
- if (event.getSource() == alignItem)
2937
+ if (source == alignItem)
25112938 {
25122939 Align();
25132940 } else
2514
- if (event.getSource() == mirrorItem)
2941
+ if (source == mirrorItem)
25152942 {
25162943 MirrorPoses();
25172944 } else
2518
- if (event.getSource() == reduceMorphItem)
2945
+ if (source == reduceMorphItem)
25192946 {
25202947 MeshReduction(false);
25212948 } else
2522
- if (event.getSource() == reduce34MorphItem)
2949
+ if (source == reduce34MorphItem)
25232950 {
25242951 MeshReduction(true);
25252952 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2953
+ if (source == reverseTrianglesItem)
25272954 {
25282955 ReverseTriangles();
25292956 } else
2530
- if (event.getSource() == reduceMeshItem)
2957
+ if (source == reduceMeshItem)
25312958 {
25322959 ReduceMesh(false);
25332960 } else
2534
- if (event.getSource() == reduce34MeshItem)
2961
+ if (source == reduce34MeshItem)
25352962 {
25362963 ReduceMesh(true);
25372964 } else
2538
- if (event.getSource() == increaseMeshItem)
2965
+ if (source == increaseMeshItem)
25392966 {
25402967 IncreaseMesh();
25412968 } else
2542
- if (event.getSource() == clipMeshItem)
2969
+ if (source == clipMeshItem)
25432970 {
25442971 ClipMesh();
25452972 } else
2546
- if (event.getSource() == smoothMeshItem)
2973
+ if (source == smoothMeshItem)
25472974 {
25482975 SmoothMesh();
25492976 } else
2550
- if (event.getSource() == transformgeometryItem)
2977
+ if (source == transformGeometryItem)
25512978 {
25522979 TransformGeometry();
25532980 } else
2554
- if (event.getSource() == resetTransformItem)
2981
+ if (source == transformChildrenItem)
2982
+ {
2983
+ TransformChildren();
2984
+ } else
2985
+ if (source == resetTransformItem)
25552986 {
25562987 ResetTransform();
25572988 } else
2558
- if (event.getSource() == resetCentroidItem)
2989
+ if (source == resetCentroidItem)
25592990 {
2560
- ResetCentroid();
2991
+ ResetCentroid(true);
25612992 } else
2562
- if (event.getSource() == resetParentItem)
2993
+ if (source == resetCentroidXZItem)
2994
+ {
2995
+ ResetCentroid(false);
2996
+ } else
2997
+ if (source == resetParentItem)
25632998 {
25642999 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25653000 {
....@@ -2569,7 +3004,7 @@
25693004
25703005 refreshContents();
25713006 } else
2572
- if (event.getSource() == repairParentItem)
3007
+ if (source == repairParentItem)
25733008 {
25743009 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25753010 {
....@@ -2583,7 +3018,7 @@
25833018
25843019 refreshContents();
25853020 } else
2586
- if (event.getSource() == repairShadowItem)
3021
+ if (source == repairShadowItem)
25873022 {
25883023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25893024 {
....@@ -2597,7 +3032,7 @@
25973032
25983033 refreshContents();
25993034 } else
2600
- if (event.getSource() == sortbysizeItem)
3035
+ if (source == sortbysizeItem)
26013036 {
26023037 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26033038 {
....@@ -2609,7 +3044,7 @@
26093044 ResetModel();
26103045 refreshContents();
26113046 } else
2612
- if (event.getSource() == sortbynameItem)
3047
+ if (source == sortbynameItem)
26133048 {
26143049 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26153050 {
....@@ -2621,7 +3056,7 @@
26213056 ResetModel();
26223057 refreshContents();
26233058 } else
2624
- if (event.getSource() == attachPigmentItem)
3059
+ if (source == attachPigmentItem)
26253060 {
26263061 String texture = GetFile("Attach pigment");
26273062 Object3D obj;
....@@ -2633,7 +3068,7 @@
26333068
26343069 refreshContents();
26353070 } else
2636
- if (event.getSource() == detachPigmentItem)
3071
+ if (source == detachPigmentItem)
26373072 {
26383073 Object3D obj;
26393074 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +3079,7 @@
26443079
26453080 refreshContents();
26463081 } else
2647
- if (event.getSource() == attachBumpItem)
3082
+ if (source == attachBumpItem)
26483083 {
26493084 String texture = GetFile("Attach bump");
26503085 Object3D obj;
....@@ -2656,7 +3091,7 @@
26563091
26573092 refreshContents();
26583093 } else
2659
- if (event.getSource() == detachBumpItem)
3094
+ if (source == detachBumpItem)
26603095 {
26613096 Object3D obj;
26623097 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +3102,7 @@
26673102
26683103 refreshContents();
26693104 } else
2670
- if (event.getSource() == pigmentBumpItem)
3105
+ if (source == pigmentBumpItem)
26713106 {
26723107 Object3D obj;
26733108 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +3113,237 @@
26783113
26793114 refreshContents();
26803115 } else
2681
- if (event.getSource() == flashSelectionButton)
3116
+ if (source == flashSelectionButton)
26823117 {
26833118 CameraPane.flash = true;
26843119 refreshContents();
26853120 } else
2686
- if (event.getSource() == oneButton)
3121
+ if (source == oneButton)
26873122 {
26883123 } else
2689
- if (event.getSource() == twoButton)
3124
+ if (source == twoButton)
26903125 {
26913126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
26923131 // bug
26933132 //gridPanel.setDividerLocation(1.0);
26943133 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3134
+// bigThree.remove(scenePanel);
3135
+// bigThree.remove(centralPanel);
3136
+// bigThree.remove(XYZPanel);
3137
+// aWindowConstraints.gridx = 0;
3138
+// aWindowConstraints.gridy = 0;
3139
+// aWindowConstraints.gridwidth = 1;
3140
+// // aConstraints.gridheight = 3;
3141
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3142
+// aWindowConstraints.weightx = 0;
3143
+// aWindowConstraints.weighty = 1;
3144
+// //bigThree.add(jtp, aWindowConstraints);
3145
+// aWindowConstraints.weightx = 1;
3146
+// aWindowConstraints.gridwidth = 3;
3147
+// // aConstraints.gridheight = 3;
3148
+// aWindowConstraints.gridx = 1;
3149
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3150
+// bigThree.add(centralPanel, aWindowConstraints);
3151
+// aWindowConstraints.weightx = 0;
3152
+// aWindowConstraints.gridx = 4;
3153
+// aWindowConstraints.gridwidth = 1;
3154
+// // aConstraints.gridheight = 3;
3155
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3156
+// //bigThree.add(XYZPanel, aWindowConstraints);
3157
+// scenePanel.setVisible(false);
3158
+// centralPanel.setVisible(true);
3159
+// XYZPanel.setVisible(false);
3160
+ bigThree.ClearUI();
3161
+ bigThree.add(centralPanel);
3162
+ bigThree.FlushUI();
3163
+
3164
+ cameraView.requestFocusInWindow();
3165
+
3166
+// refreshContents(true);
3167
+//
3168
+// try
3169
+// {
3170
+// java.awt.Robot bot = new java.awt.Robot();
3171
+// int mask = InputEvent.BUTTON1_MASK;
3172
+// bot.mouseMove(100, 100);
3173
+// bot.mousePress(mask);
3174
+// bot.mouseRelease(mask);
3175
+// }
3176
+// catch (Exception e)
3177
+// {
3178
+//
3179
+// }
3180
+
27193181 } else
2720
- if (event.getSource() == threeButton)
3182
+ if (source == threeButton)
27213183 {
27223184 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
3188
+
3189
+// bigThree.remove(scenePanel);
3190
+// bigThree.remove(centralPanel);
3191
+// bigThree.remove(XYZPanel);
3192
+// aWindowConstraints.gridx = 0;
3193
+// aWindowConstraints.gridy = 0;
3194
+// aWindowConstraints.gridwidth = 1;
3195
+// // aConstraints.gridheight = 3;
3196
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3197
+// aWindowConstraints.weightx = 0;
3198
+// aWindowConstraints.weighty = 1;
3199
+// //bigThree.add(jtp, aWindowConstraints);
3200
+// aWindowConstraints.weightx = 1;
3201
+// aWindowConstraints.gridwidth = 3;
3202
+// // aConstraints.gridheight = 3;
3203
+// aWindowConstraints.gridx = 1;
3204
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3205
+// bigThree.add(centralPanel, aWindowConstraints);
3206
+// aWindowConstraints.weightx = 0;
3207
+// aWindowConstraints.gridx = 4;
3208
+// aWindowConstraints.gridwidth = 1;
3209
+// // aConstraints.gridheight = 3;
3210
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3211
+// bigThree.add(XYZPanel, aWindowConstraints);
3212
+// bigThree.validate();
3213
+// scenePanel.setVisible(false);
3214
+// centralPanel.setVisible(true);
3215
+// XYZPanel.setVisible(true);
3216
+ bigThree.ClearUI();
3217
+ bigThree.add(centralPanel);
3218
+ bigThree.add(XYZPanel);
3219
+ bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
27473222 } else
2748
- if (event.getSource() == fourButton)
3223
+ if (source == fourButton)
27493224 {
27503225 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
3229
+
3230
+// bigThree.remove(scenePanel);
3231
+// bigThree.remove(centralPanel);
3232
+// bigThree.remove(XYZPanel);
3233
+// aWindowConstraints.gridx = 0;
3234
+// aWindowConstraints.gridy = 0;
3235
+// aWindowConstraints.gridwidth = 1;
3236
+// // aWindowConstraints.gridheight = 3;
3237
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3238
+// aWindowConstraints.weightx = 1;
3239
+// aWindowConstraints.weighty = 1;
3240
+// bigThree.add(scenePanel, aWindowConstraints);
3241
+// aWindowConstraints.weightx = 1;
3242
+// aWindowConstraints.gridwidth = 3;
3243
+// // aConstraints.gridheight = 3;
3244
+// aWindowConstraints.gridx = 1;
3245
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3246
+// //bigThree.add(cameraPanel, aWindowConstraints);
3247
+// aWindowConstraints.weightx = 0;
3248
+// aWindowConstraints.gridx = 4;
3249
+// aWindowConstraints.gridwidth = 1;
3250
+// // aWindowConstraints.gridheight = 3;
3251
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3252
+// //bigThree.add(XYZPanel, aWindowConstraints);
3253
+// bigThree.validate();
3254
+// scenePanel.setVisible(true);
3255
+// centralPanel.setVisible(false);
3256
+// XYZPanel.setVisible(false);
3257
+ bigThree.ClearUI();
3258
+ bigThree.add(scenePanel);
3259
+ bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
27753262 } else
2776
- if (event.getSource() == sixButton)
3263
+ if (source == sixButton)
27773264 {
27783265 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
3269
+
3270
+// bigThree.remove(scenePanel);
3271
+// bigThree.remove(centralPanel);
3272
+// bigThree.remove(XYZPanel);
3273
+// aWindowConstraints.gridx = 0;
3274
+// aWindowConstraints.gridy = 0;
3275
+// aWindowConstraints.gridwidth = 1;
3276
+// // aConstraints.gridheight = 3;
3277
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3278
+// aWindowConstraints.weightx = 0;
3279
+// aWindowConstraints.weighty = 1;
3280
+// bigThree.add(scenePanel, aWindowConstraints);
3281
+// aWindowConstraints.weightx = 1;
3282
+// aWindowConstraints.gridwidth = 3;
3283
+// // aWindowConstraints.gridheight = 3;
3284
+// aWindowConstraints.gridx = 1;
3285
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3286
+// bigThree.add(centralPanel, aWindowConstraints);
3287
+// aWindowConstraints.weightx = 0;
3288
+// aWindowConstraints.gridx = 4;
3289
+// aWindowConstraints.gridwidth = 1;
3290
+// // aWindowConstraints.gridheight = 3;
3291
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3292
+// //bigThree.add(XYZPanel, aConstraints);
3293
+// bigThree.validate();
3294
+// scenePanel.setVisible(true);
3295
+// centralPanel.setVisible(true);
3296
+// XYZPanel.setVisible(false);
3297
+ bigThree.ClearUI();
3298
+ bigThree.add(scenePanel);
3299
+ bigThree.add(centralPanel);
3300
+ bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
28033303 } else
2804
- if (event.getSource() == sevenButton)
3304
+ if (source == sevenButton)
28053305 {
28063306 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
3310
+
3311
+// bigThree.remove(scenePanel);
3312
+// bigThree.remove(centralPanel);
3313
+// bigThree.remove(XYZPanel);
3314
+// aWindowConstraints.gridx = 0;
3315
+// aWindowConstraints.gridy = 0;
3316
+// aWindowConstraints.gridwidth = 1;
3317
+// // aWindowConstraints.gridheight = 3;
3318
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3319
+// aWindowConstraints.weightx = 0;
3320
+// aWindowConstraints.weighty = 1;
3321
+// bigThree.add(scenePanel, aWindowConstraints);
3322
+// aWindowConstraints.weightx = 1;
3323
+// aWindowConstraints.gridwidth = 3;
3324
+// // aWindowConstraints.gridheight = 3;
3325
+// aWindowConstraints.gridx = 1;
3326
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3327
+// bigThree.add(centralPanel, aWindowConstraints);
3328
+// aWindowConstraints.weightx = 0;
3329
+// aWindowConstraints.gridx = 4;
3330
+// aWindowConstraints.gridwidth = 1;
3331
+// // aConstraints.gridheight = 3;
3332
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3333
+// bigThree.add(XYZPanel, aWindowConstraints);
3334
+// bigThree.validate();
3335
+// scenePanel.setVisible(true);
3336
+// centralPanel.setVisible(true);
3337
+// XYZPanel.setVisible(true);
3338
+ bigThree.ClearUI();
3339
+ bigThree.add(scenePanel);
3340
+ bigThree.add(centralPanel);
3341
+ bigThree.add(XYZPanel);
3342
+ bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
28313345 } else
2832
- if (event.getSource() == rootButton)
3346
+ if (source == rootButton)
28333347 {
28343348 Object3D obj;
28353349 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2839,66 +3353,84 @@
28393353 EditObject(obj);
28403354 }
28413355
3356
+ cameraView.requestFocusInWindow();
28423357 refreshContents(true);
28433358 } else
2844
- if (event.getSource() == closeButton)
3359
+ if (source == closeButton)
28453360 {
28463361 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28473362 cRadio ab;
28483363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28493364 {
28503365 ab = (cRadio)e.nextElement();
2851
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28523367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
28533374 buttonGroup.remove(ab);
28543375 radioPanel.remove(ab);
28553376
2856
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
28573379 // ab.GetObject().objectUI = null; // ?????????
28583380
28593381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28603382 break;
28613383 }
28623384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
28633387 refreshContents(true);
28643388 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
3389
+ if (source == editItem || source == editButton)
28663390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
28673397 EditSelection(false);
28683398 } else
2869
- if (event.getSource() == uneditButton)
3399
+ if (source == uneditButton)
28703400 {
28713401 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28723402 {
28733403 Object3D child = (Object3D)e.nextElement();
28743404 if(child.editWindow != null)
28753405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
28763407 child.CloseUI();
28773408 listUI.remove(child);
28783409
2879
- child.editWindow = null; // ???????????
3410
+ //child.editWindow = null; // ???????????
28803411 }
2881
- objEditor.ctrlPanel.revalidate();
3412
+ objEditor.ctrlPanel.FlushUI();
28823413 //objEditor.jTree.clearSelection();
28833414 //objEditor.ResetSliders();
28843415 refreshContents(true);
28853416 } else
2886
- if (event.getSource() == clearPanelButton)
3417
+ if (source == clearPanelButton)
28873418 {
28883419 assert(copy == group);
28893420 //copy.ClearUI();
28903421 for (Object3D obj : listUI)
28913422 {
3423
+ obj.pinned = false;
28923424 obj.CloseUI();
28933425 }
28943426 listUI.clear();
28953427 refreshContents(true);
28963428 } else
2897
- if (event.getSource() == allParamsButton)
3429
+ if (source == allParamsButton)
28983430 {
28993431 assert(copy == group);
29003432
2901
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29023434
29033435 for (Object3D obj : listUI)
29043436 {
....@@ -2915,19 +3447,19 @@
29153447
29163448 refreshContents(true);
29173449 } else
2918
- if (event.getSource() == unselectButton)
3450
+ if (source == unselectButton)
29193451 {
29203452 objEditor.jTree.clearSelection();
29213453 // ?? oct 2012 GrafreeD.clipboard.clear();
29223454 objEditor.ResetSliders();
29233455 refreshContents(true);
29243456 } else
2925
- if(event.getSource() instanceof cRadio)
3457
+ if(source instanceof cRadio)
29263458 {
29273459 group.parent = keepparent;
29283460 group.attributes = 0;
29293461 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3462
+ /*cRadio*/ radio = (cRadio)source;
29313463 Object3D obj = radio.GetObject();
29323464 System.out.println("Edit " + obj);
29333465 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,20 +3494,44 @@
29623494 frontView.object = group;
29633495 sideView.object = group;
29643496 }
2965
- group.editWindow = this;
3497
+
3498
+// fix "+" issue
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
3501
+
29663502 /*
29673503 currentLayout = radio.layout;
29683504 if (currentLayout == null)
29693505 currentLayout = sevenButton;
29703506 */
29713507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
29723513 keepparent = group.parent;
29733514 // PARENT = NULL or not???
29743515 //group.parent = null; // ROOT
29753516 //group.attributes = -1;
29763517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
29773520 refreshContents(true);
2978
- }
3521
+ } else if (event.getSource() == editCameraItem)
3522
+ {
3523
+ cameraView.ProtectCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3527
+ {
3528
+ cameraView.RevertCamera();
3529
+ cameraView.repaint();
3530
+ return;
3531
+ // } else if (event.getSource() == textureButton)
3532
+ // {
3533
+ // return; // true;
3534
+ }
29793535 else
29803536 {
29813537 //return super.action(event, arg);
....@@ -2984,7 +3540,6 @@
29843540 }
29853541
29863542 boolean useclient = false;
2987
- cRadio radio;
29883543
29893544 void ToggleRoot()
29903545 {
....@@ -3036,6 +3591,28 @@
30363591 refreshContents();
30373592 }
30383593
3594
+ void TransformChildren()
3595
+ {
3596
+ Object3D obj;
3597
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3598
+ {
3599
+ obj = (Object3D)e.nextElement();
3600
+ obj.KeepTextureMatrices();
3601
+ obj.TransformChildren();
3602
+ obj.RestoreTextureMatrices();
3603
+
3604
+// if (obj.parent == null)
3605
+// {
3606
+// System.out.println("NULL PARENT!");
3607
+// new Exception().printStackTrace();
3608
+// }
3609
+// else
3610
+// TouchTransform(obj);
3611
+// //obj.parent.Touch();
3612
+ }
3613
+
3614
+ refreshContents();
3615
+ }
30393616
30403617 void ResetTransform()
30413618 {
....@@ -3148,7 +3725,7 @@
31483725 refreshContents();
31493726 }
31503727
3151
- void ResetCentroid()
3728
+ void ResetCentroid(boolean full)
31523729 {
31533730 Object3D obj;
31543731 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3740,16 @@
31633740 LA.matIdentity(Object3D.mat);
31643741 obj.getBounds(minima, maxima, false);
31653742 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3743
+ if (full)
3744
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673745 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683746 obj.TransformMesh(Object3D.mat);
3747
+
31693748 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3749
+ if (full)
3750
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713751 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3752
+
31723753 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733754 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743755 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,7 +3778,8 @@
31973778
31983779 int size = obj.MemorySize();
31993780
3200
- System.err.println((size/1024) + " KB is the size of " + obj);
3781
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3782
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32013783 }
32023784 }
32033785 catch (Exception e)
....@@ -3234,9 +3816,9 @@
32343816 obj = (Object3D)e.nextElement();
32353817
32363818 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3819
+ Grafreed.AnalyzeObject(obj);
32383820 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3821
+ Grafreed.AnalyzeObject(obj.bRep);
32403822
32413823 // System.err.println((size/1024) + " KB is the size of " + obj);
32423824 }
....@@ -3278,6 +3860,13 @@
32783860 void GenNormals(boolean crease)
32793861 {
32803862 group.GenNormalsS(crease);
3863
+
3864
+ refreshContents();
3865
+ }
3866
+
3867
+ void GenNormalsMESH()
3868
+ {
3869
+ group.GenNormalsMeshS();
32813870
32823871 refreshContents();
32833872 }
....@@ -3450,8 +4039,8 @@
34504039
34514040 void ParseVertices()
34524041 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
4042
+ boolean epsequal = Grafreed.epsequal;
4043
+ Grafreed.epsequal = true;
34554044
34564045 for (int i=0; i<group.selection.size(); i++)
34574046 {
....@@ -3476,7 +4065,7 @@
34764065 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34774066 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34784067
3479
- g.add(GrafreeD.clipboard);
4068
+ g.add(Grafreed.clipboard);
34804069
34814070 buffer.add(g);
34824071 }
....@@ -3491,7 +4080,7 @@
34914080 makeSomething(buffer, i==group.selection.size()-1);
34924081 }
34934082
3494
- GrafreeD.epsequal = epsequal;
4083
+ Grafreed.epsequal = epsequal;
34954084
34964085 refreshContents();
34974086 }
....@@ -3509,7 +4098,16 @@
35094098 String pigment = Object3D.GetPigment(tex);
35104099 //String bump = Object3D.GetBump(tex);
35114100
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4101
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4102
+
4103
+ try
4104
+ {
4105
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4106
+ }
4107
+ catch (Exception e)
4108
+ {
4109
+ System.err.println("FAIL: " + node);
4110
+ }
35134111
35144112 double s = v.s;
35154113
....@@ -3597,11 +4195,11 @@
35974195
35984196 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35994197
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
4198
+ boolean random = CameraPane.SWITCH;
4199
+ CameraPane.SWITCH = false; // parse all random nodes
36024200 lowres.linkVerticesThis(null);
36034201 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
4202
+ CameraPane.SWITCH = random;
36054203
36064204 System.err.flush();
36074205
....@@ -3641,7 +4239,7 @@
36414239 return;
36424240
36434241 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
4242
+ Object3D ref = Grafreed.clipboard.get(0);
36454243
36464244 Object3D newgroup = new Object3D("Po:" + poses.name);
36474245
....@@ -3835,9 +4433,9 @@
38354433
38364434 void ClipMesh()
38374435 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4436
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38394437 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
4438
+ Object3D content = Grafreed.clipboard.get(0);
38414439
38424440 if (content instanceof cGroup && ((cGroup)content).transientlink )
38434441 content = ((cGroup)content).get(0);
....@@ -3846,7 +4444,7 @@
38464444 // {
38474445 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484446 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4447
+ group.selection.ClipMesh(Grafreed.clipboard);
38504448 }
38514449 // group.selection.ClipMesh(GrafreeD.clipboard);
38524450 System.out.println("DONE.");
....@@ -3893,6 +4491,18 @@
38934491 void MarkLeaves(boolean hide)
38944492 {
38954493 group.selection.MarkLeaves(hide);
4494
+ refreshContents();
4495
+ }
4496
+
4497
+ void RewindLeaves(boolean hide)
4498
+ {
4499
+ group.selection.RewindLeaves(hide);
4500
+ refreshContents();
4501
+ }
4502
+
4503
+ void RandomLeaves(boolean hide)
4504
+ {
4505
+ group.selection.RandomLeaves(hide);
38964506 refreshContents();
38974507 }
38984508
....@@ -3967,10 +4577,6 @@
39674577 // }
39684578 // }
39694579
3970
- static boolean allparams = true;
3971
-
3972
- static Vector<Object3D> listUI = new Vector<Object3D>();
3973
-
39744580 void EditSelection(boolean newWindow)
39754581 {
39764582 // aConstraints.gridy = 0;
....@@ -3978,10 +4584,10 @@
39784584 {
39794585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39804586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3981
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824588
39834589 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4590
+ if(elem != group || !newWindow)
39854591 {
39864592 // if (!(elem instanceof Composite))
39874593 // newWindow = false;
....@@ -4063,7 +4669,8 @@
40634669 //new Exception().printStackTrace();
40644670
40654671 freezemodel = true;
4066
-
4672
+ ClearUnpinned();
4673
+
40674674 /**/
40684675 //switch (event.id)
40694676 {
....@@ -4071,7 +4678,6 @@
40714678 //case 702: // Event.LIST_DESELECT
40724679 group.deselectAll();
40734680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4074
- objEditor.ClearInfo(); // .GetMaterial());
40754681 if (tps != null)
40764682 {
40774683 for (int i=0; i < tps.length; i++)
....@@ -4080,33 +4686,39 @@
40804686
40814687 //if (child.parent != null)
40824688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
40834690 group.addSelectee(child);
4084
- objEditor.SetMaterial(child); // .GetMaterial());
4085
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4086
- System.err.println("info : " + child.GetPath());
40874691 }
40884692 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4693
+// else
4694
+// {
4695
+// objEditor.SetMaterial(group); // .GetMaterial());
4696
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4697
+// System.err.println("info : " + group.GetPath());
4698
+// }
40954699
4096
- objEditor.SetText(); // jan 2014
4097
-
4098
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4700
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40994701 CameraPane.flash = true;
41004702
4101
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4703
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41024704 // a camera
41034705 {
4104
- CameraPane.camerachangeframe = 0; // don't refuse it
4105
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4706
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4707
+ {
4708
+ CameraPane.camerachangeframe = 0; // don't refuse it
4709
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4710
+ }
41064711 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41074712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41084713 }
41094714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
41104722 refreshContents();
41114723 //return true;
41124724 }
....@@ -4115,6 +4727,35 @@
41154727
41164728 freezemodel = false;
41174729 }
4730
+
4731
+ void SetPinStates(boolean enabled)
4732
+ {
4733
+ editButton.setEnabled(enabled);
4734
+ uneditButton.setEnabled(enabled);
4735
+ unselectButton.setEnabled(enabled);
4736
+ flashSelectionButton.setEnabled(enabled);
4737
+ }
4738
+
4739
+ void refreshContents(boolean cp)
4740
+ {
4741
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4742
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4743
+ {
4744
+ objEditor.ClearInfo(); // .GetMaterial());
4745
+
4746
+ for (int i=0; i < group.selection.Size(); i++)
4747
+ {
4748
+ Object3D child = (Object3D) group.selection.get(i);
4749
+
4750
+ objEditor.AddInfo(child, this, true);
4751
+ System.err.println("info : " + child.GetPath());
4752
+ }
4753
+
4754
+ objEditor.SetText(); // jan 2014
4755
+ }
4756
+
4757
+ super.refreshContents(cp);
4758
+ }
41184759
41194760 void linkSomething(Object3D thing)
41204761 {
....@@ -4186,16 +4827,19 @@
41864827 {
41874828 if (group.selection.isEmpty())
41884829 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4830
+
4831
+ Grafreed.clipboardIsTempGroup = false;
41904832 Composite tGroup = null;
41914833 if (group.selection.size() > 0) // 1)
41924834 {
41934835 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4836
+ Grafreed.clipboardIsTempGroup = true;
41954837 }
41964838
41974839 if (cut)
41984840 {
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
41994843 //int indices[] = jList.getSelectedIndices();
42004844 //for (int i = indices.length - 1; i >= 0; i--)
42014845 //jList.remove(indices[i]);
....@@ -4231,16 +4875,16 @@
42314875 //System.out.println("cut " + child);
42324876 //System.out.println("parent = " + child.parent);
42334877 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4878
+ if (Grafreed.clipboardIsTempGroup)
42354879 tGroup.add/*Child*/(tmp);
42364880 else
4237
- GrafreeD.clipboard = tmp;
4881
+ Grafreed.clipboard = tmp;
42384882 }
42394883 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4884
+ if (Grafreed.clipboardIsTempGroup)
42414885 tGroup.add/*Child*/(child);
42424886 else
4243
- GrafreeD.clipboard = child;
4887
+ Grafreed.clipboard = child;
42444888 }
42454889
42464890 //ResetModel();
....@@ -4272,21 +4916,23 @@
42724916 //System.out.println("cut " + elem);
42734917 //System.out.println("parent = " + elem.parent);
42744918 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4919
+ if (Grafreed.clipboardIsTempGroup)
42764920 tGroup.add/*Child*/(tmp);
42774921 else
4278
- GrafreeD.clipboard = tmp;
4922
+ Grafreed.clipboard = tmp;
42794923 }
42804924 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4925
+ if (Grafreed.clipboardIsTempGroup)
42824926 tGroup.add/*Child*/(child);
42834927 else
4284
- GrafreeD.clipboard = child;
4928
+ Grafreed.clipboard = child;
42854929 }
42864930
42874931 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4932
+
4933
+ if (Grafreed.clipboardIsTempGroup)
4934
+ Grafreed.clipboard = tGroup;
4935
+
42904936 if (cut)
42914937 {
42924938 ResetModel();
....@@ -4296,11 +4942,15 @@
42964942
42974943 void paste(boolean expand)
42984944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
42994949 // if (GrafreeD.clipboard == null)
43004950 // return;
43014951 boolean first = true;
43024952
4303
- if (GrafreeD.clipboardIsTempGroup)
4953
+ if (Grafreed.clipboardIsTempGroup)
43044954 {
43054955 Composite temp;
43064956
....@@ -4311,7 +4961,7 @@
43114961 temp = (Composite)Applet3D.clipboard.deepCopy();
43124962 */
43134963 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4964
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154965 {
43164966 Object3D child = (Object3D)e.nextElement();
43174967
....@@ -4345,21 +4995,22 @@
43454995 //Object3D cb = Applet3D.clipboard;
43464996 //temp.addChild(cb);
43474997 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4998
+ assert(Grafreed.clipboard.parent == null);
4999
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5000
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5001
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5002
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43535003 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
5004
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5005
+ Grafreed.clipboard.get(0).parent = keepparent;
43565006 }
43575007
5008
+ Globals.SAVEONMAKE = keep;
43585009 ResetModel();
43595010 refreshContents();
43605011 }
43615012
4362
- void pasteInto(boolean copyit)
5013
+ void pasteInto(boolean copyit, boolean clone)
43635014 {
43645015 // if (GrafreeD.clipboard == null)
43655016 // return;
....@@ -4388,15 +5039,22 @@
43885039 if (copyit)
43895040 {
43905041 // paste(false);
4391
- CloneClipboard(false); // sept 2014
5042
+ if (clone)
5043
+ {
5044
+ CloneClipboard(false); // sept 2014
5045
+ }
5046
+ else
5047
+ {
5048
+ paste(false);
5049
+ }
43925050 }
43935051 else
43945052 {
43955053 boolean first = true;
43965054
4397
- if (GrafreeD.clipboardIsTempGroup)
5055
+ if (Grafreed.clipboardIsTempGroup)
43985056 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
5057
+ Composite temp = (Composite)Grafreed.clipboard;
44005058 Object3D copy;
44015059 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44025060 {
....@@ -4406,7 +5064,7 @@
44065064 }
44075065 } else
44085066 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
5067
+ linkSomething(Grafreed.clipboard); //.get(0));
44105068 }
44115069 }
44125070 }
....@@ -4483,6 +5141,10 @@
44835141
44845142 void group(Object3D csg, boolean grab)
44855143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
44865148 if (//false) // why??
44875149 !group.selection.isEmpty())
44885150 {
....@@ -4596,10 +5258,15 @@
45965258 //node.add(csg);
45975259 //makeSomething(node);
45985260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
45995262 }
46005263
46015264 void Ungroup(Object3D g)
46025265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
46035270 if (g instanceof HiddenObject)
46045271 {
46055272 HiddenObject h = (HiddenObject) g;
....@@ -4616,6 +5283,7 @@
46165283 objEditor.makeSomething(g.get(i), false);
46175284 }
46185285 }
5286
+ Globals.SAVEONMAKE = keep;
46195287 }
46205288
46215289 void ungroup()
....@@ -4811,21 +5479,6 @@
48115479 }
48125480 */
48135481
4814
- void ImportGFD()
4815
- {
4816
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4817
- browser.show();
4818
- String filename = browser.getFile();
4819
- if (filename != null && filename.length() > 0)
4820
- {
4821
- String fullname = browser.getDirectory() + filename;
4822
-
4823
- //Object3D readobj =
4824
- objEditor.ReadGFD(fullname, objEditor);
4825
- //makeSomething(readobj);
4826
- }
4827
- }
4828
-
48295482 /*
48305483 public void Callback(Object obj)
48315484 {
....@@ -4849,26 +5502,9 @@
48495502 }
48505503 */
48515504
4852
- void ImportVRMLX3D()
4853
- {
4854
- if (GrafreeD.standAlone)
4855
- {
4856
- /**/
4857
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4858
- browser.show();
4859
- String filename = browser.getFile();
4860
- if (filename != null && filename.length() > 0)
4861
- {
4862
- String fullname = browser.getDirectory() + filename;
4863
- LoadVRMLX3D(fullname);
4864
- }
4865
- /**/
4866
- }
4867
- }
4868
-
48695505 String GetFile(String dialogName)
48705506 {
4871
- if (GrafreeD.standAlone)
5507
+ if (Grafreed.standAlone)
48725508 {
48735509 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745510 browser.show();
....@@ -4932,10 +5568,33 @@
49325568 cButton flashSelectionButton;
49335569 cButton editButton;
49345570 cButton uneditButton;
5571
+ JCheckBox allParamsButton;
49355572 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375573 cButton unselectButton;
49385574
5575
+ cButton restoreCameraButton;
5576
+
5577
+ cButton saveButton;
5578
+ cButton oneStepButton;
5579
+
5580
+ cButton groupButton;
5581
+ cButton ungroupButton;
5582
+ cButton compositeButton;
5583
+ cButton switchButton;
5584
+ cButton loopButton;
5585
+ cButton textureButton;
5586
+
5587
+ cButton gridButton;
5588
+ cButton boxButton;
5589
+ cButton sphereButton;
5590
+ cButton coneButton;
5591
+ cButton torusButton;
5592
+ cButton superButton;
5593
+ cButton kleinButton;
5594
+ cButton particlesButton;
5595
+ cButton overlayButton;
5596
+ cButton lightButton;
5597
+
49395598 cButton screenfitButton;
49405599 cButton screenfitpointButton;
49415600 cButton snapobjectButton;
....@@ -4947,14 +5606,6 @@
49475606
49485607 cButton setsupportButton;
49495608
4950
- cButton twoButton;
4951
- cButton sixButton;
4952
- cButton threeButton;
4953
- cButton sevenButton;
4954
- cButton fourButton; // full panel
4955
- cButton oneButton; // full XYZ
4956
- //cButton currentLayout;
4957
-
49585609 //
49595610 //Composite
49605611 Object3D // to do !!
....@@ -4964,9 +5615,11 @@
49645615 //JTree jTree;
49655616 private MenuItem lookAtItem;
49665617 private MenuItem lookFromItem;
4967
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
49685619 private MenuItem cutItem;
4969
- private MenuItem duplicateItem;
5620
+ private MenuItem undoItem;
5621
+ private MenuItem redoItem;
5622
+ private JMenuItem duplicateItem;
49705623 private MenuItem cloneItem;
49715624 private MenuItem cloneSupportItem;
49725625 private MenuItem overwriteGeoItem;
....@@ -4979,7 +5632,7 @@
49795632 private MenuItem linkverticesItem;
49805633 private MenuItem relinkverticesItem;
49815634 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5635
+ private MenuItem resetAllItem;
49835636 private MenuItem stepAllItem;
49845637 private MenuItem revertMeshItem;
49855638 private MenuItem poseMeshItem;
....@@ -4990,6 +5643,7 @@
49905643 private MenuItem mergeGeometriesItem;
49915644 private MenuItem copyItem;
49925645 private MenuItem pasteItem;
5646
+ private MenuItem pasteIntoItem;
49935647 private MenuItem pasteLinkItem;
49945648 private MenuItem pasteCloneItem;
49955649 private MenuItem pasteExpandItem;
....@@ -5028,6 +5682,10 @@
50285682 private MenuItem showleavesItem;
50295683 private MenuItem markleavesItem;
50305684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
50315689
50325690 private MenuItem flipVItem;
50335691 private MenuItem unflipVItem;
....@@ -5039,15 +5697,17 @@
50395697 private MenuItem panoTexturesItem;
50405698
50415699 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5700
+ private MenuItem resetCentroidXZItem;
50435701 private MenuItem resetTransformItem;
5702
+ private MenuItem transformGeometryItem;
5703
+ private MenuItem transformChildrenItem;
50445704 private MenuItem hideItem;
50455705 private MenuItem grabItem;
50465706 private MenuItem backItem;
50475707 private MenuItem frontItem;
50485708 private MenuItem cameraItem;
50495709 private MenuItem compositeItem;
5050
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
50515711 private MenuItem physicsItem;
50525712 private MenuItem frameselectorItem;
50535713 private MenuItem scriptNodeItem;
....@@ -5087,7 +5747,7 @@
50875747 private MenuItem blobItem;
50885748 private MenuItem latheItem;
50895749 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5750
+ private MenuItem overlayItem;
50915751 private MenuItem meshItem;
50925752 // private MenuItem meshGroupItem;
50935753 private MenuItem springItem;
....@@ -5109,11 +5769,6 @@
51095769 private MenuItem doubleItem;
51105770 private MenuItem tripleItem;
51115771
5112
- private MenuItem importGFDItem;
5113
- private MenuItem importVRMLX3DItem;
5114
- private MenuItem import3DSItem;
5115
- private MenuItem importOBJItem;
5116
-
51175772 private MenuItem computeAOItem;
51185773 private MenuItem recompileItem;
51195774 private MenuItem editScriptItem;
....@@ -5123,4 +5778,8 @@
51235778 private MenuItem analyzeItem;
51245779 private MenuItem dumpItem;
51255780 //boolean freezemodel = false;
5781
+
5782
+ Menu cameraMenu;
5783
+ MenuItem editCameraItem;
5784
+ MenuItem restoreCameraItem;
51265785 }