Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
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,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,31 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
222246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
224251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225252 setMasterItem.addActionListener(this);
253
+ }
226254
227255 oe.menuBar.add(menu = new Menu("Group"));
228256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +261,32 @@
233261 frontItem.addActionListener(this);
234262 compositeItem = menu.add(new MenuItem("Composite"));
235263 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237265 hideItem.addActionListener(this);
238266 ungroupItem = menu.add(new MenuItem("Ungroup"));
239267 ungroupItem.addActionListener(this);
240268 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
242270 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);
247271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248272 switchGeoItem.addActionListener(this);
249273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250274 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
252276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
253285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254286 scriptNodeItem.addActionListener(this);
255287 cameraItem = menu.add(new MenuItem("Camera"));
256288 cameraItem.addActionListener(this);
289
+ }
257290
258291 oe.menuBar.add(menu = new Menu("Object"));
259292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,14 +301,18 @@
268301 shadowYItem.addActionListener(this);
269302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
271307 linkerItem = menu.add(new MenuItem("Linker"));
272308 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275309 attributeItem = menu.add(new MenuItem("Attribute"));
276310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
277313 pointflowItem = menu.add(new MenuItem("Point Flow"));
278314 pointflowItem.addActionListener(this);
315
+ }
279316 menu.add("-");
280317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281318 resetTransformItem.addActionListener(this);
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +356,14 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +373,13 @@
329373 liveleavesItem.addActionListener(this);
330374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
332378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333379 supportleavesItem.addActionListener(this);
334380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335381 unsupportleavesItem.addActionListener(this);
382
+ }
336383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337384 hideleavesItem.addActionListener(this);
338385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +422,8 @@
375422 sortbysizeItem.addActionListener(this);
376423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
378427 menu.add("-");
379428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380429 extractGeometriesItem.addActionListener(this);
....@@ -384,20 +433,23 @@
384433 shareGeometriesItem.addActionListener(this);
385434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386435 mergeGeometriesItem.addActionListener(this);
436
+ }
387437
388438 oe.menuBar.add(menu = new Menu("Insert"));
389439 buildCreateMenu(menu);
390440
391
-
392441 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..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398443 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
401453
402454 oe.menuBar.add(menu = new Menu("Tools"));
403455 buildToolsMenu(menu);
....@@ -433,110 +485,98 @@
433485 oe.radioPanel.add(dummyButton);
434486 oe.buttonGroup.add(dummyButton);
435487 */
436
- aConstraints.gridy += 1;
437
-
438488 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439489
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444491 liveCB.setToolTipText("Enabled animation");
445492 liveCB.addItemListener(this);
446493
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
500
+ fastCB.addItemListener(this);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449503 trackCB.setToolTipText("Enable tracking");
450504 trackCB.addItemListener(this);
451505
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454507 screenfitButton.setToolTipText("Screen fit");
455508 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
509
+
457510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458511 // 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;
464512
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);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471521 flashSelectionButton.setToolTipText("Show selection");
472522 flashSelectionButton.addActionListener(this);
473523
474
- oe.toolbarPanel.add(new cButton(" ", false));
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475525
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);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482527 twoButton.setToolTipText("Show center view only");
483528 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485530 fourButton.addActionListener(this);
486531 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488533 sixButton.setToolTipText("2-column layout left");
489534 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491536 threeButton.setToolTipText("2-column layout right");
492537 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494539 sevenButton.setToolTipText("3-column layout");
495540 sevenButton.addActionListener(this);
496541 //
497542
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
500545 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503548 closeButton.setToolTipText("Close tab");
504549 closeButton.addActionListener(this);
505550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506551 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508552
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
511557 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515558
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
517561 uneditButton.addActionListener(this);
518562
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);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
531565 allParamsButton.addActionListener(this);
532566
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);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
538573 unselectButton.addActionListener(this);
539574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
540580 // oe.aConstraints.gridx += 1;
541581 // oe.aConstraints.weighty = 0;
542582 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +588,37 @@
548588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549589 // gcButton.addActionListener(this);
550590
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;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
562594 //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);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564596 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
569600
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);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
574605 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
577609 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
580613 textureCB.addItemListener(this);
581614
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
584618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
585622 //jList.addListSelectionListener(this);
586623 oe.jTree.addTreeSelectionListener(this);
587624 //jTree.setRootVisible(false);
....@@ -604,45 +641,37 @@
604641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605642 }
606643
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608645 {
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);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639647 boxCB.setToolTipText("Display bounding boxes");
640648 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643651 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644652 zoomBoxCB.addItemListener(this);
645653
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
646675 // constraints.gridy += 1;
647676 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648677 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +679,16 @@
650679 if (false)
651680 {
652681 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655684 speakerCameraCB.addItemListener(this);
656685
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659688 speakerFocusCB.addItemListener(this);
660689
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663692 smoothfocusCB.addItemListener(this);
664693 }
665694
....@@ -667,14 +696,20 @@
667696 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668697 // debugCB.addItemListener(this);
669698
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672700 oeilCB.addItemListener(this);
673701
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676703 lookAtCB.setToolTipText("Look-at target");
677704 lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
678713
679714 }
680715
....@@ -959,11 +994,11 @@
959994 {
960995 loadClipboard(true);
961996 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
997
+ pasteInto(false, false);
963998 } else {
964999 loadClipboard(false);
9651000 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9671002 }
9681003 }
9691004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1120,33 @@
10851120 kleinItem.addActionListener(this);
10861121 particleItem = menu.add(new MenuItem("Particle system"));
10871122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10881125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891126 ragdollItem.addActionListener(this);
10901127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911128 ragdoll2Item.addActionListener(this);
1129
+ }
10921130 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941132 meshItem.addActionListener(this);
10951133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10971137 springItem = menu.add(new MenuItem("Spring"));
10981138 springItem.addActionListener(this);
10991139 flagItem = menu.add(new MenuItem("Flag"));
11001140 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);
11051141 blobItem = menu.add(new MenuItem("Blob"));
11061142 blobItem.addActionListener(this);
11071143 latheItem = menu.add(new MenuItem("Lathe"));
11081144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
11091150 lightItem = menu.add(new MenuItem("Light"));
11101151 lightItem.addActionListener(this);
11111152 menu.add("-");
....@@ -1115,34 +1156,39 @@
11151156 loopItem.addActionListener(this);
11161157 doubleItem = menu.add(new MenuItem("Fork"));
11171158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
11181161 tripleItem = menu.add(new MenuItem("Trident"));
11191162 tripleItem.addActionListener(this);
1163
+ }
11201164 }
11211165
11221166 void buildToolsMenu(Menu menu)
11231167 {
11241168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251169 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
11271171
11281172 menu.add("-");
11291173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301174 parseverticesItem.addActionListener(this);
11311175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321176 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341178 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381180 reduceMorphItem.addActionListener(this);
11391181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401182 reduce34MorphItem.addActionListener(this);
1141
-
1183
+ menu.add("-");
11421184 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431185 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
11461192 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471193 memoryItem.addActionListener(this);
11481194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1211,7 @@
11651211 menu.add("-");
11661212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671213 editScriptItem.addActionListener(this);
1214
+ }
11681215 }
11691216
11701217 void ScreenFit()
....@@ -1518,6 +1565,7 @@
15181565 //
15191566 public void actionPerformed(ActionEvent event) // , Object arg)
15201567 {
1568
+ Object source = event.getSource();
15211569 /*
15221570 if (event.getSource() == nameField)
15231571 {
....@@ -1529,11 +1577,11 @@
15291577 }
15301578 else
15311579 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
15331581 {
15341582 ScreenFit();
15351583 } else
1536
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
15371585 {
15381586 cVector v1 = new cVector();
15391587 cVector v2 = new cVector();
....@@ -1542,11 +1590,11 @@
15421590 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431591 objEditor.cameraView.repaint();
15441592 } else
1545
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
15461594 {
15471595 makeSomething(new Box());
15481596 } else
1549
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
15501598 {
15511599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1615,9 @@
15671615 applyExample(particleGeom, "SMOKE");
15681616 makeSomething(particleGeom);
15691617 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15711619 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731621
15741622 ragdoll.toParent = LA.newMatrix();
15751623 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1635,7 @@
15871635 } else
15881636 /*
15891637 */
1590
- if (event.getSource() == heightFieldItem)
1638
+ if (source == heightFieldItem)
15911639 {
15921640 Object3D obj = new Object3D();
15931641
....@@ -1625,31 +1673,31 @@
16251673
16261674 makeSomething(obj);
16271675 } else
1628
- if (event.getSource() == gridItem)
1676
+ if (source == gridItem)
16291677 {
16301678 makeSomething(new Grid());
16311679 } else
1632
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
16331681 {
16341682 makeSomething(new Sphere());
16351683 } else
1636
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
16371685 {
16381686 makeSomething(new Cone());
16391687 } else
1640
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
16411689 {
16421690 makeSomething(new Torus());
16431691 } else
1644
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
16451693 {
16461694 makeSomething(new Superellipsoid());
16471695 } else
1648
- if (event.getSource() == kleinItem)
1696
+ if (source == kleinItem)
16491697 {
16501698 makeSomething(new Klein());
16511699 } else
1652
- if (event.getSource() == blobItem)
1700
+ if (source == blobItem)
16531701 {
16541702 Blob blob = new Blob();
16551703 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1705,15 @@
16571705 //blob.retile();
16581706 makeSomething(blob);
16591707 } else
1660
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
16611709 {
16621710 makeSomething(new Lathe());
16631711 } else
1664
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
16651713 {
16661714 makeSomething(new BezierSurface());
16671715 } else
1668
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
16691717 {
16701718 /*
16711719 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1728,7 @@
16801728 */
16811729 makeSomething(new Checker());
16821730 } else
1683
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
16841732 {
16851733 Object3D itemtomake = new Object3D();
16861734 Object3D child;
....@@ -1701,35 +1749,35 @@
17011749 makeSomething(child);
17021750 }
17031751 } else
1704
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
17051753 {
17061754 cSpring s = new cSpring();
17071755 s.setup();
17081756 makeSomething(s);
17091757 } else
1710
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
17111759 {
17121760 cSpring s = new cFlag();
17131761 s.setup();
17141762 makeSomething(s);
17151763 } else
1716
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
17171765 {
17181766 makeSomething(new Light());
17191767 } else
1720
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
17211769 {
17221770 group(new CSG());
17231771 } else
1724
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
17251773 {
17261774 group(new cTemplate());
17271775 } else
1728
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
17291777 {
17301778 makeSomething(new Attribute());
17311779 } else
1732
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
17331781 {
17341782 makeSomething(new PointFlow());
17351783 } else
....@@ -1741,7 +1789,7 @@
17411789 } else
17421790 */
17431791
1744
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
17451793 {
17461794 Composite g = new cGroup();
17471795 for (int i=0; i<15; i++)
....@@ -1763,7 +1811,7 @@
17631811
17641812 group(g);
17651813 } else
1766
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
17671815 {
17681816 Composite csg = new GroupLeaf();
17691817 csg.count = 5;
....@@ -1772,7 +1820,7 @@
17721820 csg.addChild(child);
17731821 child.addChild(csg);
17741822 } else
1775
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
17761824 {
17771825 Composite csg = new GroupLeaf();
17781826 csg.count = 5;
....@@ -1784,7 +1832,7 @@
17841832 csg.addChild(child);
17851833 child.addChild(csg);
17861834 } else
1787
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
17881836 {
17891837 Composite csg = new GroupLeaf();
17901838 csg.count = 4;
....@@ -1800,70 +1848,83 @@
18001848 child.addChild(csg);
18011849 } else
18021850
1803
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
18041852 {
18051853 ImportGFD();
18061854 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
18081856 {
18091857 ImportVRMLX3D();
18101858 } else
1811
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
18121860 {
18131861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141862 } else
1815
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
18161864 {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
18181874 } else
1819
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
18201876 {
18211877 Globals.drawMode = CameraPane.OCCLUSION;
18221878 Globals.theRenderer.repaint();
18231879 } else
1824
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
18251881 {
18261882 Recompile();
18271883 refreshContents();
18281884 } else
1829
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
18301886 {
18311887 OpenDialog();
18321888 refreshContents();
18331889 } else
1834
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
18351891 {
18361892 System.out.println("Invariants:");
18371893 GrafreeD.grafreeD.universe.invariants();
18381894 } else
1839
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
18401896 {
18411897 //System.out.println("Invariants:");
18421898 PrintMemory();
18431899 } else
1844
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
18451901 {
18461902 PrintPath();
18471903 } else
1848
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
18491905 {
18501906 AnalyzeObject();
18511907 } else
1852
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
18531909 {
18541910 DumpObject();
18551911 } else
1856
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
18571918 {
18581919 //Reload(lastConverter, lastFilename, true);
18591920 ScreenFit();
18601921 } else
1861
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
18621923 {
18631924 //Reload(lastConverter, lastFilename, true);
18641925 ScreenFitPoint();
18651926 } else
1866
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
18671928 {
18681929 //Reload(lastConverter, lastFilename, true);
18691930 SnapObject();
....@@ -1874,13 +1935,13 @@
18741935 // Recompile();
18751936 // refreshContents();
18761937 // } else
1877
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
18781939 {
18791940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801941 System.gc();
18811942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821943 } else
1883
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
18841945 {
18851946 Object3D obj;
18861947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1955,66 @@
18941955 }
18951956 refreshContents(true);
18961957 } else
1897
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
18981959 {
18991960 EditSelection(true);
19001961 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
19021963 {
19031964 loadClipboard(true);
19041965 } else
1905
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
19061967 {
19071968 Object3D keep = GrafreeD.clipboard;
19081969 loadClipboard(false);
19091970 paste(false);
19101971 GrafreeD.clipboard = keep;
19111972 } else
1912
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
19131974 {
19141975 CloneSelection(false);
19151976 } else
1916
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
19171978 {
19181979 CloneSelection(true);
19191980 } else
1920
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
19211982 {
19221983 loadClipboard(false);
19231984 } else
1924
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
19251986 {
19261987 paste(false);
19271988 } else
1928
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
19291990 {
1930
- pasteInto(false);
1991
+ pasteInto(true, false);
19311992 } else
1932
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
19331994 {
1934
- pasteInto(true);
1995
+ pasteInto(false, false);
19351996 } else
1936
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
19372002 {
19382003 paste(true);
19392004 } else
1940
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
19412006 {
19422007 Overwrite(Object3D.TRANSFORM);
19432008 } else
1944
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
19452010 {
19462011 Overwrite(Object3D.NAME);
19472012 } else
1948
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
19492014 {
19502015 Overwrite(Object3D.UV);
19512016 } else
1952
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
19532018 {
19542019 /* july 2015
19552020 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2034,7 @@
19692034
19702035 Overwrite(dropAttributes);
19712036 }
1972
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
19732038 {
19742039 Overwrite(Object3D.GEOMETRY);
19752040 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2051,7 @@
19862051 // refreshContents();
19872052 // }
19882053 } else
1989
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
19902055 {
19912056 //if (group.selection.size() == 1)
19922057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2062,7 @@
19972062 ResetModel();
19982063 refreshContents();
19992064 } else
2000
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
20012066 {
20022067 boolean one = false;
20032068
....@@ -2024,7 +2089,7 @@
20242089 ResetModel();
20252090 refreshContents();
20262091 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
20282093 {
20292094 boolean one = false;
20302095
....@@ -2050,7 +2115,7 @@
20502115 ResetModel();
20512116 refreshContents();
20522117 } else
2053
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
20542119 {
20552120 boolean one = false;
20562121
....@@ -2080,7 +2145,7 @@
20802145 refreshContents();
20812146 }
20822147 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
20842149 {
20852150 boolean one = false;
20862151
....@@ -2110,7 +2175,7 @@
21102175 ResetModel();
21112176 refreshContents();
21122177 } else
2113
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
21142179 {
21152180 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162181 // {
....@@ -2133,38 +2198,38 @@
21332198 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342199 for (int i=0; i<group.selection.size(); i++)
21352200 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
21382203 group.selection.get(i).linkVerticesThis(content);
21392204 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
21412206 }
21422207 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432208 refreshContents();
21442209 }
21452210 } else
2146
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
21472212 {
21482213 for (int i=0; i<group.selection.size(); i++)
21492214 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
21522217 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
21542219 }
21552220
21562221 refreshContents();
21572222 } else
2158
- if (event.getSource() == relinkverticesItem)
2223
+ if (source == relinkverticesItem)
21592224 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
21622227 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2228
+ CameraPane.SWITCH = random;
21642229
21652230 refreshContents();
21662231 } else
2167
- if (event.getSource() == resetreferencesItem)
2232
+ if (source == resetreferencesItem)
21682233 {
21692234 for (int i=0; i<group.selection.size(); i++)
21702235 {
....@@ -2173,7 +2238,7 @@
21732238
21742239 refreshContents();
21752240 } else
2176
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
21772242 {
21782243 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792244 {
....@@ -2186,7 +2251,7 @@
21862251 refreshContents();
21872252 }
21882253 } else
2189
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
21902255 {
21912256 if (group.selection.size() == 1)
21922257 {
....@@ -2205,19 +2270,19 @@
22052270 }
22062271
22072272 } else
2208
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
22092274 {
22102275 RevertMeshes();
22112276 } else
2212
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
22132278 {
22142279 ResetAll();
22152280 } else
2216
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
22172282 {
22182283 StepAll();
22192284 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
22212286 {
22222287 //int indices[] = jList.getSelectedIndices();
22232288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2290,46 @@
22252290
22262291 ClearSelection(false);
22272292 } else
2228
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
22292294 {
22302295 ClearSelection(true);
22312296 } else
2232
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
22332298 {
22342299 group(new cGroup(), true);
22352300 } else
2236
- if (event.getSource() == hideItem)
2301
+ if (source == hideItem)
22372302 {
22382303 group(new HiddenObject());
22392304 } else
2240
- if (event.getSource() == frontItem)
2305
+ if (source == frontItem)
22412306 {
22422307 front();
22432308 } else
2244
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
22452310 {
22462311 back();
22472312 } else
2248
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
22492314 {
22502315 makeSomething(new Camera());
22512316 } else
2252
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
22532318 {
22542319 group(new Composite());
22552320 } else
2256
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
22572322 {
22582323 RandomNode random = new RandomNode();
22592324 group(random);
22602325 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
22622327 } else
2263
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
22642329 {
22652330 group(new PhysicsNode());
22662331 } else
2267
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
22682333 {
22692334 for (int i=0; i<group.selection.size(); i++)
22702335 {
....@@ -2276,7 +2341,7 @@
22762341 ResetModel();
22772342 refreshContents();
22782343 } else
2279
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
22802345 {
22812346 for (int i=0; i<group.selection.size(); i++)
22822347 {
....@@ -2288,7 +2353,7 @@
22882353 ResetModel();
22892354 refreshContents();
22902355 } else
2291
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
22922357 {
22932358 for (int i=0; i<group.selection.size(); i++)
22942359 {
....@@ -2300,7 +2365,7 @@
23002365 ResetModel();
23012366 refreshContents();
23022367 } else
2303
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
23042369 {
23052370 for (int i=0; i<group.selection.size(); i++)
23062371 {
....@@ -2312,7 +2377,7 @@
23122377 ResetModel();
23132378 refreshContents();
23142379 } else
2315
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
23162381 {
23172382 boolean atleastone = false;
23182383
....@@ -2351,31 +2416,31 @@
23512416 }
23522417 }
23532418 } else
2354
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
23552420 {
23562421 group(new cLinker());
23572422 } else
2358
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
23592424 {
23602425 group(new TextureNode());
23612426 } else
2362
- if (event.getSource() == billboardItem)
2427
+ if (source == billboardItem)
23632428 {
23642429 group(new BillboardNode());
23652430 } else
2366
- if (event.getSource() == shadowXItem)
2431
+ if (source == shadowXItem)
23672432 {
23682433 CastShadow(0);
23692434 } else
2370
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
23712436 {
23722437 CastShadow(1);
23732438 } else
2374
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
23752440 {
23762441 CastShadow(2);
23772442 } else
2378
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
23792444 {
23802445 //ungroup();
23812446 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2452,179 @@
23872452
23882453 refreshContents();
23892454 } else
2390
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
23912456 {
23922457 GenUV();
23932458 } else
2394
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
23952460 {
23962461 GenNormals(true);
23972462 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2463
+ if (source == genNormalsMESHItem)
23992464 {
24002465 GenNormals(true); // TODO
24012466 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2467
+ if (source == genNormalsORGANItem)
24032468 {
24042469 GenNormals(false);
24052470 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2471
+ if (source == genNormalsMINEItem)
24072472 {
24082473 GenNormalsMINE();
24092474 } else
2410
- if (event.getSource() == stripifyItem)
2475
+ if (source == stripifyItem)
24112476 {
24122477 Stripify();
24132478 } else
2414
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
24152480 {
24162481 Unstripify();
24172482 } else
2418
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
24192484 {
24202485 Trim();
24212486 } else
2422
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
24232488 {
24242489 Untrim();
24252490 } else
2426
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
24272492 {
24282493 ClearColors();
24292494 } else
2430
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
24312496 {
24322497 ClearMaterials();
24332498 } else
2434
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
24352500 {
24362501 LiveLeaves(true);
24372502 } else
2438
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
24392504 {
24402505 LiveLeaves(false);
24412506 } else
2442
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
24432508 {
24442509 SupportLeaves(true);
24452510 } else
2446
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
24472512 {
24482513 SupportLeaves(false);
24492514 } else
2450
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
24512516 {
24522517 HideLeaves(true);
24532518 } else
2454
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
24552520 {
24562521 HideLeaves(false);
24572522 } else
2458
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
24592524 {
24602525 MarkLeaves(true);
24612526 } else
2462
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
24632528 {
24642529 MarkLeaves(false);
24652530 } else
2466
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
24672532 {
24682533 FlipV(true);
24692534 } else
2470
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
24712536 {
24722537 FlipV(false);
24732538 } else
2474
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
24752540 {
24762541 SetTexRes(0);
24772542 } else
2478
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
24792544 {
24802545 SetTexRes(1);
24812546 } else
2482
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
24832548 {
24842549 SetTexRes(2);
24852550 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
24872552 {
24882553 SetTexRes(3);
24892554 } else
2490
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
24912556 {
24922557 SetTexRes(4);
24932558 } else
2494
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
24952560 {
24962561 SetTexRes(5);
24972562 } else
2498
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
24992564 {
25002565 ReverseNormals();
25012566 } else
2502
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
25032568 {
25042569 ParseVertices();
25052570 } else
2506
- if (event.getSource() == textureFieldItem)
2571
+ if (source == textureFieldItem)
25072572 {
25082573 TextureVertices();
25092574 } else
2510
- if (event.getSource() == alignItem)
2575
+ if (source == alignItem)
25112576 {
25122577 Align();
25132578 } else
2514
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
25152580 {
25162581 MirrorPoses();
25172582 } else
2518
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
25192584 {
25202585 MeshReduction(false);
25212586 } else
2522
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
25232588 {
25242589 MeshReduction(true);
25252590 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
25272592 {
25282593 ReverseTriangles();
25292594 } else
2530
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
25312596 {
25322597 ReduceMesh(false);
25332598 } else
2534
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
25352600 {
25362601 ReduceMesh(true);
25372602 } else
2538
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
25392604 {
25402605 IncreaseMesh();
25412606 } else
2542
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
25432608 {
25442609 ClipMesh();
25452610 } else
2546
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
25472612 {
25482613 SmoothMesh();
25492614 } else
2550
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
25512616 {
25522617 TransformGeometry();
25532618 } else
2554
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
25552620 {
25562621 ResetTransform();
25572622 } else
2558
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
25592624 {
25602625 ResetCentroid();
25612626 } else
2562
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
25632628 {
25642629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652630 {
....@@ -2569,7 +2634,7 @@
25692634
25702635 refreshContents();
25712636 } else
2572
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
25732638 {
25742639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752640 {
....@@ -2583,7 +2648,7 @@
25832648
25842649 refreshContents();
25852650 } else
2586
- if (event.getSource() == repairShadowItem)
2651
+ if (source == repairShadowItem)
25872652 {
25882653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892654 {
....@@ -2597,7 +2662,7 @@
25972662
25982663 refreshContents();
25992664 } else
2600
- if (event.getSource() == sortbysizeItem)
2665
+ if (source == sortbysizeItem)
26012666 {
26022667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032668 {
....@@ -2609,7 +2674,7 @@
26092674 ResetModel();
26102675 refreshContents();
26112676 } else
2612
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
26132678 {
26142679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152680 {
....@@ -2621,7 +2686,7 @@
26212686 ResetModel();
26222687 refreshContents();
26232688 } else
2624
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
26252690 {
26262691 String texture = GetFile("Attach pigment");
26272692 Object3D obj;
....@@ -2633,7 +2698,7 @@
26332698
26342699 refreshContents();
26352700 } else
2636
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
26372702 {
26382703 Object3D obj;
26392704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2709,7 @@
26442709
26452710 refreshContents();
26462711 } else
2647
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
26482713 {
26492714 String texture = GetFile("Attach bump");
26502715 Object3D obj;
....@@ -2656,7 +2721,7 @@
26562721
26572722 refreshContents();
26582723 } else
2659
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
26602725 {
26612726 Object3D obj;
26622727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2732,7 @@
26672732
26682733 refreshContents();
26692734 } else
2670
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
26712736 {
26722737 Object3D obj;
26732738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2743,195 @@
26782743
26792744 refreshContents();
26802745 } else
2681
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
26822747 {
26832748 CameraPane.flash = true;
26842749 refreshContents();
26852750 } else
2686
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
26872752 {
26882753 } else
2689
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
26902755 {
26912756 radio.layout = twoButton;
26922757 // bug
26932758 //gridPanel.setDividerLocation(1.0);
26942759 //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();
2760
+// bigThree.remove(scenePanel);
2761
+// bigThree.remove(centralPanel);
2762
+// bigThree.remove(XYZPanel);
2763
+// aWindowConstraints.gridx = 0;
2764
+// aWindowConstraints.gridy = 0;
2765
+// aWindowConstraints.gridwidth = 1;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2768
+// aWindowConstraints.weightx = 0;
2769
+// aWindowConstraints.weighty = 1;
2770
+// //bigThree.add(jtp, aWindowConstraints);
2771
+// aWindowConstraints.weightx = 1;
2772
+// aWindowConstraints.gridwidth = 3;
2773
+// // aConstraints.gridheight = 3;
2774
+// aWindowConstraints.gridx = 1;
2775
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2776
+// bigThree.add(centralPanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 0;
2778
+// aWindowConstraints.gridx = 4;
2779
+// aWindowConstraints.gridwidth = 1;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2782
+// //bigThree.add(XYZPanel, aWindowConstraints);
2783
+// scenePanel.setVisible(false);
2784
+// centralPanel.setVisible(true);
2785
+// XYZPanel.setVisible(false);
2786
+ bigThree.ClearUI();
2787
+ bigThree.add(centralPanel);
2788
+ bigThree.FlushUI();
27192789 } else
2720
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
27212791 {
27222792 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();
2793
+
2794
+// bigThree.remove(scenePanel);
2795
+// bigThree.remove(centralPanel);
2796
+// bigThree.remove(XYZPanel);
2797
+// aWindowConstraints.gridx = 0;
2798
+// aWindowConstraints.gridy = 0;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// aWindowConstraints.weightx = 0;
2803
+// aWindowConstraints.weighty = 1;
2804
+// //bigThree.add(jtp, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 1;
2806
+// aWindowConstraints.gridwidth = 3;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.gridx = 1;
2809
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2810
+// bigThree.add(centralPanel, aWindowConstraints);
2811
+// aWindowConstraints.weightx = 0;
2812
+// aWindowConstraints.gridx = 4;
2813
+// aWindowConstraints.gridwidth = 1;
2814
+// // aConstraints.gridheight = 3;
2815
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2816
+// bigThree.add(XYZPanel, aWindowConstraints);
2817
+// bigThree.validate();
2818
+// scenePanel.setVisible(false);
2819
+// centralPanel.setVisible(true);
2820
+// XYZPanel.setVisible(true);
2821
+ bigThree.ClearUI();
2822
+ bigThree.add(centralPanel);
2823
+ bigThree.add(XYZPanel);
2824
+ bigThree.FlushUI();
27472825 } else
2748
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
27492827 {
27502828 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();
2829
+
2830
+// bigThree.remove(scenePanel);
2831
+// bigThree.remove(centralPanel);
2832
+// bigThree.remove(XYZPanel);
2833
+// aWindowConstraints.gridx = 0;
2834
+// aWindowConstraints.gridy = 0;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aWindowConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2838
+// aWindowConstraints.weightx = 1;
2839
+// aWindowConstraints.weighty = 1;
2840
+// bigThree.add(scenePanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 1;
2842
+// aWindowConstraints.gridwidth = 3;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.gridx = 1;
2845
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2846
+// //bigThree.add(cameraPanel, aWindowConstraints);
2847
+// aWindowConstraints.weightx = 0;
2848
+// aWindowConstraints.gridx = 4;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// //bigThree.add(XYZPanel, aWindowConstraints);
2853
+// bigThree.validate();
2854
+// scenePanel.setVisible(true);
2855
+// centralPanel.setVisible(false);
2856
+// XYZPanel.setVisible(false);
2857
+ bigThree.ClearUI();
2858
+ bigThree.add(scenePanel);
2859
+ bigThree.FlushUI();
27752860 } else
2776
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
27772862 {
27782863 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();
2864
+
2865
+// bigThree.remove(scenePanel);
2866
+// bigThree.remove(centralPanel);
2867
+// bigThree.remove(XYZPanel);
2868
+// aWindowConstraints.gridx = 0;
2869
+// aWindowConstraints.gridy = 0;
2870
+// aWindowConstraints.gridwidth = 1;
2871
+// // aConstraints.gridheight = 3;
2872
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2873
+// aWindowConstraints.weightx = 0;
2874
+// aWindowConstraints.weighty = 1;
2875
+// bigThree.add(scenePanel, aWindowConstraints);
2876
+// aWindowConstraints.weightx = 1;
2877
+// aWindowConstraints.gridwidth = 3;
2878
+// // aWindowConstraints.gridheight = 3;
2879
+// aWindowConstraints.gridx = 1;
2880
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2881
+// bigThree.add(centralPanel, aWindowConstraints);
2882
+// aWindowConstraints.weightx = 0;
2883
+// aWindowConstraints.gridx = 4;
2884
+// aWindowConstraints.gridwidth = 1;
2885
+// // aWindowConstraints.gridheight = 3;
2886
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2887
+// //bigThree.add(XYZPanel, aConstraints);
2888
+// bigThree.validate();
2889
+// scenePanel.setVisible(true);
2890
+// centralPanel.setVisible(true);
2891
+// XYZPanel.setVisible(false);
2892
+ bigThree.ClearUI();
2893
+ bigThree.add(scenePanel);
2894
+ bigThree.add(centralPanel);
2895
+ bigThree.FlushUI();
28032896 } else
2804
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
28052898 {
28062899 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();
2900
+
2901
+// bigThree.remove(scenePanel);
2902
+// bigThree.remove(centralPanel);
2903
+// bigThree.remove(XYZPanel);
2904
+// aWindowConstraints.gridx = 0;
2905
+// aWindowConstraints.gridy = 0;
2906
+// aWindowConstraints.gridwidth = 1;
2907
+// // aWindowConstraints.gridheight = 3;
2908
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2909
+// aWindowConstraints.weightx = 0;
2910
+// aWindowConstraints.weighty = 1;
2911
+// bigThree.add(scenePanel, aWindowConstraints);
2912
+// aWindowConstraints.weightx = 1;
2913
+// aWindowConstraints.gridwidth = 3;
2914
+// // aWindowConstraints.gridheight = 3;
2915
+// aWindowConstraints.gridx = 1;
2916
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2917
+// bigThree.add(centralPanel, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 0;
2919
+// aWindowConstraints.gridx = 4;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// bigThree.add(XYZPanel, aWindowConstraints);
2924
+// bigThree.validate();
2925
+// scenePanel.setVisible(true);
2926
+// centralPanel.setVisible(true);
2927
+// XYZPanel.setVisible(true);
2928
+ bigThree.ClearUI();
2929
+ bigThree.add(scenePanel);
2930
+ bigThree.add(centralPanel);
2931
+ bigThree.add(XYZPanel);
2932
+ bigThree.FlushUI();
28312933 } else
2832
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
28332935 {
28342936 Object3D obj;
28352937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2943,7 @@
28412943
28422944 refreshContents(true);
28432945 } else
2844
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
28452947 {
28462948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472949 cRadio ab;
....@@ -2862,11 +2964,11 @@
28622964 }
28632965 refreshContents(true);
28642966 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
28662968 {
28672969 EditSelection(false);
28682970 } else
2869
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
28702972 {
28712973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722974 {
....@@ -2878,12 +2980,12 @@
28782980
28792981 child.editWindow = null; // ???????????
28802982 }
2881
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
28822984 //objEditor.jTree.clearSelection();
28832985 //objEditor.ResetSliders();
28842986 refreshContents(true);
28852987 } else
2886
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
28872989 {
28882990 assert(copy == group);
28892991 //copy.ClearUI();
....@@ -2894,7 +2996,7 @@
28942996 listUI.clear();
28952997 refreshContents(true);
28962998 } else
2897
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
28983000 {
28993001 assert(copy == group);
29003002
....@@ -2915,19 +3017,19 @@
29153017
29163018 refreshContents(true);
29173019 } else
2918
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
29193021 {
29203022 objEditor.jTree.clearSelection();
29213023 // ?? oct 2012 GrafreeD.clipboard.clear();
29223024 objEditor.ResetSliders();
29233025 refreshContents(true);
29243026 } else
2925
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
29263028 {
29273029 group.parent = keepparent;
29283030 group.attributes = 0;
29293031 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
29313033 Object3D obj = radio.GetObject();
29323034 System.out.println("Edit " + obj);
29333035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3597,11 +3699,11 @@
35973699
35983700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993701
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
36023704 lowres.linkVerticesThis(null);
36033705 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
36053707
36063708 System.err.flush();
36073709
....@@ -4086,12 +4188,12 @@
40864188 System.err.println("info : " + child.GetPath());
40874189 }
40884190 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
40954197
40964198 objEditor.SetText(); // jan 2014
40974199
....@@ -4359,7 +4461,7 @@
43594461 refreshContents();
43604462 }
43614463
4362
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
43634465 {
43644466 // if (GrafreeD.clipboard == null)
43654467 // return;
....@@ -4388,7 +4490,14 @@
43884490 if (copyit)
43894491 {
43904492 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
43924501 }
43934502 else
43944503 {
....@@ -4932,10 +5041,12 @@
49325041 cButton flashSelectionButton;
49335042 cButton editButton;
49345043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
49355045 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375046 cButton unselectButton;
49385047
5048
+ cButton oneStepButton;
5049
+
49395050 cButton screenfitButton;
49405051 cButton screenfitpointButton;
49415052 cButton snapobjectButton;
....@@ -4990,6 +5101,7 @@
49905101 private MenuItem mergeGeometriesItem;
49915102 private MenuItem copyItem;
49925103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
49935105 private MenuItem pasteLinkItem;
49945106 private MenuItem pasteCloneItem;
49955107 private MenuItem pasteExpandItem;
....@@ -5087,7 +5199,7 @@
50875199 private MenuItem blobItem;
50885200 private MenuItem latheItem;
50895201 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
50915203 private MenuItem meshItem;
50925204 // private MenuItem meshGroupItem;
50935205 private MenuItem springItem;