Normand Briere
2019-05-02 c209bbe1cf788c9af3dcffea7667c830170a3f1f
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,36 +163,48 @@
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("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175174 cutItem = menu.add(new MenuItem("Cut"));
176175 cutItem.addActionListener(this);
177176 copyItem = menu.add(new MenuItem("Copy"));
178177 copyItem.addActionListener(this);
179178 pasteItem = menu.add(new MenuItem("Paste"));
180179 pasteItem.addActionListener(this);
180
+ menu.add("-");
181
+ cloneItem = menu.add(new MenuItem("Clone"));
182
+ cloneItem.addActionListener(this);
183
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
+ cloneSupportItem.addActionListener(this);
185
+ menu.add("-");
186
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
187
+ pasteIntoItem.addActionListener(this);
181188 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182189 pasteLinkItem.addActionListener(this);
183190 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184191 pasteCloneItem.addActionListener(this);
185192 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186193 // pasteExpandItem.addActionListener(this);
194
+ menu.add("-");
187195 clearItem = menu.add(new MenuItem("Clear"));
188196 clearItem.addActionListener(this);
197
+
198
+ if (Globals.ADVANCED)
199
+ {
200
+ // Deletes the cameras...
189201 clearAllItem = menu.add(new MenuItem("Clear All"));
190202 clearAllItem.addActionListener(this);
203
+ }
191204
192205 oe.menuBar.add(menu = new Menu("Setting"));
206
+ if (Globals.ADVANCED)
207
+ {
193208 resetMeshItem = menu.add(new MenuItem("Reset All"));
194209 resetMeshItem.addActionListener(this);
195210 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +214,7 @@
199214 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200215 resetreferencesItem.addActionListener(this);
201216 menu.add("-");
217
+ }
202218 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203219 overwriteGeoItem.addActionListener(this);
204220 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +226,26 @@
210226 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211227 overwriteUVItem.addActionListener(this);
212228 menu.add("-");
229
+ if (Globals.ADVANCED)
230
+ {
213231 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214232 generateMeshItem.addActionListener(this);
215233 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216234 poseMeshItem.addActionListener(this);
217235 menu.add("-");
236
+ }
218237 resetsupportItem = menu.add(new MenuItem("Reset support"));
219238 resetsupportItem.addActionListener(this);
220239 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221240 linkverticesItem.addActionListener(this);
222241 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223242 relinkverticesItem.addActionListener(this);
243
+
244
+ if (Globals.ADVANCED)
245
+ {
224246 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225247 setMasterItem.addActionListener(this);
248
+ }
226249
227250 oe.menuBar.add(menu = new Menu("Group"));
228251 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +256,31 @@
233256 frontItem.addActionListener(this);
234257 compositeItem = menu.add(new MenuItem("Composite"));
235258 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
259
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237260 hideItem.addActionListener(this);
238261 ungroupItem = menu.add(new MenuItem("Ungroup"));
239262 ungroupItem.addActionListener(this);
240263 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
264
+ randomItem = menu.add(new MenuItem("Switch node"));
242265 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);
247266 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248267 switchGeoItem.addActionListener(this);
249268 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250269 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
270
+ morphItem = menu.add(new MenuItem("Morph Group"));
252271 morphItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
275
+ physicsItem = menu.add(new MenuItem("Physics"));
276
+ physicsItem.addActionListener(this);
277
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278
+ frameselectorItem.addActionListener(this);
253279 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254280 scriptNodeItem.addActionListener(this);
255281 cameraItem = menu.add(new MenuItem("Camera"));
256282 cameraItem.addActionListener(this);
283
+ }
257284
258285 oe.menuBar.add(menu = new Menu("Object"));
259286 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,15 +295,18 @@
268295 shadowYItem.addActionListener(this);
269296 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270297 shadowZItem.addActionListener(this);
298
+ if (Globals.ADVANCED)
299
+ {
271300 linkerItem = menu.add(new MenuItem("Linker"));
272301 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275302 attributeItem = menu.add(new MenuItem("Attribute"));
276303 attributeItem.addActionListener(this);
304
+ templateItem = menu.add(new MenuItem("Template"));
305
+ templateItem.addActionListener(this);
277306 pointflowItem = menu.add(new MenuItem("Point Flow"));
278307 pointflowItem.addActionListener(this);
279308 menu.add("-");
309
+ }
280310 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281311 resetTransformItem.addActionListener(this);
282312 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
....@@ -293,8 +323,11 @@
293323 genNormalsCADItem.addActionListener(this);
294324 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295325 genNormalsMESHItem.addActionListener(this);
326
+ if (Globals.ADVANCED)
327
+ {
296328 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297329 genNormalsMINEItem.addActionListener(this);
330
+ }
298331 stripifyItem = menu.add(new MenuItem("Stripify"));
299332 stripifyItem.addActionListener(this);
300333 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +349,14 @@
316349 reduce34MeshItem.addActionListener(this);
317350 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318351 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321352 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322353 clipMeshItem.addActionListener(this);
354
+
355
+ if (Globals.ADVANCED)
356
+ {
357
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
358
+ smoothMeshItem.addActionListener(this);
359
+ }
323360
324361 oe.menuBar.add(menu = new Menu("Attributes"));
325362 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +366,13 @@
329366 liveleavesItem.addActionListener(this);
330367 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331368 unliveleavesItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
332371 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333372 supportleavesItem.addActionListener(this);
334373 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335374 unsupportleavesItem.addActionListener(this);
375
+ }
336376 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337377 hideleavesItem.addActionListener(this);
338378 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +415,8 @@
375415 sortbysizeItem.addActionListener(this);
376416 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377417 sortbynameItem.addActionListener(this);
418
+ if (Globals.ADVANCED)
419
+ {
378420 menu.add("-");
379421 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380422 extractGeometriesItem.addActionListener(this);
....@@ -384,11 +426,11 @@
384426 shareGeometriesItem.addActionListener(this);
385427 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386428 mergeGeometriesItem.addActionListener(this);
429
+ }
387430
388431 oe.menuBar.add(menu = new Menu("Insert"));
389432 buildCreateMenu(menu);
390433
391
-
392434 oe.menuBar.add(menu = new Menu("Include"));
393435 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394436 importGFDItem.addActionListener(this);
....@@ -433,176 +475,98 @@
433475 oe.radioPanel.add(dummyButton);
434476 oe.buttonGroup.add(dummyButton);
435477 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
478
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439479
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
441481 liveCB.setToolTipText("Enabled animation");
442482 liveCB.addItemListener(this);
443483
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
484
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485
+ oneStepButton.setToolTipText("Animate one step forward");
486
+ oneStepButton.addActionListener(this);
487
+
488
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446489 fastCB.setToolTipText("Fast mode");
447490 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515493 trackCB.setToolTipText("Enable tracking");
516494 trackCB.addItemListener(this);
517495
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520497 screenfitButton.setToolTipText("Screen fit");
521498 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
499
+
523500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524501 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530502
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
503
+ if (Globals.ADVANCED)
504
+ {
505
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ snapobjectButton.addActionListener(this);
507
+ snapobjectButton.setToolTipText("Snap Object");
508
+ }
509
+
510
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537511 flashSelectionButton.setToolTipText("Show selection");
538512 flashSelectionButton.addActionListener(this);
539513
540
- oe.toolbarPanel.add(new cButton(" ", false));
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541515
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548517 twoButton.setToolTipText("Show center view only");
549518 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551520 fourButton.addActionListener(this);
552521 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554523 sixButton.setToolTipText("2-column layout left");
555524 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557526 threeButton.setToolTipText("2-column layout right");
558527 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560529 sevenButton.setToolTipText("3-column layout");
561530 sevenButton.addActionListener(this);
562531 //
563532
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
566535 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569538 closeButton.setToolTipText("Close tab");
570539 closeButton.addActionListener(this);
571540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572541 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574542
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
+ cGridBag commandsPanel = new cGridBag();
544
+
545
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
+ editButton.setToolTipText("Edit selection");
577547 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581548
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
583551 uneditButton.addActionListener(this);
584552
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
597555 allParamsButton.addActionListener(this);
598556
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
557
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
558
+ clearPanelButton.setToolTipText("Clear edit panel");
559
+ clearPanelButton.addActionListener(this);
560
+
561
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
562
+ unselectButton.setToolTipText("Unselect");
604563 unselectButton.addActionListener(this);
605564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
606570 // oe.aConstraints.gridx += 1;
607571 // oe.aConstraints.weighty = 0;
608572 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +578,37 @@
614578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615579 // gcButton.addActionListener(this);
616580
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
628584 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630586 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
635590
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
591
+ cGridBag copyOptionsPanel = new cGridBag();
592
+
593
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
+ colorCB.setToolTipText("Copy color when dropped");
640595 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
596
+
597
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
+ materialCB.setToolTipText("Copy material when dropped");
643599 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
600
+
601
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
+ textureCB.setToolTipText("Copy texture when dropped");
646603 textureCB.addItemListener(this);
647604
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
650608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
651612 //jList.addListSelectionListener(this);
652613 oe.jTree.addTreeSelectionListener(this);
653614 //jTree.setRootVisible(false);
....@@ -669,6 +630,78 @@
669630 radio.layout = sevenButton;
670631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671632 }
633
+
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
635
+ {
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
637
+ boxCB.setToolTipText("Display bounding boxes");
638
+ boxCB.addItemListener(this);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642
+ zoomBoxCB.addItemListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
+ supportCB.setToolTipText("Enable rigging");
648
+ supportCB.addItemListener(this);
649
+
650
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
651
+ // localCB.addItemListener(this);
652
+
653
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
654
+ crowdCB.setToolTipText("Used for crowds");
655
+ crowdCB.addItemListener(this);
656
+
657
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
658
+ smoothCB.setToolTipText("Snapping delay");
659
+ smoothCB.addItemListener(this);
660
+
661
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
+ slowCB.setToolTipText("Smooth interpolation");
663
+ slowCB.addItemListener(this);
664
+
665
+// constraints.gridy += 1;
666
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
667
+// speakerMocapCB.addItemListener(this);
668
+
669
+ if (false)
670
+ {
671
+ // handled in scripts
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
674
+ speakerCameraCB.addItemListener(this);
675
+
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
678
+ speakerFocusCB.addItemListener(this);
679
+
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
682
+ smoothfocusCB.addItemListener(this);
683
+ }
684
+
685
+//constraints.gridx += 1;
686
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
687
+// debugCB.addItemListener(this);
688
+
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
690
+ oeilCB.addItemListener(this);
691
+
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
693
+ lookAtCB.setToolTipText("Look-at target");
694
+ lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
703
+
704
+ }
672705
673706 void EditObject(Object3D obj)
674707 {
....@@ -951,11 +984,11 @@
951984 {
952985 loadClipboard(true);
953986 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
987
+ pasteInto(false, false);
955988 } else {
956989 loadClipboard(false);
957990 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
959992 }
960993 }
961994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1110,33 @@
10771110 kleinItem.addActionListener(this);
10781111 particleItem = menu.add(new MenuItem("Particle system"));
10791112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10801115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811116 ragdollItem.addActionListener(this);
10821117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831118 ragdoll2Item.addActionListener(this);
1119
+ }
10841120 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861122 meshItem.addActionListener(this);
10871123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10891127 springItem = menu.add(new MenuItem("Spring"));
10901128 springItem.addActionListener(this);
10911129 flagItem = menu.add(new MenuItem("Flag"));
10921130 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971131 blobItem = menu.add(new MenuItem("Blob"));
10981132 blobItem.addActionListener(this);
10991133 latheItem = menu.add(new MenuItem("Lathe"));
11001134 latheItem.addActionListener(this);
1135
+ }
1136
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1137
+ bezierItem.addActionListener(this);
1138
+ overlayItem = menu.add(new MenuItem("Overlay"));
1139
+ overlayItem.addActionListener(this);
11011140 lightItem = menu.add(new MenuItem("Light"));
11021141 lightItem.addActionListener(this);
11031142 menu.add("-");
....@@ -1107,25 +1146,26 @@
11071146 loopItem.addActionListener(this);
11081147 doubleItem = menu.add(new MenuItem("Fork"));
11091148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
11101151 tripleItem = menu.add(new MenuItem("Trident"));
11111152 tripleItem.addActionListener(this);
1153
+ }
11121154 }
11131155
11141156 void buildToolsMenu(Menu menu)
11151157 {
11161158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171159 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
11191161
11201162 menu.add("-");
11211163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221164 parseverticesItem.addActionListener(this);
11231165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241166 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
11261168 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301170 reduceMorphItem.addActionListener(this);
11311171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1133,8 +1173,12 @@
11331173
11341174 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351175 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
11381182 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391183 memoryItem.addActionListener(this);
11401184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1201,7 @@
11571201 menu.add("-");
11581202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591203 editScriptItem.addActionListener(this);
1204
+ }
11601205 }
11611206
11621207 void ScreenFit()
....@@ -1510,6 +1555,7 @@
15101555 //
15111556 public void actionPerformed(ActionEvent event) // , Object arg)
15121557 {
1558
+ Object source = event.getSource();
15131559 /*
15141560 if (event.getSource() == nameField)
15151561 {
....@@ -1521,11 +1567,11 @@
15211567 }
15221568 else
15231569 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
15251571 {
15261572 ScreenFit();
15271573 } else
1528
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
15291575 {
15301576 cVector v1 = new cVector();
15311577 cVector v2 = new cVector();
....@@ -1534,11 +1580,11 @@
15341580 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351581 objEditor.cameraView.repaint();
15361582 } else
1537
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
15381584 {
15391585 makeSomething(new Box());
15401586 } else
1541
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
15421588 {
15431589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1605,9 @@
15591605 applyExample(particleGeom, "SMOKE");
15601606 makeSomething(particleGeom);
15611607 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15631609 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651611
15661612 ragdoll.toParent = LA.newMatrix();
15671613 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1625,7 @@
15791625 } else
15801626 /*
15811627 */
1582
- if (event.getSource() == heightFieldItem)
1628
+ if (source == heightFieldItem)
15831629 {
15841630 Object3D obj = new Object3D();
15851631
....@@ -1617,31 +1663,31 @@
16171663
16181664 makeSomething(obj);
16191665 } else
1620
- if (event.getSource() == gridItem)
1666
+ if (source == gridItem)
16211667 {
16221668 makeSomething(new Grid());
16231669 } else
1624
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
16251671 {
16261672 makeSomething(new Sphere());
16271673 } else
1628
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
16291675 {
16301676 makeSomething(new Cone());
16311677 } else
1632
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
16331679 {
16341680 makeSomething(new Torus());
16351681 } else
1636
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
16371683 {
16381684 makeSomething(new Superellipsoid());
16391685 } else
1640
- if (event.getSource() == kleinItem)
1686
+ if (source == kleinItem)
16411687 {
16421688 makeSomething(new Klein());
16431689 } else
1644
- if (event.getSource() == blobItem)
1690
+ if (source == blobItem)
16451691 {
16461692 Blob blob = new Blob();
16471693 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1695,15 @@
16491695 //blob.retile();
16501696 makeSomething(blob);
16511697 } else
1652
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
16531699 {
16541700 makeSomething(new Lathe());
16551701 } else
1656
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
16571703 {
16581704 makeSomething(new BezierSurface());
16591705 } else
1660
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
16611707 {
16621708 /*
16631709 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1718,7 @@
16721718 */
16731719 makeSomething(new Checker());
16741720 } else
1675
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
16761722 {
16771723 Object3D itemtomake = new Object3D();
16781724 Object3D child;
....@@ -1693,35 +1739,35 @@
16931739 makeSomething(child);
16941740 }
16951741 } else
1696
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
16971743 {
16981744 cSpring s = new cSpring();
16991745 s.setup();
17001746 makeSomething(s);
17011747 } else
1702
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
17031749 {
17041750 cSpring s = new cFlag();
17051751 s.setup();
17061752 makeSomething(s);
17071753 } else
1708
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
17091755 {
17101756 makeSomething(new Light());
17111757 } else
1712
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
17131759 {
17141760 group(new CSG());
17151761 } else
1716
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
17171763 {
17181764 group(new cTemplate());
17191765 } else
1720
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
17211767 {
17221768 makeSomething(new Attribute());
17231769 } else
1724
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
17251771 {
17261772 makeSomething(new PointFlow());
17271773 } else
....@@ -1733,7 +1779,7 @@
17331779 } else
17341780 */
17351781
1736
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
17371783 {
17381784 Composite g = new cGroup();
17391785 for (int i=0; i<15; i++)
....@@ -1755,7 +1801,7 @@
17551801
17561802 group(g);
17571803 } else
1758
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
17591805 {
17601806 Composite csg = new GroupLeaf();
17611807 csg.count = 5;
....@@ -1764,7 +1810,7 @@
17641810 csg.addChild(child);
17651811 child.addChild(csg);
17661812 } else
1767
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
17681814 {
17691815 Composite csg = new GroupLeaf();
17701816 csg.count = 5;
....@@ -1776,7 +1822,7 @@
17761822 csg.addChild(child);
17771823 child.addChild(csg);
17781824 } else
1779
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
17801826 {
17811827 Composite csg = new GroupLeaf();
17821828 csg.count = 4;
....@@ -1792,70 +1838,75 @@
17921838 child.addChild(csg);
17931839 } else
17941840
1795
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
17961842 {
17971843 ImportGFD();
17981844 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
18001846 {
18011847 ImportVRMLX3D();
18021848 } else
1803
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
18041850 {
18051851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061852 } else
1807
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
18081854 {
18091855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18101856 } else
1811
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
18121858 {
18131859 Globals.drawMode = CameraPane.OCCLUSION;
18141860 Globals.theRenderer.repaint();
18151861 } else
1816
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
18171863 {
18181864 Recompile();
18191865 refreshContents();
18201866 } else
1821
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
18221868 {
18231869 OpenDialog();
18241870 refreshContents();
18251871 } else
1826
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
18271873 {
18281874 System.out.println("Invariants:");
18291875 GrafreeD.grafreeD.universe.invariants();
18301876 } else
1831
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
18321878 {
18331879 //System.out.println("Invariants:");
18341880 PrintMemory();
18351881 } else
1836
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
18371883 {
18381884 PrintPath();
18391885 } else
1840
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
18411887 {
18421888 AnalyzeObject();
18431889 } else
1844
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
18451891 {
18461892 DumpObject();
18471893 } else
1848
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
18491900 {
18501901 //Reload(lastConverter, lastFilename, true);
18511902 ScreenFit();
18521903 } else
1853
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
18541905 {
18551906 //Reload(lastConverter, lastFilename, true);
18561907 ScreenFitPoint();
18571908 } else
1858
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
18591910 {
18601911 //Reload(lastConverter, lastFilename, true);
18611912 SnapObject();
....@@ -1866,13 +1917,13 @@
18661917 // Recompile();
18671918 // refreshContents();
18681919 // } else
1869
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
18701921 {
18711922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721923 System.gc();
18731924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741925 } else
1875
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
18761927 {
18771928 Object3D obj;
18781929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1937,66 @@
18861937 }
18871938 refreshContents(true);
18881939 } else
1889
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
18901941 {
18911942 EditSelection(true);
18921943 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
18941945 {
18951946 loadClipboard(true);
18961947 } else
1897
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
18981949 {
18991950 Object3D keep = GrafreeD.clipboard;
19001951 loadClipboard(false);
19011952 paste(false);
19021953 GrafreeD.clipboard = keep;
19031954 } else
1904
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
19051956 {
19061957 CloneSelection(false);
19071958 } else
1908
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
19091960 {
19101961 CloneSelection(true);
19111962 } else
1912
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
19131964 {
19141965 loadClipboard(false);
19151966 } else
1916
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
19171968 {
19181969 paste(false);
19191970 } else
1920
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
19211972 {
1922
- pasteInto(false);
1973
+ pasteInto(true, false);
19231974 } else
1924
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
19251976 {
1926
- pasteInto(true);
1977
+ pasteInto(false, false);
19271978 } else
1928
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
19291984 {
19301985 paste(true);
19311986 } else
1932
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
19331988 {
19341989 Overwrite(Object3D.TRANSFORM);
19351990 } else
1936
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
19371992 {
19381993 Overwrite(Object3D.NAME);
19391994 } else
1940
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
19411996 {
19421997 Overwrite(Object3D.UV);
19431998 } else
1944
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
19452000 {
19462001 /* july 2015
19472002 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2016,7 @@
19612016
19622017 Overwrite(dropAttributes);
19632018 }
1964
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
19652020 {
19662021 Overwrite(Object3D.GEOMETRY);
19672022 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2033,7 @@
19782033 // refreshContents();
19792034 // }
19802035 } else
1981
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
19822037 {
19832038 //if (group.selection.size() == 1)
19842039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2044,7 @@
19892044 ResetModel();
19902045 refreshContents();
19912046 } else
1992
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
19932048 {
19942049 boolean one = false;
19952050
....@@ -2016,7 +2071,7 @@
20162071 ResetModel();
20172072 refreshContents();
20182073 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
20202075 {
20212076 boolean one = false;
20222077
....@@ -2042,7 +2097,7 @@
20422097 ResetModel();
20432098 refreshContents();
20442099 } else
2045
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
20462101 {
20472102 boolean one = false;
20482103
....@@ -2072,7 +2127,7 @@
20722127 refreshContents();
20732128 }
20742129 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
20762131 {
20772132 boolean one = false;
20782133
....@@ -2102,7 +2157,7 @@
21022157 ResetModel();
21032158 refreshContents();
21042159 } else
2105
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
21062161 {
21072162 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082163 // {
....@@ -2125,38 +2180,38 @@
21252180 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262181 for (int i=0; i<group.selection.size(); i++)
21272182 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
21302185 group.selection.get(i).linkVerticesThis(content);
21312186 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
21332188 }
21342189 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352190 refreshContents();
21362191 }
21372192 } else
2138
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
21392194 {
21402195 for (int i=0; i<group.selection.size(); i++)
21412196 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
21442199 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
21462201 }
21472202
21482203 refreshContents();
21492204 } else
2150
- if (event.getSource() == relinkverticesItem)
2205
+ if (source == relinkverticesItem)
21512206 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
21542209 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2210
+ CameraPane.SWITCH = random;
21562211
21572212 refreshContents();
21582213 } else
2159
- if (event.getSource() == resetreferencesItem)
2214
+ if (source == resetreferencesItem)
21602215 {
21612216 for (int i=0; i<group.selection.size(); i++)
21622217 {
....@@ -2165,7 +2220,7 @@
21652220
21662221 refreshContents();
21672222 } else
2168
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
21692224 {
21702225 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712226 {
....@@ -2178,7 +2233,7 @@
21782233 refreshContents();
21792234 }
21802235 } else
2181
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
21822237 {
21832238 if (group.selection.size() == 1)
21842239 {
....@@ -2197,19 +2252,19 @@
21972252 }
21982253
21992254 } else
2200
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
22012256 {
22022257 RevertMeshes();
22032258 } else
2204
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
22052260 {
22062261 ResetAll();
22072262 } else
2208
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
22092264 {
22102265 StepAll();
22112266 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
22132268 {
22142269 //int indices[] = jList.getSelectedIndices();
22152270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2272,46 @@
22172272
22182273 ClearSelection(false);
22192274 } else
2220
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
22212276 {
22222277 ClearSelection(true);
22232278 } else
2224
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
22252280 {
22262281 group(new cGroup(), true);
22272282 } else
2228
- if (event.getSource() == hideItem)
2283
+ if (source == hideItem)
22292284 {
22302285 group(new HiddenObject());
22312286 } else
2232
- if (event.getSource() == frontItem)
2287
+ if (source == frontItem)
22332288 {
22342289 front();
22352290 } else
2236
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
22372292 {
22382293 back();
22392294 } else
2240
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
22412296 {
22422297 makeSomething(new Camera());
22432298 } else
2244
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
22452300 {
22462301 group(new Composite());
22472302 } else
2248
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
22492304 {
22502305 RandomNode random = new RandomNode();
22512306 group(random);
22522307 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
22542309 } else
2255
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
22562311 {
22572312 group(new PhysicsNode());
22582313 } else
2259
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
22602315 {
22612316 for (int i=0; i<group.selection.size(); i++)
22622317 {
....@@ -2268,7 +2323,7 @@
22682323 ResetModel();
22692324 refreshContents();
22702325 } else
2271
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
22722327 {
22732328 for (int i=0; i<group.selection.size(); i++)
22742329 {
....@@ -2280,7 +2335,7 @@
22802335 ResetModel();
22812336 refreshContents();
22822337 } else
2283
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
22842339 {
22852340 for (int i=0; i<group.selection.size(); i++)
22862341 {
....@@ -2292,7 +2347,7 @@
22922347 ResetModel();
22932348 refreshContents();
22942349 } else
2295
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
22962351 {
22972352 for (int i=0; i<group.selection.size(); i++)
22982353 {
....@@ -2304,7 +2359,7 @@
23042359 ResetModel();
23052360 refreshContents();
23062361 } else
2307
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
23082363 {
23092364 boolean atleastone = false;
23102365
....@@ -2343,31 +2398,31 @@
23432398 }
23442399 }
23452400 } else
2346
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
23472402 {
23482403 group(new cLinker());
23492404 } else
2350
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
23512406 {
23522407 group(new TextureNode());
23532408 } else
2354
- if (event.getSource() == billboardItem)
2409
+ if (source == billboardItem)
23552410 {
23562411 group(new BillboardNode());
23572412 } else
2358
- if (event.getSource() == shadowXItem)
2413
+ if (source == shadowXItem)
23592414 {
23602415 CastShadow(0);
23612416 } else
2362
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
23632418 {
23642419 CastShadow(1);
23652420 } else
2366
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
23672422 {
23682423 CastShadow(2);
23692424 } else
2370
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
23712426 {
23722427 //ungroup();
23732428 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2434,179 @@
23792434
23802435 refreshContents();
23812436 } else
2382
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
23832438 {
23842439 GenUV();
23852440 } else
2386
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
23872442 {
23882443 GenNormals(true);
23892444 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2445
+ if (source == genNormalsMESHItem)
23912446 {
23922447 GenNormals(true); // TODO
23932448 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2449
+ if (source == genNormalsORGANItem)
23952450 {
23962451 GenNormals(false);
23972452 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2453
+ if (source == genNormalsMINEItem)
23992454 {
24002455 GenNormalsMINE();
24012456 } else
2402
- if (event.getSource() == stripifyItem)
2457
+ if (source == stripifyItem)
24032458 {
24042459 Stripify();
24052460 } else
2406
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
24072462 {
24082463 Unstripify();
24092464 } else
2410
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
24112466 {
24122467 Trim();
24132468 } else
2414
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
24152470 {
24162471 Untrim();
24172472 } else
2418
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
24192474 {
24202475 ClearColors();
24212476 } else
2422
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
24232478 {
24242479 ClearMaterials();
24252480 } else
2426
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
24272482 {
24282483 LiveLeaves(true);
24292484 } else
2430
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
24312486 {
24322487 LiveLeaves(false);
24332488 } else
2434
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
24352490 {
24362491 SupportLeaves(true);
24372492 } else
2438
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
24392494 {
24402495 SupportLeaves(false);
24412496 } else
2442
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
24432498 {
24442499 HideLeaves(true);
24452500 } else
2446
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
24472502 {
24482503 HideLeaves(false);
24492504 } else
2450
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
24512506 {
24522507 MarkLeaves(true);
24532508 } else
2454
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
24552510 {
24562511 MarkLeaves(false);
24572512 } else
2458
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
24592514 {
24602515 FlipV(true);
24612516 } else
2462
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
24632518 {
24642519 FlipV(false);
24652520 } else
2466
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
24672522 {
24682523 SetTexRes(0);
24692524 } else
2470
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
24712526 {
24722527 SetTexRes(1);
24732528 } else
2474
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
24752530 {
24762531 SetTexRes(2);
24772532 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
24792534 {
24802535 SetTexRes(3);
24812536 } else
2482
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
24832538 {
24842539 SetTexRes(4);
24852540 } else
2486
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
24872542 {
24882543 SetTexRes(5);
24892544 } else
2490
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
24912546 {
24922547 ReverseNormals();
24932548 } else
2494
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
24952550 {
24962551 ParseVertices();
24972552 } else
2498
- if (event.getSource() == textureFieldItem)
2553
+ if (source == textureFieldItem)
24992554 {
25002555 TextureVertices();
25012556 } else
2502
- if (event.getSource() == alignItem)
2557
+ if (source == alignItem)
25032558 {
25042559 Align();
25052560 } else
2506
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
25072562 {
25082563 MirrorPoses();
25092564 } else
2510
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
25112566 {
25122567 MeshReduction(false);
25132568 } else
2514
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
25152570 {
25162571 MeshReduction(true);
25172572 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
25192574 {
25202575 ReverseTriangles();
25212576 } else
2522
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
25232578 {
25242579 ReduceMesh(false);
25252580 } else
2526
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
25272582 {
25282583 ReduceMesh(true);
25292584 } else
2530
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
25312586 {
25322587 IncreaseMesh();
25332588 } else
2534
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
25352590 {
25362591 ClipMesh();
25372592 } else
2538
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
25392594 {
25402595 SmoothMesh();
25412596 } else
2542
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
25432598 {
25442599 TransformGeometry();
25452600 } else
2546
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
25472602 {
25482603 ResetTransform();
25492604 } else
2550
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
25512606 {
25522607 ResetCentroid();
25532608 } else
2554
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
25552610 {
25562611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572612 {
....@@ -2561,7 +2616,7 @@
25612616
25622617 refreshContents();
25632618 } else
2564
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
25652620 {
25662621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672622 {
....@@ -2575,7 +2630,7 @@
25752630
25762631 refreshContents();
25772632 } else
2578
- if (event.getSource() == repairShadowItem)
2633
+ if (source == repairShadowItem)
25792634 {
25802635 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812636 {
....@@ -2589,7 +2644,7 @@
25892644
25902645 refreshContents();
25912646 } else
2592
- if (event.getSource() == sortbysizeItem)
2647
+ if (source == sortbysizeItem)
25932648 {
25942649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952650 {
....@@ -2601,7 +2656,7 @@
26012656 ResetModel();
26022657 refreshContents();
26032658 } else
2604
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
26052660 {
26062661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072662 {
....@@ -2613,7 +2668,7 @@
26132668 ResetModel();
26142669 refreshContents();
26152670 } else
2616
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
26172672 {
26182673 String texture = GetFile("Attach pigment");
26192674 Object3D obj;
....@@ -2625,7 +2680,7 @@
26252680
26262681 refreshContents();
26272682 } else
2628
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
26292684 {
26302685 Object3D obj;
26312686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2691,7 @@
26362691
26372692 refreshContents();
26382693 } else
2639
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
26402695 {
26412696 String texture = GetFile("Attach bump");
26422697 Object3D obj;
....@@ -2648,7 +2703,7 @@
26482703
26492704 refreshContents();
26502705 } else
2651
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
26522707 {
26532708 Object3D obj;
26542709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2714,7 @@
26592714
26602715 refreshContents();
26612716 } else
2662
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
26632718 {
26642719 Object3D obj;
26652720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2725,195 @@
26702725
26712726 refreshContents();
26722727 } else
2673
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
26742729 {
26752730 CameraPane.flash = true;
26762731 refreshContents();
26772732 } else
2678
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
26792734 {
26802735 } else
2681
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
26822737 {
26832738 radio.layout = twoButton;
26842739 // bug
26852740 //gridPanel.setDividerLocation(1.0);
26862741 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2750
+// aWindowConstraints.weightx = 0;
2751
+// aWindowConstraints.weighty = 1;
2752
+// //bigThree.add(jtp, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// bigThree.add(centralPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// scenePanel.setVisible(false);
2766
+// centralPanel.setVisible(true);
2767
+// XYZPanel.setVisible(false);
2768
+ bigThree.ClearUI();
2769
+ bigThree.add(centralPanel);
2770
+ bigThree.FlushUI();
27112771 } else
2712
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
27132773 {
27142774 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2775
+
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// bigThree.add(XYZPanel, aWindowConstraints);
2799
+// bigThree.validate();
2800
+// scenePanel.setVisible(false);
2801
+// centralPanel.setVisible(true);
2802
+// XYZPanel.setVisible(true);
2803
+ bigThree.ClearUI();
2804
+ bigThree.add(centralPanel);
2805
+ bigThree.add(XYZPanel);
2806
+ bigThree.FlushUI();
27392807 } else
2740
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
27412809 {
27422810 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- bigThree.revalidate();
2811
+
2812
+// bigThree.remove(scenePanel);
2813
+// bigThree.remove(centralPanel);
2814
+// bigThree.remove(XYZPanel);
2815
+// aWindowConstraints.gridx = 0;
2816
+// aWindowConstraints.gridy = 0;
2817
+// aWindowConstraints.gridwidth = 1;
2818
+// // aWindowConstraints.gridheight = 3;
2819
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.weighty = 1;
2822
+// bigThree.add(scenePanel, aWindowConstraints);
2823
+// aWindowConstraints.weightx = 1;
2824
+// aWindowConstraints.gridwidth = 3;
2825
+// // aConstraints.gridheight = 3;
2826
+// aWindowConstraints.gridx = 1;
2827
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2828
+// //bigThree.add(cameraPanel, aWindowConstraints);
2829
+// aWindowConstraints.weightx = 0;
2830
+// aWindowConstraints.gridx = 4;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// //bigThree.add(XYZPanel, aWindowConstraints);
2835
+// bigThree.validate();
2836
+// scenePanel.setVisible(true);
2837
+// centralPanel.setVisible(false);
2838
+// XYZPanel.setVisible(false);
2839
+ bigThree.ClearUI();
2840
+ bigThree.add(scenePanel);
2841
+ bigThree.FlushUI();
27672842 } else
2768
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
27692844 {
27702845 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- bigThree.revalidate();
2846
+
2847
+// bigThree.remove(scenePanel);
2848
+// bigThree.remove(centralPanel);
2849
+// bigThree.remove(XYZPanel);
2850
+// aWindowConstraints.gridx = 0;
2851
+// aWindowConstraints.gridy = 0;
2852
+// aWindowConstraints.gridwidth = 1;
2853
+// // aConstraints.gridheight = 3;
2854
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2855
+// aWindowConstraints.weightx = 0;
2856
+// aWindowConstraints.weighty = 1;
2857
+// bigThree.add(scenePanel, aWindowConstraints);
2858
+// aWindowConstraints.weightx = 1;
2859
+// aWindowConstraints.gridwidth = 3;
2860
+// // aWindowConstraints.gridheight = 3;
2861
+// aWindowConstraints.gridx = 1;
2862
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2863
+// bigThree.add(centralPanel, aWindowConstraints);
2864
+// aWindowConstraints.weightx = 0;
2865
+// aWindowConstraints.gridx = 4;
2866
+// aWindowConstraints.gridwidth = 1;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2869
+// //bigThree.add(XYZPanel, aConstraints);
2870
+// bigThree.validate();
2871
+// scenePanel.setVisible(true);
2872
+// centralPanel.setVisible(true);
2873
+// XYZPanel.setVisible(false);
2874
+ bigThree.ClearUI();
2875
+ bigThree.add(scenePanel);
2876
+ bigThree.add(centralPanel);
2877
+ bigThree.FlushUI();
27952878 } else
2796
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
27972880 {
27982881 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- bigThree.revalidate();
2882
+
2883
+// bigThree.remove(scenePanel);
2884
+// bigThree.remove(centralPanel);
2885
+// bigThree.remove(XYZPanel);
2886
+// aWindowConstraints.gridx = 0;
2887
+// aWindowConstraints.gridy = 0;
2888
+// aWindowConstraints.gridwidth = 1;
2889
+// // aWindowConstraints.gridheight = 3;
2890
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2891
+// aWindowConstraints.weightx = 0;
2892
+// aWindowConstraints.weighty = 1;
2893
+// bigThree.add(scenePanel, aWindowConstraints);
2894
+// aWindowConstraints.weightx = 1;
2895
+// aWindowConstraints.gridwidth = 3;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.gridx = 1;
2898
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2899
+// bigThree.add(centralPanel, aWindowConstraints);
2900
+// aWindowConstraints.weightx = 0;
2901
+// aWindowConstraints.gridx = 4;
2902
+// aWindowConstraints.gridwidth = 1;
2903
+// // aConstraints.gridheight = 3;
2904
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2905
+// bigThree.add(XYZPanel, aWindowConstraints);
2906
+// bigThree.validate();
2907
+// scenePanel.setVisible(true);
2908
+// centralPanel.setVisible(true);
2909
+// XYZPanel.setVisible(true);
2910
+ bigThree.ClearUI();
2911
+ bigThree.add(scenePanel);
2912
+ bigThree.add(centralPanel);
2913
+ bigThree.add(XYZPanel);
2914
+ bigThree.FlushUI();
28232915 } else
2824
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
28252917 {
28262918 Object3D obj;
28272919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2925,7 @@
28332925
28342926 refreshContents(true);
28352927 } else
2836
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
28372929 {
28382930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392931 cRadio ab;
....@@ -2854,11 +2946,11 @@
28542946 }
28552947 refreshContents(true);
28562948 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
28582950 {
28592951 EditSelection(false);
28602952 } else
2861
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
28622954 {
28632955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642956 {
....@@ -2870,12 +2962,12 @@
28702962
28712963 child.editWindow = null; // ???????????
28722964 }
2873
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
28742966 //objEditor.jTree.clearSelection();
28752967 //objEditor.ResetSliders();
28762968 refreshContents(true);
28772969 } else
2878
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
28792971 {
28802972 assert(copy == group);
28812973 //copy.ClearUI();
....@@ -2886,7 +2978,7 @@
28862978 listUI.clear();
28872979 refreshContents(true);
28882980 } else
2889
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
28902982 {
28912983 assert(copy == group);
28922984
....@@ -2907,19 +2999,19 @@
29072999
29083000 refreshContents(true);
29093001 } else
2910
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
29113003 {
29123004 objEditor.jTree.clearSelection();
29133005 // ?? oct 2012 GrafreeD.clipboard.clear();
29143006 objEditor.ResetSliders();
29153007 refreshContents(true);
29163008 } else
2917
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
29183010 {
29193011 group.parent = keepparent;
29203012 group.attributes = 0;
29213013 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
29233015 Object3D obj = radio.GetObject();
29243016 System.out.println("Edit " + obj);
29253017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3589,11 +3681,11 @@
35893681
35903682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913683
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
35943686 lowres.linkVerticesThis(null);
35953687 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
35973689
35983690 System.err.flush();
35993691
....@@ -4078,12 +4170,12 @@
40784170 System.err.println("info : " + child.GetPath());
40794171 }
40804172 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
40874179
40884180 objEditor.SetText(); // jan 2014
40894181
....@@ -4351,7 +4443,7 @@
43514443 refreshContents();
43524444 }
43534445
4354
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
43554447 {
43564448 // if (GrafreeD.clipboard == null)
43574449 // return;
....@@ -4380,7 +4472,14 @@
43804472 if (copyit)
43814473 {
43824474 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
43844483 }
43854484 else
43864485 {
....@@ -4924,10 +5023,12 @@
49245023 cButton flashSelectionButton;
49255024 cButton editButton;
49265025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
49275027 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295028 cButton unselectButton;
49305029
5030
+ cButton oneStepButton;
5031
+
49315032 cButton screenfitButton;
49325033 cButton screenfitpointButton;
49335034 cButton snapobjectButton;
....@@ -4982,6 +5083,7 @@
49825083 private MenuItem mergeGeometriesItem;
49835084 private MenuItem copyItem;
49845085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
49855087 private MenuItem pasteLinkItem;
49865088 private MenuItem pasteCloneItem;
49875089 private MenuItem pasteExpandItem;
....@@ -5079,7 +5181,7 @@
50795181 private MenuItem blobItem;
50805182 private MenuItem latheItem;
50815183 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
50835185 private MenuItem meshItem;
50845186 // private MenuItem meshGroupItem;
50855187 private MenuItem springItem;